diff --git a/module/common/lang/de.php b/module/common/lang/de.php
index 31f39799aa..44eb1b433f 100644
--- a/module/common/lang/de.php
+++ b/module/common/lang/de.php
@@ -179,7 +179,7 @@ $lang->testtask->common = 'Request';
$lang->score->common = 'Score';
$lang->build->common = 'Build';
$lang->testreport->common = 'Report';
-$lang->automation->common = 'Automation';
+$lang->automation->common = 'Automation:';
$lang->zahost->common = 'ZAhost';
$lang->executionnode->common = 'Execution Node';
$lang->team->common = 'Team';
diff --git a/module/common/lang/en.php b/module/common/lang/en.php
index 6c2eb5bf0e..14694c011a 100644
--- a/module/common/lang/en.php
+++ b/module/common/lang/en.php
@@ -179,7 +179,7 @@ $lang->testtask->common = 'Request';
$lang->score->common = 'Score';
$lang->build->common = 'Build';
$lang->testreport->common = 'Report';
-$lang->automation->common = 'Automation';
+$lang->automation->common = 'Automation:';
$lang->zahost->common = 'ZAhost';
$lang->executionnode->common = 'Execution Node';
$lang->team->common = 'Team';
diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php
index a738784ee8..54ea15507f 100644
--- a/module/common/lang/fr.php
+++ b/module/common/lang/fr.php
@@ -179,7 +179,7 @@ $lang->testtask->common = 'Request';
$lang->score->common = 'Score';
$lang->build->common = 'Build';
$lang->testreport->common = 'Report';
-$lang->automation->common = 'Automation';
+$lang->automation->common = 'Automation:';
$lang->zahost->common = 'ZAhost';
$lang->executionnode->common = 'Execution Node';
$lang->team->common = 'Team';
diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php
index adffa35d69..abbdf14037 100644
--- a/module/common/lang/menu.php
+++ b/module/common/lang/menu.php
@@ -450,7 +450,7 @@ $lang->qa->menu->testsuite = array('link' => "{$lang->testcase->testsuite}|t
$lang->qa->menu->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testtask', 'alias' => 'view,edit,linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
$lang->qa->menu->report = array('link' => "{$lang->testreport->common}|testreport|browse|productID=%s", 'subModule' => 'testreport');
$lang->qa->menu->caselib = array('link' => "{$lang->testcase->caselib}|caselib|browse|libID=0", 'subModule' => 'caselib');
-$lang->qa->menu->automation = array('link' => "{$lang->automation->common}|automation|browse|productID=%s", 'subModule' => 'automation', 'alias' => '');
+$lang->qa->menu->automation = array('link' => "{$lang->automation->common}|project|other|productID=%s", 'subModule' => 'automation', 'alias' => '', 'class' => "qa-automation-menu");
$lang->qa->menu->zahost = array('link' => "{$lang->zahost->common}|zahost|browse", 'subModule' => 'zahost');
$lang->qa->menu->executionnode = array('link' => "{$lang->executionnode->common}|executionnode|browse", 'subModule' => 'executionnode');
diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php
index c42b93e921..15453a6bf8 100644
--- a/module/common/lang/zh-cn.php
+++ b/module/common/lang/zh-cn.php
@@ -179,7 +179,7 @@ $lang->testtask->common = '测试单';
$lang->score->common = '我的积分';
$lang->build->common = '版本';
$lang->testreport->common = '测试报告';
-$lang->automation->common = '自动化';
+$lang->automation->common = '自动化:';
$lang->zahost->common = '宿主机';
$lang->executionnode->common = '执行节点';
$lang->team->common = '团队';
diff --git a/module/executionnode/model.php b/module/executionnode/model.php
index 3ab249cc34..71edfb6cd0 100755
--- a/module/executionnode/model.php
+++ b/module/executionnode/model.php
@@ -300,6 +300,24 @@ class executionnodemodel extends model
->fetchAll();
}
+ /**
+ * Get node list by hostid.
+ *
+ * @param string $browseType
+ * @param int $param
+ * @param string $orderBy
+ * @param object $pager
+ * @return void
+ */
+ public function getListByHost($hostID, $orderBy = 'id_desc')
+ {
+ return $this->dao->select('id, name, vnc, cpu, memory, disk, os, status')->from(TABLE_EXECUTIONNODE)
+ ->where('deleted')->eq(0)
+ ->andWhere("hostID")->eq($hostID)
+ ->orderBy($orderBy)
+ ->fetchAll();
+ }
+
/**
* Get Host by id.
diff --git a/module/zahost/control.php b/module/zahost/control.php
index 8c44946990..309d8d7b43 100644
--- a/module/zahost/control.php
+++ b/module/zahost/control.php
@@ -12,7 +12,7 @@
class zahost extends control
{
/**
- * View host.
+ * View host list.
*
* @param string $browseType
* @param string $param
@@ -52,6 +52,26 @@ class zahost extends control
$this->display();
}
+ /**
+ * View host.
+ *
+ * @param int $id
+ * @access public
+ * @return void
+ */
+ public function view($id, $orderBy = 'id_desc')
+ {
+ $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->orderBy = $orderBy;
+ $this->view->nodeList = $this->loadModel("executionnode")->getListByHost($this->view->zahost->hostID, $orderBy);
+ $this->view->actions = $this->loadModel('action')->getList('zahost', $id);
+ $this->display();
+ }
+
/**
* Create host.
*
diff --git a/module/zahost/css/create.css b/module/zahost/css/create.css
index 6affb4df70..20d6b74309 100644
--- a/module/zahost/css/create.css
+++ b/module/zahost/css/create.css
@@ -1,3 +1,3 @@
#unit {padding: 0px !important; width:0px; border-left: 0px;width: 63px;}
.input-group-addon {border: 0px; width: 100px;}
-#memory-addon{padding-left: 30px;text-align: left;width: 63px;}
\ No newline at end of file
+#memory-addon{text-align: center;width: 63px;}
\ No newline at end of file
diff --git a/module/zahost/css/view.css b/module/zahost/css/view.css
new file mode 100644
index 0000000000..734631374a
--- /dev/null
+++ b/module/zahost/css/view.css
@@ -0,0 +1,5 @@
+.zahost-detail .text-right{text-align: right;}
+.zahost-detail .col-8{padding-left: 10px;}
+.zahost-detail .detail-content{color: #838a9d;}
+.table.has-sort-head thead tr th a:after{line-height: 22px;}
+.table.has-sort-head thead tr th a:before{line-height: 22px;}
\ No newline at end of file
diff --git a/module/zahost/lang/de.php b/module/zahost/lang/de.php
index a98de16488..3678f9d7fa 100644
--- a/module/zahost/lang/de.php
+++ b/module/zahost/lang/de.php
@@ -10,6 +10,7 @@ $lang->zahost->delete = 'Delete';
$lang->zahost->deleteAction = 'Delete Host';
$lang->zahost->byQuery = 'Search';
$lang->zahost->all = 'All';
+$lang->zahost->browseNode = 'ExecutionNode Browse';
$lang->zahost->browseTemplate = 'Template Browse';
$lang->zahost->createTemplate = 'Create Template';
$lang->zahost->editTemplate = 'Edit Template';
diff --git a/module/zahost/lang/en.php b/module/zahost/lang/en.php
index 9670b431a5..b54a05a3f1 100644
--- a/module/zahost/lang/en.php
+++ b/module/zahost/lang/en.php
@@ -10,6 +10,7 @@ $lang->zahost->delete = 'Delete';
$lang->zahost->deleteAction = 'Delete Host';
$lang->zahost->byQuery = 'Search';
$lang->zahost->all = 'All';
+$lang->zahost->browseNode = 'ExecutionNode Browse';
$lang->zahost->browseTemplate = 'Template Browse';
$lang->zahost->createTemplate = 'Create Template';
$lang->zahost->editTemplate = 'Edit Template';
@@ -20,7 +21,7 @@ $lang->zahost->IP = 'IP/Domain';
$lang->zahost->address = 'IP/Domain';
$lang->zahost->cpu = 'CPU Cores';
$lang->zahost->memory = 'Memory Size';
-$lang->zahost->disk = 'Disk Size';
+$lang->zahost->disk = 'Disk Size';
$lang->zahost->desc = 'Description';
$lang->zahost->type = 'Type';
$lang->zahost->status = 'Status';
diff --git a/module/zahost/lang/fr.php b/module/zahost/lang/fr.php
index 9fed42b274..7a7a6f2134 100644
--- a/module/zahost/lang/fr.php
+++ b/module/zahost/lang/fr.php
@@ -10,6 +10,7 @@ $lang->zahost->delete = 'Supprimer';
$lang->zahost->deleteAction = 'Supprimer Hôte';
$lang->zahost->byQuery = 'Recherche';
$lang->zahost->all = 'Tous les hôtes';
+$lang->zahost->browseNode = 'ExecutionNode Browse';
$lang->zahost->browseTemplate = 'Template Browse';
$lang->zahost->createTemplate = 'Create Template';
$lang->zahost->editTemplate = 'Edit Template';
@@ -20,7 +21,7 @@ $lang->zahost->IP = 'IP/Domain';
$lang->zahost->address = 'IP';
$lang->zahost->cpu = 'CPU Cores';
$lang->zahost->memory = 'Mémoire Espace';
-$lang->zahost->disk = 'Disque Espace';
+$lang->zahost->disk = 'Disque Espace';
$lang->zahost->desc = 'Description';
$lang->zahost->type = 'Type';
$lang->zahost->status = 'Status';
diff --git a/module/zahost/lang/vi.php b/module/zahost/lang/vi.php
index a6977cd1d8..86674d4f0c 100644
--- a/module/zahost/lang/vi.php
+++ b/module/zahost/lang/vi.php
@@ -10,6 +10,7 @@ $lang->zahost->delete = 'Delete';
$lang->zahost->deleteAction = 'Delete Host';
$lang->zahost->byQuery = 'Search';
$lang->zahost->all = 'All';
+$lang->zahost->browseNode = 'ExecutionNode Browse';
$lang->zahost->browseTemplate = 'Template Browse';
$lang->zahost->createTemplate = 'Create Template';
$lang->zahost->editTemplate = 'Edit Template';
diff --git a/module/zahost/lang/zh-cn.php b/module/zahost/lang/zh-cn.php
index ec842c4153..d33729a7fd 100644
--- a/module/zahost/lang/zh-cn.php
+++ b/module/zahost/lang/zh-cn.php
@@ -1,15 +1,17 @@
zahost->id = 'ID';
$lang->zahost->common = '宿主机';
-$lang->zahost->browse = '主机列表';
+$lang->zahost->common = '宿主机';
+$lang->zahost->browse = '宿主机列表';
$lang->zahost->create = '添加宿主机';
-$lang->zahost->view = '主机详情';
+$lang->zahost->view = '宿主机详情';
$lang->zahost->edit = '编辑';
$lang->zahost->editAction = '编辑宿主机';
$lang->zahost->delete = '删除';
$lang->zahost->deleteAction = '删除宿主机';
$lang->zahost->byQuery = '搜索';
$lang->zahost->all = '全部主机';
+$lang->zahost->browseNode = '执行节点列表';
$lang->zahost->browseTemplate = '虚拟机模板列表';
$lang->zahost->createTemplate = '创建虚拟机模板';
$lang->zahost->editTemplate = '编辑虚拟机模板';
@@ -108,7 +110,7 @@ $lang->zahost->langList['zh_cn'] = '简体中文';
$lang->zahost->langList['zh_tw'] = '繁体中文';
$lang->zahost->langList['en_us'] = '美式英语';
-$lang->zahost->empty = '暂时没有主机';
+$lang->zahost->empty = '暂时没有宿主机';
$lang->zahost->templateEmpty = '暂时没有模板';
$lang->zahost->statusList['ready'] = '准备中';
diff --git a/module/zahost/model.php b/module/zahost/model.php
index 9672791760..cbce05d9d4 100644
--- a/module/zahost/model.php
+++ b/module/zahost/model.php
@@ -247,6 +247,8 @@ class zahostModel extends model
$imageData->hostID = $hostID;
$imageData->status = 'created';
+ $imageData->osCategory = $imageData->os;
+ unset($imageData->os);
$this->dao->insert(TABLE_IMAGE)->data($imageData, 'desc')->autoCheck()->exec();
if(dao::isError()) return false;
@@ -305,11 +307,11 @@ class zahostModel extends model
foreach($result->data as $status => $group)
{
$currentTask = null;
- foreach($group as $task)
+ foreach($group as $host)
{
- if($task->task == $image->id )
+ if($host->task == $image->id )
{
- $currentTask = $task;
+ $currentTask = $host;
break;
}
}
@@ -435,6 +437,42 @@ class zahostModel extends model
->fetchAll();
}
+ /**
+ * Build test task menu.
+ *
+ * @param object $host
+ * @param string $type
+ * @access public
+ * @return string
+ */
+ public function buildOperateMenu($host, $type = 'view')
+ {
+ $function = 'buildOperate' . ucfirst($type) . 'Menu';
+ return $this->$function($host);
+ }
+
+ /**
+ * Build test task view menu.
+ *
+ * @param object $host
+ * @access public
+ * @return string
+ */
+ public function buildOperateViewMenu($host)
+ {
+ if($host->deleted) return '';
+
+ $menu = '';
+ $params = "hostID=$host->hostID";
+
+ $menu .= $this->buildMenu('zahost', 'edit', $params, $host, 'view');
+
+ $params = "hostID=$host->assetID";
+ $menu .= $this->buildMenu('zahost', 'delete', $params, $host, 'view', 'trash', 'hiddenwin');
+
+ return $menu;
+ }
+
/**
* Get VM template list.
*
diff --git a/module/zahost/view/browse.html.php b/module/zahost/view/browse.html.php
index 671b951583..49e6900eab 100644
--- a/module/zahost/view/browse.html.php
+++ b/module/zahost/view/browse.html.php
@@ -59,7 +59,7 @@
| hostID);?> |
- inlink('browsetemplate', "id=$host->hostID"), $host->name) : $host->name;?> |
+ inlink('view', "id=$host->hostID"), $host->name, '', "");?> |
zahost->zaHostTypeList, $host->hostType);?> |
address;?> |
cpu;?> |
diff --git a/module/zahost/view/view.html.php b/module/zahost/view/view.html.php
new file mode 100644
index 0000000000..2e120bec51
--- /dev/null
+++ b/module/zahost/view/view.html.php
@@ -0,0 +1,135 @@
+
+ * @package zahost
+ * @version $Id: view.html.php $
+ * @link http://www.zentao.net
+ */
+?>
+
+
+session->zahostList ? $this->session->zahostList : $this->createLink('zahost', 'browse', "");?>
+hostID}&orderBy=%s";?>
+
+
+
+
+
+
zahost->view;?>
+
+
+
+
+
zahost->zaHostType;?>:
+
zahost->zaHostTypeList[$zahost->hostType];?>
+
+
+
+
+
zahost->address;?>:
+
address;?>
+
+
+
+
+
zahost->memory;?>:
+
memory;?>
+
+
+
+
+
+
+
zahost->virtualSoftware;?>:
+
virtualSoftware;?>
+
+
+
+
+
zahost->cpu;?>:
+
cpu;?>
+
+
+
+
+
zahost->disk;?>:
+
disk;?>
+
+
+
+
+
+
+
zahost->desc;?>
+
desc) ? $zahost->desc : $lang->noData;?>
+
+
+
+
zahost->browseNode;?>
+
+
+
+
+ | zahost->name);?> |
+ executionnode->cpu);?> |
+ executionnode->memory);?> |
+ executionnode->disk);?> |
+ executionnode->os);?> |
+ executionnode->status);?> |
+
+
+
+
+
+ | name;?> |
+ executionnode->os->cpu, $node->cpu);?> |
+ memory . $this->lang->zahost->unitList['GB'];?> |
+ disk . zget($this->lang->zahost->unitList, $node->unit);?> |
+ executionnode->os->list, $node->os);?> |
+ executionnode->statusList, $node->status);?> |
+
+
+
+
+
+
+
+ createLink('action', 'comment', "objectType=zahost&objectID=$zahost->hostID");
+ ?>
+
+ printExtendFields($zahost, 'div', "position=left&inForm=0&inCell=1");?>
+
+
+
+
+
+
+
+
+