From 6582359c3f2a1ccaca4df5573822d1499fc50ca5 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 27 Dec 2022 16:51:55 +0800 Subject: [PATCH 1/4] * Code for task #81383. --- module/testcase/lang/zh-cn.php | 1 + module/testcase/view/create.html.php | 7 +++++++ module/zanode/control.php | 24 ++++++++++++++++++++++++ module/zanode/model.php | 1 + module/zanode/view/browse.html.php | 11 ++++++++++- 5 files changed, 43 insertions(+), 1 deletion(-) diff --git a/module/testcase/lang/zh-cn.php b/module/testcase/lang/zh-cn.php index 88abec2c18..835cedb468 100644 --- a/module/testcase/lang/zh-cn.php +++ b/module/testcase/lang/zh-cn.php @@ -152,6 +152,7 @@ $lang->testcase->stepChild = '子步骤'; $lang->testcase->viewAll = '查看所有'; $lang->testcase->importToLib = '导入用例库'; $lang->testcase->showScript = '查看自动化脚本'; +$lang->testcase->autoScript = '自动化脚本'; $lang->testcase->new = '新增'; diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 9ab58cce26..cc9ff90ab8 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -148,9 +148,16 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field) testcase->forceNotReview()):?> testcase->forceNotReview, '', "id='forceNotReview0'");?> +
+ testcase->showAutoCase, '', "id='autocase' title='{$lang->testcase->showAutoCase}'");?> +
+ + testcase->autoScript;?> + fetch('file', 'buildform', 'fileCount=1&percent=0.9&filesName=script');?> + testcase->precondition;?> diff --git a/module/zanode/control.php b/module/zanode/control.php index b52a2da2d4..5825d472c4 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -150,6 +150,30 @@ class zanode extends control $this->display(); } + /** + * start Node. + * + * @param int $nodeID + * @access public + * @return void + */ + public function start($nodeID) + { + $this->handleNode($nodeID, 'boot'); + } + + /** + * shutdown Node. + * + * @param int $nodeID + * @access public + * @return void + */ + public function close($nodeID) + { + $this->handleNode($nodeID, 'destroy'); + } + /** * Suspend Node. * diff --git a/module/zanode/model.php b/module/zanode/model.php index 698ad85f74..f4f427684d 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -171,6 +171,7 @@ class zanodemodel extends model $result = commonModel::http($agnetUrl . $path, $param, array(), array("Authorization:$node->tokenSN")); $data = json_decode($result, true); + if(empty($data)) return $this->lang->zanode->notFoundAgent; if($data['code'] != 'success') return zget($this->lang->zanode->apiError, $data['code'], $data['msg']); diff --git a/module/zanode/view/browse.html.php b/module/zanode/view/browse.html.php index a9c2da8f41..f4b185128d 100644 --- a/module/zanode/view/browse.html.php +++ b/module/zanode/view/browse.html.php @@ -57,7 +57,7 @@ zanode->osName); ?> zanode->status); ?> zanode->hostName); ?> - actions ?> + actions ?> @@ -93,6 +93,15 @@ common::printLink('zanode', 'suspend', "zanodeID={$node->id}", " ", '', $suspendAttr); } + if($node->status == "shutoff") + { + common::printLink('zanode', 'start', "zanodeID={$node->id}", " ", '', "class='btn '"); + } + else + { + common::printLink('zanode', 'close', "zanodeID={$node->id}", " ", '', "class='btn '"); + } + common::printLink('zanode', 'reboot', "zanodeID={$node->id}", " ", '', $rebootAttr); common::printIcon('zanode', 'edit', "id={$node->id}", $node, 'list'); From 720d1d2799804a3ce05f22c5cb8ec52b113cf76f Mon Sep 17 00:00:00 2001 From: zhaoke Date: Wed, 28 Dec 2022 11:07:34 +0000 Subject: [PATCH 2/4] * Update detail . --- module/zanode/config.php | 5 +- module/zanode/control.php | 20 ++++-- module/zanode/css/view.css | 9 ++- module/zanode/js/view.js | 7 ++ module/zanode/lang/de.php | 12 +++- module/zanode/lang/en.php | 12 +++- module/zanode/lang/fr.php | 12 +++- module/zanode/lang/zh-cn.php | 11 +++- module/zanode/view/view.html.php | 107 ++++++++++++++++++++++--------- 9 files changed, 143 insertions(+), 52 deletions(-) create mode 100644 module/zanode/js/view.js diff --git a/module/zanode/config.php b/module/zanode/config.php index 92a58a2147..25512d7701 100644 --- a/module/zanode/config.php +++ b/module/zanode/config.php @@ -6,7 +6,10 @@ $config->zanode->create->requiredFields = 'name,host,image,cpu,memory,disk,osNam $config->zanode->edit->requiredFields = ''; $config->zanode->createimage->requiredFields = 'name'; -$config->zanode->defaultPort = '55001'; +$config->zanode->defaultPort = '55001'; +$config->zanode->defaultAccount = 'z'; +$config->zanode->defaultWinAccount = 'admin'; +$config->zanode->defaultPwd = 'CQdliYQn6tKkoFhP'; $config->zanode->initBash = 'curl -sSL https://pkg.qucheng.com/zenagent/zagent.sh | bash /dev/stdin -szvm -z%s'; diff --git a/module/zanode/control.php b/module/zanode/control.php index 5825d472c4..58bf60e9f1 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -68,8 +68,7 @@ class zanode extends control { $nodeID = $this->zanode->create(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - $initLink = $this->createLink('zanode', 'init', "nodeID=$nodeID"); - return print(""); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "id=$nodeID"))); } $this->view->title = $this->lang->zanode->create; @@ -121,10 +120,19 @@ class zanode extends control */ public function view($id) { - $this->view->title = $this->lang->zanode->view; - $this->view->zanode = $this->zanode->getNodeByID($id); - $this->view->actions = $this->loadModel('action')->getList('zanode', $id); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $node = $this->zanode->getNodeByID($id); + $vnc = $this->zanode->getVncUrl($node); + + /* Add action log. */ + // if(!empty($vnc->token)) $this->loadModel('action')->create('zanode', $id, 'getVNC'); + + $this->view->url = $node->ip . ":" . $node->hzap; + $this->view->host = !empty($vnc->hostIP) ? $vnc->hostIP:''; + $this->view->token = !empty($vnc->token) ? $vnc->token:''; + $this->view->title = $this->lang->zanode->view; + $this->view->zanode = $node; + $this->view->actions = $this->loadModel('action')->getList('zanode', $id); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->display(); } diff --git a/module/zanode/css/view.css b/module/zanode/css/view.css index 525953f674..6dc94b4809 100644 --- a/module/zanode/css/view.css +++ b/module/zanode/css/view.css @@ -3,4 +3,11 @@ .table.has-sort-head thead tr th a:after{line-height: 22px;} .table.has-sort-head thead tr th a:before{line-height: 22px;} .main-row-last{table-layout: auto;} -.zanode-mt-8{margin-top: 8px;} \ No newline at end of file +.zanode-mt-8{margin-top: 8px;} +.zanode-status-text{margin-left: 10px;font:small-caption;color:#838a9d;} +.zanode-status-text i{color:#18a6fd} +.status-notice{margin-top: 8px;margin-left: 18px;line-height: 28px;} +.status-notice a{color: #2463c7;} +.service-status{margin-top: 10px;} +.vnc-detail{min-height: 60vh;} +.vnc-mask{width: 100%;height:100%;background-color: rgba(0,0,0,0);position: absolute;} \ No newline at end of file diff --git a/module/zanode/js/view.js b/module/zanode/js/view.js new file mode 100644 index 0000000000..d6a3bb6119 --- /dev/null +++ b/module/zanode/js/view.js @@ -0,0 +1,7 @@ +var ifm = document.getElementById("vncIframe"); +ifm.height=$('.vnc-detail').css('height') +$('.vnc-mask').click(function(){ + window.open(vncLink) +}) +$('.vnc-mask').css('width', $('.vnc-detail').css('width')); +$('.vnc-mask').css('height', $('.vnc-detail').css('height')); \ No newline at end of file diff --git a/module/zanode/lang/de.php b/module/zanode/lang/de.php index 54b522642c..dc7ddccf41 100644 --- a/module/zanode/lang/de.php +++ b/module/zanode/lang/de.php @@ -22,8 +22,11 @@ $lang->zanode->start = 'Start After Created'; $lang->zanode->hostName = 'Host Name'; $lang->zanode->host = $lang->zanode->hostName; $lang->zanode->extranet = 'IP/Domain'; +$lang->zanode->sshAddress = 'SSH Address'; $lang->zanode->osArch = 'Arch'; $lang->zanode->cpuCores = 'CPU'; +$lang->zanode->defaultUser = 'Default Account Name'; +$lang->zanode->defaultPwd = 'Default Password'; $lang->zanode->memory = 'Memory Size'; $lang->zanode->desc = 'Description'; $lang->zanode->diskSize = 'Disk Size'; @@ -47,6 +50,7 @@ $lang->zanode->automation = "Automation"; $lang->zanode->install = "Install"; $lang->zanode->copy = 'Click to copy'; $lang->zanode->copied = 'Copy successful'; +$lang->zanode->manual = 'Manual'; $lang->automation = new stdClass(); $lang->automation->scriptPath = $lang->zanode->scriptPath; @@ -100,13 +104,15 @@ $lang->zanode->init->ready = "Ready"; $lang->zanode->init->next = "Next"; $lang->zanode->init->button = "Go To Settings"; -$lang->zanode->init->initSuccessNoticeTitle = "The initialization is successful, you can perform automated test settings or go to node browse."; -$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; -$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; +$lang->zanode->init->initSuccessNoticeTitle = "The service is ready, and it takes two steps to execute the automated test on the execution node:
1. Configure the automated test running environment according to the %s
2. Go to %s"; +$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; +$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; + $lang->zanode->init->serviceStatus = [ "ZenAgent" => 'not_install', "ZTF" => 'not_install', ]; + $lang->zanode->init->title = "Initialize Node"; $lang->zanode->init->descTitle = "Follow these steps to complete the initialization on the node:"; $lang->zanode->init->initDesc = "Execute the init script on the node: %s %s
- Click check service status button."; diff --git a/module/zanode/lang/en.php b/module/zanode/lang/en.php index 0244b4e243..e545d773ee 100644 --- a/module/zanode/lang/en.php +++ b/module/zanode/lang/en.php @@ -22,8 +22,11 @@ $lang->zanode->start = 'Start After Created'; $lang->zanode->hostName = 'Host Name'; $lang->zanode->host = $lang->zanode->hostName; $lang->zanode->extranet = 'IP/Domain'; +$lang->zanode->sshAddress = 'SSH Address'; $lang->zanode->osArch = 'Arch'; $lang->zanode->cpuCores = 'CPU'; +$lang->zanode->defaultUser = 'Default Account Name'; +$lang->zanode->defaultPwd = 'Default Password'; $lang->zanode->memory = 'Memory Size'; $lang->zanode->desc = 'Description'; $lang->zanode->diskSize = 'Disk Size'; @@ -47,6 +50,7 @@ $lang->zanode->automation = "Automation"; $lang->zanode->install = "Install"; $lang->zanode->copy = 'Click to copy'; $lang->zanode->copied = 'Copy successful'; +$lang->zanode->manual = 'Manual'; $lang->automation = new stdClass(); $lang->automation->scriptPath = $lang->zanode->scriptPath; @@ -100,13 +104,15 @@ $lang->zanode->init->ready = "Ready"; $lang->zanode->init->next = "Next"; $lang->zanode->init->button = "Go To Settings"; -$lang->zanode->init->initSuccessNoticeTitle = "The initialization is successful, you can perform automated test settings or go to node browse."; -$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; -$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; +$lang->zanode->init->initSuccessNoticeTitle = "The service is ready, and it takes two steps to execute the automated test on the execution node:
1. Configure the automated test running environment according to the %s
2. Go to %s"; +$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; +$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; + $lang->zanode->init->serviceStatus = [ "ZenAgent" => 'not_install', "ZTF" => 'not_install', ]; + $lang->zanode->init->title = "Initialize Node"; $lang->zanode->init->descTitle = "Follow these steps to complete the initialization on the node:"; $lang->zanode->init->initDesc = "Execute the init script on the node: %s %s
- Click check service status button."; diff --git a/module/zanode/lang/fr.php b/module/zanode/lang/fr.php index 0bf60d004c..3473f470c4 100644 --- a/module/zanode/lang/fr.php +++ b/module/zanode/lang/fr.php @@ -22,8 +22,11 @@ $lang->zanode->start = 'Start After Created'; $lang->zanode->hostName = 'Host Name'; $lang->zanode->host = $lang->zanode->hostName; $lang->zanode->extranet = 'IP/Domain'; +$lang->zanode->sshAddress = 'SSH Address'; $lang->zanode->osArch = 'Arch'; $lang->zanode->cpuCores = 'CPU'; +$lang->zanode->defaultUser = 'Default Account Name'; +$lang->zanode->defaultPwd = 'Default Password'; $lang->zanode->memory = 'Memory Size'; $lang->zanode->desc = 'Description'; $lang->zanode->diskSize = 'Disk Size'; @@ -47,6 +50,7 @@ $lang->zanode->automation = "Automation"; $lang->zanode->install = "Install"; $lang->zanode->copy = 'Click to copy'; $lang->zanode->copied = 'Copy successful'; +$lang->zanode->manual = 'Manual'; $lang->automation = new stdClass(); $lang->automation->scriptPath = $lang->zanode->scriptPath; @@ -100,13 +104,15 @@ $lang->zanode->init->ready = "Ready"; $lang->zanode->init->next = "Next"; $lang->zanode->init->button = "Go To Settings"; -$lang->zanode->init->initSuccessNoticeTitle = "The initialization is successful, you can perform automated test settings or go to node browse."; -$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; -$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; +$lang->zanode->init->initSuccessNoticeTitle = "The service is ready, and it takes two steps to execute the automated test on the execution node:
1. Configure the automated test running environment according to the %s
2. Go to %s"; +$lang->zanode->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; +$lang->zanode->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; + $lang->zanode->init->serviceStatus = [ "ZenAgent" => 'not_install', "ZTF" => 'not_install', ]; + $lang->zanode->init->title = "Initialize Node"; $lang->zanode->init->descTitle = "Follow these steps to complete the initialization on the node:"; $lang->zanode->init->initDesc = "Execute the init script on the node: %s %s
- Click check service status button."; diff --git a/module/zanode/lang/zh-cn.php b/module/zanode/lang/zh-cn.php index 472a24766d..2209e840e2 100644 --- a/module/zanode/lang/zh-cn.php +++ b/module/zanode/lang/zh-cn.php @@ -22,8 +22,11 @@ $lang->zanode->start = '创建后自动开启'; $lang->zanode->hostName = '所属宿主机'; $lang->zanode->host = $lang->zanode->hostName; $lang->zanode->extranet = 'IP/域名'; +$lang->zanode->sshAddress = 'SSH地址'; $lang->zanode->osArch = '架构'; $lang->zanode->cpuCores = 'CPU'; +$lang->zanode->defaultUser = '默认用户'; +$lang->zanode->defaultPwd = '默认密码'; $lang->zanode->memory = '内存'; $lang->zanode->diskSize = '硬盘'; $lang->zanode->desc = '描述'; @@ -47,6 +50,7 @@ $lang->zanode->automation = "自动化设置"; $lang->zanode->install = "安装"; $lang->zanode->copy = '复制'; $lang->zanode->copied = '复制成功'; +$lang->zanode->manual = '手册'; $lang->automation = new stdClass(); $lang->automation->scriptPath = $lang->zanode->scriptPath; @@ -100,9 +104,10 @@ $lang->zanode->init->ready = "已就绪"; $lang->zanode->init->next = "下一步"; $lang->zanode->init->button = "去设置"; -$lang->zanode->init->initSuccessNoticeTitle = "初始化成功,您可以进行自动化测试设置或返回列表。"; -$lang->zanode->init->initFailNoticeTitle = "初始化失败,请查看初始化脚本执行日志并尝试以下两种解决方案:"; -$lang->zanode->init->initFailNoticeDesc = "1. 重新执行脚本
2. 查看初始化常见问题"; +$lang->zanode->init->initSuccessNoticeTitle = "服务已就绪,还需两步即可在执行节点上执行自动化测试:1、根据%s配置自动化测试运行环境。
2、进行%s"; +$lang->zanode->init->initFailNoticeTitle = "初始化失败,请查看初始化脚本执行日志并尝试以下两种解决方案:"; +$lang->zanode->init->initFailNoticeDesc = "1. 重新执行脚本
2. 查看初始化常见问题"; + $lang->zanode->init->serviceStatus = [ "ZenAgent" => 'not_install', "ZTF" => 'not_install', diff --git a/module/zanode/view/view.html.php b/module/zanode/view/view.html.php index 2016e6ba81..9c5694d600 100644 --- a/module/zanode/view/view.html.php +++ b/module/zanode/view/view.html.php @@ -18,8 +18,12 @@ zanode->confirmReboot) ?> zanode->confirmShutdown) ?> zanode->actionSuccess) ?> + session->zanodeList ? $this->session->zanodeList : $this->createLink('zanode', 'browse', ""); ?> -id}&orderBy=%s"; ?> +id}&orderBy=%s"; +$account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccount : $config->zanode->defaultAccount; +?> -
-
+
+
+
zanode->defaultPwd; ?>:
+
zanode->defaultPwd; ?>
+
+
+
+
+
zanode->diskSize; ?>:
+
diskSize; ?>
+
+
-
-
zanode->desc; ?>
-
desc) ? htmlspecialchars_decode($zanode->desc) : $lang->noData; ?>
-
+ createLink('action', 'comment', "objectType=zanode&objectID=$zanode->id"); ?> +
+
+
+ ";?> +
+
printExtendFields($zanode, 'div', "position=left&inForm=0&inCell=1"); ?>
' . $lang->goback, '', 'btn btn-secondary'); ?>
deleted)) - { - if($zanode->status == "running"){ + if (empty($zanode->deleted)) { + if ($zanode->status == "running") { common::printLink('zanode', 'suspend', "id={$zanode->id}", " " . $lang->zanode->suspend, '', "title='{$lang->zanode->suspend}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'"); - } - elseif($zanode->status == "suspend") - { + } elseif ($zanode->status == "suspend") { common::printLink('zanode', 'resume', "id={$zanode->id}", " " . $lang->zanode->resume, '', "title='{$lang->zanode->resume}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'"); } - common::printLink('zanode', 'getVNC', "id={$zanode->id}", " " . $lang->zanode->getVNC, '_blank', "title='{$lang->zanode->getVNC}' class='btn " . (common::hasPriv('zanode', 'getVNC') && in_array($zanode->status ,array('running', 'launch')) ? '':'disabled') . "'"); + common::printLink('zanode', 'getVNC', "id={$zanode->id}", " " . $lang->zanode->getVNC, '_blank', "title='{$lang->zanode->getVNC}' class='btn " . (common::hasPriv('zanode', 'getVNC') && in_array($zanode->status, array('running', 'launch')) ? '' : 'disabled') . "'"); } ?>
@@ -126,10 +140,39 @@
-
-
+
+
+
+ zanode->init->statusTitle; ?> + zanode->init->checkStatus; ?> +
+
+
+ ● +   ZenAgent:   + 已就绪 + +
+
+ ● +   ZTF:   + 已就绪 + +
+
+ zanode->init->initSuccessNoticeTitle, "{$lang->zanode->manual}", html::a(helper::createLink('testcase', 'automation', "", '', true), $lang->zanode->automation, '', "class='iframe' title='{$lang->zanode->automation}' data-width='50%'", '')); ?> +
+
+
+
+
+
+
zanode->desc; ?>
+
desc) ? htmlspecialchars_decode($zanode->desc) : $lang->noData; ?>
+
+
-
- -
- +
+ +
+ \ No newline at end of file From 3a4d0a6aec5ee04149b339b777bd1c1f5e47c1fa Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Wed, 28 Dec 2022 20:04:54 +0800 Subject: [PATCH 3/4] * Finish task #81388. --- module/zahost/control.php | 12 ++--- module/zahost/css/view.css | 5 ++ module/zahost/js/view.js | 57 +++++++++++++++++++++ module/zahost/lang/de.php | 5 +- module/zahost/lang/en.php | 5 +- module/zahost/lang/fr.php | 5 +- module/zahost/lang/zh-cn.php | 5 +- module/zahost/view/browse.html.php | 3 +- module/zahost/view/create.html.php | 1 - module/zahost/view/view.html.php | 82 ++++++++++++++++++++++-------- 10 files changed, 141 insertions(+), 39 deletions(-) create mode 100644 module/zahost/js/view.js diff --git a/module/zahost/control.php b/module/zahost/control.php index 4140bdcc7b..a2604f6b65 100644 --- a/module/zahost/control.php +++ b/module/zahost/control.php @@ -63,13 +63,16 @@ class zahost extends control */ public function view($id, $orderBy = 'id_desc') { + $zahost = $this->zahost->getById($id); + $this->view->title = $this->lang->zahost->view; $this->view->position[] = html::a($this->createLink('host', 'browse'), $this->lang->zahost->common); $this->view->position[] = $this->lang->zahost->view; - $this->view->zahost = $this->zahost->getById($id); + $this->view->zahost = $zahost; $this->view->orderBy = $orderBy; $this->view->nodeList = $this->loadModel("zanode")->getListByHost($this->view->zahost->id, $orderBy); + $this->view->initBash = sprintf($this->config->zahost->initBash, $zahost->secret, getWebRoot(true)); $this->view->actions = $this->loadModel('action')->getList('zahost', $id); $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted'); $this->display(); @@ -95,14 +98,11 @@ class zahost extends control return $this->send(array('result' => 'fail', 'message' => array("extranet" => array($this->lang->zahost->netError)))); } - $initLink = $this->createLink('zahost', 'init', "hostID=$hostID"); - return print(""); + $viewLink = $this->createLink('zahost', 'view', "hostID=$hostID"); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $viewLink)); } $this->view->title = $this->lang->zahost->create; - $this->view->notice = $this->lang->zahost->initNotice; - $this->view->buttonName = $this->lang->zahost->init->title; - $this->view->closeLink = $this->createLink('zahost', 'browse'); $this->display(); } diff --git a/module/zahost/css/view.css b/module/zahost/css/view.css index 3f2cd5540d..484ad9551b 100644 --- a/module/zahost/css/view.css +++ b/module/zahost/css/view.css @@ -9,3 +9,8 @@ .status-wait {color: #f00;} .c-actions {overflow: visible!important;} .zanode-mt-8{margin-top: 8px;} +.zahost-init{padding:15px;background: #f4f5f7;margin:10px 0;} +.fail{color:red;} +.dot-symbol{padding-right:10px;} +#statusContainer{margin:10px 0;} +#checkServiceStatus{background-color:unset;} diff --git a/module/zahost/js/view.js b/module/zahost/js/view.js new file mode 100644 index 0000000000..e695139d6e --- /dev/null +++ b/module/zahost/js/view.js @@ -0,0 +1,57 @@ +ajaxGetServiceStatus(); +function ajaxGetServiceStatus() +{ + $.get(createLink('zahost', 'ajaxGetServiceStatus', 'hostID=' + hostID), function(response) + { + var resultData = JSON.parse(response); + let html = ""; + let isSuccess = true + + for (let key in resultData.data) { + if(resultData.data[key] == 'ready'){ + html += "
● " + key + ' ' + zahostLang.init[resultData.data[key]] + "
" + }else{ + isSuccess = false + html += "
● " + key + ' ' + zahostLang.init[resultData.data[key]] + "
" + } + }; + + $('#statusContainer').html(html) + if(!isSuccess){ + $('.result .init-fail').removeClass('hide') + $('.result .init-success').addClass('hide') + } + else + { + $('.result .init-fail').addClass('hide') + $('.result .init-success').removeClass('hide') + } + }); + return + +} +$('#checkServiceStatus').click(function(){ + ajaxGetServiceStatus(); +}) + +$('.btn-init-copy').live('click', function() +{ + var copyText = $('#initBash'); + copyText.show(); + copyText.select(); + document.execCommand("Copy"); + copyText.hide(); + $('.btn-init-copy').tooltip({ + trigger: 'click', + placement: 'bottom', + title: zahostLang.copied, + tipClass: 'tooltip-success' + }); + + $(this).tooltip('show'); + var that = this; + setTimeout(function() + { + $(that).tooltip('hide') + }, 2000) +}) diff --git a/module/zahost/lang/de.php b/module/zahost/lang/de.php index 6b9fd479ca..12c4b547e9 100644 --- a/module/zahost/lang/de.php +++ b/module/zahost/lang/de.php @@ -47,14 +47,15 @@ $lang->zahost->uninitNotice = 'Please init the host first'; $lang->zahost->netError = 'Unable to connect to the host, please check the network and try again.'; $lang->zahost->init = new stdclass; +$lang->zahost->init->statusTitle = "Status"; $lang->zahost->init->checkStatus = "Check Service Status"; $lang->zahost->init->not_install = "Not installed"; $lang->zahost->init->not_available = "Installed, Not Started"; $lang->zahost->init->ready = "Ready"; $lang->zahost->init->next = "Next"; -$lang->zahost->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; -$lang->zahost->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; +$lang->zahost->init->initFailNotice = "Fail,Execute the installation service command on the host or See Help."; +$lang->zahost->init->initSuccessNotice = "Succeed,%s and %s。"; $lang->zahost->init->serviceStatus = [ "kvm" => 'not_install', diff --git a/module/zahost/lang/en.php b/module/zahost/lang/en.php index 6b9fd479ca..12c4b547e9 100644 --- a/module/zahost/lang/en.php +++ b/module/zahost/lang/en.php @@ -47,14 +47,15 @@ $lang->zahost->uninitNotice = 'Please init the host first'; $lang->zahost->netError = 'Unable to connect to the host, please check the network and try again.'; $lang->zahost->init = new stdclass; +$lang->zahost->init->statusTitle = "Status"; $lang->zahost->init->checkStatus = "Check Service Status"; $lang->zahost->init->not_install = "Not installed"; $lang->zahost->init->not_available = "Installed, Not Started"; $lang->zahost->init->ready = "Ready"; $lang->zahost->init->next = "Next"; -$lang->zahost->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; -$lang->zahost->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; +$lang->zahost->init->initFailNotice = "Fail,Execute the installation service command on the host or See Help."; +$lang->zahost->init->initSuccessNotice = "Succeed,%s and %s。"; $lang->zahost->init->serviceStatus = [ "kvm" => 'not_install', diff --git a/module/zahost/lang/fr.php b/module/zahost/lang/fr.php index 55acee78a9..5b64e05f1a 100644 --- a/module/zahost/lang/fr.php +++ b/module/zahost/lang/fr.php @@ -48,13 +48,14 @@ $lang->zahost->netError = 'Unable to connect to the host, please chec $lang->zahost->init = new stdclass; $lang->zahost->init->checkStatus = "Check Service Status"; +$lang->zahost->init->checkStatus = "Check Service Status"; $lang->zahost->init->not_install = "Not installed"; $lang->zahost->init->not_available = "Installed, Not Started"; $lang->zahost->init->ready = "Ready"; $lang->zahost->init->next = "Next"; -$lang->zahost->init->initFailNoticeTitle = "Initialization failed, check the init script execution log and try the following two solutions:"; -$lang->zahost->init->initFailNoticeDesc = "1. Re-execute the script
2. Review the initialization FAQ"; +$lang->zahost->init->initFailNotice = "Fail,Execute the installation service command on the host or See Help."; +$lang->zahost->init->initSuccessNotice = "Succeed,%s and %s。"; $lang->zahost->init->serviceStatus = [ "kvm" => 'not_install', diff --git a/module/zahost/lang/zh-cn.php b/module/zahost/lang/zh-cn.php index 1cc873532c..885642b408 100644 --- a/module/zahost/lang/zh-cn.php +++ b/module/zahost/lang/zh-cn.php @@ -54,8 +54,9 @@ $lang->zahost->init->not_available = "已安装,未启动"; $lang->zahost->init->ready = "已就绪"; $lang->zahost->init->next = "下一步"; -$lang->zahost->init->initFailNoticeTitle = "初始化失败,请查看初始化脚本执行日志并尝试以下两种解决方案:"; -$lang->zahost->init->initFailNoticeDesc = "1. 重新执行脚本
2. 查看初始化常见问题"; +$lang->zahost->init->initFailNotice = "服务未就绪,在宿主机上执行安装服务命令或查看帮助."; +$lang->zahost->init->initSuccessNotice = "服务已就绪,您可以在%s后%s。"; + $lang->zahost->init->serviceStatus = [ "kvm" => 'not_install', "nginx" => 'not_install', diff --git a/module/zahost/view/browse.html.php b/module/zahost/view/browse.html.php index 29554ac6b8..325e27ad48 100644 --- a/module/zahost/view/browse.html.php +++ b/module/zahost/view/browse.html.php @@ -52,7 +52,7 @@ zahost->vsoft);?> zahost->status);?> zahost->registerDate);?> - actions;?> + actions;?> @@ -75,7 +75,6 @@ hostID]) ? 'disabled' : '';?> hostID]) ? $lang->zahost->undeletedNotice : $lang->zahost->delete;?> hostID}", $host, 'list');?> - hostID}", $host, 'list', 'refresh', '', ' init', false, "data-placement='bottom'", $lang->zahost->init->title);?> createLink('zahost', 'delete', "hostID={$host->id}"), '', 'hiddenwin', "title='$title' class='btn $disabled'");;?> diff --git a/module/zahost/view/create.html.php b/module/zahost/view/create.html.php index 85e9f5e1c9..23dbe3ba55 100644 --- a/module/zahost/view/create.html.php +++ b/module/zahost/view/create.html.php @@ -79,5 +79,4 @@ -getModuleRoot() . 'common/view/successmodal.html.php';?> getModuleRoot() . 'common/view/footer.html.php';?> diff --git a/module/zahost/view/view.html.php b/module/zahost/view/view.html.php index eea80b6edd..07bcb94a36 100644 --- a/module/zahost/view/view.html.php +++ b/module/zahost/view/view.html.php @@ -12,6 +12,8 @@ ?> getModuleRoot() . 'common/view/header.html.php';?> getModuleRoot() . 'common/view/kindeditor.html.php'; ?> +id);?> +zahost);?> session->zahostList ? $this->session->zahostList : $this->createLink('zahost', 'browse', "");?> hostID}&orderBy=%s";?> + +
+
+
+ zahost->init->statusTitle;?> + +
+
+
+
在宿主机上安装必要服务后进行检测:
+
+ + "; ?> +
+
+
●KVM
+
●Nginx
+
●noVNC
+
●Websockify
+
+
+ createLink('zahost', 'browseImage', "hostID=$zahost->id", '', true), $lang->zahost->image->downloadImage, '', "class='iframe'");?> + createLink('zanode', 'create'), $lang->zahost->createZanode);?> +
zahost->init->initSuccessNotice, $imageLink, $createNode);?>
+
+ zahost->init->initFailNotice;?> +
+ "; ?> +
+
+
+
+
+
+
+
zahost->desc;?>
desc) ? htmlspecialchars_decode($zahost->desc) : $lang->noData;?>
From 237da33c90e06df9020a7a4cb1a49506138fe3fd Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 29 Dec 2022 10:27:44 +0800 Subject: [PATCH 4/4] * Finish task #81388. --- module/testcase/control.php | 3 + module/testcase/css/create.css | 3 +- module/testcase/css/edit.css | 1 + module/testcase/model.php | 27 ++++- module/testcase/view/automation.html.php | 1 + module/testcase/view/buildscriptform.php | 124 +++++++++++++++++++++++ module/testcase/view/caseheader.html.php | 2 +- module/testcase/view/create.html.php | 30 ++++-- module/testcase/view/edit.html.php | 29 +++++- module/testcase/view/showscript.html.php | 2 +- module/testtask/view/results.html.php | 5 +- module/zahost/config.php | 2 +- module/zahost/css/view.css | 3 +- module/zahost/js/view.js | 9 +- module/zahost/lang/de.php | 2 + module/zahost/lang/en.php | 2 + module/zahost/lang/fr.php | 2 + module/zahost/lang/zh-cn.php | 2 + module/zahost/view/view.html.php | 27 ++--- module/zanode/view/browse.html.php | 4 +- 20 files changed, 243 insertions(+), 37 deletions(-) create mode 100644 module/testcase/view/buildscriptform.php diff --git a/module/testcase/control.php b/module/testcase/control.php index c1100eaf7d..324f8dfada 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -395,6 +395,7 @@ class testcase extends control $this->loadModel('story'); if(!empty($_POST)) { + if(!empty($_FILES['scriptFile'])) unset($_FILES['scriptFile']); $response['result'] = 'success'; setcookie('lastCaseModule', (int)$this->post->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, false); @@ -875,6 +876,8 @@ class testcase extends control if(!empty($_POST)) { + if(!empty($_FILES['scriptFile'])) unset($_FILES['scriptFile']); + $changes = array(); if($comment == false or $comment == 'false') { diff --git a/module/testcase/css/create.css b/module/testcase/css/create.css index 2ad82ff52e..40e076887a 100644 --- a/module/testcase/css/create.css +++ b/module/testcase/css/create.css @@ -14,6 +14,7 @@ #story_chosen .chosen-results > li.no-results {cursor: pointer;} #story_chosen .chosen-results > li.no-results:hover {color: #1a4f85; background-color: #ddd;} #story_chosen .chosen-results > li.no-results > span {font-weight: bold;} +#type_chosen {display: table-cell;} .row .col-sm-10 {width: 89%;} .row .col-sm-2 {padding-left: 0px; width: 11%;} @@ -42,4 +43,4 @@ .pri-selector > .dropdown-menu {padding: 10px;} .stageBox {padding-left: 15px !important;} -#refresh {margin-left: 7px;} \ No newline at end of file +#refresh {margin-left: 7px;} diff --git a/module/testcase/css/edit.css b/module/testcase/css/edit.css index a27479cd4d..0d16991789 100644 --- a/module/testcase/css/edit.css +++ b/module/testcase/css/edit.css @@ -7,3 +7,4 @@ [lang^=en] .detail > table > tbody th, [lang^=fr] .detail > table > tbody th {width: 100px !important;} [lang^=de] .detail > table > tbody th {width: 125px !important;} .linkCaseTitle, .linkBugTitle {white-space: nowrap;} + #type_chosen{display: table-cell;} diff --git a/module/testcase/model.php b/module/testcase/model.php index 76b0c65193..3c5d34e0c3 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -50,6 +50,16 @@ class testcaseModel extends model } } + if(!empty($_POST['auto'])) + { + $_POST['auto'] = 'auto'; + if($_POST['script']) $_POST['script'] = htmlentities($_POST['script']); + } + else + { + unset($_POST['script']); + } + $now = helper::now(); $status = $this->getStatus('create'); $case = fixer::input('post') @@ -61,7 +71,7 @@ class testcaseModel extends model ->setIF($this->app->tab == 'project', 'project', $this->session->project) ->setIF($this->app->tab == 'execution', 'execution', $this->session->execution) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story)) - ->remove('steps,expects,files,labels,stepType,forceNotReview') + ->remove('steps,expects,files,labels,stepType,forceNotReview,scriptFile,scriptName') ->setDefault('story', 0) ->cleanInt('story,product,branch,module') ->join('stage', ',') @@ -81,6 +91,8 @@ class testcaseModel extends model if(!$this->dao->isError()) { $caseID = $this->dao->lastInsertID(); + $this->config->dangers = ''; + $this->loadModel('file')->saveUpload('testcase', $caseID, 'autoscript', 'script', 'scriptName'); $this->loadModel('file')->saveUpload('testcase', $caseID); $parentStepID = 0; $this->loadModel('score')->create('testcase', 'create', $caseID); @@ -830,6 +842,17 @@ class testcaseModel extends model $version = $stepChanged ? $oldCase->version + 1 : $oldCase->version; + if(!empty($_POST['auto'])) + { + $_POST['auto'] = 'auto'; + if($_POST['script']) $_POST['script'] = htmlentities($_POST['script']); + } + else + { + $_POST['auto'] = 'no'; + $_POST['script'] = ''; + } + $case = fixer::input('post') ->add('id', $caseID) ->add('version', $version) @@ -845,7 +868,7 @@ class testcaseModel extends model ->setForce('status', $status) ->cleanInt('story,product,branch,module') ->stripTags($this->config->testcase->editor->edit['id'], $this->config->allowedTags) - ->remove('comment,steps,expects,files,labels,linkBug,stepType') + ->remove('comment,steps,expects,files,labels,linkBug,stepType,scriptFile,scriptName') ->get(); $requiredFields = $this->config->testcase->edit->requiredFields; diff --git a/module/testcase/view/automation.html.php b/module/testcase/view/automation.html.php index 85eebf00a3..9055ffb25e 100644 --- a/module/testcase/view/automation.html.php +++ b/module/testcase/view/automation.html.php @@ -28,6 +28,7 @@ testcase->product;?> + diff --git a/module/testcase/view/buildscriptform.php b/module/testcase/view/buildscriptform.php new file mode 100644 index 0000000000..0319c1c943 --- /dev/null +++ b/module/testcase/view/buildscriptform.php @@ -0,0 +1,124 @@ +loadModel('file'); +$filesName = 'scriptFile'; +$labelsName = 'scriptName'; +$maxUploadSize = strtoupper(ini_get('upload_max_filesize')); +$dangerFiles = 'zip'; + +js::set('scriptDangerExtensions', ',' . $dangerFiles . ','); +js::set('maxUploadSize', $maxUploadSize); +?> +
+
+
+
+ +
+ + +
+
+
+
+
+ + +
+
+ + +
+
+ +
+ file->maxUploadSize, $maxUploadSize);?> + + +
+ + + + diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index 9da6846a37..aa93e224c8 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -194,7 +194,7 @@
- " . $lang->testcase->automation, '', "class='btn btn-link iframe'", true, true)?> + " . $lang->testcase->automation, '', "class='btn btn-link iframe' data-width='50%'", true, true)?>
diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index cc9ff90ab8..c22b1b4bb9 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -70,7 +70,12 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field) testcase->type;?> testcase->typeList['unit']);?> - testcase->typeList, $type, "class='form-control chosen'");?> + + testcase->typeList, $type, "class='form-control chosen'");?> +
+ $lang->testcase->showAutoCase), '', "id='autocase' title='{$lang->testcase->showAutoCase}'");?> +
+ @@ -81,6 +86,10 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field) + + testcase->autoScript;?> + + testcase->lblStory;?> @@ -148,16 +157,10 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field) testcase->forceNotReview()):?> testcase->forceNotReview, '', "id='forceNotReview0'");?> -
- testcase->showAutoCase, '', "id='autocase' title='{$lang->testcase->showAutoCase}'");?> -
- - testcase->autoScript;?> - fetch('file', 'buildform', 'fileCount=1&percent=0.9&filesName=script');?> - + testcase->precondition;?> @@ -274,4 +277,15 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field)
testcase->module)?> + diff --git a/module/testcase/view/edit.html.php b/module/testcase/view/edit.html.php index 9666ee3081..2f8ab784ef 100644 --- a/module/testcase/view/edit.html.php +++ b/module/testcase/view/edit.html.php @@ -214,7 +214,16 @@ testcase->type;?> type != 'unit') unset($lang->testcase->typeList['unit']);?> - testcase->typeList, $case->type, "class='form-control chosen'");?> + + testcase->typeList, $case->type, "class='form-control chosen'");?> +
+ $lang->testcase->showAutoCase), $case->auto, "id='autocase' title='{$lang->testcase->showAutoCase}'");?> +
+ + + + testcase->autoScript;?> + testcase->stage;?> @@ -316,6 +325,24 @@ $(function() { $('#subNavbar [data-id=testcase]').addClass('active'); $('#navbar [data-id=testcase]').addClass('active'); + checkScript(); }) + +function checkScript() +{ + var autoScript = $(":checkbox[name^='auto']"); + if(autoScript.attr('checked')) + { + $('.autoScript').removeClass('hide') + }else + { + $('.autoScript').addClass('hide') + } + +} + +$(":checkbox[name^='auto']").on('click', function(){ + checkScript(); +}); diff --git a/module/testcase/view/showscript.html.php b/module/testcase/view/showscript.html.php index 8a99581506..0b679ec21c 100644 --- a/module/testcase/view/showscript.html.php +++ b/module/testcase/view/showscript.html.php @@ -24,7 +24,7 @@ js::import($jsRoot . 'misc/highlight/highlight.pack.js');
-
script, defined('ENT_SUBSTITUTE') ? ENT_QUOTES | ENT_SUBSTITUTE : ENT_QUOTES));?>
+
script;?>
diff --git a/module/testtask/view/results.html.php b/module/testtask/view/results.html.php index 12e46c718a..06b2fe7c66 100644 --- a/module/testtask/view/results.html.php +++ b/module/testtask/view/results.html.php @@ -46,7 +46,7 @@   #id?> date;?> node > 0):?> - testtask->runNode, zget($users, $result->lastRunner), $result->nodeName, !empty($result->ZTFResult) ? $lang->testtask->runCase : "{$lang->testtask->running}") . "  {$lang->testtask->auto}";?> + testtask->runNode, zget($users, $result->lastRunner), $result->nodeName, $lang->testtask->runCase) . "  {$lang->testtask->auto}";?> lastRunner) . ' ' . $lang->testtask->runCase;?> @@ -55,6 +55,9 @@ node == 0 || !empty($result->ZTFResult)):?> testcase->resultList[$result->caseResult];?> + node > 0 and empty($result->ZTFResult)):?> + testtask->running;?> + files)) echo html::a("#caseResult{$result->id}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?> diff --git a/module/zahost/config.php b/module/zahost/config.php index c08a07d951..61c7fe052b 100644 --- a/module/zahost/config.php +++ b/module/zahost/config.php @@ -12,7 +12,7 @@ $config->zahost->imageListUrl = 'https://pkg.qucheng.com/zenagent/list.json'; $config->zahost->cpuCoreList = [1 => 1, 2 => 2, 4 => 4, 6 => 6, 8 => 8, 10 => 10, 12 => 12, 16 => 16, 24 => 24, 32 => 32, 64 => 64]; -$config->zahost->initBash = 'curl -sSL https://pkg.qucheng.com/zenagent/zagent.sh | bash /dev/stdin -k%s -z%s'; +$config->zahost->initBash = 'curl -sSL https://pkg.qucheng.com/zenagent/zagent.sh | bash /dev/stdin -k %s -z %s'; global $lang; $config->zahost->search['module'] = 'zahost'; diff --git a/module/zahost/css/view.css b/module/zahost/css/view.css index 484ad9551b..38097ee93a 100644 --- a/module/zahost/css/view.css +++ b/module/zahost/css/view.css @@ -12,5 +12,6 @@ .zahost-init{padding:15px;background: #f4f5f7;margin:10px 0;} .fail{color:red;} .dot-symbol{padding-right:10px;} -#statusContainer{margin:10px 0;} +#statusContainer{margin:0px 0px 10px 0px;} #checkServiceStatus{background-color:unset;} +.service-check{margin-top: 0px;} diff --git a/module/zahost/js/view.js b/module/zahost/js/view.js index e695139d6e..aaaa2fb28c 100644 --- a/module/zahost/js/view.js +++ b/module/zahost/js/view.js @@ -6,13 +6,18 @@ function ajaxGetServiceStatus() var resultData = JSON.parse(response); let html = ""; let isSuccess = true + var service = ''; for (let key in resultData.data) { + if(key == 'kvm') service = 'KVM'; + if(key == 'nginx') service = 'Nginx'; + if(key == 'novnc') service = 'noVNC'; + if(key == 'websockify') service = 'Websockify'; if(resultData.data[key] == 'ready'){ - html += "
● " + key + ' ' + zahostLang.init[resultData.data[key]] + "
" + html += "
● " + service + ' ' + zahostLang.init[resultData.data[key]] + "
" }else{ isSuccess = false - html += "
● " + key + ' ' + zahostLang.init[resultData.data[key]] + "
" + html += "
● " + service + ' ' + zahostLang.init[resultData.data[key]] + "
" } }; diff --git a/module/zahost/lang/de.php b/module/zahost/lang/de.php index 12c4b547e9..28bf968144 100644 --- a/module/zahost/lang/de.php +++ b/module/zahost/lang/de.php @@ -112,6 +112,8 @@ $lang->zahost->softwareList['kvm'] = 'KVM'; $lang->zahost->unitList['GB'] = 'GB'; $lang->zahost->unitList['TB'] = 'TB'; +$lang->zahost->cpuUnit = 'CORE'; + $lang->zahost->zaHostType = 'Type'; $lang->zahost->zaHostTypeList['physical'] = 'Physical'; diff --git a/module/zahost/lang/en.php b/module/zahost/lang/en.php index 12c4b547e9..28bf968144 100644 --- a/module/zahost/lang/en.php +++ b/module/zahost/lang/en.php @@ -112,6 +112,8 @@ $lang->zahost->softwareList['kvm'] = 'KVM'; $lang->zahost->unitList['GB'] = 'GB'; $lang->zahost->unitList['TB'] = 'TB'; +$lang->zahost->cpuUnit = 'CORE'; + $lang->zahost->zaHostType = 'Type'; $lang->zahost->zaHostTypeList['physical'] = 'Physical'; diff --git a/module/zahost/lang/fr.php b/module/zahost/lang/fr.php index 5b64e05f1a..e62e45edcd 100644 --- a/module/zahost/lang/fr.php +++ b/module/zahost/lang/fr.php @@ -112,6 +112,8 @@ $lang->zahost->softwareList['kvm'] = 'KVM'; $lang->zahost->unitList['GB'] = 'GB'; $lang->zahost->unitList['TB'] = 'TB'; +$lang->zahost->cpuUnit = 'CORE'; + $lang->zahost->zaHostType = 'Type'; $lang->zahost->zaHostTypeList['physical'] = 'Physical'; diff --git a/module/zahost/lang/zh-cn.php b/module/zahost/lang/zh-cn.php index 885642b408..11de845915 100644 --- a/module/zahost/lang/zh-cn.php +++ b/module/zahost/lang/zh-cn.php @@ -112,6 +112,8 @@ $lang->zahost->softwareList['kvm'] = 'KVM'; $lang->zahost->unitList['GB'] = 'GB'; $lang->zahost->unitList['TB'] = 'TB'; +$lang->zahost->cpuUnit = '核'; + $lang->zahost->zaHostType = '主机类型'; $lang->zahost->zaHostTypeList['physical'] = '实体主机'; diff --git a/module/zahost/view/view.html.php b/module/zahost/view/view.html.php index 07bcb94a36..8440eaf99b 100644 --- a/module/zahost/view/view.html.php +++ b/module/zahost/view/view.html.php @@ -44,14 +44,14 @@
-
zahost->zaHostType;?>:
-
zahost->zaHostTypeList[$zahost->hostType];?>
+
zahost->cpuCores;?>:
+
cpuCores . $lang->zahost->cpuUnit;?>
-
zahost->cpuCores;?>:
-
cpuCores;?>
+
zahost->zaHostType;?>:
+
zahost->zaHostTypeList[$zahost->hostType];?>
@@ -64,14 +64,14 @@
-
zahost->diskSize;?>:
-
diskSize;?>
+
zahost->memory;?>:
+
memory . $lang->zahost->unitList['GB'];;?>
-
zahost->memory;?>:
-
memory;?>
+
zahost->vsoft;?>:
+
zahost->softwareList, $zahost->vsoft);?>
@@ -84,8 +84,8 @@
-
zahost->vsoft;?>:
-
zahost->softwareList, $zahost->vsoft);?>
+
zahost->diskSize;?>:
+
diskSize . $lang->zahost->unitList['GB'];?>
@@ -103,12 +103,7 @@
-
-
在宿主机上安装必要服务后进行检测:
-
- - "; ?> -
+
●KVM
●Nginx
diff --git a/module/zanode/view/browse.html.php b/module/zanode/view/browse.html.php index f4b185128d..ac0e6eaf54 100644 --- a/module/zanode/view/browse.html.php +++ b/module/zanode/view/browse.html.php @@ -95,11 +95,11 @@ if($node->status == "shutoff") { - common::printLink('zanode', 'start', "zanodeID={$node->id}", " ", '', "class='btn '"); + common::printLink('zanode', 'start', "zanodeID={$node->id}", " ", '', "class='btn ' title='{$lang->zanode->boot}'"); } else { - common::printLink('zanode', 'close', "zanodeID={$node->id}", " ", '', "class='btn '"); + common::printLink('zanode', 'close', "zanodeID={$node->id}", " ", '', "class='btn ' title='{$lang->zanode->shutdown}'"); } common::printLink('zanode', 'reboot', "zanodeID={$node->id}", " ", '', $rebootAttr);