* devops setting
This commit is contained in:
@@ -163,6 +163,29 @@ $config->duplicateTime = 30;
|
||||
$config->maxCount = 500;
|
||||
$config->moreLinks = array();
|
||||
|
||||
/* 渠成平台设置。CNE Api settings. */
|
||||
$config->demoAccounts = ''; // 用于演示的账号列表,该账号安装的应用30钟后会自动删除。 In account list for demo, app instance of demo will be removed in 30 minutes.
|
||||
$config->demoAppLife = 30; // Demo安装的应用实例存续时长(分钟)。The minutes life of instance which demo account installed.
|
||||
$config->CNE = new stdclass();
|
||||
$config->CNE->api = new stdclass();
|
||||
$config->CNE->api->host = '';
|
||||
$config->CNE->api->auth = 'X-Auth-Token';
|
||||
$config->CNE->api->token = 'reiquai7pei7thei4iePe5ait3Kaiquu'; // Please set token in my.php.
|
||||
$config->CNE->api->headers = array('Content-Type: application/json');
|
||||
$config->CNE->api->channel = 'stable';
|
||||
|
||||
$config->CNE->app = new stdclass;
|
||||
$config->CNE->app->domain = 'dev.haogs.cn';
|
||||
|
||||
$config->cloud = new stdclass;
|
||||
$config->cloud->api = new stdclass;
|
||||
$config->cloud->api->host = 'https://api.qucheng.com';
|
||||
$config->cloud->api->auth = 'X-Auth-Token';
|
||||
$config->cloud->api->token = 'gwaN4KynqNqQoPD7eN8s'; // Please set token in my.php.
|
||||
$config->cloud->api->headers = array('Content-Type: application/json');
|
||||
$config->cloud->api->channel = 'stable';
|
||||
$config->cloud->api->switchChannel = false;
|
||||
|
||||
/* 配置参数过滤。Filter param settings. */
|
||||
$filterConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'filter.php';
|
||||
if(file_exists($filterConfig)) include $filterConfig;
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
-- DROP TABLE IF EXISTS `zt_space`;
|
||||
CREATE TABLE `zt_space` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) NOT NULL,
|
||||
`k8space` char(64) NOT NULL,
|
||||
`owner` char(30) NOT NULL,
|
||||
`default` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`createdAt` datetime NOT NULL,
|
||||
`deleted` tinyint(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `name` (`name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_instance`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_instance` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`space` mediumint(8) unsigned NOT NULL DEFAULT 0,
|
||||
`solution` mediumint(8) unsigned NOT NULL DEFAULT 0,
|
||||
`name` char(50) DEFAULT '',
|
||||
`appID` mediumint(8) unsigned NOT NULL DEFAULT 0,
|
||||
`appName` char(50) NOT NULL DEFAULT '',
|
||||
`appVersion` char(20) NOT NULL DEFAULT '',
|
||||
`chart` char(50) NOT NULL DEFAULT '',
|
||||
`logo` varchar(255) DEFAULT '',
|
||||
`version` char(50) NOT NULL DEFAULT '',
|
||||
`desc` text,
|
||||
`introduction` varchar(500) DEFAULT '',
|
||||
`source` char(20) NOT NULL DEFAULT '',
|
||||
`channel` char(20) DEFAULT '',
|
||||
`k8name` char(64) NOT NULL DEFAULT '',
|
||||
`status` char(20) NOT NULL DEFAULT '',
|
||||
`pinned` enum('0', '1') NOT NULL DEFAULT '0',
|
||||
`domain` char(255) NOT NULL DEFAULT '',
|
||||
`smtpSnippetName` char(30) NULL DEFAULT '',
|
||||
`ldapSnippetName` char(30) NULL DEFAULT '',
|
||||
`ldapSettings` text,
|
||||
`dbSettings` text,
|
||||
`autoBackup` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`backupKeepDays` int unsigned NOT NULL DEFAULT 1,
|
||||
`autoRestore` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`env` text,
|
||||
`createdBy` char(30) NOT NULL DEFAULT '',
|
||||
`createdAt` datetime NOT NULL,
|
||||
`deleted` tinyint(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `space` (`space`),
|
||||
KEY `k8name` (`k8name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_solution`;
|
||||
CREATE TABLE IF NOT EXISTS `zt_solution` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` char(50),
|
||||
`appID` mediumint(8) unsigned NOT NULL,
|
||||
`appName` char(50) NOT NULL,
|
||||
`appVersion` char(20) NOT NULL,
|
||||
`version` char(50) NOT NULL,
|
||||
`chart` char(50) NOT NULL,
|
||||
`cover` varchar(255),
|
||||
`desc` text,
|
||||
`introduction` varchar(500),
|
||||
`source` char(20) NOT NULL,
|
||||
`channel` char(20),
|
||||
`components` text,
|
||||
`status` char(20) NOT NULL,
|
||||
`deleted` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`createdBy` char(30) NOT NULL,
|
||||
`createdAt` datetime NOT NULL,
|
||||
`updatedDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
REPLACE INTO `zt_space` (`id`, `name`,`k8space`,`owner`,`default`,`createdAt`) VALUES (1, 'default space', 'quickon-app', 'qadmin', 1, current_date());
|
||||
@@ -15,6 +15,7 @@ $config->admin->menuGroup['message'] = array('mail', 'webhook', 'sms', 'messag
|
||||
$config->admin->menuGroup['dev'] = array('dev', 'entry', 'editor');
|
||||
$config->admin->menuGroup['extension'] = array('extension');
|
||||
$config->admin->menuGroup['convert'] = array('convert');
|
||||
$config->admin->menuGroup['platform'] = array('system', 'repo', 'account', 'host', 'serverroom', 'ops', 'tree');
|
||||
|
||||
$config->admin->menuModuleGroup['model']['custom|set'] = array('project', 'issue', 'risk', 'opportunity', 'nc');
|
||||
$config->admin->menuModuleGroup['model']['custom|required'] = array('project', 'build');
|
||||
|
||||
@@ -78,6 +78,7 @@ $lang->admin->registerNotice->success = "Sie haben sich erfolgreich registrie
|
||||
$lang->admin->bind = new stdclass();
|
||||
$lang->admin->bind->caption = 'Konto verknüpfen';
|
||||
$lang->admin->bind->success = "Konto wurde verknüpft!";
|
||||
$lang->admin->bind->submit = "Binden";
|
||||
|
||||
$lang->admin->setModule = new stdclass();
|
||||
$lang->admin->setModule->module = 'Module';
|
||||
@@ -180,6 +181,8 @@ $lang->admin->menuSetting['dev']['name'] = 'Develop';
|
||||
$lang->admin->menuSetting['dev']['desc'] = 'Support for secondary development of the system.';
|
||||
$lang->admin->menuSetting['convert']['name'] = 'Data Import';
|
||||
$lang->admin->menuSetting['convert']['desc'] = 'Data import from third-party systems.';
|
||||
$lang->admin->menuSetting['platform']['name'] = 'DevOps';
|
||||
$lang->admin->menuSetting['platform']['desc'] = 'Settings of DevOps elements such as resources and environment.';
|
||||
|
||||
$lang->admin->updateDynamics = 'Dynamics';
|
||||
$lang->admin->updatePatch = 'Patch';
|
||||
|
||||
@@ -78,6 +78,7 @@ $lang->admin->registerNotice->success = "You have signed up!";
|
||||
$lang->admin->bind = new stdclass();
|
||||
$lang->admin->bind->caption = 'Link Account';
|
||||
$lang->admin->bind->success = "Account is linked!";
|
||||
$lang->admin->bind->submit = "Bind";
|
||||
|
||||
$lang->admin->setModule = new stdclass();
|
||||
$lang->admin->setModule->module = 'Module';
|
||||
@@ -180,6 +181,8 @@ $lang->admin->menuSetting['dev']['name'] = 'Develop';
|
||||
$lang->admin->menuSetting['dev']['desc'] = 'Support for secondary development of the system.';
|
||||
$lang->admin->menuSetting['convert']['name'] = 'Data Import';
|
||||
$lang->admin->menuSetting['convert']['desc'] = 'Data import from third-party systems.';
|
||||
$lang->admin->menuSetting['platform']['name'] = 'DevOps';
|
||||
$lang->admin->menuSetting['platform']['desc'] = 'Settings of DevOps elements such as resources and environment.';
|
||||
|
||||
$lang->admin->updateDynamics = 'Dynamics';
|
||||
$lang->admin->updatePatch = 'Patch';
|
||||
|
||||
@@ -78,6 +78,7 @@ $lang->admin->registerNotice->success = "Vous êtes enregistré !";
|
||||
$lang->admin->bind = new stdclass();
|
||||
$lang->admin->bind->caption = 'Lier au compte';
|
||||
$lang->admin->bind->success = "Le compte est associé !";
|
||||
$lang->admin->bind->submit = "Lier";
|
||||
|
||||
$lang->admin->setModule = new stdclass();
|
||||
$lang->admin->setModule->module = 'Module';
|
||||
@@ -180,6 +181,8 @@ $lang->admin->menuSetting['dev']['name'] = 'Develop';
|
||||
$lang->admin->menuSetting['dev']['desc'] = 'Support for secondary development of the system.';
|
||||
$lang->admin->menuSetting['convert']['name'] = 'Data Import';
|
||||
$lang->admin->menuSetting['convert']['desc'] = 'Data import from third-party systems.';
|
||||
$lang->admin->menuSetting['platform']['name'] = 'DevOps';
|
||||
$lang->admin->menuSetting['platform']['desc'] = 'Settings of DevOps elements such as resources and environment.';
|
||||
|
||||
$lang->admin->updateDynamics = 'Dynamics';
|
||||
$lang->admin->updatePatch = 'Patch';
|
||||
|
||||
@@ -39,13 +39,15 @@ $lang->admin->menuList->dev['name'] = $lang->admin->menuSetting['dev']['name'];
|
||||
$lang->admin->menuList->dev['desc'] = $lang->admin->menuSetting['dev']['desc'];
|
||||
$lang->admin->menuList->dev['order'] = 45;
|
||||
|
||||
if($config->db->driver == 'mysql')
|
||||
{
|
||||
$lang->admin->menuList->convert['name'] = $lang->admin->menuSetting['convert']['name'];
|
||||
$lang->admin->menuList->convert['desc'] = $lang->admin->menuSetting['convert']['desc'];
|
||||
$lang->admin->menuList->convert['link'] = 'convert|convertjira';
|
||||
$lang->admin->menuList->convert['order'] = 50;
|
||||
}
|
||||
$lang->admin->menuList->convert['name'] = $lang->admin->menuSetting['convert']['name'];
|
||||
$lang->admin->menuList->convert['desc'] = $lang->admin->menuSetting['convert']['desc'];
|
||||
$lang->admin->menuList->convert['link'] = 'convert|convertjira';
|
||||
$lang->admin->menuList->convert['order'] = 50;
|
||||
|
||||
$lang->admin->menuList->platform['name'] = $lang->admin->menuSetting['platform']['name'];
|
||||
$lang->admin->menuList->platform['desc'] = $lang->admin->menuSetting['platform']['desc'];
|
||||
$lang->admin->menuList->platform['link'] = 'system|browsebackup';
|
||||
$lang->admin->menuList->platform['order'] = 55;
|
||||
|
||||
$lang->admin->menuList->system['subMenu']['mode'] = array('link' => "{$lang->custom->mode}|custom|mode|");
|
||||
$lang->admin->menuList->system['subMenu']['trash'] = array('link' => "{$lang->action->trash}|action|trash|");
|
||||
@@ -180,6 +182,46 @@ $lang->admin->menuList->dev['menuOrder']['15'] = 'langItem';
|
||||
$lang->admin->menuList->dev['menuOrder']['20'] = 'editor';
|
||||
$lang->admin->menuList->dev['menuOrder']['25'] = 'entry';
|
||||
|
||||
//$lang->admin->menuList->platform['subMenu']['dashboard'] = array('link' => "{$lang->dashboard}|system|dashboard|");
|
||||
$lang->admin->menuList->platform['subMenu']['plat'] = array('link' => "{$lang->devops->platform}|system|browsebackup|", 'subModule' => 'system');
|
||||
//$lang->admin->menuList->platform['subMenu']['environment'] = array('link' => "{$lang->devops->environment}|gitlab|browse|", 'subModule' => 'gitlab,jenkins,sonarqube,gitea,gogs', 'alias' => 'create,edit,import');
|
||||
$lang->admin->menuList->platform['subMenu']['resource'] = array('link' => "{$lang->devops->resource}|host|browse|", 'subModule' => 'host,account,serverroom,ops,tree');
|
||||
$lang->admin->menuList->platform['subMenu']['setrules'] = array('link' => "{$lang->devops->rules}|repo|setrules|");
|
||||
|
||||
$lang->admin->menuList->platform['tabMenu']['plat']['backup'] = array('link' => "{$lang->backup->common}|system|browsebackup|");
|
||||
$lang->admin->menuList->platform['tabMenu']['plat']['dblist'] = array('link' => "{$lang->devops->dblist}|system|dblist|");
|
||||
$lang->admin->menuList->platform['tabMenu']['plat']['domain'] = array('link' => "{$lang->devops->domain}|system|configdomain|", 'alias' => 'editdomain,domainview');
|
||||
$lang->admin->menuList->platform['tabMenu']['plat']['oss'] = array('link' => "{$lang->devops->oss}|system|ossview|");
|
||||
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['plat']['5'] = 'backup';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['plat']['10'] = 'dblist';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['plat']['15'] = 'domain';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['plat']['20'] = 'oss';
|
||||
|
||||
$lang->admin->menuList->platform['tabMenu']['resource']['host'] = array('link' => "{$lang->devops->host}|host|browse|", 'alias' => 'create,edit,view,treemap,changestatus,group', 'subModule' => 'tree');
|
||||
$lang->admin->menuList->platform['tabMenu']['resource']['serverroom'] = array('link' => "{$lang->devops->serverroom}|serverroom|browse|", 'alias' => 'create,edit,view');
|
||||
$lang->admin->menuList->platform['tabMenu']['resource']['account'] = array('link' => "{$lang->devops->account}|account|browse|", 'alias' => 'create,edit,view');
|
||||
$lang->admin->menuList->platform['tabMenu']['resource']['provider'] = array('link' => "{$lang->devops->provider}|ops|provider|", 'alias' => 'provider');
|
||||
$lang->admin->menuList->platform['tabMenu']['resource']['city'] = array('link' => "{$lang->devops->city}|ops|city|", 'alias' => 'city');
|
||||
$lang->admin->menuList->platform['tabMenu']['resource']['cpuBrand'] = array('link' => "{$lang->devops->cpuBrand}|ops|cpuBrand|", 'alias' => 'cpubrand');
|
||||
$lang->admin->menuList->platform['tabMenu']['resource']['os'] = array('link' => "{$lang->devops->os}|ops|os|", 'alias' => 'os');
|
||||
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['resource']['5'] = 'host';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['resource']['10'] = 'serverroom';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['resource']['15'] = 'account';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['resource']['20'] = 'provider';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['resource']['25'] = 'city';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['resource']['30'] = 'cpuBrand';
|
||||
$lang->admin->menuList->platform['tabMenu']['menuOrder']['resource']['35'] = 'os';
|
||||
|
||||
//$lang->admin->menuList->platform['menuOrder']['5'] = 'dashboard';
|
||||
$lang->admin->menuList->platform['menuOrder']['10'] = 'plat';
|
||||
//$lang->admin->menuList->platform['menuOrder']['15'] = 'environment';
|
||||
$lang->admin->menuList->platform['menuOrder']['20'] = 'resource';
|
||||
$lang->admin->menuList->platform['menuOrder']['25'] = 'setrules';
|
||||
|
||||
$lang->admin->menuList->platform['dividerMenu'] = ',plat,setrules,';
|
||||
|
||||
if($config->edition != 'max')
|
||||
{
|
||||
unset($lang->admin->menuList->model['subMenu']['scrum']);
|
||||
|
||||
@@ -59,6 +59,7 @@ $lang->admin->registerNotice->success = "Bạn đã đăng ký!";
|
||||
$lang->admin->bind = new stdclass();
|
||||
$lang->admin->bind->caption = 'Liên kết tài khoản';
|
||||
$lang->admin->bind->success = "Tài khoản đã được kết nối!";
|
||||
$lang->admin->bind->submit = "Trói buộc";
|
||||
|
||||
$lang->admin->safe = new stdclass();
|
||||
$lang->admin->safe->common = 'Chính sách bảo mật';
|
||||
|
||||
@@ -78,6 +78,7 @@ $lang->admin->registerNotice->success = "登记账户成功";
|
||||
$lang->admin->bind = new stdclass();
|
||||
$lang->admin->bind->caption = '关联社区帐号';
|
||||
$lang->admin->bind->success = "关联账户成功";
|
||||
$lang->admin->bind->submit = "绑定";
|
||||
|
||||
$lang->admin->setModule = new stdclass();
|
||||
$lang->admin->setModule->module = '功能点';
|
||||
@@ -180,6 +181,8 @@ $lang->admin->menuSetting['dev']['name'] = '二次开发';
|
||||
$lang->admin->menuSetting['dev']['desc'] = '支持对系统进行二次开发。';
|
||||
$lang->admin->menuSetting['convert']['name'] = '数据导入';
|
||||
$lang->admin->menuSetting['convert']['desc'] = '第三方系统的数据导入。';
|
||||
$lang->admin->menuSetting['platform']['name'] = 'DevOps设置';
|
||||
$lang->admin->menuSetting['platform']['desc'] = '资源、环境等DevOps各要素配置。';
|
||||
|
||||
$lang->admin->updateDynamics = '更新动态';
|
||||
$lang->admin->updatePatch = '补丁更新';
|
||||
|
||||
@@ -51,6 +51,7 @@ $lang->admin->registerNotice->success = "登記賬戶成功";
|
||||
$lang->admin->bind = new stdclass();
|
||||
$lang->admin->bind->caption = '關聯社區帳號';
|
||||
$lang->admin->bind->success = "關聯賬戶成功";
|
||||
$lang->admin->bind->submit = "關聯";
|
||||
|
||||
$lang->admin->safe = new stdclass();
|
||||
$lang->admin->safe->common = '安全策略';
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$lang->CNE->InstallSuccess = '安装成功';
|
||||
$lang->CNE->InstallFailure = '安装失败';
|
||||
$lang->CNE->serverError = 'CNE服务器出错';
|
||||
|
||||
$lang->CNE->statusList = array();
|
||||
$lang->CNE->statusList['normal'] = '正常';
|
||||
$lang->CNE->statusList['abnormal'] = '异常';
|
||||
$lang->CNE->statusList['stopped'] = '关闭';
|
||||
$lang->CNE->statusList['unknown'] = '无数据';
|
||||
|
||||
$lang->CNE->statusIcons = array();
|
||||
$lang->CNE->statusIcons['normal'] = "<i class='icon icon-5x icon-check-circle status-green'></i>";
|
||||
$lang->CNE->statusIcons['abnormal'] = "<i class='icon icon-5x icon-close-circle status-red'></i>";
|
||||
$lang->CNE->statusIcons['stopped'] = "<i class='icon icon-5x icon-off status-gray'></i>";
|
||||
$lang->CNE->statusIcons['unknown'] = "<i class='icon icon-5x icon-alert-sign status-orange'></i>";
|
||||
|
||||
$lang->CNE->errorList = array();
|
||||
//$lang->CNE->errorList[400] = '不能包含特殊字符';
|
||||
$lang->CNE->errorList[400] = '请求集群接口失败';
|
||||
$lang->CNE->errorList[404] = '服务不存在';
|
||||
$lang->CNE->errorList[40004] = '证书与域名不匹配';
|
||||
$lang->CNE->errorList[41001] = '证书过期';
|
||||
$lang->CNE->errorList[41002] = '证书不匹配';
|
||||
$lang->CNE->errorList[41003] = '证书链不完整';
|
||||
$lang->CNE->errorList[41004] = '私钥与证书不匹配';
|
||||
$lang->CNE->errorList[41005] = '证书解析失败';
|
||||
$lang->CNE->errorList[41006] = '密钥解析失败';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -95,6 +95,12 @@ $lang->zanode = new stdclass();
|
||||
$lang->holiday = new stdclass();
|
||||
$lang->contact = new stdclass();
|
||||
$lang->dimension = new stdclass();
|
||||
$lang->space = new stdclass();
|
||||
$lang->store = new stdclass();
|
||||
$lang->instance = new stdclass();
|
||||
$lang->CNE = new stdclass();
|
||||
$lang->account = new stdclass();
|
||||
$lang->ops = new stdclass();
|
||||
|
||||
$lang->programstakeholder = new stdclass();
|
||||
$lang->researchplan = new stdclass();
|
||||
|
||||
@@ -353,12 +353,26 @@ $lang->testcase->case = 'Test Case';
|
||||
$lang->testcase->testsuite = 'Test Suite';
|
||||
$lang->testcase->caselib = 'Case Library';
|
||||
|
||||
$lang->devops->compile = 'Pipelines';
|
||||
$lang->devops->mr = 'Merge Request';
|
||||
$lang->devops->repo = 'Repo';
|
||||
$lang->devops->rules = 'Rule';
|
||||
$lang->devops->settings = 'Setting Merge Request';
|
||||
$lang->devops->set = 'Set';
|
||||
$lang->devops->compile = 'Pipelines';
|
||||
$lang->devops->mr = 'Merge Request';
|
||||
$lang->devops->repo = 'Repo';
|
||||
$lang->devops->rules = 'Rule';
|
||||
$lang->devops->settings = 'Setting Merge Request';
|
||||
$lang->devops->platform = 'Platform';
|
||||
$lang->devops->set = 'Set';
|
||||
$lang->devops->WIPs = 'WIPs';
|
||||
$lang->devops->environment = 'Environment';
|
||||
$lang->devops->resource = 'Resource';
|
||||
$lang->devops->dblist = 'Database';
|
||||
$lang->devops->domain = 'Domain';
|
||||
$lang->devops->oss = 'Oss';
|
||||
$lang->devops->host = 'Host';
|
||||
$lang->devops->account = 'Account';
|
||||
$lang->devops->serverroom = 'IDC';
|
||||
$lang->devops->provider = 'IDC Provider';
|
||||
$lang->devops->cpuBrand = 'CPU Brand';
|
||||
$lang->devops->city = 'IDC Location';
|
||||
$lang->devops->os = 'OS Version';
|
||||
|
||||
$lang->admin->module = 'Module';
|
||||
$lang->admin->system = 'System';
|
||||
|
||||
@@ -353,12 +353,26 @@ $lang->testcase->case = '用例';
|
||||
$lang->testcase->testsuite = '套件';
|
||||
$lang->testcase->caselib = '用例库';
|
||||
|
||||
$lang->devops->compile = '流水线';
|
||||
$lang->devops->mr = '合并请求';
|
||||
$lang->devops->repo = '代码库';
|
||||
$lang->devops->rules = '指令';
|
||||
$lang->devops->settings = '合并请求设置';
|
||||
$lang->devops->set = '设置';
|
||||
$lang->devops->compile = '流水线';
|
||||
$lang->devops->mr = '合并请求';
|
||||
$lang->devops->repo = '代码库';
|
||||
$lang->devops->rules = '指令';
|
||||
$lang->devops->settings = '合并请求设置';
|
||||
$lang->devops->platform = '平台';
|
||||
$lang->devops->set = '设置';
|
||||
$lang->devops->WIPs = '制品库';
|
||||
$lang->devops->environment = '环境';
|
||||
$lang->devops->resource = '资源';
|
||||
$lang->devops->dblist = '数据库';
|
||||
$lang->devops->domain = '域名';
|
||||
$lang->devops->oss = '对象存储';
|
||||
$lang->devops->host = '主机';
|
||||
$lang->devops->account = '账号';
|
||||
$lang->devops->serverroom = '机房';
|
||||
$lang->devops->provider = '服务商';
|
||||
$lang->devops->cpuBrand = 'CPU品牌';
|
||||
$lang->devops->city = '城市';
|
||||
$lang->devops->os = '系统版本';
|
||||
|
||||
$lang->admin->module = '功能配置';
|
||||
$lang->admin->system = '系统';
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
$config->instance = new stdclass;
|
||||
$config->instance->keepDomainList = array();
|
||||
$config->instance->keepDomainList['console'] = 'console';
|
||||
$config->instance->keepDomainList['demo'] = 'demo';
|
||||
$config->instance->keepDomainList['s3'] = 's3';
|
||||
$config->instance->keepDomainList['s3-api'] = 's3-api';
|
||||
|
||||
$config->instance->seniorChartList = array();
|
||||
$config->instance->seniorChartList['zentao'] = ['zentao-biz', 'zentao-max'];
|
||||
$config->instance->seniorChartList['zentao-biz'] = ['zentao-max'];
|
||||
|
||||
$config->instance->adminer = new stdclass();
|
||||
$config->instance->adminer->dbTypes = array();
|
||||
$config->instance->adminer->dbTypes['mysql'] = 'mysql';
|
||||
$config->instance->adminer->dbTypes['postgresql'] = 'pgsql';
|
||||
|
||||
$features = explode(',', getenv('QUICKON_FEATURES', ''));
|
||||
$config->instance->enableAutoRestore = in_array('auto-rollback', $features);
|
||||
|
||||
global $lang, $app;
|
||||
$app->loadLang('space');
|
||||
|
||||
$config->instance->actionList['start']['icon'] = 'play';
|
||||
$config->instance->actionList['start']['className'] = 'ajax-submit';
|
||||
$config->instance->actionList['start']['hint'] = $lang->instance->start;
|
||||
$config->instance->actionList['start']['text'] = $lang->instance->start;
|
||||
$config->instance->actionList['start']['url'] = array('module' => 'instance', 'method' => 'ajaxStart', 'params' => 'id={id}');
|
||||
|
||||
$config->instance->actionList['stop']['icon'] = 'off';
|
||||
$config->instance->actionList['stop']['className'] = 'ajax-submit';
|
||||
$config->instance->actionList['stop']['hint'] = $lang->instance->stop;
|
||||
$config->instance->actionList['stop']['text'] = $lang->instance->stop;
|
||||
$config->instance->actionList['stop']['data-confirm'] = $lang->instance->notices['confirmStop'];
|
||||
$config->instance->actionList['stop']['url'] = array('module' => 'instance', 'method' => 'ajaxStop', 'params' => 'id={id}');
|
||||
|
||||
$config->instance->actionList['uninstall']['icon'] = 'trash';
|
||||
$config->instance->actionList['uninstall']['hint'] = $lang->instance->uninstall;
|
||||
$config->instance->actionList['uninstall']['text'] = $lang->instance->uninstall;
|
||||
$config->instance->actionList['uninstall']['className'] = 'ajax-submit';
|
||||
$config->instance->actionList['uninstall']['data-confirm'] = $lang->instance->notices['confirmUninstall'];
|
||||
$config->instance->actionList['uninstall']['url'] = array('module' => 'instance', 'method' => 'ajaxUninstall', 'params' => 'id={id}');
|
||||
|
||||
$config->instance->actionList['visit']['icon'] = 'menu-my';
|
||||
$config->instance->actionList['visit']['hint'] = $lang->instance->visit;
|
||||
$config->instance->actionList['visit']['text'] = $lang->instance->visit;
|
||||
$config->instance->actionList['visit']['target'] = '_blank';
|
||||
$config->instance->actionList['visit']['url'] = array('module' => 'instance', 'method' => 'visit', 'params' => 'id={id}');
|
||||
|
||||
$config->instance->actionList['upgrade']['icon'] = 'refresh';
|
||||
$config->instance->actionList['upgrade']['data-toggle'] = 'modal';
|
||||
$config->instance->actionList['upgrade']['data-size'] = 'sm';
|
||||
$config->instance->actionList['upgrade']['text'] = $lang->instance->upgrade;
|
||||
$config->instance->actionList['upgrade']['hint'] = $lang->instance->upgrade;
|
||||
$config->instance->actionList['upgrade']['url'] = helper::createLink('instance', 'upgrade', "id={id}");
|
||||
|
||||
$config->instance->actions = new stdclass();
|
||||
$config->instance->actions->view = array();
|
||||
$config->instance->actions->view['mainActions'] = array('visit', 'start', 'stop', 'upgrade');
|
||||
$config->instance->actions->view['suffixActions'] = array('uninstall');
|
||||
@@ -0,0 +1,865 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QuCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
class instance extends control
|
||||
{
|
||||
/**
|
||||
* Construct function.
|
||||
*
|
||||
* @param string $moduleName
|
||||
* @param string $methodName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($moduleName = '', $methodName = '')
|
||||
{
|
||||
parent::__construct($moduleName, $methodName);
|
||||
$this->loadModel('action');
|
||||
$this->loadModel('cne');
|
||||
$this->loadModel('store');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show instance view.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $page
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function view($id, $recTotal = 0, $recPerPage = 20, $pageID = 1, $tab ='baseinfo' )
|
||||
{
|
||||
$this->loadModel('system');
|
||||
$this->app->loadLang('system');
|
||||
|
||||
$instance = $this->instance->getByID($id);
|
||||
if(empty($instance)) return print(js::alert($this->lang->instance->instanceNotExists) . js::locate($this->createLink('space', 'browse')));
|
||||
|
||||
$instance->latestVersion = $this->store->appLatestVersion($instance->appID, $instance->version);
|
||||
|
||||
$instance = $this->instance->freshStatus($instance);
|
||||
|
||||
$instanceMetric = $this->cne->instancesMetrics(array($instance));
|
||||
$instanceMetric = $instanceMetric[$instance->id];
|
||||
$this->lang->switcherMenu = $this->instance->getSwitcher($instance);
|
||||
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$backupList = array();
|
||||
$latestBackup = new stdclass;
|
||||
if($tab == 'backup') $backupList = $this->instance->backupList($instance);
|
||||
if(count($backupList)) $latestBackup = reset($backupList);
|
||||
|
||||
$hasRestoreLog = false;
|
||||
foreach($backupList as $backup)
|
||||
{
|
||||
$backup->latest_restore_time = 0;
|
||||
$backup->latest_restore_status = '';
|
||||
foreach($backup->restores as $restore)
|
||||
{
|
||||
$hasRestoreLog = true;
|
||||
if($restore->create_time > $backup->latest_restore_time)
|
||||
{
|
||||
$backup->latest_restore_time = $restore->create_time;
|
||||
$backup->latest_restore_status = $restore->status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dbList = new stdclass;
|
||||
$currentResource = new stdclass;
|
||||
$customItems = array();
|
||||
$dbList = $this->cne->appDBList($instance);
|
||||
$currentResource = $this->cne->getAppConfig($instance);
|
||||
$customItems = $this->cne->getCustomItems($instance);
|
||||
|
||||
$this->view->title = $instance->appName;
|
||||
$this->view->instance = $instance;
|
||||
$this->view->cloudApp = $this->loadModel('store')->getAppInfoByChart($instance->chart, $instance->channel, false);
|
||||
$this->view->seniorAppList = $tab == 'baseinfo' ? $this->instance->seniorAppList($instance, $instance->channel) : array();
|
||||
$this->view->actions = $this->loadModel('action')->getList('instance', $id);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->defaultAccount = $this->cne->getDefaultAccount($instance);
|
||||
$this->view->instanceMetric = $instanceMetric;
|
||||
$this->view->currentResource = $currentResource;
|
||||
$this->view->customItems = $customItems;
|
||||
$this->view->backupList = $backupList;
|
||||
$this->view->hasRestoreLog = $hasRestoreLog;
|
||||
$this->view->latestBackup = $latestBackup;
|
||||
$this->view->dbList = $dbList;
|
||||
$this->view->domain = $this->cne->getDomain($instance);
|
||||
$this->view->tab = $tab;
|
||||
$this->view->pager = $pager;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display or save auto backup settings.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function backupSettings($instanceID)
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$this->instance->saveAutoBackupSettings($instance);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$backupSettings = $this->instance->getAutoBackupSettings($instanceID);
|
||||
|
||||
$startTime = strtotime($backupSettings->backupTime);
|
||||
if($startTime < time()) $startTime = strtotime("+1 day $backupSettings->backupTime");
|
||||
|
||||
if($backupSettings->autoBackup)
|
||||
{
|
||||
$startBackupMessage = sprintf($this->lang->instance->backup->firstStartTime, $instance->name, date('Y-m-d H:i:s', $startTime));
|
||||
return $this->send(array('result' => 'success', 'message' => $startBackupMessage));
|
||||
}
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->instance->backup->disableAutoBackup));
|
||||
}
|
||||
|
||||
$backupSettings = $this->instance->getAutoBackupSettings($instanceID);
|
||||
|
||||
$this->view->title = $this->lang->instance->backup->autoBackup;
|
||||
$this->view->instance = $instance;
|
||||
$this->view->backupSettings = $backupSettings;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display or save auto restore settings.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function restoreSettings($instanceID)
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$this->instance->saveAutoRestoreSettings($instance);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$restoreSettings = $this->instance->getAutoRestoreSettings($instanceID);
|
||||
|
||||
$startTime = strtotime($restoreSettings->restoreTime);
|
||||
if($startTime < time()) $startTime = strtotime("+1 day $restoreSettings->restoreTime");
|
||||
|
||||
if($restoreSettings->autoRestore)
|
||||
{
|
||||
$startRestoreMessage = sprintf($this->lang->instance->restore->firstStartTime, $instance->name, date('Y-m-d H:i:s', $startTime));
|
||||
return $this->send(array('result' => 'success', 'message' => $startRestoreMessage));
|
||||
}
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->instance->restore->disableAutoRestore));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->instance->restore->autoRestore;
|
||||
$this->view->instance = $instance;
|
||||
$this->view->restoreSettings = $this->instance->getAutoRestoreSettings($instanceID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cron task of auto backup.
|
||||
*
|
||||
* @param string $key
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function autoBackup($key)
|
||||
{
|
||||
if($this->config->instance->enableAutoRestore) return; // Only one of auto backup and auto restore can be enabled.
|
||||
|
||||
$this->app->saveLog('Run auto backup at: ' . date('Y-md-d H:i:s'));
|
||||
|
||||
if($key != helper::readKey()) return;
|
||||
|
||||
$this->instance->autoBackup();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cron task of auto restore.
|
||||
*
|
||||
* @param string $key
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function autoRestore($key)
|
||||
{
|
||||
if(!$this->config->instance->enableAutoRestore) return; // Only one of auto backup and auto restore can be enabled.
|
||||
|
||||
$this->app->saveLog('Run auto restore at: ' . date('Y-md-d H:i:s'));
|
||||
|
||||
if($key != helper::readKey()) return;
|
||||
|
||||
$this->instance->autoRestore();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit instance app name.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setting($id)
|
||||
{
|
||||
$currentResource = new stdclass;
|
||||
$instance = $this->instance->getByID($id);
|
||||
$currentResource = $this->cne->getAppConfig($instance);
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$newInstance = fixer::input('post')->trim('name')->get();
|
||||
$memoryKb = $newInstance->memory_kb;
|
||||
unset($newInstance->memory_kb);
|
||||
|
||||
if(intval($currentResource->max->memory / 1024) != $memoryKb)
|
||||
{
|
||||
/* Check free memory size is enough or not. */
|
||||
$clusterResource = $this->cne->cneMetrics();
|
||||
$freeMemory = intval($clusterResource->metrics->memory->allocatable * 0.9); // Remain 10% memory for system.
|
||||
if($memoryKb * 1024 > $freeMemory) $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->notEnoughResource));
|
||||
|
||||
/* Request CNE to adjust memory size. */
|
||||
if(!$this->instance->updateMemorySize($instance, $memoryKb * 1024))
|
||||
{
|
||||
$this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
}
|
||||
}
|
||||
|
||||
$this->instance->updateByID($id, $newInstance);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if($newInstance->name != $instance->name)
|
||||
{
|
||||
$this->action->create('instance', $instance->id, 'editname', '', json_encode(array('result' => array('result' => 'success'), 'data' => array('oldName' => $instance->name, 'newName' => $newInstance->name))));
|
||||
}
|
||||
return $this->send(array('result' => 'success', 'load' => true, 'closeModal' => true));
|
||||
}
|
||||
|
||||
$this->view->currentResource = $currentResource;
|
||||
$this->view->instance = $instance;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade to senior serial.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @param int $seniorAppID
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function toSenior($instanceID, $seniorAppID, $confirm = 'no')
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
$cloudApp = $this->store->getAppInfo($seniorAppID, $instance->channel, false);
|
||||
if(empty($cloudApp)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->noAppInfo));
|
||||
|
||||
if($confirm == 'yes')
|
||||
{
|
||||
$success = $this->instance->upgradeToSenior($instance, $cloudApp);
|
||||
if($success) $this->send(array('result' => 'success', 'message' => '', 'locate' => $this->inLink('view', "id=$instance->id")));
|
||||
|
||||
$this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->instance->upgradeToSenior;
|
||||
$this->view->instance = $instance;
|
||||
$this->view->cloudApp = $cloudApp;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade instnace
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function upgrade($id)
|
||||
{
|
||||
$instance = $this->instance->getByID($id);
|
||||
$instance->latestVersion = $this->store->appLatestVersion($instance->appID, $instance->version);
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
if(empty($instance->latestVersion)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->noHigherVersion, 'closeModal' => true));
|
||||
|
||||
$postData = fixer::input('post')->get();
|
||||
|
||||
if($postData->confirm == 'yes') $success = $this->instance->upgrade($instance, $instance->latestVersion->version, $instance->latestVersion->app_version);
|
||||
|
||||
$logExtra = array('result' => 'success', 'data' => array('oldVersion' => $instance->appVersion, 'newVersion' => $instance->latestVersion->app_version));
|
||||
if(!$success)
|
||||
{
|
||||
$logExtra['result'] = 'fail';
|
||||
$this->action->create('instance', $instance->id, 'upgrade', '', json_encode($logExtra));
|
||||
return $this->send(array('result' => 'fail', 'message' => !empty($logExtra['message']) ? $logExtra['message'] : $this->lang->instance->notices['upgradeFail'], 'closeModal' => true));
|
||||
}
|
||||
|
||||
$this->action->create('instance', $instance->id, 'upgrade', '', json_encode($logExtra));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->instance->notices['upgradeSuccess'], 'load' => $this->createLink('instance', 'view', "id=$id"), 'closeModal' => true));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->instance->upgrade . $instance->name;
|
||||
$this->view->instance = $instance;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* 访问一个应用。
|
||||
* Visit a app.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $externalID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function visit(int $id, int $externalID = 0): void
|
||||
{
|
||||
if(!$externalID)
|
||||
{
|
||||
$instance = $this->instance->getByID($id);
|
||||
$url = $this->instance->url($instance);
|
||||
}
|
||||
else
|
||||
{
|
||||
$pipeline = $this->loadModel('pipeline')->getByID($externalID);
|
||||
$url = $pipeline->url;
|
||||
}
|
||||
|
||||
$this->locate($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* (Not used at present.) Install app by custom settings.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function customInstall($id)
|
||||
{
|
||||
// Disable custom installation in version 1.0.
|
||||
$storeUrl = $this->createLink('store', 'appview', "id=$id");
|
||||
return js::execute("window.parent.location.href='{$storeUrl}';");
|
||||
}
|
||||
|
||||
/**
|
||||
* Install app.
|
||||
*
|
||||
* @param int $appID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function install($appID)
|
||||
{
|
||||
$cloudApp = $this->store->getAppInfo($appID);
|
||||
if(empty($cloudApp)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->noAppInfo));
|
||||
|
||||
if(empty($this->config->demoAccounts))
|
||||
{
|
||||
$clusterResource = $this->cne->cneMetrics();
|
||||
$freeMemory = intval($clusterResource->metrics->memory->allocatable * 0.9); // Remain 10% memory for system.
|
||||
if($cloudApp->memory > $freeMemory)
|
||||
{
|
||||
$this->view->cloudApp = $cloudApp;
|
||||
$this->view->gapMemory = helper::formatKB(intval(($cloudApp->memory - $freeMemory)));
|
||||
$this->view->requiredMemory = helper::formatKB(intval($cloudApp->memory));
|
||||
$this->view->freeMemory = helper::formatKB(intval($freeMemory));
|
||||
|
||||
return $this->display('instance','resourceerror');
|
||||
}
|
||||
}
|
||||
|
||||
$versionList = $this->store->appVersionList($cloudApp->id);
|
||||
$mysqlList = $this->cne->sharedDBList('mysql');
|
||||
$pgList = $this->cne->sharedDBList('postgresql');
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$customData = fixer::input('post')
|
||||
->trim('customName')->setDefault('customName', '')
|
||||
->trim('customDomain')->setDefault('customDomain', '')
|
||||
->trim('version')->setDefault('version', '')
|
||||
->trim('dbType')->setDefault('dbType', 'unsharedDB')
|
||||
->trim('dbService')
|
||||
->setDefault('app_version', '')
|
||||
->get();
|
||||
if($customData->version && isset($versionList[$customData->version])) $customData->app_version = $versionList[$customData->version]->app_version;
|
||||
|
||||
if(isset($this->config->instance->keepDomainList[$customData->customDomain]) || $this->instance->domainExists($customData->customDomain)) return $this->send(array('result' => 'fail', 'message' => $customData->customDomain . $this->lang->instance->errors->domainExists));
|
||||
|
||||
if(!validater::checkLength($customData->customDomain, 20, 2)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->domainLength));
|
||||
if(!validater::checkREG($customData->customDomain, '/^[a-z\d]+$/')) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->wrongDomainCharacter));
|
||||
|
||||
/* If select the version, replace the latest version of App by selected version. */
|
||||
if($customData->version)
|
||||
{
|
||||
$cloudApp->version = $customData->version;
|
||||
$cloudApp->app_version = $customData->app_version;
|
||||
}
|
||||
|
||||
$sharedDB = new stdclass;
|
||||
if(isset($cloudApp->dependencies->mysql) && $customData->dbType == 'sharedDB')
|
||||
{
|
||||
$sharedDB = zget($mysqlList, $customData->dbService);
|
||||
}
|
||||
elseif(isset($cloudApp->dependencies->postgresql) && $customData->dbType == 'sharedDB')
|
||||
{
|
||||
$sharedDB = zget($pgList, $customData->dbService);
|
||||
}
|
||||
$instance = $this->instance->install($cloudApp, $sharedDB, $customData);
|
||||
if(!$instance) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->notices['installFail']));
|
||||
|
||||
unset($_GET['onlybody']);
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->instance->notices['installSuccess'], 'load' => $this->createLink('instance', 'view', "id=$instance->id"), 'closeModal' => true));
|
||||
}
|
||||
|
||||
$this->lang->switcherMenu = $this->instance->getInstallSwitcher($cloudApp);
|
||||
|
||||
$this->view->position[] = $this->view->title;
|
||||
|
||||
$this->view->title = $this->lang->instance->install . $cloudApp->alias;
|
||||
$this->view->cloudApp = $cloudApp;
|
||||
|
||||
$this->view->versionList = array();
|
||||
foreach($versionList as $version) $this->view->versionList[$version->version] = $version->app_version . " ({$version->version})";
|
||||
|
||||
$this->view->thirdDomain = $this->instance->randThirdDomain();
|
||||
$this->view->mysqlList = $this->instance->dbListToOptions($mysqlList);
|
||||
$this->view->pgList = $this->instance->dbListToOptions($pgList);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Uninstall app instance.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxUninstall($instanceID, $type = '')
|
||||
{
|
||||
if($type == 'external')
|
||||
{
|
||||
$instance = $this->loadModel('pipeline')->getByID($instanceID);
|
||||
if(!$instance) return $this->send(array('result' => 'success', 'message' => $this->lang->instance->notices['success']));
|
||||
|
||||
return $this->send($this->fetch($instance->type, 'delete', array('id' => $instance->id)));
|
||||
}
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
if(!$instance) return $this->send(array('result' => 'success', 'message' => $this->lang->instance->notices['success']));
|
||||
|
||||
$success = $this->instance->uninstall($instance);
|
||||
$this->action->create('instance', $instance->id, 'uninstall', '', json_encode(array('result' => $success, 'app' => array('alias' => $instance->appName, 'app_version' => $instance->version))));
|
||||
if($success) return $this->send(array('result' => 'success', 'message' => zget($this->lang->instance->notices, 'uninstallSuccess'), 'locate' => $this->createLink('space', 'browse')));
|
||||
|
||||
return $this->send(array('result' => 'fail', 'message' => zget($this->lang->instance->notices, 'uninstallFail')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Start app instance.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxStart($instanceID)
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
if(!$instance) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->instanceNotExists));
|
||||
|
||||
$result = $this->instance->start($instance);
|
||||
$this->action->create('instance', $instance->id, 'start', '', json_encode(array('result' => $result, 'app' => array('alias' => $instance->appName, 'app_version' => $instance->version))));
|
||||
|
||||
if($result->code == 200) return $this->send(array('result' => 'success', 'load' => true, 'message' => zget($this->lang->instance->notices, 'startSuccess')));
|
||||
|
||||
return $this->send(array('result' => 'fail', 'message' => !empty($result->message) ? $result->message : zget($this->lang->instance->notices, 'startFail')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop app instance.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxStop($instanceID)
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
if(!$instance) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->instanceNotExists));
|
||||
|
||||
$result = $this->instance->stop($instance);
|
||||
$this->action->create('instance', $instance->id, 'stop', '', json_encode(array('result' => $result, 'app' => array('alias' => $instance->appName, 'app_version' => $instance->version))));
|
||||
if($result->code == 200) return $this->send(array('result' => 'success', 'load' => true, 'message' => zget($this->lang->instance->notices, 'stopSuccess')));
|
||||
|
||||
return $this->send(array('result' => 'fail', 'message' => !empty($result->message) ? $result->message : zget($this->lang->instance->notices, 'stopFail')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Query status of app instance.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxStatus()
|
||||
{
|
||||
$postData = fixer::input('post')->setDefault('idList', array())->get();
|
||||
|
||||
$instances = $this->instance->getByIdList($postData->idList);
|
||||
$statusList = $this->instance->batchFresh($instances);
|
||||
|
||||
return $this->send(array('result' => 'success', 'data' => $statusList));
|
||||
}
|
||||
|
||||
/**
|
||||
* Backup instnacd by ajax.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxBackup($instanceID)
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
$success = $this->instance->backup($instance, $this->app->user);
|
||||
if(!$success)
|
||||
{
|
||||
$this->action->create('instance', $instance->id, 'backup', '', json_encode(array('result' => array('result' => 'fail'))));
|
||||
return $this->send(array('result' => 'fail', 'message' => zget($this->lang->instance->notices, 'backupFail')));
|
||||
}
|
||||
|
||||
$this->action->create('instance', $instance->id, 'backup', '', json_encode(array('result' => array('result' => 'success'))));
|
||||
return $this->send(array('result' => 'success', 'message' => zget($this->lang->instance->notices, 'backupSuccess')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore instance by ajax
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxRestore()
|
||||
{
|
||||
$postData = fixer::input('post')
|
||||
->trim('instanceID')
|
||||
->trim('backupName')->get();
|
||||
|
||||
if(empty($postData->instanceID) || empty($postData->backupName)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->wrongRequestData));
|
||||
|
||||
$instance = $this->instance->getByID($postData->instanceID);
|
||||
if(empty($instance))return print(js::alert($this->lang->instance->instanceNotExists) . js::locate($this->createLink('space', 'browse')));
|
||||
|
||||
$success = $this->instance->restore($instance, $this->app->user, $postData->backupName);
|
||||
if(!$success)
|
||||
{
|
||||
$this->action->create('instance', $instance->id, 'restore', '', json_encode(array('result' => array('result' => 'fail'))));
|
||||
return $this->send(array('result' => 'fail', 'message' => zget($this->lang->instance->notices, 'restoreFail')));
|
||||
}
|
||||
|
||||
$this->action->create('instance', $instance->id, 'restore', '', json_encode(array('result' => array('result' => 'success'))));
|
||||
return $this->send(array('result' => 'success', 'message' => zget($this->lang->instance->notices, 'restoreSuccess')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete backup by ajax.
|
||||
*
|
||||
* @param int $backupID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxDeleteBackup($backupID)
|
||||
{
|
||||
$success = $this->instance->deleteBackup($backupID, $this->app->user);
|
||||
if(!$success) return $this->send(array('result' => 'fail', 'message' => zget($this->lang->instance->notices, 'deleteFail')));
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => zget($this->lang->instance->notices, 'deleteSuccess')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate database auth parameters and jump to login page.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxDBAuthUrl()
|
||||
{
|
||||
$post = fixer::input('post')
|
||||
->setDefault('namespace', 'default')
|
||||
->setDefault('instanceID', 0)
|
||||
->setDefault('dbType', '')
|
||||
->get();
|
||||
if(empty($post->dbName)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->dbNameIsEmpty));
|
||||
|
||||
$instance = $this->instance->getByID($post->instanceID);
|
||||
if(empty($instance)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->instanceNotExists));
|
||||
|
||||
$detail = $this->loadModel('cne')->appDBDetail($instance, $post->dbName);
|
||||
if(empty($detail)) return $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->notFoundDB));
|
||||
|
||||
$dbAuth = array();
|
||||
$dbAuth['driver'] = zget($this->config->instance->adminer->dbTypes, $post->dbType, '');
|
||||
$dbAuth['server'] = $detail->host . ':' . $detail->port;
|
||||
$dbAuth['username'] = $detail->username;
|
||||
$dbAuth['db'] = $detail->database;
|
||||
$dbAuth['password'] = $detail->password;
|
||||
|
||||
$url = '/adminer?' . http_build_query($dbAuth);
|
||||
$this->send(array('result' => 'success', 'message' => '', 'data' => array('url' => $url)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust instance memory size by ajax.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxAdjustMemory($instanceID)
|
||||
{
|
||||
$postData = fixer::input('post')->get();
|
||||
|
||||
/* Check free memory size is enough or not. */
|
||||
$clusterResource = $this->cne->cneMetrics();
|
||||
$freeMemory = intval($clusterResource->metrics->memory->allocatable * 0.9); // Remain 10% memory for system.
|
||||
if($postData->memory_kb * 1024 > $freeMemory) $this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->notEnoughResource));
|
||||
|
||||
/* Request CNE to adjust memory size. */
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
if(!$this->instance->updateMemorySize($instance, $postData->memory_kb * 1024))
|
||||
{
|
||||
$this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
}
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch LDAP between enable and disable by ajax.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSwitchLDAP($instanceID)
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
$postData = fixer::input('post')->get();
|
||||
|
||||
if($this->instance->switchLDAP($instance, $postData->enableLDAP == 'true'))
|
||||
{
|
||||
$this->send(array('result' => 'success', 'message' => ''));
|
||||
}
|
||||
|
||||
$this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->switchLDAPFailed));
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch SMTP between enable and disable by ajax.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxSwitchSMTP($instanceID)
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
$postData = fixer::input('post')->get();
|
||||
|
||||
if($this->instance->switchSMTP($instance, $postData->enableSMTP == 'true'))
|
||||
{
|
||||
$this->send(array('result' => 'success', 'message' => ''));
|
||||
}
|
||||
|
||||
$this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->switchSMTPFailed));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update custom settings by ajax. For example: env variables.
|
||||
*
|
||||
* @param int $instanceID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxUpdateCustom($instanceID)
|
||||
{
|
||||
$instance = $this->instance->getByID($instanceID);
|
||||
if(!$instance) $this->send(array('result' => 'fail', 'message' => $this->lang->instance->instanceNotExists));
|
||||
|
||||
$postData = fixer::input('post')->get();
|
||||
|
||||
$settings = new stdclass;
|
||||
$settings->force_restart = true;
|
||||
$settings->settings_map = new stdclass;
|
||||
$settings->settings_map->custom = $postData;
|
||||
|
||||
if($this->cne->updateConfig($instance, $settings))
|
||||
{
|
||||
$this->action->create('instance', $instanceID, 'updatecustom', '', json_encode($settings));
|
||||
$this->send(array('result' => 'success', 'message' => ''));
|
||||
}
|
||||
|
||||
$this->send(array('result' => 'fail', 'message' => $this->lang->instance->errors->setEnvFailed));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete expired demo instance by cron.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteExpiredDemoInstance()
|
||||
{
|
||||
if(empty($this->config->demoAccounts)) return $this->send(array('result' => 'fail', 'message' => 'This api is only for demo enviroment.'));
|
||||
|
||||
$this->instance->deleteExpiredDemoInstance();
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => ''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get instance info for q tool in console.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return mixed
|
||||
*/
|
||||
public function apiDetail($id)
|
||||
{
|
||||
if(!$this->checkCneToken())
|
||||
{
|
||||
helper::setStatus(401);
|
||||
return print(json_encode(array('code' => 401, 'message' => 'Invalid token.')));
|
||||
}
|
||||
|
||||
if(empty($id)) return print(json_encode(array('code' => 401, 'message' => 'Invalid id.')));
|
||||
|
||||
$instance = $this->instance->getByID($id);
|
||||
if(empty($instance)) return print(json_encode(array('code' => 404, 'message' => 'Not found.', 'data' => array())));
|
||||
|
||||
$instance->space = $instance->spaceData && isset($instance->spaceData->k8space) ? $instance->spaceData->k8space : '';
|
||||
unset($instance->desc);
|
||||
unset($instance->spaceData);
|
||||
|
||||
return print(json_encode(array('code' => 200, 'message' => 'success', 'data' => $instance)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get instances list by account through api for q tool.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function apiBrowse()
|
||||
{
|
||||
if(!$this->checkCneToken())
|
||||
{
|
||||
helper::setStatus(401);
|
||||
return print(json_encode(array('code' => 401, 'message' => 'Invalid token.')));
|
||||
}
|
||||
|
||||
$requestBody = json_decode(file_get_contents("php://input"));
|
||||
$account = zget($requestBody, 'account', '');
|
||||
if(empty($account)) return print(json_encode(array('code' => 700, 'message' => 'Account is required.', 'data' => new stdclass)));
|
||||
|
||||
$recPerPage = zget($requestBody, 'perPage', 20);
|
||||
$pageID = zget($requestBody, 'page', 1);
|
||||
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = pager::init(0, $recPerPage, $pageID);
|
||||
|
||||
$instanceList = $this->instance->getByAccount($account, $pager);
|
||||
|
||||
$result = new stdclass;
|
||||
$result->list = $instanceList;
|
||||
$result->page = $pageID;
|
||||
$result->perPage = $recPerPage;
|
||||
$result->pageTotal = $pager->pageTotal;
|
||||
$result->total = $pager->recTotal;
|
||||
|
||||
return print(json_encode(array('code' => 200, 'message' => 'success', 'data' => $result)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Install app by api for q tool.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function apiInstall()
|
||||
{
|
||||
if(!$this->checkCneToken())
|
||||
{
|
||||
helper::setStatus(401);
|
||||
return print(json_encode(array('code' => 401, 'message' => 'Invalid token.')));
|
||||
}
|
||||
|
||||
$requestBody = json_decode(file_get_contents("php://input"));
|
||||
$chart = zget($requestBody , 'chart', '');
|
||||
if(empty($chart)) return print(json_encode(array('code' => 701, 'message' => 'Param chart is required.')));
|
||||
|
||||
$user = null;
|
||||
$account = zget($requestBody, 'account', '');
|
||||
if($account) $user = $this->loadModel('user')->getById($account);
|
||||
if(empty($user)) $user = $this->loadModel('company')->getAdmin();
|
||||
if(empty($user)) return print(json_encode(array('code' => 703, 'message' => 'No user.')));
|
||||
|
||||
$this->app->user = $user;
|
||||
|
||||
$name = zget($requestBody , 'name', '');
|
||||
$channel = zget($requestBody , 'channel', 'stable');
|
||||
$k8name = zget($requestBody , 'k8name', '');
|
||||
if($k8name && $this->instance->k8nameExists($k8name)) return print(json_encode(array('code' => 706, 'message' => $k8name . ' has been used, please change it and try again.')));
|
||||
|
||||
$thirdDomain = zget($requestBody , 'domain', '');
|
||||
if($this->instance->domainExists($thirdDomain)) return print(json_encode(array('code' => 705, 'message' => $thirdDomain . ' has been used, please change it and try again.')));
|
||||
|
||||
$cloudApp = $this->store->getAppInfoByChart($chart, $channel, false);
|
||||
if(empty($cloudApp)) return print(json_encode(array('code' => 702, 'message' => 'App not found.')));
|
||||
|
||||
$result = $this->instance->apiInstall($cloudApp, $thirdDomain, $name, $k8name, $channel);
|
||||
|
||||
if($result) return print(json_encode(array('code' => 200, 'message' => 'success', 'data' => new stdclass)));
|
||||
|
||||
return print(json_encode(array('code' => 704, 'message' => 'Fail to install app.', 'data' => new stdclass)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check CNE token.
|
||||
*
|
||||
* @access private
|
||||
* @return bool
|
||||
*/
|
||||
private function checkCneToken()
|
||||
{
|
||||
$token = zget($_SERVER, 'HTTP_TOKEN');
|
||||
return $token == $this->config->CNE->api->token;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
#backupSettingForm{ margin-bottom: 40px;}
|
||||
@@ -0,0 +1,5 @@
|
||||
#installForm .advanced {padding: 10px 0; border-bottom: solid 1px #e4e4e4;}
|
||||
#installForm .advanced a {font-weight: 700;}
|
||||
#installForm .advanced .icon {display: inline-block; margin-left: 10px;}
|
||||
#installForm .advanced a:hover, #installForm table td a:focus, #installForm table td a:hover {color: #61be68;}
|
||||
#installForm td {height: 46px;}
|
||||
@@ -0,0 +1 @@
|
||||
.modal-message {font-weight: bold; padding: 20px;}
|
||||
@@ -0,0 +1,32 @@
|
||||
#mainContent .nav-tabs li>a::before {height: 0;}
|
||||
.instance-name h3 {display: inline-block; padding-left: 10px;}
|
||||
.instance-name > span {font-size: 14px; font-weight: bolder; padding: 3px 3px; margin: 0 5px;}
|
||||
.instance-panel .btn-group .btn {width: 60px;}
|
||||
.instance-panel .btn-group i {font-size: 24px;}
|
||||
.instance-status span {display: inline-block; margin-right: 10px; padding-bottom: 1px;}
|
||||
.instance-status i {font-size: 18px;}
|
||||
.instance-source span {display: inline-block; margin-right: 10px; width: 100px;}
|
||||
#senior-app-desc a {color: #61be68}
|
||||
a#serialDiff {color: #ff9800;}
|
||||
#seniorAppPanel span.text-info:hover {color: #2196f3;}
|
||||
.instance-log .panel-body {padding-bottom: 8px; padding-left: 10px;}
|
||||
.instance-log .panel-body table {margin-bottom: 0;}
|
||||
.usage-box {border-radius: 3px;}
|
||||
.c-title {text-align: center; padding-top: 10px; font-size: 15px}
|
||||
.progress-pie {margin: 10px auto;}
|
||||
.instance-panel > div > a:last-child { margin-left: 8px;}
|
||||
.solution-link {display: inline-block; margin-left: 20px;}
|
||||
|
||||
#backup .panel {padding: 10px;}
|
||||
#backup .panel .btn-toolbar{padding: 0 0 10px 0;}
|
||||
#backup .panel .panel-heading {height: 50px;}
|
||||
#backup table.table {margin-bottom: 20px; width: auto;}
|
||||
#backup table th.actions {padding-left: 15px;}
|
||||
#backup table td>.btn {padding-left: 5px; padding-right: 5px;}
|
||||
#backup .btn.btn-info[disabled] {color: rgba(255,255,255,.7); background-color: #61be68;}
|
||||
|
||||
#advance .panel-title span {padding-left: 10px;}
|
||||
#advance hr {margin: 5px 20px;}
|
||||
#advance .scalable-input{height: 26px;}
|
||||
#advance .center{text-align: center;}
|
||||
#advance .hide{display: none}
|
||||
@@ -0,0 +1,8 @@
|
||||
.detail-header .icon-info-sign {color: rgba(var(--color-secondary-500-rgb),var(--tw-bg-opacity));}
|
||||
#dynamicPager {justify-content: flex-end;}
|
||||
#dynamicPager .ghost {color: rgb(131, 138, 157);}
|
||||
#dynamicTable a {color: inherit;}
|
||||
.progress-container {word-break: keep-all; white-space: nowrap;}
|
||||
.progress-container i {margin: auto; margin-right: 6px;}
|
||||
.progress-container .progress {margin: auto; width: 100%; height: .7rem; margin-left: 6px; margin-right: 15px;}
|
||||
.label-dot {display: inline-block; width: 8px; height: 8px; padding: 0; line-height: 20px; text-indent: -9999em; border-radius: 50%;}
|
||||
@@ -0,0 +1,64 @@
|
||||
$(function()
|
||||
{
|
||||
$(".form-time").datetimepicker({
|
||||
weekStart: 1,
|
||||
todayBtn: 1,
|
||||
autoclose: 1,
|
||||
todayHighlight: 1,
|
||||
startView: 1,
|
||||
minView: 0,
|
||||
maxView: 1,
|
||||
forceParse: 0,
|
||||
format: 'hh:ii'
|
||||
});
|
||||
|
||||
$("input[type=checkbox][name='autoBackup[]']").on('change', function(event)
|
||||
{
|
||||
var enabled = $("input[type=checkbox][name='autoBackup[]']:checked").length > 0;
|
||||
if(enabled)
|
||||
{
|
||||
$('.backup-settings').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.backup-settings').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[type=checkbox][name='autoBackup[]']").change();
|
||||
|
||||
$("#keepDays").on('input', function(event)
|
||||
{
|
||||
console.log(event,event.target.value);
|
||||
event.target.value = event.target.value.replace(/[^\d]+/g,'');
|
||||
if(Number(event.target.value) < 1)
|
||||
{
|
||||
event.target.value = 1;
|
||||
}
|
||||
|
||||
if(Number(event.target.value) > 30)
|
||||
{
|
||||
event.target.value = 30;
|
||||
}
|
||||
});
|
||||
|
||||
$('#backupSettingForm #saveSetting').on('click', function()
|
||||
{
|
||||
var settings = $('#backupSettingForm').serialize();
|
||||
$.post(createLink('instance', 'backupSettings', 'id=' + instanceID), settings).done(function(response)
|
||||
{
|
||||
var res = JSON.parse(response);
|
||||
|
||||
if(res.result == 'success')
|
||||
{
|
||||
parent.window.$.closeModal();
|
||||
parent.window.bootAlert({title: instanceNotices.success, message:res.message});
|
||||
}
|
||||
else
|
||||
{
|
||||
var errMsg = res.message instanceof Array ? res.message.join('<br/>') : res.message;
|
||||
parent.window.bootAlert({title: instanceNotices.fail, message: errMsg});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
$(function()
|
||||
{
|
||||
$('input[type=number]').on('change', function(event)
|
||||
{
|
||||
if($(event.target).val() <= 1) $(event.target).val(1);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,48 @@
|
||||
$(function()
|
||||
{
|
||||
$('#installForm').on('submit', function(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.installing + '</div>',
|
||||
});
|
||||
|
||||
$.post($('#installForm').attr('action'), $('#installForm').serializeArray()).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
config.onlybody = 'no';
|
||||
window.parent.$.apps.open(res.locate, 'space');
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("input[type=radio][name='dbType']").on('change', function(event)
|
||||
{
|
||||
if(event.target.value == 'sharedDB')
|
||||
{
|
||||
$("select[name=dbService]").closest('td').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("select[name=dbService]").closest('td').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$(".advanced a").on('click', function(event)
|
||||
{
|
||||
let downArrow = $(".advanced a .icon-chevron-double-down");
|
||||
let upArrow = $(".advanced a .icon-chevron-double-up");
|
||||
if(downArrow.length >0 ) downArrow.removeClass('icon-chevron-double-down').addClass('icon-chevron-double-up');
|
||||
if(upArrow.length >0 ) upArrow.removeClass('icon-chevron-double-up').addClass('icon-chevron-double-down');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
$(function()
|
||||
{
|
||||
$(".form-time").datetimepicker({
|
||||
weekStart: 1,
|
||||
todayBtn: 1,
|
||||
autoclose: 1,
|
||||
todayHighlight: 1,
|
||||
startView: 1,
|
||||
minView: 0,
|
||||
maxView: 1,
|
||||
forceParse: 0,
|
||||
format: 'hh:ii'
|
||||
});
|
||||
|
||||
$("input[type=checkbox][name='autoRestore[]']").on('change', function(event)
|
||||
{
|
||||
var enabled = $("input[type=checkbox][name='autoRestore[]']:checked").length > 0;
|
||||
if(enabled)
|
||||
{
|
||||
$('.restore-settings').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.restore-settings').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[type=checkbox][name='autoRestore[]']").change();
|
||||
|
||||
$('#restoreSettingForm #saveSetting').on('click', function()
|
||||
{
|
||||
var settings = $('#restoreSettingForm').serialize();
|
||||
$.post(createLink('instance', 'restoreSettings', 'id=' + instanceID), settings).done(function(response)
|
||||
{
|
||||
var res = JSON.parse(response);
|
||||
|
||||
if(res.result == 'success')
|
||||
{
|
||||
parent.window.$.closeModal();
|
||||
parent.window.bootAlert({title: instanceNotices.success, message:res.message});
|
||||
}
|
||||
else
|
||||
{
|
||||
var errMsg = res.message instanceof Array ? res.message.join('<br/>') : res.message;
|
||||
parent.window.bootAlert({title: instanceNotices.fail, message: errMsg});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
$(function(){
|
||||
$("#toSeniorForm input#readtrue").on('change', function()
|
||||
{
|
||||
if($('#toSeniorForm input#readtrue:checked').length > 0)
|
||||
{
|
||||
$('#toSeniorForm button[type=submit]').attr('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#toSeniorForm button[type=submit]').attr('disabled', true);
|
||||
}
|
||||
});
|
||||
$("#toSeniorForm input#readtrue").change();
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
$(function()
|
||||
{
|
||||
$('#upgradeForm').on('submit', function(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.upgrading + '</div>',
|
||||
});
|
||||
|
||||
$.post($('#upgradeForm').attr('action'), $('#upgradeForm').serializeArray()).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
window.parent.$('#triggerModal').modal('hide');
|
||||
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
config.onlybody = 'no';
|
||||
window.parent.$.apps.reload('space', createLink('space', 'browse'), 'space');
|
||||
window.parent.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,502 @@
|
||||
$(function()
|
||||
{
|
||||
$('#memBtn').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.adjustMemory, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.adjusting + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'ajaxAdjustMemory', 'id=' + id, 'json');
|
||||
var adjustData = {memory_kb: $('select[name=memory_kb]').val()};
|
||||
$.post(url, adjustData).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.parent.$.apps.open(createLink('instance', 'view', 'id=' + id), 'space');
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$('#ldapBtn').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.switchLDAP, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.switching + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'ajaxSwitchLDAP', 'id=' + id, 'json');
|
||||
var postData = {enableLDAP: $("[name='enableLDAP[]']:checked").length > 0};
|
||||
$.post(url, postData).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.parent.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#smtpBtn').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.switchSMTP, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.switching + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'ajaxSwitchSMTP', 'id=' + id, 'json');
|
||||
var postData = {enableSMTP: $("[name='enableSMTP[]']:checked").length > 0};
|
||||
$.post(url, postData).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.parent.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#customBtn').on('click', function(event)
|
||||
{
|
||||
var errors = '';
|
||||
$("#customForm").find("input[type=text]").each(function(index, item)
|
||||
{
|
||||
if($(item).val().trim().length == 0)
|
||||
{
|
||||
errors += $(item).attr('placeholder') + instanceNotices.required + '<br/>';
|
||||
}
|
||||
});
|
||||
if(errors.length > 0)
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.error,
|
||||
message: errors,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
bootbox.confirm(instanceNotices.confirmCustom, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.setting + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'ajaxUpdateCustom', 'id=' + id, 'json');
|
||||
var formData = $('#customForm').serializeArray();
|
||||
var customData = {};
|
||||
formData.forEach(function(item, index){
|
||||
customData[item.name] = item.value;
|
||||
});
|
||||
|
||||
$.post(url, customData).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.parent.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$('.btn-uninstall').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.confirmUninstall, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.uninstalling + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'ajaxUninstall', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.parent.$.apps.open(createLink('space', 'browse'), 'space');
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('.btn-start').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.confirmStart, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.starting + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'ajaxStart', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('.btn-stop').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.confirmStop, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.stopping + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'ajaxStop', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('.btn-backup').on('click', function(event)
|
||||
{
|
||||
$('#confirmRestore').modal('hide');
|
||||
bootbox.confirm(instanceNotices.confirmBackup, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.backuping + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'ajaxBackup', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.success,
|
||||
message: res.message,
|
||||
callback: function(){window.location.reload();}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('.btn-restore').click(function()
|
||||
{
|
||||
let backupName = $(this).attr('backup-name');
|
||||
let instanceID = $(this).attr('instance-id');
|
||||
$('#confirmRestore #submitRestore').data('backup-name', backupName);
|
||||
$('#confirmRestore #submitRestore').data('instance-id', instanceID);
|
||||
$('#confirmRestore').modal('show');
|
||||
});
|
||||
|
||||
$('#submitRestore').on('click', function(event)
|
||||
{
|
||||
$('#confirmRestore').modal('hide');
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.restoring + '</div>',
|
||||
});
|
||||
|
||||
var instanceID = $(event.target).closest('button').data('instance-id');
|
||||
var backupName = $(event.target).closest('button').data('backup-name');
|
||||
var url = createLink('instance', 'ajaxRestore', '', 'json');
|
||||
$.post(url, { instanceID, backupName }).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.success,
|
||||
message: res.message,
|
||||
callback: function(){window.location.reload();}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.btn-delete-backup').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.confirmDelete, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.deleting + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('backup-id');
|
||||
var url = createLink('instance', 'ajaxDeleteBackup', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.success,
|
||||
message: res.message,
|
||||
callback: function(){window.location.reload();}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('button.db-login').on('click', function(event)
|
||||
{
|
||||
var dbName = $(event.target).data('db-name');
|
||||
var dbType = $(event.target).data('db-type');
|
||||
var instanceID = $(event.target).data('id');
|
||||
|
||||
$.post(createLink('instance', 'ajaxDBAuthUrl'), {dbName, dbType, instanceID}).done(function(res)
|
||||
{
|
||||
var response = JSON.parse(res);
|
||||
if(response.result == 'success')
|
||||
{
|
||||
window.parent.open(response.data.url, 'Adminer');
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(response.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var enableTimer = true;
|
||||
window.parent.$(window.parent.document).on('showapp', function(event, app)
|
||||
{
|
||||
enableTimer = app.code == 'space';
|
||||
});
|
||||
|
||||
setInterval(function()
|
||||
{
|
||||
if(!enableTimer) return;
|
||||
|
||||
var statusURL = createLink('instance', 'ajaxStatus');
|
||||
$.post(statusURL, {idList: instanceIdList}).done(function(response)
|
||||
{
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success' && res.data instanceof Array)
|
||||
{
|
||||
res.data.forEach(function(instance)
|
||||
{
|
||||
if($(".instance-status[instance-id=" + instance.id + "]").data('status') != instance.status) window.location.reload();
|
||||
});
|
||||
}
|
||||
if(res.locate) window.parent.location.href = res.locate;
|
||||
});
|
||||
}, 1000 * 5);
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
|
||||
/* Count down for demo instance. */
|
||||
setInterval(function()
|
||||
{
|
||||
var nowSeconds = Math.round((new Date).getTime() / 1000);
|
||||
$('.count-down').each(function(index, item)
|
||||
{
|
||||
var createdAt = $(item).data('created-at');
|
||||
var passSeconds = nowSeconds - createdAt;
|
||||
var leftSeconds = (demoAppLife ? demoAppLife : 30) * 60 - passSeconds;
|
||||
|
||||
if(leftSeconds < 0)
|
||||
{
|
||||
window.parent.location.href = createLink('space', 'browse');
|
||||
}
|
||||
else
|
||||
{
|
||||
var minutes = Math.floor(leftSeconds / 60);
|
||||
var seconds = Math.round(leftSeconds % 60);
|
||||
$(item).find('.left-time').text(('0' + minutes).slice(-2) + ':' + ('0' + seconds).slice(-2));
|
||||
}
|
||||
|
||||
})
|
||||
}, 1000)
|
||||
|
||||
$('#replicas-edit').on('click', function()
|
||||
{
|
||||
$('#replicas-input').show()
|
||||
$('#replicas-text').hide()
|
||||
$('#replicas-save').show()
|
||||
$('#replicas-edit').hide()
|
||||
})
|
||||
|
||||
$('#replicas-save').on('click', function()
|
||||
{
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.adjusting + '</div>',
|
||||
});
|
||||
|
||||
var id = $(event.target).closest('button').attr('instance-id');
|
||||
var url = createLink('instance', 'replicas', 'id=' + id, 'json');
|
||||
var adjustData = {replicas: $('#replicas-input').val()};
|
||||
$.post(url, adjustData).done(function(response)
|
||||
{
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.parent.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,43 @@
|
||||
window.openAdminer = function()
|
||||
{
|
||||
var dbName = $(this).data('dbname');
|
||||
var dbType = $(this).data('dbtype');
|
||||
var instanceID = $(this).data('id');
|
||||
|
||||
$.ajaxSubmit
|
||||
(
|
||||
{
|
||||
url: $.createLink('instance', 'ajaxDBAuthUrl'),
|
||||
method: 'POST', data: {dbName, dbType, instanceID},
|
||||
onSuccess: (response) =>
|
||||
{
|
||||
if(response.result == 'success')
|
||||
{
|
||||
window.open(response.data.url, 'Adminer');
|
||||
}
|
||||
else
|
||||
{
|
||||
zui.Modal.alert(response.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
var reloadTimes = 0;
|
||||
window.afterPageUpdate = function()
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
if(reloadTimes > 20) return;
|
||||
if($('#statusTD').data('reload') === true || $('#memoryRate').data('load') == true)
|
||||
{
|
||||
reloadTimes++;
|
||||
fetchContent({url: $.createLink('instance', 'view', 'id=' + instanceID),
|
||||
selector: '#instanceInfoContainer',
|
||||
id: 'instanceInfoContainer',
|
||||
target: '#instanceInfoContainer',
|
||||
});
|
||||
}
|
||||
}, 4000);
|
||||
}
|
||||
@@ -0,0 +1,333 @@
|
||||
<?php
|
||||
$lang->instance = new stdclass;
|
||||
$lang->instance->name = '名称';
|
||||
$lang->instance->appName = '应用类型';
|
||||
$lang->instance->version = '版本';
|
||||
$lang->instance->status = '状态';
|
||||
$lang->instance->cpu = 'CPU';
|
||||
$lang->instance->mem = '内存';
|
||||
$lang->instance->space = '空间';
|
||||
$lang->instance->domain = '域名';
|
||||
$lang->instance->visitIP = '访问方式';
|
||||
$lang->instance->dbType = '数据库';
|
||||
$lang->instance->advanceOption = '高级选项';
|
||||
$lang->instance->baseInfo = '基本信息';
|
||||
$lang->instance->backupAndRestore = '备份';
|
||||
$lang->instance->advance = '高级';
|
||||
$lang->instance->enableLDAP = '启用LDAP';
|
||||
$lang->instance->linkLDAP = '集成LDAP';
|
||||
$lang->instance->enableSMTP = '启用SMTP';
|
||||
$lang->instance->customSetting = '自定义配置';
|
||||
$lang->instance->upgradeToSenior = '升级到高级版';
|
||||
$lang->instance->updateDomain = '更新域名';
|
||||
$lang->instance->updateLog = '更新日志';
|
||||
$lang->instance->start = '启动';
|
||||
$lang->instance->restart = '重启';
|
||||
$lang->instance->stop = '关闭';
|
||||
$lang->instance->install = '安装';
|
||||
$lang->instance->update = '更新';
|
||||
$lang->instance->upgrade = '升级';
|
||||
$lang->instance->customInstall = '自定义安装';
|
||||
$lang->instance->uninstall = '删除';
|
||||
$lang->instance->visit = '访问';
|
||||
$lang->instance->editName = '修改名称';
|
||||
$lang->instance->cpuCore = '核';
|
||||
$lang->instance->scalable = '应用水平扩容';
|
||||
$lang->instance->change = '修改';
|
||||
|
||||
$lang->instance->systemLDAPInactive = '未开启系统LDAP';
|
||||
$lang->instance->toSystemLDAP = '去启用';
|
||||
|
||||
$lang->instance->enableSMTP = '启用SMTP';
|
||||
$lang->instance->systemSMTPInactive = '未开启系统SMTP';
|
||||
$lang->instance->toSystemSMTP = '去启用';
|
||||
|
||||
|
||||
$lang->instance->serviceInfo = '服务信息';
|
||||
$lang->instance->appTemplate = '应用模板';
|
||||
$lang->instance->source = '来源';
|
||||
$lang->instance->installBy = '创建者';
|
||||
$lang->instance->installAt = '创建时间';
|
||||
$lang->instance->runDuration = '已运行';
|
||||
$lang->instance->defaultAccount = '默认用户';
|
||||
$lang->instance->defaultPassword = '默认密码';
|
||||
$lang->instance->operationLog = '操作记录';
|
||||
$lang->instance->installedService = '已安装服务';
|
||||
$lang->instance->runningService = '运行中的服务';
|
||||
$lang->instance->installApp = '安装应用';
|
||||
$lang->instance->cpuUsage = 'CPU占用';
|
||||
$lang->instance->memUsage = '内存占用';
|
||||
$lang->instance->memTotal = '(共%s)';
|
||||
$lang->instance->currentMemory = '当前内存';
|
||||
$lang->instance->adjustMem = '调整内存';
|
||||
$lang->instance->setting = '设置';
|
||||
$lang->instance->saveSetting = '保存设置';
|
||||
$lang->instance->leftTime = '剩余';
|
||||
$lang->instance->switchTo = '升级到';
|
||||
$lang->instance->or = '或';
|
||||
$lang->instance->hasRead = '已阅读';
|
||||
$lang->instance->stopInstanceTips = '关闭服务后才能升级到高级版!';
|
||||
|
||||
$lang->instance->dbTypes = array();
|
||||
$lang->instance->dbTypes['sharedDB'] = '共享数据库';
|
||||
$lang->instance->dbTypes['unsharedDB'] = '独享数据库';
|
||||
|
||||
$lang->instance->backup = new stdclass;
|
||||
$lang->instance->backup->common = '备份';
|
||||
$lang->instance->backup->date = '备份时间';
|
||||
$lang->instance->backup->operator = '备份人';
|
||||
$lang->instance->backup->type = '备份类型';
|
||||
$lang->instance->backup->backupStatus = '备份状态';
|
||||
$lang->instance->backup->restoreStatus = '回滚状态';
|
||||
$lang->instance->backup->restoreOperator = '回滚人';
|
||||
$lang->instance->backup->restoreTime = '回滚时间';
|
||||
$lang->instance->backup->action = '操作';
|
||||
$lang->instance->backup->restore = '回滚';
|
||||
$lang->instance->backup->restoreInfo = '回滚信息';
|
||||
$lang->instance->backup->delete = '删除';
|
||||
$lang->instance->backup->rebackup = '重试备份';
|
||||
$lang->instance->backup->create = '创建备份';
|
||||
$lang->instance->backup->database = '数据库';
|
||||
$lang->instance->backup->dbType = '类型';
|
||||
$lang->instance->backup->dbName = '名称';
|
||||
$lang->instance->backup->dbStatus = '状态';
|
||||
$lang->instance->backup->dbSpentSeconds = '耗时(秒)';
|
||||
$lang->instance->backup->dbSize = '大小';
|
||||
$lang->instance->backup->volumne = '数据卷';
|
||||
$lang->instance->backup->volName = '名称';
|
||||
$lang->instance->backup->volMountName = '挂载目录';
|
||||
$lang->instance->backup->volStatus = '状态';
|
||||
$lang->instance->backup->volSpentSeconds = '耗时(秒)';
|
||||
$lang->instance->backup->volSize = '大小';
|
||||
$lang->instance->backup->lastRestore = '上次回滚';
|
||||
$lang->instance->backup->restoreDate = '回滚时间';
|
||||
$lang->instance->backup->latestBackupAt = '上次备份时间';
|
||||
$lang->instance->backup->backupBeforeRestore = '回滚前建议您先备份!';
|
||||
$lang->instance->backup->enableAutoBackup = '开启自动备份';
|
||||
$lang->instance->backup->autoBackup = '自动备份';
|
||||
$lang->instance->backup->cycleDays = '备份周期';
|
||||
$lang->instance->backup->backupTime = '备份时间';
|
||||
$lang->instance->backup->keepDays = '保留天数';
|
||||
$lang->instance->backup->keepDayRange = '请输入1~30之间的整数';
|
||||
$lang->instance->backup->firstStartTime = '%s 首次备份将于%s 执行';
|
||||
$lang->instance->backup->invalidTime = '无效的时间';
|
||||
$lang->instance->backup->disableAutoBackup = '自动备份已关闭';
|
||||
$lang->instance->backup->keepBackupBySystem = '备份数据超过1条时系统才会删除过期的自动备份数据。';
|
||||
|
||||
$lang->instance->backup->cycleList[1] = '每日';
|
||||
|
||||
$lang->instance->backup->operators = array();
|
||||
$lang->instance->backup->operators['auto'] = '自动备份';
|
||||
|
||||
$lang->instance->backup->statusList = array();
|
||||
$lang->instance->backup->statusList['success'] = '成功';
|
||||
$lang->instance->backup->statusList['failed'] = '失败';
|
||||
$lang->instance->backup->statusList['pending'] = '等待中';
|
||||
$lang->instance->backup->statusList['processing'] = '备份中';
|
||||
$lang->instance->backup->statusList['inprogress'] = '备份中';
|
||||
$lang->instance->backup->statusList['completed'] = '完成';
|
||||
$lang->instance->backup->statusList['executedFailed'] = '失败';
|
||||
$lang->instance->backup->statusList['uploading'] = '上传中';
|
||||
$lang->instance->backup->statusList['deleting'] = '删除中';
|
||||
$lang->instance->backup->statusList['uploadFailed'] = '上传失败';
|
||||
$lang->instance->backup->statusList['downloading'] = '下载中';
|
||||
$lang->instance->backup->statusList['downloadFailed'] = '下载失败';
|
||||
|
||||
$lang->instance->restore = new stdclass;
|
||||
$lang->instance->restore->autoRestore = '自动还原';
|
||||
$lang->instance->restore->enableAutoRestore = '开启自动还原';
|
||||
$lang->instance->restore->cycleDays = '还原周期';
|
||||
$lang->instance->restore->restoreTime = '还原时间';
|
||||
$lang->instance->restore->invalidTime = '无效的时间';
|
||||
$lang->instance->restore->disableAutoRestore = '自动还原已关闭';
|
||||
$lang->instance->restore->firstStartTime = '%s 首次自动还原将于%s 执行';
|
||||
|
||||
$lang->instance->restore->cycleList[1] = '每日';
|
||||
|
||||
$lang->instance->restore->statusList = array();
|
||||
$lang->instance->restore->statusList['pending'] = '等待中';
|
||||
$lang->instance->restore->statusList['inprogress'] = '进行中';
|
||||
$lang->instance->restore->statusList['completed'] = '完成';
|
||||
$lang->instance->restore->statusList['failed'] = '失败';
|
||||
|
||||
$lang->instance->dbList = '数据库';
|
||||
$lang->instance->dbName = '名称';
|
||||
$lang->instance->dbStatus = '状态';
|
||||
$lang->instance->dbType = '类型';
|
||||
$lang->instance->action = '操作';
|
||||
$lang->instance->management = '管理';
|
||||
$lang->instance->dbReady = '正常';
|
||||
$lang->instance->dbWaiting = '等待就绪';
|
||||
|
||||
$lang->instance->log = new stdclass;
|
||||
$lang->instance->log->date = '日期';
|
||||
$lang->instance->log->message = '内容';
|
||||
|
||||
$lang->instance->actionList = array();
|
||||
$lang->instance->actionList['install'] = '安装了%s';
|
||||
$lang->instance->actionList['uninstall'] = '删除了%s';
|
||||
$lang->instance->actionList['start'] = '启动了%s';
|
||||
$lang->instance->actionList['stop'] = '关闭了%s';
|
||||
$lang->instance->actionList['editname'] = '修改了名称';
|
||||
$lang->instance->actionList['upgrade'] = '升级了%s';
|
||||
$lang->instance->actionList['backup'] = '备份了%s';
|
||||
$lang->instance->actionList['restore'] = '回滚了%s';
|
||||
$lang->instance->actionList['adjustmemory'] = '调整 %s 的内存到 %s';
|
||||
$lang->instance->actionList['adjustreplicas'] = '调整 %s 的副本数到 %s';
|
||||
$lang->instance->actionList['enableldap'] = '启用了LDAP';
|
||||
$lang->instance->actionList['disableldap'] = '禁用了LDAP';
|
||||
$lang->instance->actionList['enablesmtp'] = '启用了SMTP';
|
||||
$lang->instance->actionList['disablesmtp'] = '禁用了SMTP';
|
||||
$lang->instance->actionList['updatecustom'] = '修改了自定义配置';
|
||||
$lang->instance->actionList['tosenior'] = '升级服务到高级版';
|
||||
$lang->instance->actionList['saveautobackupsettings'] = '修改了自动备份设置';
|
||||
$lang->instance->actionList['saveautorestoresettings'] = '修改了自动还原设置';
|
||||
$lang->instance->actionList['autobackup'] = '系统执行了自动备份';
|
||||
$lang->instance->actionList['autorestore'] = '系统执行了自动还原';
|
||||
$lang->instance->actionList['deleteexpiredbackup'] = '系统删除了过期的自动备份';
|
||||
|
||||
$lang->instance->sourceList = array();
|
||||
$lang->instance->sourceList['cloud'] = '渠成公共市场';
|
||||
$lang->instance->sourceList['local'] = '本地市场';
|
||||
|
||||
$lang->instance->channelList = array();
|
||||
$lang->instance->channelList['test'] = '测试版';
|
||||
$lang->instance->channelList['stable'] = '稳定版';
|
||||
|
||||
$lang->instance->statusList = array();
|
||||
$lang->instance->statusList['installationFail'] = '安装失败';
|
||||
$lang->instance->statusList['creating'] = '创建中';
|
||||
$lang->instance->statusList['initializing'] = '初始化';
|
||||
$lang->instance->statusList['pulling'] = '下载中';
|
||||
$lang->instance->statusList['startup'] = '启动中';
|
||||
$lang->instance->statusList['starting'] = '启动中';
|
||||
$lang->instance->statusList['running'] = '运行中';
|
||||
$lang->instance->statusList['suspending'] = '暂停中';
|
||||
$lang->instance->statusList['suspended'] = '已暂停';
|
||||
$lang->instance->statusList['installing'] = '安装中';
|
||||
$lang->instance->statusList['uninstalling'] = '删除中';
|
||||
$lang->instance->statusList['stopping'] = '关闭中';
|
||||
$lang->instance->statusList['stopped'] = '已关闭';
|
||||
$lang->instance->statusList['destroying'] = '销毁中';
|
||||
$lang->instance->statusList['destroyed'] = '已销毁';
|
||||
$lang->instance->statusList['abnormal'] = '异常';
|
||||
$lang->instance->statusList['upgrading'] = '更新中';
|
||||
$lang->instance->statusList['unknown'] = '未知';
|
||||
|
||||
$lang->instance->htmlStatusesClass = array();
|
||||
$lang->instance->htmlStatusesClass['running'] = 'success';
|
||||
$lang->instance->htmlStatusesClass['stopped'] = 'default';
|
||||
$lang->instance->htmlStatusesClass['abnormal'] = 'danger';
|
||||
$lang->instance->htmlStatusesClass['installationFail'] = 'danger';
|
||||
$lang->instance->htmlStatusesClass['busy'] = "warning";
|
||||
|
||||
$lang->instance->memOptions = array();
|
||||
$lang->instance->memOptions[128 * 1024] = '128MB';
|
||||
$lang->instance->memOptions[256 * 1024] = '256MB';
|
||||
$lang->instance->memOptions[512 * 1024] = '512MB';
|
||||
$lang->instance->memOptions[1024 * 1024] = '1GB';
|
||||
$lang->instance->memOptions[2048 * 1024] = '2GB';
|
||||
$lang->instance->memOptions[4096 * 1024] = '4GB';
|
||||
$lang->instance->memOptions[8192 * 1024] = '8GB';
|
||||
$lang->instance->memOptions[16384 * 1024] = '16GB';
|
||||
$lang->instance->memOptions[32768 * 1024] = '32GB';
|
||||
|
||||
$lang->instance->componentFields = array();
|
||||
$lang->instance->componentFields['replicas'] = '副本数';
|
||||
$lang->instance->componentFields['cpu_limit'] = 'CPU';
|
||||
$lang->instance->componentFields['mem_limit'] = '内存';
|
||||
|
||||
$lang->instance->notices = array();
|
||||
$lang->instance->notices['success'] = '成功';
|
||||
$lang->instance->notices['fail'] = '失败';
|
||||
$lang->instance->notices['error'] = '错误';
|
||||
$lang->instance->notices['confirmStart'] = '确定启动该应用吗?';
|
||||
$lang->instance->notices['confirmStop'] = '确定关闭该应用吗?';
|
||||
$lang->instance->notices['confirmUninstall'] = '确定删除该应用吗?';
|
||||
$lang->instance->notices['startSuccess'] = '启动成功';
|
||||
$lang->instance->notices['startFail'] = '启动失败';
|
||||
$lang->instance->notices['stopSuccess'] = '关闭成功';
|
||||
$lang->instance->notices['stopFail'] = '关闭失败';
|
||||
$lang->instance->notices['uninstallSuccess'] = '删除成功';
|
||||
$lang->instance->notices['uninstallFail'] = '删除失败';
|
||||
$lang->instance->notices['installSuccess'] = '安装成功';
|
||||
$lang->instance->notices['installFail'] = '安装失败';
|
||||
$lang->instance->notices['upgradeSuccess'] = '升级成功';
|
||||
$lang->instance->notices['upgradeFail'] = '升级失败';
|
||||
$lang->instance->notices['backupSuccess'] = '备份任务已提交';
|
||||
$lang->instance->notices['backupFail'] = '备份失败';
|
||||
$lang->instance->notices['restoreSuccess'] = '回滚任务已提交';
|
||||
$lang->instance->notices['restoreFail'] = '回滚失败';
|
||||
$lang->instance->notices['deleteSuccess'] = '删除成功';
|
||||
$lang->instance->notices['deleteFail'] = '删除失败';
|
||||
$lang->instance->notices['starting'] = '启动中,请稍候...';
|
||||
$lang->instance->notices['stopping'] = '关闭中,请稍候...';
|
||||
$lang->instance->notices['installing'] = '安装中,请稍候...';
|
||||
$lang->instance->notices['uninstalling'] = '删除中,请稍候...';
|
||||
$lang->instance->notices['upgrading'] = '升级中,请稍候...';
|
||||
$lang->instance->notices['backuping'] = '备份中,请稍候...';
|
||||
$lang->instance->notices['restoring'] = '回滚中,请稍候...';
|
||||
$lang->instance->notices['deleting'] = '删除中,请稍候...';
|
||||
$lang->instance->notices['adjusting'] = '调整中,请稍候...';
|
||||
$lang->instance->notices['switching'] = '提交中,请稍候...';
|
||||
$lang->instance->notices['setting'] = '提交中,请稍候...';
|
||||
$lang->instance->notices['confirmInstall'] = '确定要安装(%s)?';
|
||||
$lang->instance->notices['confirmUpgrade'] = '确定要升级到最新版吗?';
|
||||
$lang->instance->notices['confirmBackup'] = '确定要备份吗?';
|
||||
$lang->instance->notices['confirmRestore'] = '本操作将用备份的数据覆盖当前的数据,确定要回滚吗?';
|
||||
$lang->instance->notices['confirmDelete'] = '确定要删除该备份数据吗?';
|
||||
$lang->instance->notices['adjustMemory'] = '确定要调整中内存吗?';
|
||||
$lang->instance->notices['switchLDAP'] = '修改LDAP会重启服务,确定要修改LDAP吗?';
|
||||
$lang->instance->notices['enableLDAPFailed'] = '启用LDAP失败';
|
||||
$lang->instance->notices['disableLDAPFailed'] = '禁用LDAP失败';
|
||||
$lang->instance->notices['enableLDAPSuccess'] = '启用LDAP成功';
|
||||
$lang->instance->notices['disableLDAPSuccess'] = '禁用LDAP成功';
|
||||
$lang->instance->notices['switchSMTP'] = '修改SMTP会重启服务,确定要修改SMTP吗?';
|
||||
$lang->instance->notices['enableSMTPFailed'] = '启用SMTP失败';
|
||||
$lang->instance->notices['disableSMTPFailed'] = '禁用SMTP失败';
|
||||
$lang->instance->notices['enableSMTPSuccess'] = '启用SMTP成功';
|
||||
$lang->instance->notices['disableSMTPSuccess'] = '禁用SMTP成功';
|
||||
$lang->instance->notices['confirmCustom'] = '修改自定义配置后服务将自动重启以使配置生效。';
|
||||
$lang->instance->notices['required'] = '不能为空';
|
||||
|
||||
$lang->instance->nameChangeTo = ' %s 修改为 %s 。';
|
||||
$lang->instance->versionChangeTo = ' %s 升级为 %s 。';
|
||||
$lang->instance->toSeniorSerial = '从 %s 升级到 %s 。';
|
||||
$lang->instance->adjustMemorySize = '建议调整内存到 %s 。';
|
||||
$lang->instance->enableAutoBackup = '开启自动备份';
|
||||
$lang->instance->disableAutoBackup = '关闭自动备份';
|
||||
|
||||
$lang->instance->instanceNotExists = '服务不存在';
|
||||
$lang->instance->caplicasTooSmall = '副本数不能小于1';
|
||||
$lang->instance->empty = '暂无服务';
|
||||
$lang->instance->noComponent = '无组件,点击';
|
||||
$lang->instance->noHigherVersion = '未找到更高版本!';
|
||||
$lang->instance->backupOnlyRunning = '运行状态才能备份';
|
||||
$lang->instance->restoreOnlyRunning = '运行状态才能回滚';
|
||||
$lang->instance->howToSelectDB = '如何选择?';
|
||||
$lang->instance->appLifeTip = 'demo账号安装的应用有30分钟限制,30分钟后自动删除。';
|
||||
$lang->instance->serialDiff = '查看版本区别';
|
||||
$lang->instance->descOfSwitchSerial = '您当前使用的是<strong>%s</strong>,想要体验更多高级功能,可升级至%s。';
|
||||
$lang->instance->toSeniorAttention = '重要提示';
|
||||
$lang->instance->toSeniorTips = "<ul class='text-danger'><li>版本升级后,无法回退到原版本。</li><li>企业版、旗舰版自安装后免费试用6个月。</li><li>开源版升级到企业版或旗舰版后,试用期最大支持3个用户,
|
||||
请检查开源版用户数量。超出限制将不可用。</li><li>升级成功后,服务将自动重启。</li><li>为避免造成数据丢失,请您在升级前务必做好数据备份。</li></ul>";
|
||||
|
||||
$lang->instance->errors = new stdclass;
|
||||
$lang->instance->errors->domainLength = '域名长度必须介于2-20字符之间';
|
||||
$lang->instance->errors->domainExists = '域名已被占用,请使用其它域名。';
|
||||
$lang->instance->errors->wrongDomainCharacter = '域名只能是小写英文字母和数字';
|
||||
$lang->instance->errors->noAppInfo = '获取应用数据失败,请稍候重试。';
|
||||
$lang->instance->errors->notEnoughResource = '集群资源不足';
|
||||
$lang->instance->errors->notEnoughMemory = '%s 应用需要 %s 内存,当前可用内存%s ,还需要 %s,请扩充内存资源或删除其他服务后重试!';
|
||||
$lang->instance->errors->restoreRunning = '当前回滚正在进行中,请等待当前回滚完成。';
|
||||
$lang->instance->errors->noBackup = '无备份数据,';
|
||||
$lang->instance->errors->wrongRequestData = '提交的数据有误,请刷新页面后重试。';
|
||||
$lang->instance->errors->noDBList = '无数据库或不可访问';
|
||||
$lang->instance->errors->notFoundDB = '找不到该数据库';
|
||||
$lang->instance->errors->dbNameIsEmpty = '数据库名为空';
|
||||
$lang->instance->errors->failToAdjustMemory = '调整内存失败';
|
||||
$lang->instance->errors->switchLDAPFailed = '修改LDAP设置失败';
|
||||
$lang->instance->errors->switchSMTPFailed = '修改SMTP设置失败';
|
||||
$lang->instance->errors->updateCustomFailed = '修改自定义配置失败';
|
||||
$lang->instance->errors->failToSenior = '升级到高级版失败';
|
||||
$lang->instance->errors->failedToUpdateDomain = '更新域名失败';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The setting view file of instance module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Ke Zhao<zhaoke@easycorp.ltd>
|
||||
* @package instance
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::id('instanceSettingForm'),
|
||||
set::title($lang->instance->setting),
|
||||
set::submitBtnText($lang->save),
|
||||
set::actions(array('submit')),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
set::name('name'),
|
||||
set::width('500px'),
|
||||
set::label($lang->instance->name),
|
||||
set::value($instance->name),
|
||||
)
|
||||
),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
set::name('memory_kb'),
|
||||
set::width('250px'),
|
||||
set::control('picker'),
|
||||
set::label($lang->instance->adjustMem),
|
||||
set::value(intval($currentResource->max->memory / 1024)),
|
||||
set::items($this->instance->filterMemOptions($currentResource)),
|
||||
)
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The setting view file of instance module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Ke Zhao<zhaoke@easycorp.ltd>
|
||||
* @package instance
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::id('instanceSettingForm'),
|
||||
set::title(''),
|
||||
set::submitBtnText($lang->confirm),
|
||||
set::actions(array('submit', array('text' => $lang->cancel, 'data-type' => 'submit', 'data-dismiss' => 'modal'))),
|
||||
span
|
||||
(
|
||||
setClass('p-4 font-semibold'),
|
||||
icon('exclamation-sign', setClass('text-warning icon-2x align-middle m-2')),
|
||||
$lang->instance->notices['confirmUpgrade'],
|
||||
empty($instance->latestVersion->change_log_url) ? null: a
|
||||
(
|
||||
setClass('ml-5'),
|
||||
set::target('_blank'),
|
||||
set::href($instance->latestVersion->change_log_url),
|
||||
setStyle('color', 'initial'),
|
||||
setStyle('font-weight', 'initial'),
|
||||
setStyle('text-decoration', 'underline'),
|
||||
$lang->instance->updateLog,
|
||||
),
|
||||
),
|
||||
div(setStyle('height', '20px')),
|
||||
input(set::type('hidden'), set::name('confirm'), set::value('yes'))
|
||||
);
|
||||
@@ -0,0 +1,203 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* The appview view file of instance module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Ke Zhao<zhaoke@easycorp.ltd>
|
||||
* @package instance
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
jsVar('instanceID', $instance->id);
|
||||
|
||||
$setting = usePager('pager');
|
||||
$cpuInfo = $this->instance->printCpuUsage($instance, $instanceMetric->cpu, 'array');
|
||||
$memoryInfo = $this->instance->printMemUsage($instance, $instanceMetric->memory, 'array');
|
||||
$actions = $this->loadModel('common')->buildOperateMenu($instance);
|
||||
|
||||
$dbListWg = array();
|
||||
foreach($dbList as $db)
|
||||
{
|
||||
$disabledClass = $db->ready && commonModel::hasPriv('instance', 'ajaxDBAuthUrl') ? '' : 'disabled';
|
||||
$dbListWg[] = h::tr
|
||||
(
|
||||
h::td($db->db_name),
|
||||
h::td($db->db_type),
|
||||
h::td
|
||||
(
|
||||
$db->ready ? $lang->instance->dbReady : $lang->instance->dbWaiting,
|
||||
setClass('text-' . ($db->ready ? 'success' : 'danger'))
|
||||
),
|
||||
|
||||
h::td
|
||||
(
|
||||
btn
|
||||
(
|
||||
$lang->instance->management,
|
||||
setClass('btn text-primary ghost ' . $disabledClass),
|
||||
setData('dbname', $db->name),
|
||||
setData('dbtype', $db->db_type),
|
||||
setData('id', $instance->id),
|
||||
on::click('openAdminer'),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
detailHeader(
|
||||
to::prefix(''),
|
||||
to::title(''),
|
||||
);
|
||||
div
|
||||
(
|
||||
setClass('flex flex-normal gap-x-5'),
|
||||
div
|
||||
(
|
||||
setClass('basis-2/3'),
|
||||
setID('instanceInfoContainer'),
|
||||
detailBody
|
||||
(
|
||||
sectionList
|
||||
(
|
||||
/* 应用名称信息图标区块 */
|
||||
section
|
||||
(
|
||||
div
|
||||
(
|
||||
setClass('flex justify-between'),
|
||||
div
|
||||
(
|
||||
setClass('flex basis-full'),
|
||||
img(set::src($instance->logo), setStyle(array('width' => '50px', 'height' => '50px'))),
|
||||
div
|
||||
(
|
||||
setClass('ml-3 flex col gap-y-1 basis-full'),
|
||||
div
|
||||
(
|
||||
$instance->name, setClass('text-xl'),
|
||||
span($cloudApp->app_version, setClass('ml-3 label lighter rounded-full'))
|
||||
),
|
||||
div
|
||||
(
|
||||
setClass('flex progress-container'),
|
||||
set::title($cpuInfo['tip']),
|
||||
icon('cog-outline text-' . $cpuInfo['color']),
|
||||
$lang->instance->cpuUsage,
|
||||
div
|
||||
(
|
||||
setClass('progress rounded-lg'),
|
||||
setStyle('background', "var(--color-{$cpuInfo['color']}-50)"),
|
||||
div
|
||||
(
|
||||
setClass('progress-bar ' . $cpuInfo['color']),
|
||||
set::role('progressbar'),
|
||||
setStyle('width', $cpuInfo['rate'])
|
||||
)
|
||||
),
|
||||
icon('desktop text-' . $memoryInfo['color']),
|
||||
$lang->instance->memUsage,
|
||||
span
|
||||
(
|
||||
setClass('text-gray'),
|
||||
sprintf($lang->instance->memTotal, helper::formatKB($instanceMetric->memory->limit)),
|
||||
),
|
||||
div
|
||||
(
|
||||
setClass('progress rounded-lg'),
|
||||
set::title($memoryInfo['tip']),
|
||||
setStyle('background', "var(--color-{$memoryInfo['color']}-50)"),
|
||||
div
|
||||
(
|
||||
setID('memoryRate'),
|
||||
set::role('progressbar'),
|
||||
setData('load', $instance->status == 'running' && $memoryInfo['rate'] == '0%'),
|
||||
setClass('progress-bar ' . $memoryInfo['color']),
|
||||
setStyle('width', $memoryInfo['rate'])
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
btn($lang->instance->setting, setClass('btn ghost'), set::icon('backend'), setData('toggle', 'modal'), setData('size', 'sm'), set::url(createLink('instance', 'setting', "id={$instance->id}")))
|
||||
),
|
||||
),
|
||||
/* 基本信息区块 */
|
||||
section
|
||||
(
|
||||
set::title($lang->instance->baseInfo),
|
||||
h::table
|
||||
(
|
||||
setStyle('min-width', '700px'),
|
||||
setClass('table w-auto max-w-full bordered mt-4'),
|
||||
h::tr
|
||||
(
|
||||
h::th($lang->instance->status),
|
||||
h::th($lang->instance->source),
|
||||
// h::th($lang->instance->appTemplate),
|
||||
h::th($lang->instance->installBy),
|
||||
h::th($lang->instance->installAt),
|
||||
h::th($lang->instance->runDuration),
|
||||
$defaultAccount ? h::th($lang->instance->defaultAccount) : null,
|
||||
$defaultAccount ? h::th($lang->instance->defaultPassword) : null,
|
||||
),
|
||||
h::tr
|
||||
(
|
||||
h::td
|
||||
(
|
||||
setID('statusTD'),
|
||||
setData('reload', in_array($instance->status, array('creating', 'initializing', 'pulling', 'startup', 'starting', 'suspending', 'installing', 'uninstalling', 'stopping', 'destroying', 'upgrading'))),
|
||||
span
|
||||
(
|
||||
setClass('label label-dot mr-1 ' . zget($this->lang->instance->htmlStatusesClass, $instance->status, ''))
|
||||
),
|
||||
zget($this->lang->instance->statusList, $instance->status, ''), setClass('text-' . zget($this->lang->instance->htmlStatusesClass, $instance->status, ''))
|
||||
),
|
||||
h::td(zget($lang->instance->sourceList, $instance->source, '')),
|
||||
// h::td(a(set::href($this->createLink('store', 'appView', "id=$instance->appID")), $instance->appName)),
|
||||
h::td(zget($users, $instance->createdBy, '')),
|
||||
h::td(substr($instance->createdAt, 0, 16)),
|
||||
h::td(common::printDuration($instance->runDuration)),
|
||||
$defaultAccount ? h::td($defaultAccount->username) : null,
|
||||
$defaultAccount ? h::td($defaultAccount->password) : null,
|
||||
)
|
||||
)
|
||||
),
|
||||
/* 数据库区块 */
|
||||
empty($dbList) ? null : section
|
||||
(
|
||||
set::title($lang->instance->dbList),
|
||||
h::table
|
||||
(
|
||||
setStyle('min-width', '700px'),
|
||||
setClass('table w-auto max-w-full bordered mt-4'),
|
||||
h::tr
|
||||
(
|
||||
h::th($lang->instance->dbName),
|
||||
h::th($lang->instance->dbType, setStyle('width', '100px')),
|
||||
h::th($lang->instance->status, setStyle('width', '100px')),
|
||||
h::th($lang->instance->action, setStyle('width', '100px')),
|
||||
),
|
||||
$dbListWg
|
||||
)
|
||||
),
|
||||
),
|
||||
floatToolbar
|
||||
(
|
||||
set::object($instance),
|
||||
isAjaxRequest('modal') ? null : to::prefix(backBtn(set::icon('back'), set::class('ghost text-white'), $lang->goback)),
|
||||
set::main($actions['mainActions']),
|
||||
set::suffix($actions['suffixActions'])
|
||||
),
|
||||
)
|
||||
),
|
||||
div
|
||||
(
|
||||
setClass('basis-auto'),
|
||||
history()
|
||||
)
|
||||
);
|
||||
@@ -0,0 +1,192 @@
|
||||
<div class='panel'>
|
||||
<?php $ips = (array) zget($domain,'load_balancer_ips', new stdclass);?>
|
||||
<?php if(!empty($ips)):?>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->instance->visitIP;?></span></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<table class='table table-form cell'>
|
||||
<?php foreach($ips as $key => $value):?>
|
||||
<tr>
|
||||
<th><?php echo $key;?></th>
|
||||
<td><?php echo $value;?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->instance->mem;?></span></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<form id='memoryForm' class='cell not-watch load-indicator'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td colspan="3">
|
||||
<span class='label label-info'><?php echo $lang->instance->currentMemory;?>:<?php echo helper::formatKB($currentResource->resources->memory / 1024);?></span>
|
||||
<span class='label label-warning'><?php $this->instance->printSuggestedMemory($instanceMetric->memory, $lang->instance->memOptions);?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->adjustMem;?></th>
|
||||
<td class='w-100px'><?php echo html::select('memory_kb', $this->instance->filterMemOptions($currentResource), '', "class='form-control'");?></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='text-center'>
|
||||
<?php echo html::commonButton($lang->instance->saveSetting, "id='memBtn' instance-id='$instance->id'", 'btn btn-primary'); ?>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php if(isset($cloudApp->features->ldap)):?>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->system->ldapManagement;?></span></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<form id='LDAPForm' class='cell not-watch load-indicator'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<?php $LDAPInstalled = $this->system->hasSystemLDAP();?>
|
||||
<?php $enableLDAP = $instance->ldapSnippetName ? 'true' : '' ;?>
|
||||
<td class='w-120px'><?php echo html::checkbox('enableLDAP', array('true' => $lang->instance->enableLDAP), $enableLDAP, ($LDAPInstalled ? '' : 'disabled'));?></td>
|
||||
<td colspan='2'>
|
||||
<?php if(!$LDAPInstalled):?>
|
||||
<?php echo $lang->instance->systemLDAPInactive;?>
|
||||
<?php echo html::a(helper::createLink('system', 'installLDAP'), $lang->instance->toSystemLDAP, '', "class='btn btn-default'");?>
|
||||
<?php endif?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='w-100px text-center'>
|
||||
<?php echo html::commonButton($lang->instance->saveSetting, "id='ldapBtn' instance-id='$instance->id'" . ($LDAPInstalled ? '' : 'disabled'), 'btn btn-primary');?>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php if(isset($cloudApp->features->mail)):?>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->system->SMTP->common;?></span></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<form id='SMTPForm' class='cell not-watch load-indicator'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<?php $SMTPInstalled = $this->system->isSMTPEnabled();?>
|
||||
<?php $enableSMTP = $instance->smtpSnippetName ? 'true' : '' ;?>
|
||||
<td class='w-120px'><?php echo html::checkbox('enableSMTP', array('true' => $lang->instance->enableSMTP), $enableSMTP, ($SMTPInstalled ? '' : 'disabled'));?></td>
|
||||
<td colspan='2'>
|
||||
<?php if(!$SMTPInstalled):?>
|
||||
<?php echo $lang->instance->systemSMTPInactive;?>
|
||||
<?php echo html::a(helper::createLink('system', 'installSMTP'), $lang->instance->toSystemSMTP, '', "class='btn btn-default'");?>
|
||||
<?php endif?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='w-100px text-center'>
|
||||
<?php echo html::commonButton($lang->instance->saveSetting, "id='smtpBtn' instance-id='$instance->id'" . ($SMTPInstalled ? '' : 'disabled'), 'btn btn-primary');?>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(!empty($currentResource->scalable) && $config->edition == 'biz'):?>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->instance->scalable;?></span></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<form id='replicasForm' class='cell not-watch load-indicator'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->componentFields['replicas'];?></th>
|
||||
<td class='w-80px center'>
|
||||
<span id="replicas-text"><?php echo $currentResource->replicas;?></span>
|
||||
<?php echo html::select('scalable', array(1=>1, 2=>2, 3=>3, 4=>4), intval($currentResource->replicas) ? : 1, " id='replicas-input' max='4' min='1' class='form-control scalable-input hide'");?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::commonButton($lang->instance->change, 'id="replicas-edit"', 'btn btn-primary ' . (in_array($instance->status, array('uninstalling', 'destroying', 'destroyed', 'unknown', 'abnormal')) ? 'disabled' : ''));?>
|
||||
<?php echo html::commonButton($lang->instance->saveSetting, "id='replicas-save' instance-id='$instance->id'", 'btn btn-primary hide');?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(count($customItems)):?>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->instance->customSetting;?></span></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<form id='customForm' class='cell not-watch load-indicator'>
|
||||
<table class='table table-form'>
|
||||
<?php foreach($customItems as $item):?>
|
||||
<tr>
|
||||
<th><?php echo $item->label;?></th>
|
||||
<td>
|
||||
<?php echo html::input($item->name, $item->default, "class='form-control' placeholder='{$item->label}'");?>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='text-center'>
|
||||
<?php echo html::commonButton($lang->instance->saveSetting, "id='customBtn' instance-id='$instance->id'", 'btn btn-primary'); ?>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php if(!empty($dbList)):?>
|
||||
<hr/>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->instance->dbList;?></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<table class='table table-bordered text-center'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->dbName;?></th>
|
||||
<th><?php echo $lang->instance->dbType;?></th>
|
||||
<th><?php echo $lang->instance->dbStatus;?></th>
|
||||
<th><?php echo $lang->instance->action;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($dbList as $db):?>
|
||||
<tr>
|
||||
<td><?php echo $db->db_name;?></td>
|
||||
<td><?php echo $db->db_type;?></td>
|
||||
<td><?php echo $db->ready ? $lang->instance->dbReady : $lang->instance->dbWaiting;?></td>
|
||||
<td><?php $this->instance->printDBAction($db, $instance);?></td>
|
||||
<tr>
|
||||
<?php endforeach;?>
|
||||
<tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
@@ -0,0 +1,80 @@
|
||||
<div class='panel'>
|
||||
<div class='panel-heading'>
|
||||
<span class='text-blue'><?php echo $lang->instance->backup->keepBackupBySystem;?></span>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php echo html::a(".", $lang->refresh, '', "class='btn'");?>
|
||||
<?php $autoBackupBtn = html::a(helper::createLink('instance', 'backupSettings', "id={$instance->id}", '', true), $lang->instance->backup->autoBackup, '', "class='iframe btn btn-primary' title='{$lang->instance->backup->autoBackup}' data-width='520' data-app='space'");?>
|
||||
<?php $autoRestoreBtn = html::a(helper::createLink('instance', 'restoreSettings', "id={$instance->id}", '', true), $lang->instance->restore->autoRestore, '', "class='iframe btn btn-primary' title='{$lang->instance->restore->autoRestore}' data-width='520' data-app='space'");?>
|
||||
<?php echo $this->config->instance->enableAutoRestore ? $autoRestoreBtn : $autoBackupBtn;?>
|
||||
<?php $this->instance->printBackupBtn($instance);?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(empty($backupList)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<?php echo $lang->instance->errors->noBackup;?>
|
||||
<?php $this->instance->printBackupBtn($instance);?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<table class="table table-bordered text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='w-150px'><?php echo $lang->instance->backup->date;?></th>
|
||||
<th class='w-150px'><?php echo $lang->instance->backup->operator;?></th>
|
||||
<th class='w-150px'><?php echo $lang->instance->backup->dbStatus;?></th>
|
||||
<th class='w-150px'><?php echo $lang->instance->backup->dbSize;?></th>
|
||||
<?php if($hasRestoreLog):?>
|
||||
<th class='w-150px'><?php echo $lang->instance->backup->restoreDate;?></th>
|
||||
<th class='w-150px'><?php echo $lang->instance->backup->dbStatus;?></th>
|
||||
<?php endif;?>
|
||||
<th class="w-150px actions">
|
||||
<?php echo $lang->instance->backup->action;?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($backupList as $backup):?>
|
||||
<tr>
|
||||
<td><span data-toggle='tooltip' data-placement='bottom' title='<?php echo date('Y-m-d H:i:s', $backup->create_time);?>'><?php echo date('Y-m-d', $backup->create_time);?></span></td>
|
||||
<td><?php echo zget($lang->instance->backup->operators, $backup->username, $backup->username);?></td>
|
||||
<td><?php echo zget($lang->instance->backup->statusList, strtolower($backup->status));?></td>
|
||||
<?php $backupSize = isset($backup->backup_details->db[0]) ? intval(zget($backup->backup_details->db[0], 'size', 0)) : 0;?>
|
||||
<?php $backupSize += isset($backup->backup_details->volume[0]) ? intval(zget($backup->backup_details->volume[0], 'doneBytes', 0)) : 0;?>
|
||||
<td><?php echo helper::formatKB($backupSize / 1024);?></td>
|
||||
<?php if($hasRestoreLog):?>
|
||||
<td>
|
||||
<span data-toggle='tooltip' data-placement='bottom' title='<?php echo $backup->latest_restore_time ? date('Y-m-d H:i:s', $backup->latest_restore_time) : '';?>'>
|
||||
<?php echo $backup->latest_restore_time ? date('Y-m-d', $backup->latest_restore_time) : '';?>
|
||||
</span>
|
||||
</td>
|
||||
<td><?php echo $backup->latest_restore_status ? zget($lang->instance->restore->statusList, $backup->latest_restore_status, '') : '';?></td>
|
||||
<?php endif;?>
|
||||
<td><?php $this->instance->printRestoreBtn($instance, $backup);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="modal fade" id="confirmRestore" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog w-400px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
|
||||
<h2 class="text-center"><?php echo $lang->instance->backup->restore;?></h2>
|
||||
<div class="text-center confirm-text">
|
||||
<p class='modal-message text-center'><?php echo $lang->instance->backup->backupBeforeRestore;?></p>
|
||||
<p class='modal-message text-center'>
|
||||
<?php echo $lang->instance->backup->latestBackupAt;?>:
|
||||
<?php echo date('Y-m-d H:i:s', $latestBackup->create_time);?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<?php echo html::commonButton($lang->instance->backup->common, "instance-id='{$instance->id}'", 'btn-backup btn btn-wide');?>
|
||||
<?php echo html::commonButton($lang->instance->backup->restore, "id='submitRestore'", 'btn btn-primary btn-wide');?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* The auto backup view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.cn)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.cn
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/datepicker.html.php';?>
|
||||
<?php js::set('instanceNotices', $lang->instance->notices);?>
|
||||
<?php js::set('instanceID', $instance->id);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->instance->backup->autoBackup;?></h2>
|
||||
</div>
|
||||
<div>
|
||||
<form id='backupSettingForm' method='post' class="cell not-watch load-indicator main-form">
|
||||
<h4><?php echo html::checkbox('autoBackup', array('true' => $lang->instance->backup->enableAutoBackup), $backupSettings->autoBackup ? 'true' : '');?></h4>
|
||||
<table class="table table-form backup-settings">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->backup->backupTime;?></th>
|
||||
<td class='required'>
|
||||
<div class='input-group'>
|
||||
<div class='datepicker-wrapper datepicker-date'>
|
||||
<?php echo html::input('backupTime', $backupSettings->backupTime, "class='form-control form-time' data-picker-position='bottom-right' maxlength='20'");?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->instance->backup->cycleDays;?></th>
|
||||
<td class='required w-250px'>
|
||||
<div class='input-group'><?php echo html::select('cycleDays', $lang->instance->backup->cycleList, $backupSettings->cycleDays, "class='form-control' maxlength='20'");?></div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->backup->keepDays;?></th>
|
||||
<td class='required'>
|
||||
<div class='input-group'><?php echo html::number('keepDays', $backupSettings->keepDays, "class='form-control' maxlength='2' min='1' max='30'");?></div>
|
||||
<span><?php echo $lang->instance->backup->keepDayRange;?></span>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="text-center form-actions"><?php echo html::commonButton($lang->save, "id='saveSetting'", 'btn btn-primary');?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,115 @@
|
||||
<div>
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col col-4">
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->status;?></th>
|
||||
<td class="instance-status" instance-id="<?php echo $instance->id;?>" data-status="<?php echo $instance->status;?>">
|
||||
<?php echo $this->instance->printStatus($instance, false);?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->source;?></th>
|
||||
<td class="instance-source">
|
||||
<span><?php echo zget($lang->instance->sourceList, $instance->source, '');?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->appTemplate;?></th>
|
||||
<td><?php echo html::a($this->createLink('store', 'appView', "id=$instance->appID"), $instance->appName);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->installAt;?></th>
|
||||
<td><span><?php echo substr($instance->createdAt, 0, 16);?></span></td>
|
||||
</tr>
|
||||
<?php if($instance->status == 'running'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->runDuration;?></th>
|
||||
<td><?php echo common::printDuration($instance->runDuration);?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($defaultAccount):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->defaultAccount;?></th>
|
||||
<td><?php echo $defaultAccount->username;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->defaultPassword;?></th>
|
||||
<td><?php echo $defaultAccount->password;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class='col col-8 usage-box'>
|
||||
<div class='col col-6'>
|
||||
<div class="c-title"><?php echo $lang->instance->cpuUsage;?></div>
|
||||
<?php $this->instance->printCpuUsage($instance, $instanceMetric->cpu, 'pie');?>
|
||||
</div>
|
||||
<div class='col col-6'>
|
||||
<div class="c-title"><?php echo $lang->instance->memUsage;?></div>
|
||||
<?php $this->instance->printMemUsage($instance, $instanceMetric->memory, 'pie');?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(empty($instance->solution) && array_key_exists(strtolower($instance->chart), $this->config->instance->seniorChartList)):?>
|
||||
<div id='seniorAppPanel' class="panel">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title"><?php echo $lang->instance->upgradeToSenior;?></div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p id='senior-app-desc'>
|
||||
<?php $seniorAppHtml = '';?>
|
||||
<?php foreach($seniorAppList as $number => $seniorApp):?>
|
||||
<?php if($number > 0) $seniorAppHtml .= $lang->instance->or;?>
|
||||
<?php $seniorAppHtml .= html::a(helper::createLink('store', 'appview', "id=$seniorApp->id"), $seniorApp->alias, '_blank');?>
|
||||
<?php endforeach;?>
|
||||
<?php $currentAppUrl = html::a(helper::createLink('store', 'appview', "id=$instance->appID"), $instance->appName, '_blank');?>
|
||||
<?php printf($lang->instance->descOfSwitchSerial, $currentAppUrl, $seniorAppHtml);?>
|
||||
<?php echo html::a('https://www.zentao.net/page/enterprise.html', $lang->instance->serialDiff, '_blank', "id='serialDiff' class=''");?>
|
||||
</p>
|
||||
<div>
|
||||
<?php $disabled = $instance->status == 'stopped' ? '' : 'disabled';?>
|
||||
<?php foreach($seniorAppList as $seniorApp):?>
|
||||
<?php $toSeniorUrl = $this->inLink('toSenior', "id={$instance->id}&seniorAppID={$seniorApp->id}", '', true);?>
|
||||
<?php echo html::a($toSeniorUrl, $lang->instance->switchTo . $seniorApp->alias, '', $disabled . " class='iframe btn btn-primary' title='{$lang->instance->upgrade}' data-width='520' data-app='space'");?>
|
||||
<?php endforeach;?>
|
||||
<?php if($disabled == 'disabled'):?>
|
||||
<span class='text-info'><?php echo $lang->instance->stopInstanceTips;?></span>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class="panel instance-log">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title"><?php echo $lang->instance->operationLog;?></div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-180px"><?php echo $lang->instance->log->date;?></th>
|
||||
<th><?php echo $lang->instance->log->message;?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($logs as $log):?>
|
||||
<tr>
|
||||
<td><?php echo $log->date;?></td>
|
||||
<td><?php echo $this->instance->printLog($instance, $log);?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-footer"><?php $pager->show('right', 'pagerjs');?></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* The custom install view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php echo html::a($this->createLink('store', 'appView', "id={$appID}"), '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<form class="cell load-indicator main-form form-ajax" method='post'>
|
||||
<h3><?php echo $lang->instance->customInstall;?></h3>
|
||||
<?php if(empty($components)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><?php echo html::a($this->createLink('store', 'appView', "id={$appID}"), $lang->instance->noComponent . '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-info'");?></p>
|
||||
</div>
|
||||
<?php endif?>
|
||||
<ul class="nav nav-tabs">
|
||||
<?php foreach($components as $component):?>
|
||||
<li class="<?php echo$activeTab == $component->name ? 'active' : '';?>">
|
||||
<a data-tab href="#<?php echo $component->name;?>"><?php echo $component->name;?></a>
|
||||
</li>
|
||||
<?php endforeach?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<?php foreach($components as $component):?>
|
||||
<div class="tab-pane <?php echo$activeTab == $component->name ? 'active' : '';?>" id="<?php echo $component->name;?>">
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<?php foreach($component->settings as $setting):?>
|
||||
<?php
|
||||
if($setting->type == 'choice')
|
||||
{
|
||||
$selectOptions = array_combine($setting->options, $setting->options);
|
||||
if(strpos($setting->field, 'resources_cpu') !== false) $selectOptions = $this->instance->getCpuOptions($setting->options);
|
||||
if(strpos($setting->field, 'resources_memory') !== false) $selectOptions = $this->instance->getMemOptions($setting->options);
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<th class='w-150px'><?php echo zget($this->lang->instance->componentFields, $setting->name, $setting->name);?></th>
|
||||
<td class='w-200px'>
|
||||
<div class='input-group'>
|
||||
<?php if($setting->type == 'choice') echo html::select($setting->field, $selectOptions, $setting->value, "class='form-control chosen'");?>
|
||||
<?php if($setting->type == 'int') echo html::number($setting->field, $setting->value, "class='form-control'", "require");?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php if(!empty($components)):?>
|
||||
<div class="text-center form-actions"><?php echo html::submitButton($lang->instance->install);?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->instance->editName;?></h2>
|
||||
</div>
|
||||
<form method='post' target='hiddenwin' id='dataform'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-100px'><?php echo $lang->instance->name;?></th>
|
||||
<td><?php echo html::input('name', $instance->name, "class='form-control' maxlength='50'");?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='text-center form-actions'><?php echo html::submitButton() . html::backButton();?></div>
|
||||
</form>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* The install view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.cn)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.cn
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php js::set('instanceNotices', $lang->instance->notices);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->instance->installApp . $cloudApp->alias . $cloudApp->app_version;?></h2>
|
||||
</div>
|
||||
<form id='installForm' action='<?php echo helper::createLink("instance", "install", "id={$cloudApp->id}", '', '', false);?>' class="cell not-watch load-indicator main-form">
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->instance->name;?></th>
|
||||
<td class='w-250px'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('customName', $cloudApp->alias, "class='form-control' maxlength='20'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->domain;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::input('customDomain', $thirdDomain, "class='form-control' maxlength='20'");?>
|
||||
<span class='input-group-addon'><?php echo $this->cne->sysDomain();?></span>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='advanced'><?php echo html::a("#advanced-settings", $lang->instance->advanceOption . "<i class='icon icon-chevron-double-down'></i>", '', "data-toggle='collapse'");?></div>
|
||||
<table class="collapse table table-form" id="advanced-settings">
|
||||
<tbody>
|
||||
<?php if(strtolower(getenv('ALLOW_SELECT_VERSION')) == 'true' || strtolower(getenv('ALLOW_SELECT_VERSION')) == '1'):?>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->instance->version;?></th>
|
||||
<td class='w-250px'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('version', $versionList, '', "class='form-control'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if(isset($cloudApp->features->ldap) && $this->loadModel('system')->hasSystemLDAP()):?>
|
||||
<tr>
|
||||
<th class='w-80px'></th>
|
||||
<td class='w-250px'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::checkbox('ldapSnippet', array($this->system->ldapSnippetName() => $lang->instance->enableLDAP));?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if(isset($cloudApp->features->mail) && $this->loadModel('system')->isSMTPEnabled()):?>
|
||||
<tr>
|
||||
<th class='w-80px'></th>
|
||||
<td class='w-250px'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::checkbox('smtpSnippet', array($this->system->smtpSnippetName() => $lang->instance->enableSMTP));?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if(isset($cloudApp->dependencies->mysql) and $mysqlList or isset($cloudApp->dependencies->postgresql) and $pgList):?>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->instance->dbType;?></th>
|
||||
<td class='w-250px'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::radio('dbType', $lang->instance->dbTypes, 'sharedDB');?>
|
||||
</div>
|
||||
</td>
|
||||
<td><?php echo html::a('https://www.qucheng.com/book/Installation-manual/app-install-33.html',$lang->instance->howToSelectDB, '_blank');?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if(isset($cloudApp->dependencies->mysql) and $mysqlList):?>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('dbService', $mysqlList, '', "class='form-control'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php elseif(isset($cloudApp->dependencies->postgresql) and $pgList):?>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('dbService', $pgList, '', "class='form-control'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="text-center form-actions"><?php echo html::submitButton($lang->instance->install);?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* The custom install view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.cn)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.cn
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->instance->errors->notEnoughResource;?></h2>
|
||||
</div>
|
||||
<div><p style='padding-top: 15px;'><?php echo sprintf($lang->instance->errors->notEnoughMemory, $cloudApp->alias, $requiredMemory, $freeMemory, $gapMemory);?></p></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* The restore settings view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.cn)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.cn
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/datepicker.html.php';?>
|
||||
<?php js::set('instanceNotices', $lang->instance->notices);?>
|
||||
<?php js::set('instanceID', $instance->id);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->instance->restore->autoRestore;?></h2>
|
||||
</div>
|
||||
<div>
|
||||
<form id='restoreSettingForm' method='post' class="cell not-watch load-indicator main-form">
|
||||
<h4>
|
||||
<?php echo html::checkbox('autoRestore', array('true' => $lang->instance->restore->enableAutoRestore), $restoreSettings->autoRestore ? 'true' : '');?>
|
||||
</h4>
|
||||
<table class="table table-form restore-settings">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->restore->restoreTime;?></th>
|
||||
<td class='required'>
|
||||
<div class='input-group'>
|
||||
<div class='datepicker-wrapper datepicker-date'>
|
||||
<?php echo html::input('restoreTime', $restoreSettings->restoreTime, "class='form-control form-time' data-picker-position='bottom-right' maxlength='20'");?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->instance->restore->cycleDays;?></th>
|
||||
<td class='required w-250px'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('cycleDays', $lang->instance->restore->cycleList, $restoreSettings->cycleDays, "class='form-control' maxlength='20'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="text-center form-actions"><?php echo html::commonButton($lang->save, "id='saveSetting'", 'btn btn-primary');?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* The upgrade to senior App view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.cn)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.cn
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->instance->toSeniorAttention;?></h2>
|
||||
</div>
|
||||
<div>
|
||||
<form id='toSeniorForm' action="<?php echo $this->inLink('toSenior', "instanceID={$instance->id}&seniorAppID={$cloudApp->id}&confirm=yes");?>" class="cell not-watch load-indicator main-form form-ajax">
|
||||
<div><?php echo $lang->instance->toSeniorTips;?></div>
|
||||
<div>
|
||||
<?php echo html::checkbox('read', array('true'=>$lang->instance->hasRead));?>
|
||||
</div>
|
||||
<div class="text-center form-actions"><?php echo html::submitButton($lang->instance->upgrade, 'disabled');?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php js::set('instanceNotices', $lang->instance->notices);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo "{$lang->instance->upgrade} : {$instance->name}";?></h2>
|
||||
</div>
|
||||
<form method='post' action='<?php echo helper::createLink("instance", "upgrade", "id=$instance->id");?>' id='upgradeForm'>
|
||||
<?php if(empty($instance->latestVersion)):?>
|
||||
<p class='modal-message text-center'><?php echo $lang->instance->noHigherVersion;?></p>
|
||||
<?php else:?>
|
||||
<p class='modal-message text-center'><?php echo $lang->instance->notices['confirmUpgrade'];?></p>
|
||||
<?php echo html::hidden('confirm', 'yes');?>
|
||||
<div class='text-center'>
|
||||
<button type="button" class="btn btn-default btn-wide" data-dismiss="modal"><?php echo $lang->cancel;?></button>
|
||||
<?php echo html::submitButton($lang->instance->upgrade);?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* The detail view file of instance module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QuCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package instance
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php js::set('instanceNotices', $lang->instance->notices);?>
|
||||
<?php js::set('instanceIdList', array($instance->id));?>
|
||||
<?php js::set('demoAppLife', $config->demoAppLife);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left instance-name'>
|
||||
<h3><?php echo $instance->name;?></h3>
|
||||
<span><?php echo $instance->appVersion;?></span>
|
||||
<?php echo html::a($this->createLink('instance', 'editname', "id=$instance->id", '', true), '<i class="icon-edit"></i>', '', "class='iframe' title='$lang->edit' data-width='600' data-app='space'");?>
|
||||
<?php if($instance->solution):?>
|
||||
<?php echo html::a(helper::createLink('solution', 'view', "id=$instance->solution"), $instance->solutionData->name, '', "class='label label-success label-outline solution-link'");?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right instance-panel'>
|
||||
<div class="">
|
||||
<?php $this->instance->printTextActions($instance);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="<?php echo $tab == 'baseinfo' ? 'active' : '';?>"><a href="<?php echo $this->createLink('instance', 'view', "id=$instance->id&page=&perPage=&pageSize=&tab=baseinfo");?>"><?php echo $lang->instance->baseInfo;?></a></li>
|
||||
<li class="<?php echo $tab == 'backup' ? 'active' : '';?>"><a href="<?php echo $this->createLink('instance', 'view', "id={$instance->id}&total=&perPage=&pageID=&tab=backup");?>"><?php echo $lang->instance->backupAndRestore;?></a></li>
|
||||
<li class="<?php echo $tab == 'advance' ? 'active' : '';?>"><a href="<?php echo $this->createLink('instance', 'view', "id={$instance->id}&total=&perPage=&pageID=&tab=advance");?>"><?php echo $lang->instance->advance;?></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane <?php echo $tab == 'baseinfo' ? 'active' : '';?>" id="baseInfo">
|
||||
<?php include 'baseinfo.html.php';?>
|
||||
</div>
|
||||
<div class="tab-pane <?php echo $tab == 'backup' ? 'active' : '';?>" id="backup">
|
||||
<?php if($tab == 'backup') include 'backup.html.php';?>
|
||||
</div>
|
||||
<div class="tab-pane <?php echo $tab == 'advance' ? 'active' : '';?>" id="advance">
|
||||
<?php if($tab == 'advance') include 'advance.html.php';?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
global $lang, $app;
|
||||
$app->loadLang('instance');
|
||||
|
||||
$config->system->dtable = new stdclass();
|
||||
|
||||
$config->system->dtable->dbList = new stdclass();
|
||||
|
||||
$config->system->dtable->dbList->fieldList['name']['title'] = $lang->system->dbName;
|
||||
$config->system->dtable->dbList->fieldList['name']['group'] = 1;
|
||||
|
||||
$config->system->dtable->dbList->fieldList['dbType']['title'] = $lang->system->dbType;
|
||||
$config->system->dtable->dbList->fieldList['dbType']['name'] = 'db_type';
|
||||
$config->system->dtable->dbList->fieldList['dbType']['group'] = 2;
|
||||
|
||||
$config->system->dtable->dbList->fieldList['dbStatus']['title'] = $lang->system->dbStatus;
|
||||
$config->system->dtable->dbList->fieldList['dbStatus']['name'] = 'status';
|
||||
$config->system->dtable->dbList->fieldList['dbStatus']['map'] = $lang->instance->statusList;
|
||||
|
||||
$config->system->dtable->dbList->fieldList['actions']['name'] = 'actions';
|
||||
$config->system->dtable->dbList->fieldList['actions']['title'] = $lang->actions;
|
||||
$config->system->dtable->dbList->fieldList['actions']['type'] = 'actions';
|
||||
$config->system->dtable->dbList->fieldList['actions']['menu'] = array('management');
|
||||
|
||||
$config->system->dtable->dbList->fieldList['actions']['list']['management']['icon'] = 'cog-outline';
|
||||
$config->system->dtable->dbList->fieldList['actions']['list']['management']['hint'] = $lang->system->management;
|
||||
|
||||
$config->system->dtable->backup = new stdclass();
|
||||
|
||||
$config->system->dtable->backup->fieldList['time']['title'] = $lang->system->backup->time;
|
||||
$config->system->dtable->backup->fieldList['time']['type'] = 'datetime';
|
||||
|
||||
$config->system->dtable->backup->fieldList['backupPerson']['title'] = $lang->system->backup->backupPerson;
|
||||
|
||||
$config->system->dtable->backup->fieldList['type']['title'] = $lang->system->backup->type;
|
||||
|
||||
$config->system->dtable->backup->fieldList['actions']['name'] = 'actions';
|
||||
$config->system->dtable->backup->fieldList['actions']['title'] = $lang->actions;
|
||||
$config->system->dtable->backup->fieldList['actions']['type'] = 'actions';
|
||||
$config->system->dtable->backup->fieldList['actions']['menu'] = array('restore', 'delete');
|
||||
|
||||
$config->system->dtable->backup->fieldList['actions']['list']['restore']['icon'] = 'history';
|
||||
$config->system->dtable->backup->fieldList['actions']['list']['restore']['hint'] = $lang->system->backup->restore;
|
||||
$config->system->dtable->backup->fieldList['actions']['list']['restore']['url'] = array('module' => 'backup', 'method' => 'restore', 'params' => 'time={time}');
|
||||
$config->system->dtable->backup->fieldList['actions']['list']['restore']['data-confirm'] = $lang->system->backup->confirmDelete;
|
||||
|
||||
$config->system->dtable->backup->fieldList['actions']['list']['delete']['icon'] = 'trash';
|
||||
$config->system->dtable->backup->fieldList['actions']['list']['delete']['hint'] = $lang->delete;
|
||||
$config->system->dtable->backup->fieldList['actions']['list']['delete']['url'] = array('module' => 'backup', 'method' => 'delete', 'params' => 'time={time}');
|
||||
$config->system->dtable->backup->fieldList['actions']['list']['delete']['data-confirm'] = $lang->system->backup->confirmRestore;
|
||||
@@ -0,0 +1,699 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of system module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QuCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
class system extends control
|
||||
{
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($moduleName = '', $methodName = '')
|
||||
{
|
||||
parent::__construct($moduleName, $methodName);
|
||||
|
||||
$this->backupPath = $this->loadModel('backup')->getBackupPath();
|
||||
if(!is_dir($this->backupPath))
|
||||
{
|
||||
if(!mkdir($this->backupPath, 0755, true)) $this->view->error = sprintf($this->lang->system->backup->error->noWritable, $this->backupPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!is_writable($this->backupPath)) $this->view->error = sprintf($this->lang->system->backup->error->noWritable, $this->backupPath);
|
||||
}
|
||||
if(!is_writable($this->app->getTmpRoot())) $this->view->error = sprintf($this->lang->system->backup->error->noWritable, $this->app->getTmpRoot());
|
||||
|
||||
$this->loadModel('action');
|
||||
$this->loadModel('setting');
|
||||
}
|
||||
|
||||
/**
|
||||
* System index.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->view->title = $this->lang->system->common;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Dashboard page.
|
||||
*
|
||||
* @param int $total
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function dashboard($total = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$this->loadModel('cne');
|
||||
$this->app->loadClass('pager', true);
|
||||
$pager = new pager($total, $recPerPage, $pageID);
|
||||
|
||||
$instances = $this->loadModel('instance')->getByAccount($this->app->user->account, $pager, '', '', 'running');
|
||||
|
||||
$actions = $this->loadModel('action')->getDynamic('all', 'today');
|
||||
|
||||
$this->view->position[] = $this->lang->my->common;
|
||||
|
||||
$this->view->title = $this->lang->my->common;
|
||||
$this->view->instances = $instances;
|
||||
$this->view->actions = $actions;
|
||||
$this->view->cneMetrics = $this->cne->cneMetrics();
|
||||
$this->view->instancesMetrics = $this->cne->instancesMetrics($instances);
|
||||
$this->view->pager = $pager;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show database list.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function dbList()
|
||||
{
|
||||
$this->app->loadLang('instance');
|
||||
|
||||
$this->view->title = $this->lang->system->dbManagement;
|
||||
$this->view->dbList = $this->loadModel('cne')->allDBList();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the connection of LDAP by post parameters.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function testLDAPConnection()
|
||||
{
|
||||
$settings = fixer::input('post')
|
||||
->setDefault('host', '')
|
||||
->setDefault('port', '')
|
||||
->setDefault('bindDN', '')
|
||||
->setDefault('bindPass', '')
|
||||
->setDefault('baseDN', '')
|
||||
->get();
|
||||
|
||||
$success = $this->system->testLDAPConnection($settings);
|
||||
if($success) return $this->send(array('result' => 'success', 'message' => $this->lang->system->notices->verifyLDAPSuccess));
|
||||
|
||||
return $this->send(array('result' => 'fail', 'message' => $this->lang->system->errors->verifyLDAPFailed));
|
||||
}
|
||||
|
||||
/**
|
||||
* Install LDAP
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function installLDAP()
|
||||
{
|
||||
if($this->system->hasSystemLDAP()) return print(js::locate($this->inLink('ldapView')));
|
||||
|
||||
$channel = $this->app->session->cloudChannel ? $this->app->session->cloudChannel : $this->config->cloud->api->channel;
|
||||
$ldapApp = $this->loadModel('store')->getAppInfoByChart('openldap', $channel, false);
|
||||
if($_POST)
|
||||
{
|
||||
$postData = fixer::input('post')->setDefault('source', 'qucheng')->get();
|
||||
if($postData->source == 'qucheng')
|
||||
{
|
||||
$this->system->installQuchengLDAP($ldapApp, $channel);
|
||||
}
|
||||
else if($postData->source == 'extra')
|
||||
{
|
||||
$this->system->configExtraLDAP((object)$postData->extra);
|
||||
}
|
||||
else
|
||||
{
|
||||
dao::$errors[] = $this->lang->system->notSupportedLDAP;
|
||||
}
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->system->notices->ldapInstallSuccess, 'locate' => $this->inLink('ldapView')));
|
||||
}
|
||||
|
||||
$this->lang->switcherMenu = $this->system->getLDAPSwitcher();
|
||||
|
||||
$this->view->title = $this->lang->system->ldapManagement;
|
||||
$this->view->ldapApp = $ldapApp;
|
||||
$this->view->activeLDAP = $this->system->getActiveLDAP();
|
||||
$this->view->ldapSettings = $this->system->getExtraLDAPSettings();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit extra LDAP.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editLDAP()
|
||||
{
|
||||
$channel = $this->app->session->cloudChannel ? $this->app->session->cloudChannel : $this->config->cloud->api->channel;
|
||||
$ldapApp = $this->loadModel('store')->getAppInfoByChart('openldap', $channel, false);
|
||||
if($_POST)
|
||||
{
|
||||
session_write_close();
|
||||
$this->system->updateLDAP($ldapApp, $channel);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->system->notices->ldapUpdateSuccess, 'locate' => $this->inLink('ldapView')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->system->editLDAP;
|
||||
|
||||
|
||||
$this->view->ldapApp = $ldapApp;
|
||||
$this->view->activeLDAP = $this->system->getActiveLDAP();
|
||||
$this->view->ldapSettings = $this->system->getExtraLDAPSettings();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* ajaxUpdatingLDAPProgress
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxUpdatingLDAPProgress()
|
||||
{
|
||||
session_write_close();
|
||||
|
||||
$number = $this->loadModel('setting')->getItem('owner=system&module=common§ion=ldap&key=updatingProgress');
|
||||
echo sprintf($this->lang->system->LDAP->updatingProgress, intval($number));
|
||||
}
|
||||
|
||||
/**
|
||||
* LDAP view.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ldapView()
|
||||
{
|
||||
$this->loadModel('instance');
|
||||
$this->app->loadLang('instance');
|
||||
|
||||
$ldapInstance = new stdclass;
|
||||
$ldapInstance->id = 0;
|
||||
|
||||
$activeLDAP = $this->loadModel('setting')->getItem('owner=system&module=common§ion=ldap&key=active');
|
||||
if($activeLDAP == 'qucheng')
|
||||
{
|
||||
$instanceID = $this->loadModel('setting')->getItem('owner=system&module=common§ion=ldap&key=instanceID');
|
||||
$ldapInstance = $this->instance->getByID($instanceID);
|
||||
if(empty($ldapInstance)) return print js::alert($this->lang->system->notices->noLDAP);
|
||||
|
||||
$ldapInstance = $this->instance->freshStatus($ldapInstance);
|
||||
$ldapSettings = json_decode($ldapInstance->ldapSettings);
|
||||
}
|
||||
else if($activeLDAP == 'extra')
|
||||
{
|
||||
$ldapSettings = $this->system->getExtraLDAPSettings();
|
||||
}
|
||||
else
|
||||
{
|
||||
return print js::alert($this->lang->system->notices->noLDAP);
|
||||
}
|
||||
|
||||
$this->lang->switcherMenu = $this->system->getLDAPSwitcher();
|
||||
|
||||
$this->view->title = $this->lang->system->ldapManagement;
|
||||
|
||||
$this->view->activeLDAP = $activeLDAP;
|
||||
$this->view->instanceID = $ldapInstance->id;
|
||||
$this->view->ldapInstance = $ldapInstance;
|
||||
$this->view->ldapSettings = $ldapSettings;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Uninstall all LDAP in system. (This function is only for debug and test.)
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function uninstallLDAP()
|
||||
{
|
||||
if(!$this->config->debug) return; // Only run in debug mode.
|
||||
|
||||
/* 1. uninstall QuCheng LDAP. */
|
||||
if($this->system->uninstallQuChengLDAP())
|
||||
{
|
||||
echo date('Y-m-d H:i:s') . ": Uninstall QuCheng LDAP success.<br/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo date('Y-m-d H:i:s') . ": Uninstall QuCheng LDAP fail.<br/>";
|
||||
$errors = dao::getError();
|
||||
foreach($errors as $error) echo $error . '<br/>';
|
||||
}
|
||||
|
||||
/* 2. uninstall extra LDAP. */
|
||||
if($this->system->uninstallExtraLDAP())
|
||||
{
|
||||
echo date('Y-m-d H:i:s') . ": Uninstall extra LDAP success.<br/>";
|
||||
}
|
||||
else{
|
||||
echo date('Y-m-d H:i:s') . ": Uninstall extra LDAP fail.<br/>";
|
||||
$errors = dao::getError();
|
||||
foreach($errors as $error) echo $error . '<br/>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* OSS view.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ossView()
|
||||
{
|
||||
$this->loadModel('cne');
|
||||
|
||||
$minioInstance = new stdclass;
|
||||
$minioInstance->k8name = 'cne-operator';
|
||||
$minioInstance->spaceData = new stdclass;
|
||||
$minioInstance->spaceData->k8space = $this->config->k8space;
|
||||
|
||||
$ossAccount = $this->cne->getDefaultAccount($minioInstance, '', 'minio');
|
||||
$ossDomain = $this->cne->getDomain($minioInstance, '', 'minio');
|
||||
$this->lang->switcherMenu = $this->system->getOssSwitcher();
|
||||
|
||||
$this->view->title = $this->lang->system->oss->common;
|
||||
$this->view->ossAccount = $ossAccount;
|
||||
$this->view->ossDomain = $ossDomain;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Install SMTP.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function installSMTP()
|
||||
{
|
||||
if($this->system->smtpSnippetName()) return print(js::locate($this->inLink('smtpView')));
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$channel = $this->app->session->cloudChannel ? $this->app->session->cloudChannel : $this->config->cloud->api->channel;
|
||||
$this->system->installSysSMTP($channel);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->system->notices->smtpInstallSuccess, 'locate' => $this->inLink('smtpView')));
|
||||
}
|
||||
|
||||
$this->lang->switcherMenu = $this->system->getSMTPSwitcher();
|
||||
|
||||
$this->view->title = $this->lang->system->SMTP->common;
|
||||
$this->view->smtpSettings = $this->system->getSMTPSettings();
|
||||
$this->view->smtpLinked = false;
|
||||
$this->view->activeSMTP = false;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit SMTP.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editSMTP()
|
||||
{
|
||||
$this->loadModel('instance');
|
||||
$this->app->loadLang('instance');
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$channel = $this->app->session->cloudChannel ? $this->app->session->cloudChannel : $this->config->cloud->api->channel;
|
||||
$postData = fixer::input('post')->setDefault('source', 'qucheng')->get();
|
||||
$this->system->updateSMTPSettings();
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->system->notices->smtpUpdateSuccess, 'locate' => $this->inLink('smtpView')));
|
||||
}
|
||||
|
||||
$this->lang->switcherMenu = $this->system->getSMTPSwitcher();
|
||||
|
||||
$this->view->title = $this->lang->system->SMTP->editSMTP;
|
||||
$this->view->smtpSettings = $this->system->getSMTPSettings();
|
||||
$this->view->smtpLinked = $this->instance->countSMTP();
|
||||
$this->view->activeSMTP = zget($this->view->smtpSettings, 'enabled', false);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show SMTP setting detail.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function smtpView()
|
||||
{
|
||||
$this->loadModel('instance');
|
||||
$this->app->loadLang('instance');
|
||||
|
||||
$instanceID = $this->loadModel('setting')->getItem('owner=system&module=common§ion=smtp&key=instanceID');
|
||||
$smtpInstance = $this->instance->getByID($instanceID);
|
||||
if(empty($smtpInstance)) return print js::alert($this->lang->system->notices->notFoundSMTPService);
|
||||
|
||||
|
||||
$this->lang->switcherMenu = $this->system->getSMTPSwitcher();
|
||||
|
||||
$this->view->title = $this->lang->system->SMTP->common;
|
||||
$this->view->smtpSettings = $this->system->getSMTPSettings();
|
||||
$this->view->smtpInstance = $smtpInstance;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Uninstall SMTP. (This function is only for debug and test.)
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function uninstallSMTP()
|
||||
{
|
||||
if(!$this->config->debug) return; // Only run in debug mode.
|
||||
|
||||
/* Uninstall system SMTP proxy APP. */
|
||||
if($this->system->uninstallSysSMTP())
|
||||
{
|
||||
echo date('Y-m-d H:i:s') . ": Uninstall system SMTP success.<br/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo date('Y-m-d H:i:s') . ": Uninstall system SMTP fail.<br/>";
|
||||
$errors = dao::getError();
|
||||
foreach($errors as $error) echo $error . '<br/>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Config customer's domain.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function configDomain()
|
||||
{
|
||||
$domainSettings = $this->system->getDomainSettings();
|
||||
if($domainSettings->customDomain) $this->locate($this->inLink('domainView'));
|
||||
$this->locate($this->inLink('editDomain'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit customer's domain.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editDomain()
|
||||
{
|
||||
$this->loadModel('instance');
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
session_write_close();
|
||||
$this->system->saveDomainSettings();
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::$errors));
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->system->notices->updateDomainSuccess, 'locate' => $this->inlink('domainView')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->system->domain->common;
|
||||
$this->view->domainSettings = $this->system->getDomainSettings();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* AjaxValidCert
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxValidateCert()
|
||||
{
|
||||
$certData = fixer::input('post')->get();
|
||||
|
||||
$this->dao->select('*')->from('system')->data($certData)
|
||||
->batchCheck('customDomain,certPem,certKey', 'notempty');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::$errors));
|
||||
|
||||
if(!validater::checkREG($certData->customDomain, '/^((?!-)[a-z0-9-]{1,63}(?<!-)\\.)+[a-z]{2,6}$/'))
|
||||
{
|
||||
return $this->send(array('result' => 'fail', 'message' => $this->lang->system->errors->invalidDomain));
|
||||
}
|
||||
|
||||
$certName = 'tls-' . str_replace('.', '-',$certData->customDomain);
|
||||
$result = $this->loadModel('cne')->validateCert($certName, $certData->certPem, $certData->certKey, $certData->customDomain);
|
||||
if($result->code == 200) return $this->send(array('result' => 'success', 'message' => $this->lang->system->notices->validCert));
|
||||
|
||||
return $this->send(array('result' => 'fail', 'message' => $result->message));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show progress of updating domains.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxUpdatingDomainProgress()
|
||||
{
|
||||
session_write_close();
|
||||
|
||||
$oldDomainQty = $this->loadModel('instance')->countOldDomain();
|
||||
return print(sprintf($this->lang->system->domain->updatingProgress, $oldDomainQty));
|
||||
}
|
||||
|
||||
/**
|
||||
* Domain settings view.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function domainView()
|
||||
{
|
||||
$domainSettings = $this->system->getDomainSettings();
|
||||
$certName = 'tls-' . str_replace('.', '-', $domainSettings->customDomain);
|
||||
$cert = $this->loadModel('cne')->certInfo($certName);
|
||||
|
||||
$notAfter = zget($cert, 'not_after', '');
|
||||
if($notAfter) $cert->expiredDate = date('Y-m-d H:i:s', $notAfter);
|
||||
|
||||
$this->view->title = $this->lang->system->domain->common;
|
||||
$this->view->domainSettings = $domainSettings;
|
||||
$this->view->cert = $cert;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Config Server Load Balancing.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function configSLB()
|
||||
{
|
||||
$slbSettings = $this->system->getSLBSettings();
|
||||
if($slbSettings->name) return print(js::locate($this->inLink('slbView')));
|
||||
|
||||
return print(js::locate($this->inLink('editSLB')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit SLB.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editSLB()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->system->saveSLBSettings();
|
||||
if(dao::isError())
|
||||
{
|
||||
return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
}
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->system->notices->configSLBSuccess, 'locate' => $this->inLink('SLBView')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->system->SLB->common;
|
||||
$this->view->SLBSettings = $this->system->getSLBSettings();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* SLB View.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function SLBView()
|
||||
{
|
||||
$this->view->title = $this->lang->system->SLB->common;
|
||||
$this->view->slbSettings = $this->system->getSLBSettings();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function browseBackup()
|
||||
{
|
||||
$backups = array();
|
||||
if(empty($this->view->error))
|
||||
{
|
||||
$sqlFiles = glob("{$this->backupPath}*.sql*");
|
||||
if(!empty($sqlFiles))
|
||||
{
|
||||
foreach($sqlFiles as $file)
|
||||
{
|
||||
$fileName = basename($file);
|
||||
$backupFile = new stdclass();
|
||||
$backupFile->time = filemtime($file);
|
||||
$backupFile->name = substr($fileName, 0, strpos($fileName, '.'));
|
||||
$backupFile->sqlSummary = $this->system->getSQLSummary($file);
|
||||
$backupFile->files[$file] = $this->backup->getBackupSummary($file);
|
||||
|
||||
$fileBackup = $this->backup->getBackupFile($backupFile->name, 'file');
|
||||
if($fileBackup) $backupFile->files[$fileBackup] = $this->backup->getBackupSummary($fileBackup);
|
||||
|
||||
$codeBackup = $this->backup->getBackupFile($backupFile->name, 'code');
|
||||
if($codeBackup) $backupFile->files[$codeBackup] = $this->backup->getBackupSummary($codeBackup);
|
||||
|
||||
$backups[$backupFile->name] = $backupFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
krsort($backups);
|
||||
|
||||
$this->view->title = $this->lang->backup->common;
|
||||
$this->view->position[] = $this->lang->backup->common;
|
||||
$this->view->backups = $backups;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify SMTP account by ajax.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxVerifySMTPAccount()
|
||||
{
|
||||
$accountInfo= fixer::input('post')->get();
|
||||
|
||||
$passed = $this->loadModel('cne')->validateSMTP($accountInfo);
|
||||
if($passed) $this->send(array('result' => 'success', 'message' => $this->lang->system->notices->verifySMTPSuccess));
|
||||
|
||||
$this->send(array('result' => 'fail', 'message' => $this->lang->system->errors->verifySMTPFailed));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate database auth parameters and jump to login page.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxDBAuthUrl()
|
||||
{
|
||||
$post = fixer::input('post')
|
||||
->setDefault('namespace', 'default')
|
||||
->get();
|
||||
if(empty($post->dbName)) return $this->send(array('result' => 'fail', 'message' => $this->lang->system->errors->dbNameIsEmpty));
|
||||
|
||||
$detail = $this->loadModel('cne')->dbDetail($post->dbName, $post->namespace);
|
||||
if(empty($detail)) return $this->send(array('result' => 'fail', 'message' => $this->lang->system->errors->notFoundDB));
|
||||
|
||||
$this->app->loadConfig('instance');
|
||||
$dbAuth = array();
|
||||
$dbAuth['driver'] = zget($this->config->instance->adminer->dbTypes, $post->dbType, '');
|
||||
$dbAuth['server'] = $detail->host . ':' . $detail->port;
|
||||
$dbAuth['username'] = $detail->username;
|
||||
$dbAuth['db'] = $detail->database;
|
||||
$dbAuth['password'] = $detail->password;
|
||||
|
||||
$url = '/adminer?'. http_build_query($dbAuth);
|
||||
$this->send(array('result' => 'success', 'message' => '', 'data' => array('url' => $url)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LDAP info by ajax.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxLdapInfo()
|
||||
{
|
||||
$instanceID = $this->loadModel('setting')->getItem('owner=system&module=common§ion=ldap&key=instanceID');
|
||||
$ldapInstance = $this->loadModel('instance')->getByID($instanceID);
|
||||
if(empty($ldapInstance)) return $this->send(array('result' => 'fail', 'message' => $this->lang->system->errors->notFoundLDAP));
|
||||
|
||||
$ldapSetting = json_decode($ldapInstance->ldapSettings);
|
||||
|
||||
$secretKey = helper::readKey();
|
||||
$password = openssl_decrypt($ldapSetting->auth->password, 'DES-ECB', $secretKey);
|
||||
if(!$password) $password = openssl_decrypt($ldapSetting->auth->password, 'DES-ECB', $ldapInstance->createdAt); // Secret key was createdAt field value less v2.2.
|
||||
|
||||
$this->send(array('result' => 'success', 'message' => '', 'data' => array('domain' => $this->instance->url($ldapInstance), 'account' => $ldapSetting->auth->username, 'pass' => $password)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get oss account and domain by ajax.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxOssInfo()
|
||||
{
|
||||
$minioInstance = new stdclass;
|
||||
$minioInstance->k8name = 'cne-operator';
|
||||
$minioInstance->spaceData = new stdclass;
|
||||
$minioInstance->spaceData->k8space = $this->config->k8space;
|
||||
|
||||
$ossAccount = $this->loadModel('cne')->getDefaultAccount($minioInstance, '', 'minio');
|
||||
|
||||
$ossDomain = $this->cne->getDomain($minioInstance, '', 'minio');
|
||||
$ossDomain->domain = $ossDomain->access_host;
|
||||
|
||||
$url = $this->loadModel('instance')->url($ossDomain);
|
||||
|
||||
if($ossAccount and $ossDomain) return $this->send(array('result' => 'success', 'message' => '', 'data' => array('account' => $ossAccount, 'url' => $url)));
|
||||
|
||||
$this->send(array('result' => 'fail', 'message' => $this->lang->system->errors->failGetOssAccount));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#mainContent .table {margin: auto;width: 60%; min-width:400px; max-width: 800px;}
|
||||
#mainContent .main-header {margin-bottom: 20px;}
|
||||
#mainContent .main-header h2{font-size: 18px;}
|
||||
@@ -0,0 +1 @@
|
||||
table tr th.new-domain-label{vertical-align: top; padding-top: 14px;}
|
||||
@@ -0,0 +1 @@
|
||||
.advanced {padding:5px 0 5px 150px;}
|
||||
@@ -0,0 +1,7 @@
|
||||
.plug-container > div{margin-bottom: 20px;}
|
||||
.plug-container a {display: inline-block; width: 150px;}
|
||||
.plug-container a:hover { text-decoration: none; box-shadow: 0 1px 5px rgb(0 0 0 / 18%);}
|
||||
.logo { display: inline-block; padding: 10px;}
|
||||
.logo .icon {font-size: 100px; color: #70c0fb;}
|
||||
.logo img {width: 100px; height:100px;}
|
||||
.plug-title {display: inline-block; padding-top: 10px; text-align: center; font-size: 16px; font-weight: 500;}
|
||||
@@ -0,0 +1 @@
|
||||
.advanced {padding:5px 0 5px 150px;}
|
||||
@@ -0,0 +1 @@
|
||||
#mainContent .main-col {display: block;}
|
||||
@@ -0,0 +1,7 @@
|
||||
.btn.label-lg.label-primary.btn-edit {color: #61be68;}
|
||||
.btn.label-lg.label-outline {background-color: #ffffff!important;}
|
||||
.btn.label-lg.label-outline:hover, .btn-visit.btn:focus {background-color: #e5fbf3!important;}
|
||||
.edit-tools-tips {display: inline-block; margin: 0 10px;}
|
||||
#ldapAccountModal .modal-content {padding-bottom: 20px;}
|
||||
input#ldapPassword {border:none;}
|
||||
#ldapPassBtn {border:none;}
|
||||
@@ -0,0 +1,5 @@
|
||||
.btn.label-lg.label-outline {background-color: #ffffff!important;}
|
||||
.btn.label-lg.label-outline:hover, .btn-visit.btn:focus {background-color: #e5fbf3!important;}
|
||||
input#ossPassword {border:none;}
|
||||
input#ossSK{border:none;}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#smtpPassBtn{border: 0;}
|
||||
@@ -0,0 +1,22 @@
|
||||
$(function()
|
||||
{
|
||||
$('button.db-login').on('click', function(event)
|
||||
{
|
||||
var dbName = $(event.target).data('db-name');
|
||||
var dbType = $(event.target).data('db-type');
|
||||
var namespace = $(event.target).data('namespace');
|
||||
|
||||
$.post(createLink('system', 'ajaxDBAuthUrl'), {dbName, namespace, dbType}).done(function(res)
|
||||
{
|
||||
var response = JSON.parse(res);
|
||||
if(response.result == 'success')
|
||||
{
|
||||
window.parent.open(response.data.url, 'Adminer');
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(response.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
window.manageDb = function(dbName, dbType, namespace)
|
||||
{
|
||||
$.post($.createLink('system', 'ajaxDBAuthUrl'), {dbName, namespace, dbType}, function(res)
|
||||
{
|
||||
var response = JSON.parse(res);
|
||||
if(response.result == 'success')
|
||||
{
|
||||
window.parent.open(response.data.url, 'Adminer');
|
||||
}
|
||||
else
|
||||
{
|
||||
zui.Modal.alert(response.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.renderDbList = function (result, {col, row, value})
|
||||
{
|
||||
if(col.name === 'status')
|
||||
{
|
||||
var statusClass = value == 'running' ? 'text-success' : '';
|
||||
result[0] = {html: '<span class="' + statusClass + '">' + result[0] + '</span>'};
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
$(function()
|
||||
{
|
||||
/**
|
||||
* Fresh submitBtn status.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function freshSubmitBtn()
|
||||
{
|
||||
if($('#httpstrue:checked').length == 0)
|
||||
{
|
||||
$('#submitBtn').attr('disabled', false);
|
||||
return;
|
||||
}
|
||||
var pass = $('#validateCertBtn').attr('pass') == 'true';
|
||||
if(pass)
|
||||
{
|
||||
$('#submitBtn').attr('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#submitBtn').attr('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
freshSubmitBtn();
|
||||
|
||||
/**
|
||||
* Toggle certificate textarea.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function toggleCertBox()
|
||||
{
|
||||
$showCert = $("#httpstrue[type=checkbox]:checked").length > 0;
|
||||
if($showCert)
|
||||
{
|
||||
$('#cert-box').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#cert-box').hide();
|
||||
}
|
||||
|
||||
freshSubmitBtn();
|
||||
}
|
||||
|
||||
toggleCertBox();
|
||||
|
||||
$("#httpstrue[type=checkbox]").on('change', function()
|
||||
{
|
||||
toggleCertBox();
|
||||
});
|
||||
|
||||
$('#validateCertBtn').on('click', function()
|
||||
{
|
||||
var certData = {};
|
||||
certData.customDomain = $('#customDomain').val();
|
||||
certData.certPem = $('#certPem').val();
|
||||
certData.certKey = $('#certKey').val();
|
||||
$.post(createLink('system', 'ajaxValidateCert'), certData).done(function(response)
|
||||
{
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#validateCertBtn').attr('pass', 'true');
|
||||
$('#validateMsg').removeClass('text-red').addClass('text-green');
|
||||
$('#validateMsg').html(res.message);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#validateCertBtn').attr('pass', 'false');
|
||||
$('#validateMsg').removeClass('text-green').addClass('text-red');
|
||||
var errMessage = res.message;
|
||||
if(res.message instanceof Array) errMessage = res.message.join(' ');
|
||||
if(res.message instanceof Object) errMessage = Object.values(res.message).join(' ');
|
||||
|
||||
$('#validateMsg').html(errMessage);
|
||||
}
|
||||
freshSubmitBtn();
|
||||
});
|
||||
});
|
||||
|
||||
var timerID = 0;
|
||||
|
||||
/**
|
||||
* Show progress modal and fresh progress of updating domain by ajax.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function showProgressModal()
|
||||
{
|
||||
$('#waiting').modal('show');
|
||||
timerID = setInterval(function()
|
||||
{
|
||||
$.get(createLink('system', 'ajaxUpdatingDomainProgress'), function(data)
|
||||
{
|
||||
$('#waiting #message').html(data);
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
$('#submitBtn').on('click', function()
|
||||
{
|
||||
bootbox.confirm(notices.confirmUpdateDomain, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
showProgressModal();
|
||||
$('#submitBtn').attr('disabled', true);
|
||||
|
||||
var domainData = $('#domainForm').serializeArray();
|
||||
$.post(createLink('system', 'editDomain'), domainData).done(function(response)
|
||||
{
|
||||
$('#submitBtn').attr('disabled', false);
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
parent.window.location.href = res.locate;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#waiting').modal('hide');
|
||||
clearInterval(timerID);
|
||||
|
||||
var errMessage = res.message;
|
||||
if(res.message instanceof Array) errMessage = res.message.join('<br/>');
|
||||
if(res.message instanceof Object) errMessage = Object.values(res.message).join('<br/>');
|
||||
|
||||
bootbox.alert(
|
||||
{
|
||||
title: notices.fail,
|
||||
message: errMessage,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
function onHttpsChange(event)
|
||||
{
|
||||
const $https = $(event.target);
|
||||
|
||||
if($https.prop('checked'))
|
||||
{
|
||||
$('.cert').removeClass('hidden');
|
||||
|
||||
var pass = $('#validateCertBtn').attr('pass') == 'true';
|
||||
if(!pass) $('#domainForm button[type=submit]').prop('disabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.cert').addClass('hidden');
|
||||
$('#domainForm button[type=submit]').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
function checkCert()
|
||||
{
|
||||
var certData = {};
|
||||
certData.customDomain = $('#customDomain').val();
|
||||
certData.certPem = $('#certPem').val();
|
||||
certData.certKey = $('#certKey').val();
|
||||
|
||||
$.ajaxSubmit(
|
||||
{
|
||||
url: $.createLink('system', 'ajaxValidateCert'),
|
||||
data: certData,
|
||||
onComplete: function(res)
|
||||
{
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#validateCertBtn').attr('pass', 'true');
|
||||
$('#validateMsg').removeClass('text-danger').addClass('text-success');
|
||||
$('#validateMsg').html(res.message);
|
||||
$('#domainForm button[type=submit]').prop('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#validateCertBtn').attr('pass', 'false');
|
||||
$('#validateMsg').removeClass('text-success').addClass('text-danger');
|
||||
var errMessage = res.message;
|
||||
if(res.message instanceof Array) errMessage = res.message.join(' ');
|
||||
if(res.message instanceof Object) errMessage = Object.values(res.message).join(' ');
|
||||
|
||||
$('#validateMsg').html(errMessage);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
$(function()
|
||||
{
|
||||
/**
|
||||
* Fresh submit button.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function freshSubmitBtn()
|
||||
{
|
||||
var enableLDAP = $('#LDAPForm input[type=checkbox]:checked').length > 0;
|
||||
var ldapCheckPass = true;
|
||||
if($('#LDAPForm select[name=source]').val() == 'extra')
|
||||
{
|
||||
ldapCheckPass = $('#testConnectBtn').attr('pass') == 'true';
|
||||
}
|
||||
|
||||
if(enableLDAP && ldapCheckPass)
|
||||
{
|
||||
$('#LDAPForm #submitBtn').attr('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#LDAPForm #submitBtn').attr('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
freshSubmitBtn();
|
||||
|
||||
$('#LDAPForm input[type=checkbox]').on('change', function(event)
|
||||
{
|
||||
freshSubmitBtn();
|
||||
});
|
||||
|
||||
$('#LDAPForm input[type=checkbox]').change();
|
||||
|
||||
$('select[name=source]').on('change', function(event)
|
||||
{
|
||||
if($(event.target).val() == 'qucheng')
|
||||
{
|
||||
$('#quchengLDAP').show();
|
||||
$('#extraLDAP').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#quchengLDAP').hide();
|
||||
$('#extraLDAP').show();
|
||||
}
|
||||
|
||||
freshSubmitBtn();
|
||||
});
|
||||
$('select[name=source]').change();
|
||||
|
||||
$('#testConnectBtn').on('click', function(event)
|
||||
{
|
||||
var settings = {};
|
||||
settings.host = $('input[name="extra[host]"]').val();
|
||||
settings.port = $('input[name="extra[port]"]').val();
|
||||
settings.bindDN = $('input[name="extra[bindDN]"]').val();
|
||||
settings.bindPass = $('input[name="extra[bindPass]"]').val();
|
||||
settings.baseDN = $('input[name="extra[baseDN]"]').val();
|
||||
if(!settings.host || !settings.port || !settings.bindDN || !settings.bindPass || !settings.baseDN)
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: notices.attention,
|
||||
message: notices.fillAllRequiredFields,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(createLink('system', 'testLDAPConnection'), settings).done(function(response)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = JSON.parse(response);
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
var res = {result: 'fail', message: errors.verifyLDAPFailed,};
|
||||
}
|
||||
$('#connectResult').html(res.message);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#testConnectBtn').attr('pass', 'true');
|
||||
$('#connectResult').removeClass('text-red').addClass('text-success');
|
||||
freshSubmitBtn();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#testConnectBtn').attr('pass', 'false');
|
||||
$('#connectResult').removeClass('text-success').addClass('text-red');
|
||||
freshSubmitBtn();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var timerID = 0;
|
||||
|
||||
/**
|
||||
* Show updating LDAP progress modal.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function showProgressModal()
|
||||
{
|
||||
$('#waiting').modal('show');
|
||||
timerID = setInterval(function()
|
||||
{
|
||||
$.get(createLink('system', 'ajaxUpdatingLDAPProgress'), function(data)
|
||||
{
|
||||
$('#waiting #message').html(data);
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
$('#submitBtn').on('click', function()
|
||||
{
|
||||
bootbox.confirm(notices.confirmUpdateLDAP, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
showProgressModal();
|
||||
$('#submitBtn').attr('disabled', true);
|
||||
|
||||
var ldapData = $('#LDAPForm').serializeArray();
|
||||
$.post(createLink('system', 'editLDAP'), ldapData).done(function(response)
|
||||
{
|
||||
$('#submitBtn').attr('disabled', false);
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
parent.window.location.href = res.locate;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#waiting').modal('hide');
|
||||
clearInterval(timerID);
|
||||
|
||||
var errMessage = res.message;
|
||||
if(res.message instanceof Array) errMessage = res.message.join('<br/>');
|
||||
if(res.message instanceof Object) errMessage = Object.values(res.message).join('<br/>');
|
||||
|
||||
bootbox.alert(
|
||||
{
|
||||
title: notices.fail,
|
||||
message: errMessage,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
$(function()
|
||||
{
|
||||
var overtime = 30;
|
||||
var timerID = 0;
|
||||
$("#submitBtn").on('click', function()
|
||||
{
|
||||
$('#waiting').modal('show');
|
||||
timerID = setInterval(function()
|
||||
{
|
||||
$('#timer').text(overtime);
|
||||
overtime--;
|
||||
}, 1000);
|
||||
|
||||
var slbData = {};
|
||||
slbData.ippool = $('#ippool').val();
|
||||
$.post(createLink('system', 'editSLB'), slbData).done(function(response)
|
||||
{
|
||||
$('#waiting').modal('hide');
|
||||
clearInterval(timerID);
|
||||
overtime = 30;
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success'){
|
||||
parent.window.location.href = res.locate;
|
||||
}else{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: notices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,73 @@
|
||||
$(function()
|
||||
{
|
||||
/**
|
||||
* Fresh submit btton by enable SMTP checkboc value and verified result of SMTP account.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function freshSubmitBtn()
|
||||
{
|
||||
var enableSMTP = $('#smtpForm input[type=checkbox]:checked').length > 0;
|
||||
var accountRight = $('#verifyAccountBtn').attr('pass') == 'true';
|
||||
|
||||
if(enableSMTP && accountRight)
|
||||
{
|
||||
$('#smtpForm button[type=submit]').attr('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#smtpForm button[type=submit]').attr('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
$('#smtpForm input[type=checkbox]').on('change', function(event)
|
||||
{
|
||||
freshSubmitBtn();
|
||||
});
|
||||
|
||||
$('#smtpForm input[type=checkbox]').change();
|
||||
|
||||
$('#verifyAccountBtn').on('click', function(event)
|
||||
{
|
||||
var settings = {};
|
||||
settings.host = $("input[name='host']").val();
|
||||
settings.port = $("input[name='port']").val();
|
||||
settings.user = $("input[name='user']").val();
|
||||
settings.pass = $("input[name='pass']").val();
|
||||
if(!settings.host || !settings.port || !settings.user || !settings.pass)
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: notices.attention,
|
||||
message: notices.fillAllRequiredFields,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(createLink('system', 'ajaxVerifySMTPAccount'), settings).done(function(response)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = JSON.parse(response);
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
var res = {result: 'fail', message: errors.verifySMTPFailed,};
|
||||
}
|
||||
$('#verifyResult').html(res.message);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#verifyAccountBtn').attr('pass', 'true');
|
||||
$('#verifyResult').removeClass('text-red').addClass('text-success');
|
||||
freshSubmitBtn();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#verifyAccountBtn').attr('pass', 'false');
|
||||
$('#verifyResult').removeClass('text-success').addClass('text-red');
|
||||
freshSubmitBtn();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,129 @@
|
||||
$(function()
|
||||
{
|
||||
/**
|
||||
* Fresh submit button.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function freshSubmitBtn()
|
||||
{
|
||||
var enableLDAP = $('#LDAPForm input[type=checkbox]:checked').length > 0;
|
||||
var ldapCheckPass = true;
|
||||
if($('#LDAPForm select[name=source]').val() == 'extra')
|
||||
{
|
||||
ldapCheckPass = $('#testConnectBtn').attr('pass') == 'true';
|
||||
}
|
||||
|
||||
if(enableLDAP && ldapCheckPass)
|
||||
{
|
||||
$('#LDAPForm #submitBtn').attr('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#LDAPForm #submitBtn').attr('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
freshSubmitBtn();
|
||||
|
||||
$('#LDAPForm input[type=checkbox]').on('change', function(event)
|
||||
{
|
||||
freshSubmitBtn();
|
||||
});
|
||||
|
||||
$('#LDAPForm input[type=checkbox]').change();
|
||||
|
||||
$('select[name=source]').on('change', function(event)
|
||||
{
|
||||
if($(event.target).val() == 'qucheng')
|
||||
{
|
||||
$('#quchengLDAP').show();
|
||||
$('#extraLDAP').hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#quchengLDAP').hide();
|
||||
$('#extraLDAP').show();
|
||||
}
|
||||
|
||||
freshSubmitBtn();
|
||||
});
|
||||
$('select[name=source]').change();
|
||||
|
||||
$('#testConnectBtn').on('click', function(event)
|
||||
{
|
||||
var settings = {};
|
||||
settings.host = $('input[name="extra[host]"]').val();
|
||||
settings.port = $('input[name="extra[port]"]').val();
|
||||
settings.bindDN = $('input[name="extra[bindDN]"]').val();
|
||||
settings.bindPass = $('input[name="extra[bindPass]"]').val();
|
||||
settings.baseDN = $('input[name="extra[baseDN]"]').val();
|
||||
if(!settings.host || !settings.port || !settings.bindDN || !settings.bindPass || !settings.baseDN)
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: notices.attention,
|
||||
message: notices.fillAllRequiredFields,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(createLink('system', 'testLDAPConnection'), settings).done(function(response)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = JSON.parse(response);
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
var res = {result: 'fail', message: errors.verifyLDAPFailed,};
|
||||
}
|
||||
$('#connectResult').html(res.message);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#testConnectBtn').attr('pass', 'true');
|
||||
$('#connectResult').removeClass('text-red').addClass('text-success');
|
||||
freshSubmitBtn();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#testConnectBtn').attr('pass', 'false');
|
||||
$('#connectResult').removeClass('text-success').addClass('text-red');
|
||||
freshSubmitBtn();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#submitBtn').on('click', function()
|
||||
{
|
||||
$('#submitBtn').attr('disabled', true);
|
||||
|
||||
var ldapData = $('#LDAPForm').serializeArray();
|
||||
$.post(createLink('system', 'installLDAP'), ldapData).done(function(response)
|
||||
{
|
||||
$('#submitBtn').attr('disabled', false);
|
||||
|
||||
var res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
parent.window.location.href = res.locate;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#waiting').modal('hide');
|
||||
clearInterval(timerID);
|
||||
|
||||
var errMessage = res.message;
|
||||
if(res.message instanceof Array) errMessage = res.message.join('<br/>');
|
||||
if(res.message instanceof Object) errMessage = Object.values(res.message).join('<br/>');
|
||||
|
||||
bootbox.alert(
|
||||
{
|
||||
title: notices.fail,
|
||||
message: errMessage,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,91 @@
|
||||
$(function()
|
||||
{
|
||||
/**
|
||||
* Fresh submit btton by enable SMTP checkboc value and verified result of SMTP account.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function freshSubmitBtn()
|
||||
{
|
||||
var enableSMTP = $('#smtpForm input[type=checkbox]:checked').length > 0;
|
||||
var accountRight = $('#verifyAccountBtn').attr('pass') == 'true';
|
||||
|
||||
if(enableSMTP)
|
||||
{
|
||||
$('#smtpForm').find('table').show();
|
||||
$('#smtpForm').find('button[type=submit]').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#smtpForm').find('table').hide();
|
||||
$('#smtpForm').find('button[type=submit]').hide();
|
||||
}
|
||||
|
||||
if(enableSMTP && accountRight)
|
||||
{
|
||||
$('#smtpForm button[type=submit]').attr('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#smtpForm button[type=submit]').attr('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
$('#smtpForm input[type=checkbox]').on('change', function(event)
|
||||
{
|
||||
freshSubmitBtn();
|
||||
});
|
||||
|
||||
$('#smtpForm input[type=checkbox]').change();
|
||||
|
||||
$('#smtpForm input[type=text]').on('change', function(event)
|
||||
{
|
||||
$('#verifyAccountBtn').attr('pass', 'false');
|
||||
$('#verifyResult').text('');
|
||||
freshSubmitBtn();
|
||||
});
|
||||
|
||||
$('#verifyAccountBtn').on('click', function(event)
|
||||
{
|
||||
var settings = {};
|
||||
settings.host = $("input[name='host']").val();
|
||||
settings.port = $("input[name='port']").val();
|
||||
settings.user = $("input[name='user']").val();
|
||||
settings.pass = $("input[name='pass']").val();
|
||||
if(!settings.host || !settings.port || !settings.user || !settings.pass)
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: notices.attention,
|
||||
message: notices.fillAllRequiredFields,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(createLink('system', 'ajaxVerifySMTPAccount'), settings).done(function(response)
|
||||
{
|
||||
try
|
||||
{
|
||||
var res = JSON.parse(response);
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
var res = {result: 'fail', message: errors.verifySMTPFailed,};
|
||||
}
|
||||
$('#verifyResult').html(res.message);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#verifyAccountBtn').attr('pass', 'true');
|
||||
$('#verifyResult').removeClass('text-red').addClass('text-success');
|
||||
freshSubmitBtn();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#verifyAccountBtn').attr('pass', 'false');
|
||||
$('#verifyResult').removeClass('text-success').addClass('text-red');
|
||||
freshSubmitBtn();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,127 @@
|
||||
$(function()
|
||||
{
|
||||
$('.btn-visit').on('click', function(event)
|
||||
{
|
||||
$.get(createLink('system', 'ajaxLdapInfo'), function(response)
|
||||
{
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#ldapAccount').text(res.data.account);
|
||||
$('#ldapPassword').val(res.data.pass);
|
||||
$('#ldapVisitUrl').attr('href', '//' + res.data.domain);
|
||||
$('#ldapAccountModal').modal('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#ldapPassBtn').on('click', function(event){
|
||||
var inputTyep = $('#ldap_password').attr('type');
|
||||
if(inputTyep == 'text'){
|
||||
$('#ldap_password').attr('type', 'password');
|
||||
$('#ldapPassBtn').find('.icon').removeClass('icon-eye').addClass('icon-eye-off');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#ldap_password').attr('type', 'text');
|
||||
$('#ldapPassBtn').find('.icon').addClass('icon-eye').removeClass('icon-eye-off');
|
||||
}
|
||||
});
|
||||
|
||||
$('#copyPassBtn').on('click', function(event)
|
||||
{
|
||||
$('#ldapPassword').select();
|
||||
document.execCommand('copy');
|
||||
bootbox.alert(copySuccess);
|
||||
});
|
||||
|
||||
$('.btn-start').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.confirmStart, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.starting + '</div>',
|
||||
});
|
||||
|
||||
let id = $(event.target).closest('button').attr('instance-id');
|
||||
let url = createLink('instance', 'ajaxStart', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('.btn-stop').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.confirmStop, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.stopping + '</div>',
|
||||
});
|
||||
|
||||
let id = $(event.target).closest('button').attr('instance-id');
|
||||
let url = createLink('instance', 'ajaxStop', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
setInterval(function()
|
||||
{
|
||||
var mainMenu = parent.window.$.apps.getLastApp();
|
||||
if(mainMenu.code != 'system') return;
|
||||
|
||||
var statusURL = createLink('instance', 'ajaxStatus');
|
||||
$.post(statusURL, {idList: instanceIdList}).done(function(response)
|
||||
{
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success' && res.data instanceof Array)
|
||||
{
|
||||
res.data.forEach(function(instance)
|
||||
{
|
||||
if($(".instance-status[instance-id=" + instance.id + "]").data('status') != instance.status) window.location.reload();
|
||||
});
|
||||
}
|
||||
if(res.locate) window.parent.location.href = res.locate;
|
||||
});
|
||||
}, 1000 * 5);
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
$(function()
|
||||
{
|
||||
$('#ossManage').on('click', function(event)
|
||||
{
|
||||
$.get(createLink('system', 'ajaxOssInfo'), function(response)
|
||||
{
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#ossAdmin').text(res.data.account.username);
|
||||
$('#ossPassword').val(res.data.account.password);
|
||||
$('#ossVisitUrl').attr('href', res.data.url);
|
||||
$('#ossAccountModal').modal('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#copySKBtn').on('click', function(event)
|
||||
{
|
||||
$('#ossSK').removeClass('hidden').select();
|
||||
document.execCommand('copy');
|
||||
$('#ossSK').addClass('hidden');
|
||||
bootbox.alert(copySuccess);
|
||||
});
|
||||
|
||||
$('#copyPassBtn').on('click', function(event)
|
||||
{
|
||||
$('#ossPassword').removeClass('hidden').select();
|
||||
document.execCommand('copy');
|
||||
$('#ossPassword').addClass('hidden');
|
||||
bootbox.alert(copySuccess);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
$(function()
|
||||
{
|
||||
$.get($.createLink('system', 'ajaxOssInfo'), function(response)
|
||||
{
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
$('#ossAdmin').text(res.data.account.username);
|
||||
$('#ossPassword').val(res.data.account.password);
|
||||
$('#ossVisitUrl').attr('href', res.data.url);
|
||||
$('#ossAccountModal').modal('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function copySK()
|
||||
{
|
||||
var sk = document.getElementById('ossSK');
|
||||
$('#ossSK').removeClass('hidden');
|
||||
sk.select();
|
||||
document.execCommand('copy');
|
||||
$('#ossSK').addClass('hidden');
|
||||
zui.Modal.alert(copySuccess);
|
||||
}
|
||||
|
||||
function copyPassBtn()
|
||||
{
|
||||
var ossPassword = document.getElementById('ossPassword');
|
||||
$('#ossPassword').removeClass('hidden');
|
||||
ossPassword.select();
|
||||
document.execCommand('copy');
|
||||
$('#ossPassword').addClass('hidden');
|
||||
zui.Modal.alert(copySuccess);
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
$(function()
|
||||
{
|
||||
$('#smtpPassBtn').on('click', function(event){
|
||||
var inputTyep = $('#smtp_password').attr('type');
|
||||
if(inputTyep == 'text'){
|
||||
$('#smtp_password').attr('type', 'password');
|
||||
$('#smtpPassBtn').find('.icon').removeClass('icon-eye').addClass('icon-eye-off');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#smtp_password').attr('type', 'text');
|
||||
$('#smtpPassBtn').find('.icon').addClass('icon-eye').removeClass('icon-eye-off');
|
||||
}
|
||||
});
|
||||
|
||||
$('.btn-start').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.confirmStart, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.starting + '</div>',
|
||||
});
|
||||
|
||||
let id = $(event.target).closest('button').attr('instance-id');
|
||||
let url = createLink('instance', 'ajaxStart', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('.btn-stop').on('click', function(event)
|
||||
{
|
||||
bootbox.confirm(instanceNotices.confirmStop, function(result)
|
||||
{
|
||||
if(!result) return;
|
||||
|
||||
var loadingDialog = bootbox.dialog(
|
||||
{
|
||||
message: '<div class="text-center"><i class="icon icon-spinner-indicator icon-spin"></i> ' + instanceNotices.stopping + '</div>',
|
||||
});
|
||||
|
||||
let id = $(event.target).closest('button').attr('instance-id');
|
||||
let url = createLink('instance', 'ajaxStop', 'id=' + id, 'json');
|
||||
$.post(url).done(function(response)
|
||||
{
|
||||
loadingDialog.modal('hide');
|
||||
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success')
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
bootbox.alert(
|
||||
{
|
||||
title: instanceNotices.fail,
|
||||
message: res.message,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
var enableTimer = true;
|
||||
window.parent.$(window.parent.document).on('showapp', function(event, app)
|
||||
{
|
||||
enableTimer = app.code == 'space';
|
||||
});
|
||||
|
||||
setInterval(function()
|
||||
{
|
||||
if(!enableTimer) return;
|
||||
|
||||
var statusURL = createLink('instance', 'ajaxStatus');
|
||||
$.post(statusURL, {idList: instanceIdList}).done(function(response)
|
||||
{
|
||||
let res = JSON.parse(response);
|
||||
if(res.result == 'success' && res.data instanceof Array)
|
||||
{
|
||||
res.data.forEach(function(instance)
|
||||
{
|
||||
if($(".instance-status[instance-id=" + instance.id + "]").data('status') != instance.status) window.location.reload();
|
||||
});
|
||||
}
|
||||
if(res.locate) window.parent.location.href = res.locate;
|
||||
});
|
||||
}, 1000 * 5);
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
$lang->system->dashboard = 'Dashboard';
|
||||
$lang->system->systemInfo = 'System information';
|
||||
$lang->system->dbManagement = 'Database management';
|
||||
$lang->system->ldapManagement = 'LDAP';
|
||||
$lang->system->dbList = 'Database list';
|
||||
$lang->system->dbName = 'Name';
|
||||
$lang->system->dbStatus = 'Status';
|
||||
$lang->system->dbType = 'Type';
|
||||
$lang->system->action = 'Action';
|
||||
$lang->system->management = 'Management';
|
||||
$lang->system->visit = 'Visit';
|
||||
$lang->system->close = 'Close';
|
||||
$lang->system->installLDAP = 'Install LDAP';
|
||||
$lang->system->editLDAP = 'Edit';
|
||||
$lang->system->LDAPInfo = 'LDAP information';
|
||||
$lang->system->accountInfo = 'Account information';
|
||||
$lang->system->advance = 'Senior';
|
||||
$lang->system->verify = 'Check';
|
||||
$lang->system->copy = 'Copy';
|
||||
$lang->system->copySuccess = '已复制到剪切板';
|
||||
$lang->system->cneStatus = '平台状态';
|
||||
$lang->system->cneStatistic = '资源统计';
|
||||
$lang->system->latestDynamic = '最新动态';
|
||||
$lang->system->nodeQuantity = '节点数';
|
||||
$lang->system->serviceQuantity = '服务数';
|
||||
$lang->system->cpuUsage = 'CPU(核)';
|
||||
$lang->system->memUsage = '内存(GB)';
|
||||
|
||||
/* LDAP */
|
||||
$lang->system->LDAP = new stdclass;
|
||||
$lang->system->LDAP->info = 'LDAP信息';
|
||||
$lang->system->LDAP->ldapEnabled = '启用LDAP';
|
||||
$lang->system->LDAP->ldapQucheng = '渠成内置';
|
||||
$lang->system->LDAP->ldapSource = '来源';
|
||||
$lang->system->LDAP->ldapInstall = '安装并启用';
|
||||
$lang->system->LDAP->ldapUpdate = '更新';
|
||||
$lang->system->LDAP->accountInfo = '账号信息';
|
||||
$lang->system->LDAP->account = '账号';
|
||||
$lang->system->LDAP->password = '密码';
|
||||
$lang->system->LDAP->ldapUsername = '用户名';
|
||||
$lang->system->LDAP->ldapName = '名称';
|
||||
$lang->system->LDAP->host = '主机';
|
||||
$lang->system->LDAP->port = '端口';
|
||||
$lang->system->LDAP->account = '账号';
|
||||
$lang->system->LDAP->password = '密码';
|
||||
$lang->system->LDAP->ldapRoot = '根节点';
|
||||
$lang->system->LDAP->filterUser = '用户过滤';
|
||||
$lang->system->LDAP->email = '邮件字段';
|
||||
$lang->system->LDAP->extraAccount = '用户名字段';
|
||||
$lang->system->LDAP->ldapAdvance = '高级设置';
|
||||
$lang->system->LDAP->updateLDAP = '更新LDAP';
|
||||
$lang->system->LDAP->updateInstance = '更新已关联LDAP的服务';
|
||||
$lang->system->LDAP->updatingProgress = '更新中...剩余 %s 个服务。';
|
||||
|
||||
$lang->system->ldapTypeList = array();
|
||||
$lang->system->ldapTypeList['qucheng'] = '渠成内置';
|
||||
$lang->system->ldapTypeList['extra'] = '外部映射';
|
||||
|
||||
/* OSS */
|
||||
$lang->system->oss = new stdclass;
|
||||
$lang->system->oss->common = 'Object Storage';
|
||||
$lang->system->oss->appURL = 'Application address';
|
||||
$lang->system->oss->user = 'User name';
|
||||
$lang->system->oss->password = 'Password';
|
||||
$lang->system->oss->manage = 'Manage';
|
||||
$lang->system->oss->apiURL = 'API address';
|
||||
$lang->system->oss->accessKey = 'Access Key';
|
||||
$lang->system->oss->secretKey = 'Secret Key';
|
||||
|
||||
/* SMTP */
|
||||
$lang->system->SMTP = new stdclass;
|
||||
$lang->system->SMTP->common = '邮箱配置';
|
||||
$lang->system->SMTP->enabled = '启用SMTP';
|
||||
$lang->system->SMTP->install = '安装';
|
||||
$lang->system->SMTP->update = '更新';
|
||||
$lang->system->SMTP->edit = '编辑';
|
||||
$lang->system->SMTP->editSMTP = '编辑SMTP';
|
||||
$lang->system->SMTP->account = '发信邮箱';
|
||||
$lang->system->SMTP->password = '密码';
|
||||
$lang->system->SMTP->host = 'SMTP服务器';
|
||||
$lang->system->SMTP->port = 'SMTP端口';
|
||||
$lang->system->SMTP->save = '保存';
|
||||
|
||||
/* Domain */
|
||||
$lang->system->customDomain = '新域名';
|
||||
$lang->system->certPem = '公钥证书';
|
||||
$lang->system->certKey = '私钥';
|
||||
|
||||
$lang->system->domain = new stdclass;
|
||||
$lang->system->domain->common = '域名管理';
|
||||
$lang->system->domain->editDomain = '修改域名配置';
|
||||
$lang->system->domain->config = '配置域名和证书';
|
||||
$lang->system->domain->currentDomain = '当前域名';
|
||||
$lang->system->domain->oldDomain = '旧域名';
|
||||
$lang->system->domain->newDomain = '新域名';
|
||||
$lang->system->domain->expiredDate = '证书过期时间';
|
||||
$lang->system->domain->uploadCert = '上传证书(仅支持泛域名证书)';
|
||||
|
||||
$lang->system->domain->notReuseOldDomain = '使用自定义域名后无法改回默认域名';
|
||||
$lang->system->domain->setDNS = '建议修改域名前请先进行DNS解析,';
|
||||
$lang->system->domain->dnsHelperLink = '点击查看帮助文档';
|
||||
$lang->system->domain->updateInstancesDomain = '更新已安装服务的域名';
|
||||
$lang->system->domain->totalOldDomain = '共 %s 个。';
|
||||
$lang->system->domain->updatingProgress = '更新中...,剩余 %s 个,';
|
||||
$lang->system->domain->updating = '更新中...';
|
||||
|
||||
$lang->system->SLB = new stdclass;
|
||||
$lang->system->SLB->common = '负载均衡';
|
||||
$lang->system->SLB->config = '配置负载均衡';
|
||||
$lang->system->SLB->edit = '修改负载均衡';
|
||||
$lang->system->SLB->ipPool = 'IP段';
|
||||
$lang->system->SLB->ipPoolExample = '示例:192.168.10.0/24或者192.168.10.0-192.168.10.100';
|
||||
$lang->system->SLB->installing = '正在配置负载均衡';
|
||||
$lang->system->SLB->leftSeconds = '预计剩余';
|
||||
$lang->system->SLB->second = '秒';
|
||||
|
||||
$lang->system->notices = new stdclass;
|
||||
$lang->system->notices->success = '成功';
|
||||
$lang->system->notices->fail = '失败';
|
||||
$lang->system->notices->attention = '注意';
|
||||
$lang->system->notices->noLDAP = '找不到LDAP配置数据';
|
||||
$lang->system->notices->ldapUsed = '%s个服务已关联了LDAP';
|
||||
$lang->system->notices->ldapInstallSuccess = 'LDAP安装成功';
|
||||
$lang->system->notices->ldapUpdateSuccess = 'LDAP更新成功';
|
||||
$lang->system->notices->confirmUpdateLDAP = '修改LDAP后,会自动更新并重启已关联的服务,确定要修改吗?';
|
||||
$lang->system->notices->verifyLDAPSuccess = '校验LDAP成功!';
|
||||
$lang->system->notices->fillAllRequiredFields = '请填写全部必填项!';
|
||||
$lang->system->notices->smtpInstallSuccess = 'LDAP安装成功';
|
||||
$lang->system->notices->smtpUpdateSuccess = 'LDAP更新成功';
|
||||
$lang->system->notices->smtpWhiteList = '为防止邮件被屏蔽,请在邮件服务器里面将发信邮箱设为白名单';
|
||||
$lang->system->notices->smtpAuthCode = '有些邮箱要填写单独申请的授权码,具体请到邮箱相关设置查询';
|
||||
$lang->system->notices->smtpUsed = '%s 个服务关联了SMTP';
|
||||
$lang->system->notices->verifySMTPSuccess = '校验成功!';
|
||||
$lang->system->notices->pleaseCheckSMTPInfo = '校验失败!请检查用户名和密码是否正确';
|
||||
$lang->system->notices->confirmUpdateDomain = '修改域名后,会自动更新已安装服务的域名,确定要修改吗?';
|
||||
$lang->system->notices->updateDomainSuccess = '域名修改成功。';
|
||||
$lang->system->notices->configSLBSuccess = '配置负载均衡成功。';
|
||||
$lang->system->notices->validCert = '校验成功';
|
||||
|
||||
$lang->system->errors = new stdclass;
|
||||
$lang->system->errors->notFoundDB = '找不到该数据库';
|
||||
$lang->system->errors->notFoundLDAP = '找不到LDAP数据';
|
||||
$lang->system->errors->dbNameIsEmpty = '数据库名为空';
|
||||
$lang->system->errors->notSupportedLDAP = '暂不支持该类型的LDAP';
|
||||
$lang->system->errors->failToInstallLDAP = '安装内置LDAP失败';
|
||||
$lang->system->errors->failToInstallExtraLDAP = '对接外部LDAP失败';
|
||||
$lang->system->errors->failToUpdateExtraLDAP = '更新外部LDAP失败';
|
||||
$lang->system->errors->failToUninstallQuChengLDAP = '卸载渠成内部LDAP失败';
|
||||
$lang->system->errors->failToUninstallExtraLDAP = '卸载外部LDAP失败';
|
||||
$lang->system->errors->failToDeleteLDAPSnippet = '删除LDAP片段失败';
|
||||
$lang->system->errors->verifyLDAPFailed = '校验LDAP失败';
|
||||
$lang->system->errors->LDAPLinked = '有服务已经关联了LDAP';
|
||||
$lang->system->errors->SMTPLinked = '有服务已经关联了SMTP服务';
|
||||
$lang->system->errors->failGetOssAccount = '获取对象存储账号失败';
|
||||
$lang->system->errors->failToInstallSMTP = '安装SMTP失败';
|
||||
$lang->system->errors->failToUninstallSMTP = '卸载SMTP失败';
|
||||
$lang->system->errors->failToUpdateSMTP = '更新SMTP失败';
|
||||
$lang->system->errors->verifySMTPFailed = '校验SMTP失败';
|
||||
$lang->system->errors->notFoundSMTPApp = '找不到SMTP代理应用';
|
||||
$lang->system->errors->notFoundSMTPService = '找不到SMTP代理服务';
|
||||
$lang->system->errors->domainIsRequired = '必须填写域名';
|
||||
$lang->system->errors->invalidDomain = '无效的域名或格式错误。域名只允许小写字母、数字、点(.)和中横线(-)';
|
||||
$lang->system->errors->failToUpdateDomain = '更新域名失败';
|
||||
$lang->system->errors->forbiddenOriginalDomain = '不能修改为平台默认域名';
|
||||
$lang->system->errors->newDomainIsSameWithOld = '新域名不能与原域名相同';
|
||||
$lang->system->errors->failedToConfigSLB = '配置负载均衡失败';
|
||||
$lang->system->errors->wrongIPRange = 'IP段格式错误,请参照示例格式,' . $lang->system->SLB->ipPoolExample;
|
||||
$lang->system->errors->ippoolRequired = 'IP段不能为空';
|
||||
$lang->system->errors->failedToInstallSLBComponent = '安装负载均衡组件失败';
|
||||
$lang->system->errors->tryReinstallSLB = '安装负载均衡组件超时,请重试。';
|
||||
|
||||
$lang->system->backup = new stdclass();
|
||||
$lang->system->backup->common = '系统备份';
|
||||
$lang->system->backup->shortCommon = '备份';
|
||||
$lang->system->backup->systemInfo = '系统信息';
|
||||
$lang->system->backup->index = '备份首页';
|
||||
$lang->system->backup->history = '备份记录';
|
||||
$lang->system->backup->delete = '删除备份';
|
||||
$lang->system->backup->backup = '备份';
|
||||
$lang->system->backup->restore = '回滚';
|
||||
$lang->system->backup->change = '保留时间';
|
||||
$lang->system->backup->changeAB = '修改';
|
||||
$lang->system->backup->rmPHPHeader = '去除安全设置';
|
||||
$lang->system->backup->setting = '设置';
|
||||
$lang->system->backup->backupPerson = '备份人';
|
||||
$lang->system->backup->type = '备份类型';
|
||||
|
||||
$lang->system->backup->settingAction = '备份设置';
|
||||
|
||||
$lang->system->backup->name = '名称';
|
||||
$lang->system->backup->currentVersion = '当前版本';
|
||||
$lang->system->backup->latestVersion = '最新版本';
|
||||
|
||||
$lang->system->backup->time = '备份时间';
|
||||
$lang->system->backup->files = '备份文件';
|
||||
$lang->system->backup->allCount = '总文件数';
|
||||
$lang->system->backup->count = '备份文件数';
|
||||
$lang->system->backup->size = '大小';
|
||||
$lang->system->backup->status = '状态';
|
||||
$lang->system->backup->running = '运行中';
|
||||
$lang->system->backup->done = '完成';
|
||||
|
||||
$lang->system->backup->backupName = '备份名称:';
|
||||
$lang->system->backup->backupSql = '备份数据库:';
|
||||
$lang->system->backup->backupFile = '备份附件:';
|
||||
$lang->system->backup->restoreImage = '回滚平台镜像:';
|
||||
$lang->system->backup->restoreSQL = '回滚数据库:';
|
||||
$lang->system->backup->restoreFile = '回滚附件:';
|
||||
$lang->system->backup->checkService = '检查服务:';
|
||||
|
||||
$lang->system->backup->upgrade = '升级';
|
||||
$lang->system->backup->rollback = '回滚';
|
||||
$lang->system->backup->restart = '重启';
|
||||
$lang->system->backup->delete = '删除';
|
||||
|
||||
$lang->system->backup->statusList['success'] = '成功';
|
||||
$lang->system->backup->statusList['fail'] = '失败';
|
||||
|
||||
$lang->system->backup->restoreProgress['doing'] = '进行中';
|
||||
$lang->system->backup->restoreProgress['done'] = '完成';
|
||||
|
||||
$lang->system->backup->typeList['manual'] = '手动备份';
|
||||
$lang->system->backup->typeList['upgrade'] = '升级前自动备份';
|
||||
$lang->system->backup->typeList['restore'] = '回滚前自动备份';
|
||||
|
||||
$lang->system->backup->settingDir = '备份目录';
|
||||
$lang->system->backup->settingList['nofile'] = '不备份附件和代码';
|
||||
$lang->system->backup->settingList['nosafe'] = '不需要防下载PHP文件头';
|
||||
|
||||
$lang->system->backup->waitting = '<span id="backupType"></span>正在进行中,请稍候...';
|
||||
$lang->system->backup->progressSQL = '备份中,已备份%s';
|
||||
$lang->system->backup->progressAttach = '备份中,共有%s个文件,已经备份%s个';
|
||||
$lang->system->backup->progressCode = '代码备份中,共有%s个文件,已经备份%s个';
|
||||
$lang->system->backup->confirmDelete = '是否删除该备份?';
|
||||
$lang->system->backup->confirmRestore = '请确认是否回滚?';
|
||||
$lang->system->backup->holdDays = '备份保留最近 %s 天';
|
||||
$lang->system->backup->copiedFail = '复制失败的文件:';
|
||||
$lang->system->backup->restoreTip = '还原功能只还原数据库。';
|
||||
$lang->system->backup->versionInfo = '点击查看新版本介绍';
|
||||
$lang->system->backup->confirmUpgrade = '请确认是否升级渠成平台?';
|
||||
$lang->system->backup->upgrading = '升级中';
|
||||
$lang->system->backup->backupTitle = '正在备份 渠成平台...';
|
||||
$lang->system->backup->restoreTitle = '正在回滚 渠成平台...';
|
||||
$lang->system->backup->backingUp = '进行中';
|
||||
$lang->system->backup->restoring = '进行中';
|
||||
|
||||
$lang->system->backup->success = new stdclass();
|
||||
$lang->system->backup->success->backup = '备份成功!';
|
||||
$lang->system->backup->success->restore = '还原成功!';
|
||||
$lang->system->backup->success->upgrade = '升级成功!';
|
||||
$lang->system->backup->success->degrade = '降级成功!';
|
||||
|
||||
$lang->system->backup->error = new stdclass();
|
||||
$lang->system->backup->error->noCreateDir = '备份目录不存在,也无法创建该目录';
|
||||
$lang->system->backup->error->noWritable = "<code>%s</code> 不可写!请检查该目录权限,否则无法备份。";
|
||||
$lang->system->backup->error->noDelete = "文件 %s 无法删除,修改权限或手工删除。";
|
||||
$lang->system->backup->error->restoreSQL = "数据库还原失败,错误:%s";
|
||||
$lang->system->backup->error->restoreFile = "附件还原失败,错误:%s";
|
||||
$lang->system->backup->error->backupFile = "附件备份失败,错误:%s";
|
||||
$lang->system->backup->error->backupCode = "代码备份失败,错误:%s";
|
||||
|
||||
$lang->system->backup->error->upgradeFail = "升级失败!";
|
||||
$lang->system->backup->error->upgradeOvertime = "升级超时!";
|
||||
$lang->system->backup->error->degradeFail = "降级失败!";
|
||||
$lang->system->backup->error->beenLatestVersion = "已经是最新版,无需升级!";
|
||||
$lang->system->backup->error->requireVersion = "必须上传版本号!";
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
$lang->system->dashboard = '仪表盘';
|
||||
$lang->system->systemInfo = '系统信息';
|
||||
$lang->system->dbManagement = '数据库管理';
|
||||
$lang->system->ldapManagement = 'LDAP';
|
||||
$lang->system->dbList = '数据库列表';
|
||||
$lang->system->dbName = '名称';
|
||||
$lang->system->dbStatus = '状态';
|
||||
$lang->system->dbType = '类型';
|
||||
$lang->system->action = '操作';
|
||||
$lang->system->management = '管理';
|
||||
$lang->system->visit = '访问';
|
||||
$lang->system->close = '关闭';
|
||||
$lang->system->installLDAP = '安装LDAP';
|
||||
$lang->system->editLDAP = '编辑';
|
||||
$lang->system->LDAPInfo = 'LDAP信息';
|
||||
$lang->system->accountInfo = '账号信息';
|
||||
$lang->system->advance = '高级';
|
||||
$lang->system->verify = '校验';
|
||||
$lang->system->copy = '复制';
|
||||
$lang->system->copySuccess = '已复制到剪切板';
|
||||
$lang->system->cneStatus = '平台状态';
|
||||
$lang->system->cneStatistic = '资源统计';
|
||||
$lang->system->latestDynamic = '最新动态';
|
||||
$lang->system->nodeQuantity = '节点数';
|
||||
$lang->system->serviceQuantity = '服务数';
|
||||
$lang->system->cpuUsage = 'CPU(核)';
|
||||
$lang->system->memUsage = '内存(GB)';
|
||||
|
||||
/* LDAP */
|
||||
$lang->system->LDAP = new stdclass;
|
||||
$lang->system->LDAP->info = 'LDAP信息';
|
||||
$lang->system->LDAP->ldapEnabled = '启用LDAP';
|
||||
$lang->system->LDAP->ldapQucheng = '渠成内置';
|
||||
$lang->system->LDAP->ldapSource = '来源';
|
||||
$lang->system->LDAP->ldapInstall = '安装并启用';
|
||||
$lang->system->LDAP->ldapUpdate = '更新';
|
||||
$lang->system->LDAP->accountInfo = '账号信息';
|
||||
$lang->system->LDAP->account = '账号';
|
||||
$lang->system->LDAP->password = '密码';
|
||||
$lang->system->LDAP->ldapUsername = '用户名';
|
||||
$lang->system->LDAP->ldapName = '名称';
|
||||
$lang->system->LDAP->host = '主机';
|
||||
$lang->system->LDAP->port = '端口';
|
||||
$lang->system->LDAP->account = '账号';
|
||||
$lang->system->LDAP->password = '密码';
|
||||
$lang->system->LDAP->ldapRoot = '根节点';
|
||||
$lang->system->LDAP->filterUser = '用户过滤';
|
||||
$lang->system->LDAP->email = '邮件字段';
|
||||
$lang->system->LDAP->extraAccount = '用户名字段';
|
||||
$lang->system->LDAP->ldapAdvance = '高级设置';
|
||||
$lang->system->LDAP->updateLDAP = '更新LDAP';
|
||||
$lang->system->LDAP->updateInstance = '更新已关联LDAP的服务';
|
||||
$lang->system->LDAP->updatingProgress = '更新中...剩余 %s 个服务。';
|
||||
|
||||
$lang->system->ldapTypeList = array();
|
||||
$lang->system->ldapTypeList['qucheng'] = '渠成内置';
|
||||
$lang->system->ldapTypeList['extra'] = '外部映射';
|
||||
|
||||
/* OSS */
|
||||
$lang->system->oss = new stdclass;
|
||||
$lang->system->oss->common = '对象存储';
|
||||
$lang->system->oss->appURL = '应用地址';
|
||||
$lang->system->oss->user = '用户名';
|
||||
$lang->system->oss->password = '密码';
|
||||
$lang->system->oss->manage = '管理';
|
||||
$lang->system->oss->apiURL = 'API地址';
|
||||
$lang->system->oss->accessKey = 'Access Key';
|
||||
$lang->system->oss->secretKey = 'Secret Key';
|
||||
|
||||
/* SMTP */
|
||||
$lang->system->SMTP = new stdclass;
|
||||
$lang->system->SMTP->common = '邮箱配置';
|
||||
$lang->system->SMTP->enabled = '启用SMTP';
|
||||
$lang->system->SMTP->install = '安装';
|
||||
$lang->system->SMTP->update = '更新';
|
||||
$lang->system->SMTP->edit = '编辑';
|
||||
$lang->system->SMTP->editSMTP = '编辑SMTP';
|
||||
$lang->system->SMTP->account = '发信邮箱';
|
||||
$lang->system->SMTP->password = '密码';
|
||||
$lang->system->SMTP->host = 'SMTP服务器';
|
||||
$lang->system->SMTP->port = 'SMTP端口';
|
||||
$lang->system->SMTP->save = '保存';
|
||||
|
||||
/* Domain */
|
||||
$lang->system->customDomain = '新域名';
|
||||
$lang->system->certPem = '公钥证书';
|
||||
$lang->system->certKey = '私钥';
|
||||
|
||||
$lang->system->domain = new stdclass;
|
||||
$lang->system->domain->common = '域名管理';
|
||||
$lang->system->domain->editDomain = '修改域名配置';
|
||||
$lang->system->domain->config = '配置域名和证书';
|
||||
$lang->system->domain->currentDomain = '当前域名';
|
||||
$lang->system->domain->oldDomain = '旧域名';
|
||||
$lang->system->domain->newDomain = '新域名';
|
||||
$lang->system->domain->expiredDate = '证书过期时间';
|
||||
$lang->system->domain->uploadCert = '上传证书(仅支持泛域名证书)';
|
||||
|
||||
$lang->system->domain->notReuseOldDomain = '使用自定义域名后无法改回默认域名';
|
||||
$lang->system->domain->setDNS = '建议修改域名前请先进行DNS解析,';
|
||||
$lang->system->domain->dnsHelperLink = '点击查看帮助文档';
|
||||
$lang->system->domain->updateInstancesDomain = '更新已安装服务的域名';
|
||||
$lang->system->domain->totalOldDomain = '共 %s 个。';
|
||||
$lang->system->domain->updatingProgress = '更新中...,剩余 %s 个,';
|
||||
$lang->system->domain->updating = '更新中...';
|
||||
|
||||
$lang->system->SLB = new stdclass;
|
||||
$lang->system->SLB->common = '负载均衡';
|
||||
$lang->system->SLB->config = '配置负载均衡';
|
||||
$lang->system->SLB->edit = '修改负载均衡';
|
||||
$lang->system->SLB->ipPool = 'IP段';
|
||||
$lang->system->SLB->ipPoolExample = '示例:192.168.10.0/24或者192.168.10.0-192.168.10.100';
|
||||
$lang->system->SLB->installing = '正在配置负载均衡';
|
||||
$lang->system->SLB->leftSeconds = '预计剩余';
|
||||
$lang->system->SLB->second = '秒';
|
||||
|
||||
$lang->system->notices = new stdclass;
|
||||
$lang->system->notices->success = '成功';
|
||||
$lang->system->notices->fail = '失败';
|
||||
$lang->system->notices->attention = '注意';
|
||||
$lang->system->notices->noLDAP = '找不到LDAP配置数据';
|
||||
$lang->system->notices->ldapUsed = '%s个服务已关联了LDAP';
|
||||
$lang->system->notices->ldapInstallSuccess = 'LDAP安装成功';
|
||||
$lang->system->notices->ldapUpdateSuccess = 'LDAP更新成功';
|
||||
$lang->system->notices->confirmUpdateLDAP = '修改LDAP后,会自动更新并重启已关联的服务,确定要修改吗?';
|
||||
$lang->system->notices->verifyLDAPSuccess = '校验LDAP成功!';
|
||||
$lang->system->notices->fillAllRequiredFields = '请填写全部必填项!';
|
||||
$lang->system->notices->smtpInstallSuccess = 'LDAP安装成功';
|
||||
$lang->system->notices->smtpUpdateSuccess = 'LDAP更新成功';
|
||||
$lang->system->notices->smtpWhiteList = '为防止邮件被屏蔽,请在邮件服务器里面将发信邮箱设为白名单';
|
||||
$lang->system->notices->smtpAuthCode = '有些邮箱要填写单独申请的授权码,具体请到邮箱相关设置查询';
|
||||
$lang->system->notices->smtpUsed = '%s 个服务关联了SMTP';
|
||||
$lang->system->notices->verifySMTPSuccess = '校验成功!';
|
||||
$lang->system->notices->pleaseCheckSMTPInfo = '校验失败!请检查用户名和密码是否正确';
|
||||
$lang->system->notices->confirmUpdateDomain = '修改域名后,会自动更新已安装服务的域名,确定要修改吗?';
|
||||
$lang->system->notices->updateDomainSuccess = '域名修改成功。';
|
||||
$lang->system->notices->configSLBSuccess = '配置负载均衡成功。';
|
||||
$lang->system->notices->validCert = '校验成功';
|
||||
|
||||
$lang->system->errors = new stdclass;
|
||||
$lang->system->errors->notFoundDB = '找不到该数据库';
|
||||
$lang->system->errors->notFoundLDAP = '找不到LDAP数据';
|
||||
$lang->system->errors->dbNameIsEmpty = '数据库名为空';
|
||||
$lang->system->errors->notSupportedLDAP = '暂不支持该类型的LDAP';
|
||||
$lang->system->errors->failToInstallLDAP = '安装内置LDAP失败';
|
||||
$lang->system->errors->failToInstallExtraLDAP = '对接外部LDAP失败';
|
||||
$lang->system->errors->failToUpdateExtraLDAP = '更新外部LDAP失败';
|
||||
$lang->system->errors->failToUninstallQuChengLDAP = '卸载渠成内部LDAP失败';
|
||||
$lang->system->errors->failToUninstallExtraLDAP = '卸载外部LDAP失败';
|
||||
$lang->system->errors->failToDeleteLDAPSnippet = '删除LDAP片段失败';
|
||||
$lang->system->errors->verifyLDAPFailed = '校验LDAP失败';
|
||||
$lang->system->errors->LDAPLinked = '有服务已经关联了LDAP';
|
||||
$lang->system->errors->SMTPLinked = '有服务已经关联了SMTP服务';
|
||||
$lang->system->errors->failGetOssAccount = '获取对象存储账号失败';
|
||||
$lang->system->errors->failToInstallSMTP = '安装SMTP失败';
|
||||
$lang->system->errors->failToUninstallSMTP = '卸载SMTP失败';
|
||||
$lang->system->errors->failToUpdateSMTP = '更新SMTP失败';
|
||||
$lang->system->errors->verifySMTPFailed = '校验SMTP失败';
|
||||
$lang->system->errors->notFoundSMTPApp = '找不到SMTP代理应用';
|
||||
$lang->system->errors->notFoundSMTPService = '找不到SMTP代理服务';
|
||||
$lang->system->errors->domainIsRequired = '必须填写域名';
|
||||
$lang->system->errors->invalidDomain = '无效的域名或格式错误。域名只允许小写字母、数字、点(.)和中横线(-)';
|
||||
$lang->system->errors->failToUpdateDomain = '更新域名失败';
|
||||
$lang->system->errors->forbiddenOriginalDomain = '不能修改为平台默认域名';
|
||||
$lang->system->errors->newDomainIsSameWithOld = '新域名不能与原域名相同';
|
||||
$lang->system->errors->failedToConfigSLB = '配置负载均衡失败';
|
||||
$lang->system->errors->wrongIPRange = 'IP段格式错误,请参照示例格式,' . $lang->system->SLB->ipPoolExample;
|
||||
$lang->system->errors->ippoolRequired = 'IP段不能为空';
|
||||
$lang->system->errors->failedToInstallSLBComponent = '安装负载均衡组件失败';
|
||||
$lang->system->errors->tryReinstallSLB = '安装负载均衡组件超时,请重试。';
|
||||
|
||||
$lang->system->backup = new stdclass();
|
||||
$lang->system->backup->common = '系统备份';
|
||||
$lang->system->backup->shortCommon = '备份';
|
||||
$lang->system->backup->systemInfo = '系统信息';
|
||||
$lang->system->backup->index = '备份首页';
|
||||
$lang->system->backup->history = '备份记录';
|
||||
$lang->system->backup->delete = '删除备份';
|
||||
$lang->system->backup->backup = '备份';
|
||||
$lang->system->backup->restore = '回滚';
|
||||
$lang->system->backup->change = '保留时间';
|
||||
$lang->system->backup->changeAB = '修改';
|
||||
$lang->system->backup->rmPHPHeader = '去除安全设置';
|
||||
$lang->system->backup->setting = '设置';
|
||||
$lang->system->backup->backupPerson = '备份人';
|
||||
$lang->system->backup->type = '备份类型';
|
||||
|
||||
$lang->system->backup->settingAction = '备份设置';
|
||||
|
||||
$lang->system->backup->name = '名称';
|
||||
$lang->system->backup->currentVersion = '当前版本';
|
||||
$lang->system->backup->latestVersion = '最新版本';
|
||||
|
||||
$lang->system->backup->time = '备份时间';
|
||||
$lang->system->backup->files = '备份文件';
|
||||
$lang->system->backup->allCount = '总文件数';
|
||||
$lang->system->backup->count = '备份文件数';
|
||||
$lang->system->backup->size = '大小';
|
||||
$lang->system->backup->status = '状态';
|
||||
$lang->system->backup->running = '运行中';
|
||||
$lang->system->backup->done = '完成';
|
||||
|
||||
$lang->system->backup->backupName = '备份名称:';
|
||||
$lang->system->backup->backupSql = '备份数据库:';
|
||||
$lang->system->backup->backupFile = '备份附件:';
|
||||
$lang->system->backup->restoreImage = '回滚平台镜像:';
|
||||
$lang->system->backup->restoreSQL = '回滚数据库:';
|
||||
$lang->system->backup->restoreFile = '回滚附件:';
|
||||
$lang->system->backup->checkService = '检查服务:';
|
||||
|
||||
$lang->system->backup->upgrade = '升级';
|
||||
$lang->system->backup->rollback = '回滚';
|
||||
$lang->system->backup->restart = '重启';
|
||||
$lang->system->backup->delete = '删除';
|
||||
|
||||
$lang->system->backup->statusList['success'] = '成功';
|
||||
$lang->system->backup->statusList['fail'] = '失败';
|
||||
|
||||
$lang->system->backup->restoreProgress['doing'] = '进行中';
|
||||
$lang->system->backup->restoreProgress['done'] = '完成';
|
||||
|
||||
$lang->system->backup->typeList['manual'] = '手动备份';
|
||||
$lang->system->backup->typeList['upgrade'] = '升级前自动备份';
|
||||
$lang->system->backup->typeList['restore'] = '回滚前自动备份';
|
||||
|
||||
$lang->system->backup->settingDir = '备份目录';
|
||||
$lang->system->backup->settingList['nofile'] = '不备份附件和代码';
|
||||
$lang->system->backup->settingList['nosafe'] = '不需要防下载PHP文件头';
|
||||
|
||||
$lang->system->backup->waitting = '<span id="backupType"></span>正在进行中,请稍候...';
|
||||
$lang->system->backup->progressSQL = '备份中,已备份%s';
|
||||
$lang->system->backup->progressAttach = '备份中,共有%s个文件,已经备份%s个';
|
||||
$lang->system->backup->progressCode = '代码备份中,共有%s个文件,已经备份%s个';
|
||||
$lang->system->backup->confirmDelete = '是否删除该备份?';
|
||||
$lang->system->backup->confirmRestore = '请确认是否回滚?';
|
||||
$lang->system->backup->holdDays = '备份保留最近 %s 天';
|
||||
$lang->system->backup->copiedFail = '复制失败的文件:';
|
||||
$lang->system->backup->restoreTip = '还原功能只还原数据库。';
|
||||
$lang->system->backup->versionInfo = '点击查看新版本介绍';
|
||||
$lang->system->backup->confirmUpgrade = '请确认是否升级渠成平台?';
|
||||
$lang->system->backup->upgrading = '升级中';
|
||||
$lang->system->backup->backupTitle = '正在备份 渠成平台...';
|
||||
$lang->system->backup->restoreTitle = '正在回滚 渠成平台...';
|
||||
$lang->system->backup->backingUp = '进行中';
|
||||
$lang->system->backup->restoring = '进行中';
|
||||
|
||||
$lang->system->backup->success = new stdclass();
|
||||
$lang->system->backup->success->backup = '备份成功!';
|
||||
$lang->system->backup->success->restore = '还原成功!';
|
||||
$lang->system->backup->success->upgrade = '升级成功!';
|
||||
$lang->system->backup->success->degrade = '降级成功!';
|
||||
|
||||
$lang->system->backup->error = new stdclass();
|
||||
$lang->system->backup->error->noCreateDir = '备份目录不存在,也无法创建该目录';
|
||||
$lang->system->backup->error->noWritable = "<code>%s</code> 不可写!请检查该目录权限,否则无法备份。";
|
||||
$lang->system->backup->error->noDelete = "文件 %s 无法删除,修改权限或手工删除。";
|
||||
$lang->system->backup->error->restoreSQL = "数据库还原失败,错误:%s";
|
||||
$lang->system->backup->error->restoreFile = "附件还原失败,错误:%s";
|
||||
$lang->system->backup->error->backupFile = "附件备份失败,错误:%s";
|
||||
$lang->system->backup->error->backupCode = "代码备份失败,错误:%s";
|
||||
|
||||
$lang->system->backup->error->upgradeFail = "升级失败!";
|
||||
$lang->system->backup->error->upgradeOvertime = "升级超时!";
|
||||
$lang->system->backup->error->degradeFail = "降级失败!";
|
||||
$lang->system->backup->error->beenLatestVersion = "已经是最新版,无需升级!";
|
||||
$lang->system->backup->error->requireVersion = "必须上传版本号!";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The browsebackup view file of system module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Zeng Gang<zenggang@easycorp.ltd>
|
||||
* @package system
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
foreach($backups as $backup)
|
||||
{
|
||||
$backup->backupPerson = isset($backup->sqlSummary['account']) ? $backup->sqlSummary['account'] : '';
|
||||
if(empty($backup->sqlSummary['backupType'])) $backup->sqlSummary['backupType'] = '';
|
||||
$backup->type = $backup->sqlSummary['backupType'];
|
||||
}
|
||||
$backups = initTableData($backups, $config->system->dtable->backup->fieldList, $this->system);
|
||||
|
||||
panel
|
||||
(
|
||||
set::size('lg'),
|
||||
set::title($lang->system->backup->systemInfo),
|
||||
div
|
||||
(
|
||||
setStyle('width', '66.6%'),
|
||||
dtable
|
||||
(
|
||||
set::cols($config->system->dtable->backup->fieldList),
|
||||
set::data($backups),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
render();
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The dblist view file of system module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Zeng Gang<zenggang@easycorp.ltd>
|
||||
* @package system
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
$config->system->dtable->dbList->fieldList['actions']['list']['management']['url'] = 'javascript:manageDb("{name}", "{db_type}", "{namespace}")';
|
||||
|
||||
$dbList = initTableData($dbList, $config->system->dtable->dbList->fieldList, $this->system);
|
||||
|
||||
panel
|
||||
(
|
||||
set::size('lg'),
|
||||
set::title($lang->system->dbList),
|
||||
div
|
||||
(
|
||||
setStyle('width', '66.6%'),
|
||||
dtable
|
||||
(
|
||||
set::cols($config->system->dtable->dbList->fieldList),
|
||||
set::data($dbList),
|
||||
set::onRenderCell(jsRaw('window.renderDbList'))
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
render();
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The domainview view file of system module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Zeng Gang<zenggang@easycorp.ltd>
|
||||
* @package system
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
$expiredDate = !empty($cert) ? zget($cert, 'expiredDate', '') : '';
|
||||
|
||||
panel
|
||||
(
|
||||
set::size('lg'),
|
||||
set::title($lang->system->domain->common),
|
||||
to::headingActions
|
||||
(
|
||||
btn
|
||||
(
|
||||
setClass('primary'),
|
||||
$lang->system->domain->editDomain,
|
||||
set::url($this->createLink('system', 'editDomain')),
|
||||
),
|
||||
),
|
||||
tableData
|
||||
(
|
||||
item
|
||||
(
|
||||
set::name($lang->system->domain->currentDomain),
|
||||
zget($domainSettings, 'customDomain', ''),
|
||||
),
|
||||
item
|
||||
(
|
||||
set::name($lang->system->domain->expiredDate),
|
||||
$expiredDate
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
render();
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The editdomain view file of system module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Zeng Gang<zenggang@easycorp.ltd>
|
||||
* @package system
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::title($lang->system->domain->config),
|
||||
set::id('domainForm'),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->system->domain->oldDomain),
|
||||
set::control('static'),
|
||||
set::value($this->loadModel('cne')->sysDomain()),
|
||||
h::span
|
||||
(
|
||||
setClass('tips-git leading-8 ml-2 text-danger'),
|
||||
$lang->system->domain->notReuseOldDomain,
|
||||
),
|
||||
),
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->system->domain->newDomain),
|
||||
set::name('customDomain'),
|
||||
set::value(zget($domainSettings, 'customDomain', '')),
|
||||
set::required(true),
|
||||
h::span
|
||||
(
|
||||
setClass('tips-git leading-8 ml-2'),
|
||||
$lang->system->domain->setDNS,
|
||||
),
|
||||
h::a
|
||||
(
|
||||
setClass('leading-8'),
|
||||
set::target('_blank'),
|
||||
set::href('https://www.qucheng.com/book/Installation-manual/47.html'),
|
||||
$lang->system->domain->dnsHelperLink
|
||||
),
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label(''),
|
||||
set::name('https[]'),
|
||||
set::control(array('type' => 'checkbox', 'text' => $lang->system->domain->uploadCert, 'value' => 'true')),
|
||||
on::change('onHttpsChange'),
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
setClass('cert hidden'),
|
||||
set::label($lang->system->certPem),
|
||||
set::name('certPem'),
|
||||
set::control('textarea'),
|
||||
set::value(zget($domainSettings, 'certPem', '')),
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
setClass('cert hidden'),
|
||||
set::label($lang->system->certKey),
|
||||
set::name('certPem'),
|
||||
set::control('textarea'),
|
||||
set::value(zget($domainSettings, 'certKey', '')),
|
||||
),
|
||||
formRow
|
||||
(
|
||||
formGroup
|
||||
(
|
||||
setClass('cert hidden'),
|
||||
set::label(''),
|
||||
btn
|
||||
(
|
||||
$lang->system->verify,
|
||||
set::id('validateCertBtn'),
|
||||
on::click('checkCert'),
|
||||
),
|
||||
h::span
|
||||
(
|
||||
setClass('tips-git leading-8 ml-2'),
|
||||
set::id('validateMsg'),
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
render();
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The index view file of system module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Zeng Gang<zenggang@easycorp.ltd>
|
||||
* @package system
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
|
||||
render();
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The ossview view file of system module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Zeng Gang<zenggang@easycorp.ltd>
|
||||
* @package system
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
|
||||
jsVar('copySuccess', $lang->system->copySuccess);
|
||||
|
||||
$apiURL = !empty($ossDomain->extra_hosts) ? zget($ossDomain->extra_hosts, 'api', '') : '';
|
||||
|
||||
panel
|
||||
(
|
||||
set::size('lg'),
|
||||
set::title($lang->system->oss->common),
|
||||
tableData
|
||||
(
|
||||
item
|
||||
(
|
||||
set::name($lang->system->oss->appURL),
|
||||
a
|
||||
(
|
||||
set::id('ossVisitUrl'),
|
||||
set::target('_blank'),
|
||||
$lang->system->visit,
|
||||
),
|
||||
),
|
||||
item
|
||||
(
|
||||
set::name($lang->system->oss->user),
|
||||
span
|
||||
(
|
||||
set::id('ossAdmin'),
|
||||
),
|
||||
),
|
||||
item
|
||||
(
|
||||
set::name($lang->system->oss->password),
|
||||
h::input
|
||||
(
|
||||
setClass('hidden'),
|
||||
set::id('ossPassword'),
|
||||
set::value($ossAccount->password),
|
||||
),
|
||||
btn
|
||||
(
|
||||
$lang->system->copy,
|
||||
on::click('copyPassBtn'),
|
||||
)
|
||||
),
|
||||
item
|
||||
(
|
||||
set::name($lang->system->oss->apiURL),
|
||||
$apiURL,
|
||||
),
|
||||
item
|
||||
(
|
||||
set::name($lang->system->oss->accessKey),
|
||||
$ossAccount->username,
|
||||
),
|
||||
item
|
||||
(
|
||||
set::name($lang->system->oss->secretKey),
|
||||
h::input
|
||||
(
|
||||
setClass('hidden'),
|
||||
set::id('ossSK'),
|
||||
set::value($ossAccount->password),
|
||||
),
|
||||
btn
|
||||
(
|
||||
$lang->system->copy,
|
||||
on::click('copySK'),
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
render();
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* The html template file of index method of my module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QuCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package my
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id="mainContent" class="main-row">
|
||||
<div class="main-col col-12">
|
||||
<div class="panel"><?php include 'overviewblock.html.php';?></div>
|
||||
<div class="panel"><?php include 'instancesblock.html.php';?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* The adminer view file of system module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i> " . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->dbList;?></h2>
|
||||
</div>
|
||||
<table class='table table-bordered text-center'>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->dbName;?></th>
|
||||
<th><?php echo $lang->system->dbType;?></th>
|
||||
<th><?php echo $lang->system->dbStatus;?></th>
|
||||
<th><?php echo $lang->system->action?></th>
|
||||
</tr>
|
||||
<?php foreach($dbList as $db):?>
|
||||
<tr>
|
||||
<td><?php echo $db->name;?></td>
|
||||
<td><?php echo $db->db_type?></td>
|
||||
<td><?php echo zget($lang->instance->statusList, $db->status);?></td>
|
||||
<td><?php $this->system->printDBAction($db);?></td>
|
||||
<tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* The install domain view file of system module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->domain->common;?></h2>
|
||||
<div class='smtp-button-group btn-toolbar pull-right'>
|
||||
<?php echo html::a($this->inLink('editDomain'), $lang->system->domain->editDomain, '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->domain->currentDomain;?></th>
|
||||
<td><?php echo zget($domainSettings, 'customDomain', '');?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->domain->expiredDate;?></th>
|
||||
<td><?php echo zget($cert, 'expiredDate', '');?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit domain view file of system module of chandao.net.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php $ldapLinked = false;?>
|
||||
<?php js::set('errors', $lang->system->errors);?>
|
||||
<?php js::set('notices', $lang->system->notices);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->domain->config;?></h2>
|
||||
</div>
|
||||
<form id='domainForm' class='cell not-watch load-indicator main-form form-ajax'>
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->domain->oldDomain;?></th>
|
||||
<td><?php echo $this->loadModel('cne')->sysDomain();?> <span class='with-padding text-danger'><?php echo $lang->system->domain->notReuseOldDomain;?></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='new-domain-label'><?php echo $lang->system->domain->newDomain;?></th>
|
||||
<td class='required'>
|
||||
<?php echo html::input('customDomain', zget($domainSettings, 'customDomain', ''), "class='form-control' placeholder=''");?>
|
||||
<div class='with-padding'>
|
||||
<span><?php echo $lang->system->domain->setDNS;?></span>
|
||||
<?php echo html::a('https://www.qucheng.com/book/Installation-manual/47.html', $lang->system->domain->dnsHelperLink, '_blank', "class='text-primary'");?>
|
||||
</div>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<h4>
|
||||
<?php $domainUsed = false;?>
|
||||
<?php echo html::checkbox('https', array('true' => $lang->system->domain->uploadCert), $domainSettings->https, ($domainUsed ? "onclick='return false;'" : ''));?>
|
||||
</h4>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table id='cert-box' class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->certPem;?></th>
|
||||
<td class='required' colspan='2'><?php echo html::textarea('certPem', zget($domainSettings, 'certPem', ''), "class='form-control' rows='5'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->certKey;?></th>
|
||||
<td class='required' colspan='2'><?php echo html::textarea('certKey', zget($domainSettings, 'certKey', ''), "class='form-control' rows='5'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan='2' >
|
||||
<?php echo html::commonButton($lang->system->verify, "id='validateCertBtn'");?>
|
||||
<span class='with-padding' id='validateMsg'></span>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='text-center'><?php echo html::commonButton($lang->save, "id='submitBtn'", "btn btn-primary");?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="waiting" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog w-400px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h4><?php echo $lang->system->domain->updateInstancesDomain;?></h4>
|
||||
<div>
|
||||
<span id='message'><?php echo $lang->system->domain->updating;?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit LDAP view file of system module of chandao.net.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php $ldapLinked = $this->loadModel('instance')->countLDAP();?>
|
||||
<?php js::set('errors', $lang->system->errors);?>
|
||||
<?php js::set('notices', $lang->system->notices);?>
|
||||
<?php js::set('disableEdit', ($ldapLinked ? true : false));?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->ldapManagement;?></h2>
|
||||
</div>
|
||||
<?php include('./ldapform.html.php');?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit SLB view file of system module of chandao.net.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php $ldapLinked = false;?>
|
||||
<?php js::set('errors', $lang->system->errors);?>
|
||||
<?php js::set('notices', $lang->system->notices);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->SLB->config;?></h2>
|
||||
</div>
|
||||
<form id='SLBForm' class='cell not-watch main-form'>
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SLB->ipPool;?></th>
|
||||
<td class='required w-400px'>
|
||||
<?php echo html::input('ippool', zget($SLBSettings, 'ippool', ''), "class='form-control' placeholder='{$lang->system->SLB->ipPoolExample}'");?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='text-center'><?php echo html::commonButton($lang->save, "id='submitBtn'", 'btn btn-wide btn-primary');?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="waiting" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog w-400px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h4><?php echo $lang->system->SLB->installing;?></h4>
|
||||
<div>
|
||||
<span id='message'><?php echo $lang->system->SLB->leftSeconds;?></span>
|
||||
<span id='timer'></span>
|
||||
<span><?php echo $lang->system->SLB->second;?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit SMTP view file of system module of chandao.net.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php $smtpLinked = $this->loadModel('instance')->countSMTP();?>
|
||||
<?php js::set('errors', $lang->system->errors);?>
|
||||
<?php js::set('notices', $lang->system->notices);?>
|
||||
<?php js::set('disableEdit', ($smtpLinked ? true : false));?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->SMTP->editSMTP;?></h2>
|
||||
</div>
|
||||
<?php include('./smtpform.html.php');?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* The index view file of system module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col'>
|
||||
<div class='row plug-container'>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('system', 'dashboard');?>'>
|
||||
<span class='logo'><i class='icon icon-info-dashboard'></i></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->dashboard;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('backup', 'index');?>'>
|
||||
<span class='logo'><i class='icon icon-info-sign'></i></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->systemInfo;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('system', 'dblist');?>'>
|
||||
<span class='logo'><img class='logo' src='/theme/default/images/main/db_logo.svg' /></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->dbManagement;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('system', 'installLDAP');?>'>
|
||||
<span class='logo'><img src='/theme/default/images/main/ldap_logo.jpg' /></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->ldapManagement;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('system', 'ossview');?>'>
|
||||
<span class='logo'><img src='/theme/default/images/main/minio_logo.svg' /></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->oss->common;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('system', 'installSMTP');?>'>
|
||||
<span class='logo'><i class='icon icon-envelope-o'></i></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->SMTP->common;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('system', 'configDomain');?>'>
|
||||
<span class='logo'><i class='icon icon-globe'></i></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->domain->common;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('system', 'configSLB');?>'>
|
||||
<span class='logo'><i class='icon icon-treemap'></i></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->SLB->common;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?php if($config->edition == 'biz'):?>
|
||||
<div class='text-center col-xs-6 col-sm-3 col-md-2 col-lg-2'>
|
||||
<a class='cell' href='<?php echo helper::createLink('system', 'license');?>'>
|
||||
<span class='logo'><img src='/theme/default/images/main/license.svg' /></span><br/>
|
||||
<span class='plug-title text-center'><?php echo $lang->system->license;?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit LDAP view file of system module of chandao.net.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php $ldapLinked = $this->loadModel('instance')->countLDAP();?>
|
||||
<?php js::set('errors', $lang->system->errors);?>
|
||||
<?php js::set('notices', $lang->system->notices);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->installLDAP;?></h2>
|
||||
</div>
|
||||
<?php include('./ldapform.html.php');?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit SMTP view file of system module of chandao.net.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php $ldapLinked = $this->loadModel('instance')->countSMTP();?>
|
||||
<?php js::set('errors', $lang->system->errors);?>
|
||||
<?php js::set('notices', $lang->system->notices);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->SMTP->install;?></h2>
|
||||
</div>
|
||||
<?php include('./smtpform.html.php');?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php $this->app->loadLang('instance');?>
|
||||
<?php js::set('instanceIdList', array_column($instances, 'id'));?>
|
||||
<div class="cell main-table instance-container">
|
||||
<h3 class='text-center'><?php echo $lang->instance->runningService;?></h3>
|
||||
<?php if(empty($instances)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->instance->empty;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->name;?></th>
|
||||
<th><?php echo $lang->instance->version;?></th>
|
||||
<th class='w-180px'><?php echo $lang->instance->status?></th>
|
||||
<th><?php echo $lang->instance->cpu;?></th>
|
||||
<th><?php echo $lang->instance->mem;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($instances as $instance):?>
|
||||
<tr>
|
||||
<td><?php echo html::a($this->createLink('instance', 'view', "id=$instance->id"), $instance->name);?></td>
|
||||
<td><?php echo $instance->appVersion;?></td>
|
||||
<td class="instance-status" instance-id="<?php echo $instance->id;?>" data-status="<?php echo $instance->status;?>">
|
||||
<?php echo $this->instance->printStatus($instance, false);?>
|
||||
<?php if(commonModel::isDemoAccount()):?>
|
||||
<span class="count-down label label-outline label-danger" data-created-at="<?php echo strtotime($instance->createdAt);?>">
|
||||
<span><?php echo $lang->instance->leftTime;?></span>
|
||||
<span class='left-time'>00:00</span>
|
||||
</span>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<?php $metrics= zget($instancesMetrics, $instance->id);?>
|
||||
<td><?php $this->instance->printCpuUsage($instance, $metrics->cpu);?></td>
|
||||
<td><?php $this->instance->printMemUsage($instance, $metrics->memory);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-footer"><?php echo $pager->show('right', 'pagerjs');?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
@@ -0,0 +1,98 @@
|
||||
<form id='LDAPForm' class='cell not-watch load-indicator main-form form-ajax'>
|
||||
<h4>
|
||||
<?php $enableLDAP = $this->system->hasSystemLDAP();?>
|
||||
<?php echo html::checkbox('enableLDAP', array('true' => $lang->system->LDAP->ldapEnabled), $enableLDAP ? 'true' : '', (($ldapLinked or $activeLDAP) ? "onclick='return false;'" : '')); ?>
|
||||
</h4>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapSource;?></th>
|
||||
<td class='required w-300px'><?php echo html::select('source', $lang->system->ldapTypeList, $activeLDAP,"class='form-control'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table id='quchengLDAP' class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapUsername?></th>
|
||||
<td><?php echo $ldapApp->account->username;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapRoot;?></th>
|
||||
<td><?php echo 'dc=quickon,dc=org';?></td>
|
||||
<tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id='extraLDAP'>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->host;?></th>
|
||||
<td class='required w-300px'><?php echo html::input('extra[host]', zget($ldapSettings, 'host', ''), "class='form-control required' placeholder='192.168.1.1'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->port;?></th>
|
||||
<td class='required'><?php echo html::input('extra[port]', zget($ldapSettings, 'port', ''), "class='form-control' placeholder='389'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapUsername;?></th>
|
||||
<td class='required'><?php echo html::input('extra[bindDN]', zget($ldapSettings, 'bindDN', ''), "class='form-control' placeholder='admin'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->password;?></th>
|
||||
<td class='required'><?php echo html::input('extra[bindPass]', zget($ldapSettings, 'bindPass', ''), "class='form-control' placeholder='******'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapRoot;?></th>
|
||||
<td class='required'><?php echo html::input('extra[baseDN]', zget($ldapSettings, 'baseDN', ''), "class='form-control' placeholder='dc=quickon,dc=org'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='advanced'><?php echo html::a("#advanced-settings", $lang->system->LDAP->ldapAdvance . "<i class='icon icon-chevron-double-down'></i>", '', "data-toggle='collapse'");?></div>
|
||||
<table class="collapse table table-form" id="advanced-settings">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->filterUser;?></th>
|
||||
<td class='w-300px'><?php echo html::input('extra[filter]', zget($ldapSettings, 'filter', '&(objectClass=posixAccount)(uid=%s)'), "class='form-control' placeholder='&(objectClass=posixAccount)(cn=%s)'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->email;?></th>
|
||||
<td class='w-300px'><?php echo html::input('extra[attrEmail]', zget($ldapSettings, 'attrEmail', 'mail'), "class='form-control' placeholder='mail'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->extraAccount;?></th>
|
||||
<td class='w-300px'><?php echo html::input('extra[attrUser]', zget($ldapSettings, 'attrUser', 'uid'), "class='form-control' placeholder='uid'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class='w-100px text-right'><?php echo html::commonButton($lang->system->verify, "id='testConnectBtn'");?></td>
|
||||
<td class='w-300px text-left'><span id='connectResult'></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class='text-center form-actions'><?php echo html::commonButton($activeLDAP ? $lang->system->LDAP->ldapUpdate : $lang->system->LDAP->ldapInstall, "id='submitBtn'", "btn btn-primary btn-wide");?></div>
|
||||
</form>
|
||||
<div class="modal fade" id="waiting" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog w-400px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h4><?php echo $lang->system->LDAP->updateLDAP;?></h4>
|
||||
<div><span id='message'></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/**
|
||||
* The install ldap view file of system module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php js::set('instanceNotices', $lang->instance->notices);?>
|
||||
<?php js::set('instanceIdList', array($instanceID));?>
|
||||
<?php js::set('copySuccess', $lang->system->copySuccess);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->LDAP->info;?></h2>
|
||||
<div class='ldap-button-group btn-toolbar pull-right'>
|
||||
<?php $this->system->printEditLDAPBtn();?>
|
||||
<?php if($activeLDAP == 'qucheng'):?>
|
||||
<?php $this->system->printLDAPButtons($ldapInstance);?>
|
||||
<?php else:?>
|
||||
<?php echo html::a('#', $lang->system->visit, '', "disabled class='btn label label-outline label-primary label-lg'");?>
|
||||
<?php echo html::a('#', $lang->system->close, '', "disabled class='btn label label-outline label-primary label-lg'");?>
|
||||
<?php endif?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($activeLDAP == 'qucheng'):?>
|
||||
<table class='table table-form instance-status' instance-id='<?php echo $ldapInstance->id;?>' data-status='<?php echo $ldapInstance->status;?>'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapSource;?></th>
|
||||
<td><?php echo zget($lang->system->ldapTypeList, $activeLDAP, '');?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapUsername;?></th>
|
||||
<td><?php echo zget($ldapSettings->auth, 'username', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapRoot;?></th>
|
||||
<td><?php echo zget($ldapSettings->auth, 'root', '');?></td>
|
||||
<tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->status;?></th>
|
||||
<td><span><?php echo zget($lang->instance->statusList, $ldapInstance->status, '');?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php elseif($activeLDAP == 'extra'):?>
|
||||
<table class='table table-form instance-status'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapSource;?></th>
|
||||
<td><?php echo zget($lang->system->ldapTypeList, $activeLDAP, '');?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->host;?></th>
|
||||
<td><?php echo zget($ldapSettings, 'host', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->port;?></th>
|
||||
<td><?php echo zget($ldapSettings, 'port', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapUsername;?></th>
|
||||
<td><?php echo zget($ldapSettings, 'bindDN', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->password;?></th>
|
||||
<td>
|
||||
<div class='w-250px input-group'>
|
||||
<?php echo html::password('ldap_password', zget($ldapSettings, 'bindPass', ''), "readonly class='form-control'");?>
|
||||
<span class='input-group-addon'><button id='ldapPassBtn'><i class='icon icon-eye-off'></i></button></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->ldapRoot;?></th>
|
||||
<td><?php echo zget($ldapSettings, 'baseDN', '');?></td>
|
||||
</tr>
|
||||
<tr><td></td></tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<th class='text-left'><?php echo $lang->system->LDAP->ldapAdvance;?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->filterUser;?></th>
|
||||
<td><?php echo zget($ldapSettings, 'filter', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->email;?></th>
|
||||
<td><?php echo zget($ldapSettings, 'attrEmail', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->LDAP->extraAccount;?></th>
|
||||
<td><?php echo zget($ldapSettings, 'attrUser', '');?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="ldapAccountModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog w-400px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
|
||||
<h2 class="text-center"><?php echo $lang->system->LDAP->accountInfo;?></h2>
|
||||
<div><?php echo $lang->system->LDAP->account;?>:<span id='ldapAccount'></span></div>
|
||||
<div>
|
||||
<?php echo $lang->system->LDAP->password;?>:<input id='ldapPassword' readonly />
|
||||
<?php echo html::commonButton($lang->system->copy, "id='copyPassBtn'", "btn bnt-link");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<?php echo html::commonButton($lang->cancel, "data-dismiss='modal'", 'btn btn-wide');?>
|
||||
<?php echo html::a('#', $lang->system->visit, '_blank', "id='ldapVisitUrl' class='btn btn-primary btn-wide'");?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* The install ldap view file of system module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php js::set('copySuccess', $lang->system->copySuccess);?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->oss->common;?></h2>
|
||||
<div class='ldap-button-group btn-toolbar pull-right'>
|
||||
<?php echo html::commonButton($lang->system->oss->manage, "id='ossManage'", "btn label label-outline label-primary label-lg");?>
|
||||
</div>
|
||||
</div>
|
||||
<table class='table table-form instance-status'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->oss->apiURL;?></th>
|
||||
<td><?php echo zget($ossDomain->extra_hosts, 'api', '');?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->oss->accessKey;?></th>
|
||||
<td><?php echo $ossAccount->username;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->oss->secretKey;?></th>
|
||||
<td>
|
||||
<input id='ossSK' class='hidden' value='<?php echo $ossAccount->password;?>' />
|
||||
<?php echo html::commonButton($lang->system->copy, "id='copySKBtn'");?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="ossAccountModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog w-400px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
|
||||
<h2 class="text-center"><?php echo $lang->system->accountInfo;?></h2>
|
||||
<p><?php echo $lang->system->oss->user;?>:<span id='ossAdmin'></span></p>
|
||||
<p>
|
||||
<?php echo $lang->system->oss->password;?>:<input id='ossPassword' class='hidden' readonly />
|
||||
<?php echo html::commonButton($lang->system->copy, "id='copyPassBtn'", 'btn btn-link');?>
|
||||
</p>
|
||||
<div class="text-center">
|
||||
<?php echo html::commonButton($lang->cancel, "data-dismiss='modal'", 'btn btn-wide');?>
|
||||
<?php echo html::a('#', $lang->system->visit, '_blank', "id='ossVisitUrl' class='btn btn-primary btn-wide'");?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php $this->app->loadLang('cne');?>
|
||||
<div class="cell overview-container">
|
||||
<div class="table-row">
|
||||
<div class="col col-left text-center">
|
||||
<h3 class=""><?php echo $lang->system->cneStatus;?></h3>
|
||||
<div><?php echo zget($this->lang->CNE->statusIcons, $cneMetrics->status, $this->lang->CNE->statusIcons['unknown']);?></div>
|
||||
<div class='cne-status-text'><?php echo zget($lang->CNE->statusList, $cneMetrics->status, $lang->CNE->statusList['unknown']);?></div>
|
||||
</div>
|
||||
<div class="col col-right">
|
||||
<h3 class="text-center"><?php echo $lang->system->cneStatistic;?></h3>
|
||||
<div class="row tiles">
|
||||
<div class="col tile">
|
||||
<div class="tile-title"><?php echo $lang->system->nodeQuantity;?></div>
|
||||
<div class="tile-amount"><?php echo $cneMetrics->node_count;?></div>
|
||||
</div>
|
||||
<div class="col tile">
|
||||
<div class="tile-title"><?php echo $lang->system->serviceQuantity;?></div>
|
||||
<div class="tile-amount"><?php echo $this->instance->totalServices();?></div>
|
||||
</div>
|
||||
<div class="col tile">
|
||||
<div class="tile-title"><?php echo $lang->system->cpuUsage;?></div>
|
||||
<?php $this->cne->printCpuUsage($cneMetrics->metrics->cpu);?>
|
||||
</div>
|
||||
<div class="col tile">
|
||||
<div class="tile-title"><?php echo $lang->system->memUsage;?></div>
|
||||
<?php $this->cne->printMemUsage($cneMetrics->metrics->memory);?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* The install domain view file of system module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->SLB->common;?></h2>
|
||||
<div class='smtp-button-group btn-toolbar pull-right'>
|
||||
<?php echo html::a($this->inLink('editSLB'), $lang->system->SLB->edit, '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SLB->ipPool;?></th>
|
||||
<td><?php echo zget($slbSettings, 'ippool', '');?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,36 @@
|
||||
<form id='smtpForm' class='cell load-indicator main-form form-ajax'>
|
||||
<h4>
|
||||
<?php $enableSMTP= $this->system->smtpSnippetName();?>
|
||||
<?php echo html::checkbox('enableSMTP', array('true' => $lang->system->SMTP->enabled), $enableSMTP ? 'true' : '', (($smtpLinked or $activeSMTP) ? "onclick='return false;'" : ''));?>
|
||||
</h4>
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SMTP->account;?></th>
|
||||
<td class='required w-300px'><?php echo html::input('user', zget($smtpSettings, 'SMTP_USER', ''), "class='form-control' placeholder='example@smtp.com'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SMTP->password;?></th>
|
||||
<td class='required'><?php echo html::input('pass', zget($smtpSettings, 'SMTP_PASS', ''), "class='form-control' placeholder=''");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SMTP->host;?></th>
|
||||
<td class='required'><?php echo html::input('host', zget($smtpSettings, 'SMTP_HOST', ''), "class='form-control' placeholder=''");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SMTP->port;?></th>
|
||||
<td class='required'><?php echo html::input('port', zget($smtpSettings, 'SMTP_PORT', ''), "class='form-control' placeholder='25'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='w-100px text-right'><?php echo html::commonButton($lang->system->verify, "id='verifyAccountBtn'");?></td>
|
||||
<td class='w-300px text-left'><span id='verifyResult'></span></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='text-center form-actions'><?php echo html::submitButton($activeSMTP ? $lang->system->SMTP->update : $lang->system->SMTP->install);?></div>
|
||||
</form>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* The install SMTP view file of system module of QuCheng.
|
||||
*
|
||||
* @copyright Copyright 2021-2022 北京渠成软件有限公司(BeiJing QurCheng Software Co,LTD, www.qucheng.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Jianhua Wang <wangjianhua@easycorp.ltd>
|
||||
* @package system
|
||||
* @version $Id$
|
||||
* @link https://www.qucheng.com
|
||||
*/
|
||||
?>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/header.html.php';?>
|
||||
<?php js::set('instanceNotices', $lang->instance->notices);?>
|
||||
<?php js::set('instanceIdList', array($smtpInstance->id));?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a($this->createLink('system', 'index'), "<i class='icon icon-back icon-sm'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->system->SMTP->common;?></h2>
|
||||
<div class='smtp-button-group btn-toolbar pull-right'>
|
||||
<?php $this->system->printSMTPButtons($smtpInstance);?>
|
||||
</div>
|
||||
</div>
|
||||
<table class='table table-form instance-status' instance-id='<?php echo $smtpInstance->id;?>' data-status='<?php echo $smtpInstance->status;?>'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SMTP->account;?></th>
|
||||
<td><?php echo zget($smtpSettings, 'SMTP_USER', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SMTP->password;?></th>
|
||||
<td>
|
||||
<div class='w-250px input-group'>
|
||||
<?php echo html::password('smtp_password', zget($smtpSettings, 'SMTP_PASS', ''), "readonly class='form-control'");?>
|
||||
<span class='input-group-addon'><button id='smtpPassBtn'><i class='icon icon-eye-off'></i></button></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SMTP->host;?></th>
|
||||
<td><?php echo zget($smtpSettings, 'SMTP_HOST', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->system->SMTP->port;?></th>
|
||||
<td><?php echo zget($smtpSettings, 'SMTP_PORT', '');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->instance->status;?></th>
|
||||
<td><span><?php echo zget($lang->instance->statusList, $smtpInstance->status, '');?></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $this->app->getModuleRoot() . '/common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,4 @@
|
||||
<svg width="23" height="22" viewBox="0 0 23 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="23" height="22" rx="4" fill="#2E7FFF"/>
|
||||
<path d="M15.067 7.00032C13.676 7 12.3788 7.68035 11.6177 8.80922C10.6185 7.32944 8.73546 6.66166 6.98732 7.16713C5.23917 7.67261 4.04102 9.2313 4.04102 11C4.04102 12.7687 5.23917 14.3274 6.98732 14.8329C8.73546 15.3383 10.6185 14.6706 11.6177 13.1908C12.6986 14.7907 14.7965 15.4245 16.6235 14.7033C18.4505 13.982 19.4949 12.1075 19.1157 10.2306C18.7364 8.35368 17.0396 6.99987 15.067 7.00032ZM10.1534 12.2589C9.57909 13.1112 8.49537 13.4964 7.48891 13.2059C6.48245 12.9154 5.79247 12.0183 5.79247 11.0001C5.79247 9.982 6.48245 9.08484 7.48891 8.79434C8.49537 8.50384 9.57909 8.88904 10.1534 9.74141L11.0054 11L10.1534 12.2589ZM15.067 13.3012C14.266 13.3015 13.5191 12.9093 13.0816 12.2589L12.2296 11L13.0816 9.74141C13.7029 8.82075 14.9096 8.45552 15.9607 8.86998C17.0119 9.28445 17.6132 10.3626 17.3954 11.4423C17.1776 12.5221 16.2018 13.3012 15.067 13.3012Z" fill="#FCFDFE"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
Reference in New Issue
Block a user