diff --git a/module/testcase/css/automation.css b/module/testcase/css/automation.css new file mode 100644 index 0000000000..dc2b387672 --- /dev/null +++ b/module/testcase/css/automation.css @@ -0,0 +1 @@ +table a.refresh {border-color: white;} diff --git a/module/testcase/js/automation.js b/module/testcase/js/automation.js new file mode 100644 index 0000000000..29a66f56fc --- /dev/null +++ b/module/testcase/js/automation.js @@ -0,0 +1,8 @@ +function loadNodes() +{ + var nodeLink = createLink('zanode', 'ajaxGetNodes'); + $('#nodeIdBox').load(nodeLink, function() + { + $('#nodeIdBox').find('#node').picker(); + }); +} diff --git a/module/testcase/view/automation.html.php b/module/testcase/view/automation.html.php index 20a2d96b99..f14d333418 100644 --- a/module/testcase/view/automation.html.php +++ b/module/testcase/view/automation.html.php @@ -33,26 +33,27 @@ zanode->common;?> - node) ? $automation->node : '', "class='form-control picker-select'");?> - + node) ? $automation->node : '', "class='form-control picker-select'");?> + + createLink('zanode', 'create'), $lang->zanode->create, '', "class='text-primary' target='_blank'");?> + ", '', "class='btn btn-icon refresh' data-toggle='tooltip' title='{$lang->refresh}' onclick='loadNodes()'");?> + zanode->scriptPath;?> - scriptPath) ? $automation->scriptPath : '', "class='form-control'");?> + scriptPath) ? $automation->scriptPath : '', "class='form-control' placeholder='{$lang->zanode->scriptTips}'");?> - zanode->shell;?> - shell) ? $automation->shell : '', "rows='6' class='form-control'");?> + shell) ? $automation->shell : '', "rows='6' class='form-control' placeholder='{$lang->zanode->shellTips}'");?> - diff --git a/module/zahost/control.php b/module/zahost/control.php index 0e25e3911e..1af478abed 100644 --- a/module/zahost/control.php +++ b/module/zahost/control.php @@ -44,7 +44,7 @@ class zahost extends control $showFeature = false; $accounts = !empty($this->config->global->skipAutomation) ? $this->config->global->skipAutomation : ''; - if(strpos(",$accounts,", $this->app->user->account) === false) + if(strpos(",$accounts,", $this->app->user->account) === false) { $showFeature = true; $accounts .= ',' . $this->app->user->account; @@ -109,6 +109,7 @@ class zahost extends control } $viewLink = $this->createLink('zahost', 'view', "hostID=$hostID"); + if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => 'parent.loadHosts()')); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $viewLink)); } @@ -368,4 +369,16 @@ class zahost extends control return $this->send(array('result' => 'success', 'message' => '', 'data' => $serviceStatus)); } + + /** + * Ajax:get hosts. + * + * @access public + * @return void + */ + public function ajaxGetHosts() + { + $hostList = $this->zahost->getPairs(); + return print(html::select("parent", $hostList, '', "class='form-control chosen'")); + } } diff --git a/module/zanode/control.php b/module/zanode/control.php index 7360defed1..d10c470029 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -626,4 +626,16 @@ class zanode extends control return $this->send(array('result' => 'success', 'message' => 'success')); } } + + /** + * Ajax:get nodes. + * + * @access public + * @return void + */ + public function ajaxGetNodes() + { + $nodeList = $this->zanode->getPairs(); + return print(html::select("node", $nodeList, '', "class='form-control picker-select'")); + } } diff --git a/module/zanode/css/browse.css b/module/zanode/css/browse.css index 0e04690ee1..64b697e35c 100644 --- a/module/zanode/css/browse.css +++ b/module/zanode/css/browse.css @@ -7,3 +7,6 @@ .desktop, .createImage{margin-right: 4px;} #helpTab .icon-help {line-height: unset;} #bysearchTab {margin-right: 0px;} + +.c-actions a img{position: relative; left: -80px; filter: drop-shadow(#18a6fd 80px 0); width: 18px;} +.c-actions a.disabled img {filter: drop-shadow(#313c52 80px 0);} diff --git a/module/zanode/css/view.css b/module/zanode/css/view.css index adb03140cd..f3bc568f0a 100644 --- a/module/zanode/css/view.css +++ b/module/zanode/css/view.css @@ -17,5 +17,6 @@ .node-not-wrap{white-space: nowrap;} .btn-info {background-color: unset;} .btn.disabled i {color: #fff;} +.btn-toolbar a img{margin-bottom: 1px;} #serviceContent{min-height: 120px;} .btn-snap-create{width: 100px;height: 30px;} \ No newline at end of file diff --git a/module/zanode/js/create.js b/module/zanode/js/create.js index bd96c2ca22..4fa5ae9c80 100644 --- a/module/zanode/js/create.js +++ b/module/zanode/js/create.js @@ -1,4 +1,10 @@ -function zahostType() +/** + * Change zanode type. + * + * @access public + * @return void + */ +function zanodeType() { if($('#type').val() == 'physics') { @@ -17,3 +23,18 @@ function zahostType() $('#osNamePhysics').addClass('hidden'); } } + +/** + * Load hosts. + * + * @access public + * @return void + */ +function loadHosts() +{ + var hostLink = createLink('zahost', 'ajaxGetHosts'); + $('#hostIdBox').load(hostLink, function() + { + $('#hostIdBox').find('#parent').chosen(); + }); +} diff --git a/module/zanode/model.php b/module/zanode/model.php index b74e88339a..685d9e510c 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -641,7 +641,7 @@ class zanodemodel extends model { return $this->dao->select('*')->from(TABLE_ZAHOST) ->where('deleted')->eq(0) - ->andWhere("type")->eq('node') + ->andWhere("type")->in('node,physics') ->orderBy($orderBy) ->fetchAll('id'); } @@ -657,7 +657,7 @@ class zanodemodel extends model { return $this->dao->select('*')->from(TABLE_ZAHOST) ->where('deleted')->eq(0) - ->andWhere("type")->eq('node') + ->andWhere("type")->in('node,physics') ->orderBy($orderBy) ->fetchPairs('id', 'name'); } diff --git a/module/zanode/view/browse.html.php b/module/zanode/view/browse.html.php index 6fad0df376..51a3972059 100644 --- a/module/zanode/view/browse.html.php +++ b/module/zanode/view/browse.html.php @@ -53,7 +53,7 @@ idAB); ?> zanode->name); ?> - zahost->type); ?> + zahost->type); ?> zanode->extranet); ?> zanode->cpuCores); ?> zanode->memory); ?> @@ -69,7 +69,7 @@ id; ?> inlink('view', "id=$node->id"), $node->name, '', ""); ?> - lang->zanode->typeList, $node->type); ?> + lang->zanode->typeList, $node->type); ?> extranet; ?> zanode->os->cpuCores, $node->cpuCores); ?> memory . $this->lang->zahost->unitList['GB']; ?> @@ -119,7 +119,7 @@ } common::printLink('zanode', 'reboot', "zanodeID={$node->id}", " ", '', $rebootAttr); - common::printLink('zanode', 'createSnapshot', "zanodeID={$node->id}", " ", '', $snapshotAttr, true, true); + common::printLink('zanode', 'createSnapshot', "zanodeID={$node->id}", " ", '', $snapshotAttr, true, true); if(common::hasPriv('zanode', 'createImage') or common::hasPriv('zanode', 'destroy')) { diff --git a/module/zanode/view/create.html.php b/module/zanode/view/create.html.php index 19f1a570df..bddd7ac64f 100644 --- a/module/zanode/view/create.html.php +++ b/module/zanode/view/create.html.php @@ -22,15 +22,15 @@
- + - + - - + + diff --git a/module/zanode/view/view.html.php b/module/zanode/view/view.html.php index 288eee8ed9..5bbabc65d5 100644 --- a/module/zanode/view/view.html.php +++ b/module/zanode/view/view.html.php @@ -223,7 +223,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou } common::printLink('zanode', 'reboot', "zanodeID={$zanode->id}", " " . $lang->zanode->rebootNode, '', $rebootAttr); - common::printLink('zanode', 'createSnapshot', "zanodeID={$zanode->id}", " " . $lang->zanode->createSnapshot, '', $snapshotAttr, true, true); + common::printLink('zanode', 'createSnapshot', "zanodeID={$zanode->id}", " " . $lang->zanode->createSnapshot, '', $snapshotAttr, true, true); } ?> diff --git a/www/static/svg/snapshot.svg b/www/static/svg/snapshot.svg new file mode 100644 index 0000000000..7de17aeb33 --- /dev/null +++ b/www/static/svg/snapshot.svg @@ -0,0 +1,10 @@ + + + 相机_o + + + + + + +
zahost->type;?>zanode->typeList, 'virtual', "class='form-control chosen' onchange='zahostType()'")?>zanode->typeList, 'virtual', "class='form-control chosen' onchange='zanodeType()'")?>
zanode->hostName;?>createLink('zahost', 'create', array(), '', true), $lang->zahost->create, '', "class='text-primary iframe'");?>
zanode->name;?>