diff --git a/api/v1/entries/hostheartbeat.php b/api/v1/entries/hostheartbeat.php index 1d54b4c9c2..16946fb0f7 100644 --- a/api/v1/entries/hostheartbeat.php +++ b/api/v1/entries/hostheartbeat.php @@ -28,8 +28,8 @@ class hostHeartbeatEntry extends baseEntry /* Check param. */ $status = $this->requestBody->status; - $vms = $this->requestBody->Vms; - $zap = $this->requestBody->port; + $vms = !empty($this->requestBody->Vms) ? $this->requestBody->Vms : array(); + $zap = !empty($this->requestBody->port) ? $this->requestBody->port : 0; $now = helper::now(); if(!$status) return $this->sendError(400, 'Params error.'); @@ -37,7 +37,7 @@ class hostHeartbeatEntry extends baseEntry $conditionValue = $secret ? $secret : $token; $this->dao = $this->loadModel('common')->dao; - $hostInfo = $this->dao->select('id,tokenSN')->from(TABLE_ZAHOST) + $hostInfo = $this->dao->select('id,tokenSN,hostType')->from(TABLE_ZAHOST) ->beginIF($secret)->where('secret')->eq($secret)->fi() ->beginIF(!$secret)->where('tokenSN')->eq($token) ->andWhere('tokenTime')->gt($now)->fi() @@ -83,11 +83,18 @@ class hostHeartbeatEntry extends baseEntry if($heartbeat > 0) $vmData['heartbeat'] = date("Y-m-d H:i:s", $heartbeat); - $this->dao->update(TABLE_ZAHOST)->data($vmData)->where('mac')->eq($vm->macAddress)->exec(); - - if($vm->status == 'running') + if($hostInfo->hostType == 'physics') { - $node = $this->loadModel('zanode')->getNodeByMac($vm->macAddress); + $this->dao->update(TABLE_ZAHOST)->data($vmData)->where('id')->eq($hostInfo->id)->exec(); + } + else + { + $this->dao->update(TABLE_ZAHOST)->data($vmData)->where('mac')->eq($vm->macAddress)->exec(); + } + + if($vm->status == 'running' && $hostInfo->hostType != 'physics') + { + $node = $this->loadModel('zanode')->getNodeByMac($vm->macAddress); if(!empty($node)) { $snaps = $this->loadModel('zanode')->getSnapshotList($node->id); diff --git a/module/zanode/config.php b/module/zanode/config.php index c8a81099d6..cf21004640 100644 --- a/module/zanode/config.php +++ b/module/zanode/config.php @@ -12,7 +12,7 @@ $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'; +$config->zanode->initBash = 'curl -sSL https://pkg.qucheng.com/zenagent/zagent.sh | bash /dev/stdin -s zvm -k %s -z %s'; $config->zanode->os = new stdClass(); diff --git a/module/zanode/control.php b/module/zanode/control.php index d10c470029..87ee162afc 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -161,17 +161,16 @@ class zanode extends control $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->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->snapshotList = $this->zanode->getSnapshotList($id); - $this->view->actions = $this->loadModel('action')->getList('zanode', $id); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->initBash = sprintf($this->config->zanode->initBash, $node->secret, getWebRoot(true)); + $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 1c198cb0cf..2861d331c8 100644 --- a/module/zanode/css/view.css +++ b/module/zanode/css/view.css @@ -7,10 +7,10 @@ .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{margin-top: 16px;line-height: 28px;} .status-notice a{color: #2463c7;} .service-status a{color: #2463c7;} -.service-status{margin-top: 10px;} +.service-status{margin-top: 5px;} .vnc-detail{height: 60vh;min-height: 550px;} .vnc-mask{width: 100%;height:100%;background-color: rgba(0,0,0,0);position: absolute;z-index: 1;} .checkStatus{color: #313c52;} @@ -19,3 +19,4 @@ .btn.disabled i {color: #fff;} .btn-toolbar a img{margin-bottom: 1px;} #serviceContent{min-height: 120px;} +.zanode-init{padding:15px;background: #f4f5f7;margin:10px 0;} diff --git a/module/zanode/js/create.js b/module/zanode/js/create.js index 4fa5ae9c80..153bc3b0d0 100644 --- a/module/zanode/js/create.js +++ b/module/zanode/js/create.js @@ -6,7 +6,7 @@ */ function zanodeType() { - if($('#type').val() == 'physics') + if($('#hostType').val() == 'physics') { $('#parent').closest('tr').hide(); $('#image').closest('tr').hide(); diff --git a/module/zanode/js/view.js b/module/zanode/js/view.js index d46022f99f..8a3d6c81c5 100644 --- a/module/zanode/js/view.js +++ b/module/zanode/js/view.js @@ -88,14 +88,14 @@ function checkServiceStatus(){ if(!isSuccess) { - // $('.init-fail').show(); + $('.init-fail').show(); $('.init-success').hide(); } else { clearInterval(checkInterval) $('.init-success').show(); - // $('.init-fail').hide(); + $('.init-fail').hide(); } setTimeout(function() { $('#serviceContent').removeClass('loading'); @@ -161,6 +161,28 @@ $('.btn-pwd-copy').live('click', function() }, 2000) }) +$('.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: 'top', + title: zanodeLang.copied, + tipClass: 'tooltip-success' + }); + + $(this).tooltip('show'); + var that = this; + setTimeout(function() + { + $(that).tooltip('hide') + }, 2000) +}) + $('.btn-pwd-show').live('click', function() { var pwd = $('#pwd-copy').text(); diff --git a/module/zanode/lang/de.php b/module/zanode/lang/de.php index 2d269e533c..2af03c56ef 100644 --- a/module/zanode/lang/de.php +++ b/module/zanode/lang/de.php @@ -63,6 +63,9 @@ $lang->zanode->manual = 'Manual'; $lang->zanode->initializing = 'Initializing'; $lang->zanode->showPwd = 'Show Password'; $lang->zanode->hidePwd = 'Hide Password'; +$lang->zanode->baseInfo = 'Basic information'; +$lang->zanode->cpuUnit = 'CORE'; +$lang->zanode->IP = 'Extranet Address'; $lang->zanode->typeList['node'] = 'Virtual machine'; $lang->zanode->typeList['physics'] = 'Physical machine'; @@ -149,8 +152,7 @@ $lang->zanode->init->next = "Next"; $lang->zanode->init->button = "Go To Settings"; $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->initFailNotice = "Fail,Execute the installation service command on the node or See Help."; $lang->zanode->init->serviceStatus = array( "ZenAgent" => 'not_install', diff --git a/module/zanode/lang/en.php b/module/zanode/lang/en.php index 996e12770c..0201c94e57 100644 --- a/module/zanode/lang/en.php +++ b/module/zanode/lang/en.php @@ -63,6 +63,9 @@ $lang->zanode->manual = 'Manual'; $lang->zanode->initializing = 'Initializing'; $lang->zanode->showPwd = 'Show Password'; $lang->zanode->hidePwd = 'Hide Password'; +$lang->zanode->baseInfo = 'Basic information'; +$lang->zanode->cpuUnit = 'CORE'; +$lang->zanode->IP = 'Extranet Address'; $lang->zanode->typeList['node'] = 'Virtual machine'; $lang->zanode->typeList['physics'] = 'Physical machine'; @@ -149,8 +152,7 @@ $lang->zanode->init->next = "Next"; $lang->zanode->init->button = "Go To Settings"; $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->initFailNotice = "Fail,Execute the installation service command on the node or See Help."; $lang->zanode->init->serviceStatus = array( "ZenAgent" => 'not_install', diff --git a/module/zanode/lang/fr.php b/module/zanode/lang/fr.php index 2d269e533c..91a75a7818 100644 --- a/module/zanode/lang/fr.php +++ b/module/zanode/lang/fr.php @@ -63,6 +63,9 @@ $lang->zanode->manual = 'Manual'; $lang->zanode->initializing = 'Initializing'; $lang->zanode->showPwd = 'Show Password'; $lang->zanode->hidePwd = 'Hide Password'; +$lang->zanode->baseInfo = 'Basic information'; +$lang->zanode->cpuUnit = 'CORE'; +$lang->zanode->IP = 'Extranet Address'; $lang->zanode->typeList['node'] = 'Virtual machine'; $lang->zanode->typeList['physics'] = 'Physical machine'; diff --git a/module/zanode/lang/zh-cn.php b/module/zanode/lang/zh-cn.php index abfcbd593d..74b264d066 100644 --- a/module/zanode/lang/zh-cn.php +++ b/module/zanode/lang/zh-cn.php @@ -63,6 +63,9 @@ $lang->zanode->manual = '手册'; $lang->zanode->initializing = '初始化中'; $lang->zanode->showPwd = '显示密码'; $lang->zanode->hidePwd = '隐藏密码'; +$lang->zanode->baseInfo = '基础信息'; +$lang->zanode->cpuUnit = '核'; +$lang->zanode->IP = 'IP/域名'; $lang->zanode->typeList['node'] = '虚拟机'; $lang->zanode->typeList['physics'] = '物理机'; @@ -149,8 +152,7 @@ $lang->zanode->init->next = "下一步"; $lang->zanode->init->button = "去设置"; $lang->zanode->init->initSuccessNoticeTitle = "服务已就绪,还需两步即可在执行节点上执行自动化测试:
1、根据%s配置自动化测试运行环境。
2、进行%s"; -$lang->zanode->init->initFailNoticeTitle = "初始化失败,请查看初始化脚本执行日志并尝试以下两种解决方案:"; -$lang->zanode->init->initFailNoticeDesc = "1、 重新执行脚本
2、 查看初始化常见问题"; +$lang->zanode->init->initFailNotice = "服务未就绪,在执行节点上执行安装服务命令或查看帮助."; $lang->zanode->init->serviceStatus = array( "ZenAgent" => 'not_install', diff --git a/module/zanode/model.php b/module/zanode/model.php index cd278381fb..4079c65161 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -54,14 +54,22 @@ class zanodemodel extends model public function create() { $data = fixer::input('post') - ->setIF($this->post->type == 'physics', 'parent', 0) - ->setIF($this->post->type == 'physics', 'osName', $this->post->osNamePhysics) + ->setIF($this->post->hostType == 'physics', 'parent', 0) + ->setIF($this->post->hostType == 'physics', 'osName', $this->post->osNamePhysics) ->remove('osNamePhysics') ->get(); + $data->type = "node"; + + if($data->hostType == 'physics') + { + $data->secret = md5($data->name . time()); + $data->status = "offline"; + } + /* Batch check fields. */ $this->dao->update(TABLE_ZAHOST)->data($data) - ->batchCheck($data->type == 'node' ? $this->config->zanode->create->requiredFields : $this->config->zanode->create->physicsRequiredFields, 'notempty'); + ->batchCheck($data->hostType != 'physics' ? $this->config->zanode->create->requiredFields : $this->config->zanode->create->physicsRequiredFields, 'notempty'); if(dao::isError()) return false; @@ -72,10 +80,10 @@ class zanodemodel extends model } /* If name already exists return error. */ - $node = $this->dao->select('*')->from(TABLE_ZAHOST)->where('name')->eq($data->name)->andWhere('type')->in('node,physics')->fetch(); + $node = $this->dao->select('*')->from(TABLE_ZAHOST)->where('name')->eq($data->name)->andWhere('type')->eq('node')->fetch(); if($node) return dao::$errors[] = $this->lang->zanode->nameUnique; - if($data->type == 'physics') + if($data->hostType == 'physics') { $ping = $this->loadModel('zahost')->checkAddress($data->extranet); if(!$ping) @@ -450,7 +458,7 @@ class zanodemodel extends model { $node = $this->getNodeByID($id); - if($node) + if($node && $node->hostType != 'physics') { $req = array( 'name' => $node->name ); $agnetUrl = 'http://' . $node->ip . ':' . $node->hzap; @@ -570,11 +578,11 @@ class zanodemodel extends model $query = str_replace('`hostID`', 't2.`id`', $query); } - $list = $this->dao->select("t1.*, t2.name as hostName, if(t1.type='node', t2.extranet, t1.extranet) extranet,if(t1.type='node', t3.osName, t1.osName) osName")->from(TABLE_ZAHOST)->alias('t1') + $list = $this->dao->select("t1.*, t2.name as hostName, if(t1.hostType='', t2.extranet, t1.extranet) extranet,if(t1.hostType='', t3.osName, t1.osName) osName")->from(TABLE_ZAHOST)->alias('t1') ->leftJoin(TABLE_ZAHOST)->alias('t2')->on('t1.parent = t2.id') ->leftJoin(TABLE_IMAGE)->alias('t3')->on('t3.id = t1.image') ->where('t1.deleted')->eq(0) - ->andWhere("((t1.type = 'node' and t2.type = 'zahost') or t1.type = 'physics')") + ->andWhere("t1.type = 'node'") ->beginIF($query)->andWhere($query)->fi() ->orderBy($orderBy) ->page($pager) @@ -587,7 +595,9 @@ class zanodemodel extends model foreach($list as $l) { - $host = zget($hosts, $l->parent); + $host = $l->hostType == '' ? zget($hosts, $l->parent) : clone $l; + $host->status = in_array($host->status, array('running', 'ready')) ? "online" : $host->status; + if($l->status == 'running' || $l->status == 'ready') { if(empty($host)) @@ -604,7 +614,7 @@ class zanodemodel extends model if(time() - strtotime($l->heartbeat) > 60) { - $l->status = 'wait'; + $l->status = $l->hostType == '' ? 'wait' : 'offline'; } } } @@ -654,6 +664,8 @@ class zanodemodel extends model */ public function getListByHost($hostID, $orderBy = 'id_desc') { + if(!$hostID) return array(); + $list = $this->dao->select('id, name, vnc, cpuCores, memory, diskSize, osName, status, heartbeat')->from(TABLE_ZAHOST) ->where('deleted')->eq(0) ->andWhere("parent")->eq($hostID) @@ -786,14 +798,16 @@ class zanodemodel extends model */ public function getNodeByID($id) { - $node = $this->dao->select("t1.*, t2.name as hostName, t2.extranet as ip,t2.zap as hzap,if(t1.type='node', t3.osName, t1.osName) osName, t2.tokenSN as tokenSN, t2.secret as secret")->from(TABLE_ZAHOST) + $node = $this->dao->select("t1.*, t2.name as hostName, if(t1.hostType='', t2.extranet, t1.extranet) ip,t2.zap as hzap,if(t1.hostType='', t3.osName, t1.osName) osName, if(t1.hostType='', t2.tokenSN, t1.tokenSN) tokenSN, if(t1.hostType='', t2.secret, t1.secret) secret")->from(TABLE_ZAHOST) ->alias('t1') ->leftJoin(TABLE_ZAHOST)->alias('t2')->on('t1.parent = t2.id') ->leftJoin(TABLE_IMAGE)->alias('t3')->on('t3.id = t1.image') ->where('t1.id')->eq($id) ->fetch(); - $host = $this->loadModel("zahost")->getByID($node->type == 'node' ? $node->parent : $node->id); + $host = $node->hostType == '' ? $this->loadModel("zahost")->getByID($node->parent) : clone $node; + $host->status = in_array($host->status, array('running', 'ready')) ? "online" : $host->status; + if($node->status == 'running' || $node->status == 'ready') { if(empty($host) || $host->status != 'online') @@ -802,7 +816,7 @@ class zanodemodel extends model } elseif(time() - strtotime($node->heartbeat) > 60) { - $node->status = 'wait'; + $node->status = $node->hostType == '' ? 'wait' : 'offline'; } } @@ -821,7 +835,9 @@ class zanodemodel extends model ->where('mac')->eq($mac) ->fetch(); - $host = $this->loadModel("zahost")->getByID($node->parent); + $host = $node->hostType == '' ? $this->loadModel("zahost")->getByID($node->parent) : $node; + $host->status = in_array($host->status, array('running', 'ready')) ? "online" : $host->status; + if($node->status == 'running' || $node->status == 'ready') { if(empty($host) || $host->status != 'online') diff --git a/module/zanode/view/browse.html.php b/module/zanode/view/browse.html.php index 6f32044c4f..26e45c9bd5 100644 --- a/module/zanode/view/browse.html.php +++ b/module/zanode/view/browse.html.php @@ -80,26 +80,26 @@ zanode->suspend}' target='hiddenwin'"; - $suspendAttr .= $node->type == 'physics' || $node->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'"; + $suspendAttr .= $node->hostType == 'physics' || $node->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'"; $resumeAttr = "title='{$lang->zanode->resume}' target='hiddenwin'"; - $resumeAttr .= $node->type == 'physics' || $node->status == 'running' || $node->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'"; + $resumeAttr .= $node->hostType == 'physics' || $node->status == 'running' || $node->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'"; $rebootAttr = "title='{$lang->zanode->reboot}' target='hiddenwin'"; - $rebootAttr .= $node->type == 'physics' || $node->status == 'shutoff' || $node->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'"; + $rebootAttr .= $node->hostType == 'physics' || $node->status == 'shutoff' || $node->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'"; $closeAttr = "title='{$lang->zanode->shutdown}'"; - $closeAttr .= $node->type == 'physics' || $node->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"'; + $closeAttr .= $node->hostType == 'physics' || $node->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"'; $startAttr = "title='{$lang->zanode->boot}'"; - $startAttr .= $node->type == 'physics' || $node->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"'; + $startAttr .= $node->hostType == 'physics' || $node->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"'; $snapshotAttr = "title='{$lang->zanode->createSnapshot}'"; - $snapshotAttr .= $node->type == 'physics' || $node->status != 'running' ? ' class="btn disabled"' : ' class="btn iframe"'; + $snapshotAttr .= $node->hostType == 'physics' || $node->status != 'running' ? ' class="btn disabled"' : ' class="btn iframe"'; - $imageAttr = $node->status != 'running' ? ' class="btn btn-action iframe createImage disabled"' : ' class="btn btn-action iframe createImage"'; + $imageAttr = $node->hostType == 'physics' || $node->status != 'running' ? ' class="btn btn-action iframe createImage disabled"' : ' class="btn btn-action iframe createImage"'; - common::printLink('zanode', 'getVNC', "id={$node->id}", " ", (in_array($node->status ,array('running', 'launch', 'wait')) ? '_blank' : ''), "title='{$lang->zanode->getVNC}' class='btn desktop " . (in_array($node->status ,array('running', 'launch', 'wait')) ? '':'disabled') . "'", ''); + common::printLink('zanode', 'getVNC', "id={$node->id}", " ", (in_array($node->status ,array('running', 'launch', 'wait')) ? '_blank' : ''), "title='{$lang->zanode->getVNC}' class='btn desktop " . ($node->hostType == '' && in_array($node->status ,array('running', 'launch', 'wait')) ? '':'disabled') . "'", ''); if($node->status == "suspend") { common::printLink('zanode', 'resume', "zanodeID={$node->id}", " ", '', $resumeAttr); diff --git a/module/zanode/view/create.html.php b/module/zanode/view/create.html.php index bddd7ac64f..49a581691a 100644 --- a/module/zanode/view/create.html.php +++ b/module/zanode/view/create.html.php @@ -24,7 +24,7 @@ - + diff --git a/module/zanode/view/edit.html.php b/module/zanode/view/edit.html.php index e733b205a0..a2e6b12940 100644 --- a/module/zanode/view/edit.html.php +++ b/module/zanode/view/edit.html.php @@ -21,7 +21,7 @@
zahost->type;?>zanode->typeList, 'virtual', "class='form-control chosen' onchange='zanodeType()'")?>zanode->typeList, 'virtual', "class='form-control chosen' onchange='zanodeType()'")?>
- type == 'node'):?> + hostType != 'physics'):?> @@ -29,17 +29,17 @@ - + - type == 'node'):?> + hostType != 'physics'):?> - + @@ -69,7 +69,7 @@ - + diff --git a/module/zanode/view/view.html.php b/module/zanode/view/view.html.php index 64686fcb72..52247cdec6 100644 --- a/module/zanode/view/view.html.php +++ b/module/zanode/view/view.html.php @@ -44,7 +44,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
-
zahost->baseInfo; ?>
+
zanode->baseInfo; ?>
@@ -63,7 +63,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
zanode->cpuCores; ?>:
-
cpuCores . ' ' . $lang->zahost->cpuUnit; ?>
+
cpuCores . ' ' . $lang->zanode->cpuUnit; ?>
@@ -132,28 +132,34 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou zanode->init->statusTitle; ?>
-
+
-   ZenAgent   +  ZenAgent   zanode->initializing; ?>
-   ZTF   +  ZTF   zanode->initializing; ?>  '>zanode->install ?>
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->init->initFailNoticeTitle . '
' . $lang->zanode->init->initFailNoticeDesc;?>
+
+ zanode->init->initFailNotice;?> + +
+ "; ?> +
+
- + hostType == ''):?>
zanode->browseSnapshot;?>
@@ -175,23 +181,23 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou deleted)) { $suspendAttr = "title='{$lang->zanode->suspend}' target='hiddenwin'"; - $suspendAttr .= $zanode->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'"; + $suspendAttr .= $zanode->hostType == 'physics' || $zanode->status != 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'"; $resumeAttr = "title='{$lang->zanode->resume}' target='hiddenwin'"; - $resumeAttr .= $zanode->status == 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'"; + $resumeAttr .= $zanode->hostType == 'physics' || $zanode->status == 'running' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'"; $rebootAttr = "title='{$lang->zanode->reboot}' target='hiddenwin'"; - $rebootAttr .= $zanode->status == 'shutoff' || $zanode->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'"; + $rebootAttr .= $zanode->hostType == 'physics' || $zanode->status == 'shutoff' || $zanode->status == 'wait' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'"; $closeAttr = "title='{$lang->zanode->shutdown}'"; - $closeAttr .= $zanode->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"'; + $closeAttr .= $zanode->hostType == 'physics' || $zanode->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"'; $startAttr = "title='{$lang->zanode->boot}'"; - $startAttr .= $zanode->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"'; + $startAttr .= $zanode->hostType == 'physics' || $zanode->status == 'wait' ? ' class="btn disabled"' : ' class="btn iframe"'; $snapshotAttr = "title='{$lang->zanode->createSnapshot}'"; - $snapshotAttr .= $zanode->status != 'running' ? ' class="btn disabled"' : ' class="btn iframe"'; - common::printLink('zanode', 'getVNC', "id={$zanode->id}", " " . $lang->zanode->getVNC, in_array($zanode->status ,array('running', 'launch', 'wait')) ? '_blank' : '', "title='{$lang->zanode->getVNC}' class='btn desktop " . (in_array($zanode->status ,array('running', 'launch', 'wait')) ? '':'disabled') . "'", ''); + $snapshotAttr .= $zanode->hostType == 'physics' || $zanode->status != 'running' ? ' class="btn disabled"' : ' class="btn iframe"'; + common::printLink('zanode', 'getVNC', "id={$zanode->id}", " " . $lang->zanode->getVNC, in_array($zanode->status ,array('running', 'launch', 'wait')) ? '_blank' : '', "title='{$lang->zanode->getVNC}' class='btn desktop " . ($zanode->hostType == '' && in_array($zanode->status ,array('running', 'launch', 'wait')) ? '':'disabled') . "'", ''); if($zanode->status == "suspend") {
zanode->hostName;?> name, "class='form-control' readonly='readonly'");?>
zanode->name;?>name, "class='form-control' placeholder=\"{$lang->zanode->nameValid}\" readonly='readonly'");?>name, "class='form-control' placeholder=\"{$lang->zanode->nameValid}\" " . ($zanode->hostType != 'physics' ? "readonly='readonly'" : ''));?>
zanode->image;?> name, "class='form-control' readonly='readonly'");?>
zahost->IP;?>zanode->IP;?> extranet, "class='form-control' readonly='readonly'");?>
zanode->osName;?>osName, "class='form-control' readonly='readonly'")?>osName, "class='form-control' " . ($zanode->hostType != 'physics' ? "readonly='readonly'" : ''))?>
zanode->desc ?>