diff --git a/module/zanode/config.php b/module/zanode/config.php
index cf21004640..447e580967 100644
--- a/module/zanode/config.php
+++ b/module/zanode/config.php
@@ -3,7 +3,7 @@ $config->zanode->create = new stdClass();
$config->zanode->edit = new stdClass();
$config->zanode->createimage = new stdClass();
$config->zanode->create->requiredFields = 'name,host,image,cpu,memory,disk,osName';
-$config->zanode->create->physicsRequiredFields = 'name,extranet,cpu,memory,osName';
+$config->zanode->create->physicsRequiredFields = 'name,extranet,cpu,memory,osNamePhysics';
$config->zanode->edit->requiredFields = '';
$config->zanode->createimage->requiredFields = 'name';
@@ -13,6 +13,7 @@ $config->zanode->defaultWinAccount = 'admin';
$config->zanode->defaultPwd = 'CQdliYQn6tKkoFhP';
$config->zanode->initBash = 'curl -sSL https://pkg.qucheng.com/zenagent/zagent.sh | bash /dev/stdin -s zvm -k %s -z %s';
+$config->zanode->initPosh = 'Invoke-WebRequest -UseBasicParsing -Uri "https://pkg.qucheng.com/zenagent/zagent-vm.ps1" -OutFile "./install-zanget-vm.ps1"; &"./install-zanget-vm.ps1" -s %s -z %s';
$config->zanode->os = new stdClass();
@@ -51,3 +52,33 @@ $config->zanode->editor->create = array('id' => 'desc', 'tools' => 'simpleT
$config->zanode->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
$config->zanode->editor->createimage = array('id' => 'desc', 'tools' => 'simpleTools');
$config->zanode->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools');
+
+$config->zanode->osType = array('linux' => 'Linux', 'windows' => 'Microsoft Windows');
+
+$config->zanode->linuxList[''] = '';
+$config->zanode->linuxList['centOS65'] = 'CentOS 6.5';
+$config->zanode->linuxList['centOS66'] = 'CentOS 6.6';
+$config->zanode->linuxList['centOS67'] = 'CentOS 6.7';
+$config->zanode->linuxList['centOS70'] = 'CentOS 7.0';
+$config->zanode->linuxList['centOS71'] = 'CentOS 7.1';
+$config->zanode->linuxList['centOS79'] = 'CentOS 7.9';
+
+$config->zanode->linuxList['ubuntu1404'] = 'Ubuntu 14.04';
+$config->zanode->linuxList['ubuntu1604'] = 'Ubuntu 16.04';
+$config->zanode->linuxList['ubuntu1804'] = 'Ubuntu 18.04';
+$config->zanode->linuxList['ubuntu2004'] = 'Ubuntu 20.04';
+
+$config->zanode->linuxList['debianBullseye'] = 'Debian Bullseye';
+$config->zanode->linuxList['debianBuster'] = 'Debian Buster';
+
+$config->zanode->windowsList[''] = '';
+$config->zanode->windowsList['win10'] = 'Windows 10';
+$config->zanode->windowsList['winserver08x64'] = 'Windows Server2008 x64';
+$config->zanode->windowsList['winserver12'] = 'Windows Server2012';
+$config->zanode->windowsList['winserver16'] = 'Windows Server2016';
+
+$config->zanode->versionToOs[''] = '';
+$config->zanode->versionToOs['win10'] = 'windows';
+$config->zanode->versionToOs['winserver08x64'] = 'windows';
+$config->zanode->versionToOs['winserver12'] = 'windows';
+$config->zanode->versionToOs['winserver16'] = 'windows';
\ No newline at end of file
diff --git a/module/zanode/control.php b/module/zanode/control.php
index 87ee162afc..b403c4e337 100644
--- a/module/zanode/control.php
+++ b/module/zanode/control.php
@@ -167,7 +167,7 @@ class zanode extends control
$this->view->title = $this->lang->zanode->view;
$this->view->zanode = $node;
$this->view->snapshotList = $this->zanode->getSnapshotList($id);
- $this->view->initBash = sprintf($this->config->zanode->initBash, $node->secret, getWebRoot(true));
+ $this->view->initBash = sprintf(zget($this->config->zanode->versionToOs, $node->osName, '') != '' ? $this->config->zanode->initPosh : $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');
@@ -563,8 +563,9 @@ class zanode extends control
if ($node->status != 'running')
{
$serviceStatus['ZenAgent'] = "unknown";
- $serviceStatus['ZTF'] = "unknown";
+ $serviceStatus['ZTF'] = "unknown";
}
+ $node->status = $node->status == 'online' ? 'ready' : $node->status;
$serviceStatus['node'] = $node->status;
return $this->send(array('result' => 'success', 'message' => '', 'data' => $serviceStatus));
diff --git a/module/zanode/css/common.css b/module/zanode/css/common.css
index 1ef909a85b..8190cc895c 100644
--- a/module/zanode/css/common.css
+++ b/module/zanode/css/common.css
@@ -1 +1,3 @@
.icon-help{line-height: 34px;}
+#osNamePhysicsContainer{display: flex;}
+#osNamePhysicsContainer select{margin-right: 5px;}
\ No newline at end of file
diff --git a/module/zanode/js/create.js b/module/zanode/js/create.js
index 153bc3b0d0..efad795dbe 100644
--- a/module/zanode/js/create.js
+++ b/module/zanode/js/create.js
@@ -12,7 +12,7 @@ function zanodeType()
$('#image').closest('tr').hide();
$('#extranet').closest('tr').removeClass('hidden');
$('#osName').addClass('hidden');
- $('#osNamePhysics').removeClass('hidden');
+ $('#osNamePhysicsContainer').removeClass('hidden');
}
else
{
@@ -20,7 +20,7 @@ function zanodeType()
$('#image').closest('tr').show();
$('#extranet').closest('tr').addClass('hidden');
$('#osName').removeClass('hidden');
- $('#osNamePhysics').addClass('hidden');
+ $('#osNamePhysicsContainer').addClass('hidden');
}
}
@@ -38,3 +38,30 @@ function loadHosts()
$('#hostIdBox').find('#parent').chosen();
});
}
+
+$(function()
+{
+ $('#osNamePhysicsPre').on('change', function()
+ {
+ console.log($(this).val())
+ if($(this).val() == 'linux')
+ {
+ $('#osNamePhysics').empty();
+ for(var i in linuxList)
+ {
+ console.log(linuxList[i])
+ $('#osNamePhysics').append('')
+ }
+ }
+ else
+ {
+ $('#osNamePhysics').empty();
+ for(var i in windowsList)
+ {
+ console.log(windowsList[i])
+ $('#osNamePhysics').append('')
+ }
+ }
+ $('#osNamePhysics').trigger('chosen:updated');
+ })
+})
\ No newline at end of file
diff --git a/module/zanode/js/view.js b/module/zanode/js/view.js
index 8a3d6c81c5..a662d9a178 100644
--- a/module/zanode/js/view.js
+++ b/module/zanode/js/view.js
@@ -36,7 +36,14 @@ function checkServiceStatus(){
{
if(resultData.data[key] == 'unknown')
{
- $('.ztf-status').text(zanodeLang.init.unknown)
+ if(hostType == 'physics')
+ {
+ $('.ztf-status').text(zanodeLang.init.not_install)
+ }
+ else
+ {
+ $('.ztf-status').text(zanodeLang.init.unknown)
+ }
}
else
{
@@ -210,6 +217,9 @@ $('#jumpManual').click(function()
$(function(){
$('#checkServiceStatus').trigger("click")
+ if(hostType == 'physics'){
+ return;
+ }
checkInterval = setInterval(() => {
intervalTimes++;
if(intervalTimes > 300)
diff --git a/module/zanode/lang/de.php b/module/zanode/lang/de.php
index a066079d06..e267876755 100644
--- a/module/zanode/lang/de.php
+++ b/module/zanode/lang/de.php
@@ -22,6 +22,7 @@ $lang->zanode->getVNC = 'Remote management';
$lang->zanode->all = 'All';
$lang->zanode->byQuery = 'Search';
$lang->zanode->osName = 'System';
+$lang->zanode->osNamePhysics = 'System';
$lang->zanode->image = 'VM Image';
$lang->zanode->imageName = 'Image Name';
$lang->zanode->name = 'Name';
@@ -29,7 +30,8 @@ $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 Command';
+$lang->zanode->sshCommand = 'SSH Command';
+$lang->zanode->sshAddress = 'SSH Address';
$lang->zanode->osArch = 'Arch';
$lang->zanode->cpuCores = 'CPU';
$lang->zanode->defaultUser = 'Default Account Name';
@@ -154,8 +156,9 @@ $lang->zanode->init->ready = "Ready";
$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->initFailNotice = "Fail,Execute the installation service command on the node or See Help.";
+$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->initFailNotice = "Fail,Execute the installation service command on the node or See Help.";
+$lang->zanode->init->initFailNoticeOnPhysics = "The service has not been installed yet, please check the service status after executing the following command on the execution node。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 d5079ea53f..32d75cb283 100644
--- a/module/zanode/lang/en.php
+++ b/module/zanode/lang/en.php
@@ -22,6 +22,7 @@ $lang->zanode->getVNC = 'Remote management';
$lang->zanode->all = 'All';
$lang->zanode->byQuery = 'Search';
$lang->zanode->osName = 'System';
+$lang->zanode->osNamePhysics = 'System';
$lang->zanode->image = 'VM Image';
$lang->zanode->imageName = 'Image Name';
$lang->zanode->name = 'Name';
@@ -29,7 +30,8 @@ $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 Command';
+$lang->zanode->sshCommand = 'SSH Command';
+$lang->zanode->sshAddress = 'SSH Address';
$lang->zanode->osArch = 'Arch';
$lang->zanode->cpuCores = 'CPU';
$lang->zanode->defaultUser = 'Default Account Name';
@@ -154,8 +156,9 @@ $lang->zanode->init->ready = "Ready";
$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->initFailNotice = "Fail,Execute the installation service command on the node or See Help.";
+$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->initFailNotice = "Fail,Execute the installation service command on the node or See Help.";
+$lang->zanode->init->initFailNoticeOnPhysics = "The service has not been installed yet, please check the service status after executing the following command on the execution node。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 a066079d06..e267876755 100644
--- a/module/zanode/lang/fr.php
+++ b/module/zanode/lang/fr.php
@@ -22,6 +22,7 @@ $lang->zanode->getVNC = 'Remote management';
$lang->zanode->all = 'All';
$lang->zanode->byQuery = 'Search';
$lang->zanode->osName = 'System';
+$lang->zanode->osNamePhysics = 'System';
$lang->zanode->image = 'VM Image';
$lang->zanode->imageName = 'Image Name';
$lang->zanode->name = 'Name';
@@ -29,7 +30,8 @@ $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 Command';
+$lang->zanode->sshCommand = 'SSH Command';
+$lang->zanode->sshAddress = 'SSH Address';
$lang->zanode->osArch = 'Arch';
$lang->zanode->cpuCores = 'CPU';
$lang->zanode->defaultUser = 'Default Account Name';
@@ -154,8 +156,9 @@ $lang->zanode->init->ready = "Ready";
$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->initFailNotice = "Fail,Execute the installation service command on the node or See Help.";
+$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->initFailNotice = "Fail,Execute the installation service command on the node or See Help.";
+$lang->zanode->init->initFailNoticeOnPhysics = "The service has not been installed yet, please check the service status after executing the following command on the execution node。See Help";
$lang->zanode->init->serviceStatus = array(
"ZenAgent" => 'not_install',
diff --git a/module/zanode/lang/zh-cn.php b/module/zanode/lang/zh-cn.php
index 794e92aca1..40426b0ee7 100644
--- a/module/zanode/lang/zh-cn.php
+++ b/module/zanode/lang/zh-cn.php
@@ -22,6 +22,7 @@ $lang->zanode->getVNC = '远程';
$lang->zanode->all = '全部';
$lang->zanode->byQuery = '搜索';
$lang->zanode->osName = '操作系统';
+$lang->zanode->osNamePhysics = '操作系统';
$lang->zanode->image = '镜像';
$lang->zanode->imageName = '镜像名称';
$lang->zanode->name = '名称';
@@ -29,7 +30,8 @@ $lang->zanode->start = '创建后自动开启';
$lang->zanode->hostName = '所属宿主机';
$lang->zanode->host = $lang->zanode->hostName;
$lang->zanode->extranet = 'IP/域名';
-$lang->zanode->sshAddress = 'SSH命令';
+$lang->zanode->sshCommand = 'SSH命令';
+$lang->zanode->sshAddress = 'SSH地址';
$lang->zanode->osArch = '架构';
$lang->zanode->cpuCores = 'CPU';
$lang->zanode->defaultUser = '默认用户';
@@ -136,7 +138,7 @@ $lang->zanode->statusList['shutoff'] = '已关机';
$lang->zanode->statusList['shutodown'] = '已关机';
$lang->zanode->statusList['destroy_fail'] = '销毁失败';
$lang->zanode->statusList['wait'] = '初始化中';
-$lang->zanode->statusList['online'] = '已上架';
+$lang->zanode->statusList['online'] = '运行中';
$lang->zanode->statusList['restoring'] = '还原中';
$lang->zanode->statusList['creating_snap'] = '创建快照中';
$lang->zanode->statusList['creating_img'] = '导出镜像中';
@@ -154,8 +156,9 @@ $lang->zanode->init->ready = "已就绪";
$lang->zanode->init->next = "下一步";
$lang->zanode->init->button = "去设置";
-$lang->zanode->init->initSuccessNoticeTitle = "服务已就绪,还需两步即可在执行节点上执行自动化测试:
1、根据%s配置自动化测试运行环境。
2、进行%s";
-$lang->zanode->init->initFailNotice = "服务未就绪,在执行节点上执行安装服务命令或查看帮助.";
+$lang->zanode->init->initSuccessNoticeTitle = "服务已就绪,还需两步即可在执行节点上执行自动化测试:
1、根据%s配置自动化测试运行环境。
2、进行%s";
+$lang->zanode->init->initFailNotice = "服务未就绪,在执行节点上执行安装服务命令或查看帮助.";
+$lang->zanode->init->initFailNoticeOnPhysics = "服务还没有安装,请在执行节点执行以下命令后检测服务状态。查看帮助";
$lang->zanode->init->serviceStatus = array(
"ZenAgent" => 'not_install',
diff --git a/module/zanode/model.php b/module/zanode/model.php
index fcd5bdad85..9d8496106b 100644
--- a/module/zanode/model.php
+++ b/module/zanode/model.php
@@ -59,7 +59,6 @@ class zanodemodel extends model
$data = fixer::input('post')
->setIF($this->post->hostType == 'physics', 'parent', 0)
->setIF($this->post->hostType == 'physics', 'osName', $this->post->osNamePhysics)
- ->remove('osNamePhysics')
->get();
$data->type = "node";
@@ -80,6 +79,7 @@ class zanodemodel extends model
if(dao::isError()) return false;
+ unset($data->osNamePhysics);
if(!preg_match("/^(?!_)(?!-)(?!\.)[a-zA-Z0-9\_\.\-]+$/", $data->name))
{
dao::$errors[] = $this->lang->zanode->nameValid;
diff --git a/module/zanode/view/browse.html.php b/module/zanode/view/browse.html.php
index cffabea247..e88f0ead05 100644
--- a/module/zanode/view/browse.html.php
+++ b/module/zanode/view/browse.html.php
@@ -69,7 +69,7 @@