* Code for task #81383.

This commit is contained in:
tanghucheng
2022-12-27 16:51:55 +08:00
parent c27f758bf8
commit 6582359c3f
5 changed files with 43 additions and 1 deletions
+1
View File
@@ -152,6 +152,7 @@ $lang->testcase->stepChild = '子步骤';
$lang->testcase->viewAll = '查看所有';
$lang->testcase->importToLib = '导入用例库';
$lang->testcase->showScript = '查看自动化脚本';
$lang->testcase->autoScript = '自动化脚本';
$lang->testcase->new = '新增';
+7
View File
@@ -148,9 +148,16 @@ foreach(explode(',', $config->testcase->create->requiredFields) as $field)
<?php if(!$this->testcase->forceNotReview()):?>
<span class="input-group-addon"><?php echo html::checkbox('forceNotReview', $lang->testcase->forceNotReview, '', "id='forceNotReview0'");?></span>
<?php endif;?>
<div class="input-group-addon">
<?php echo html::checkbox('auto', $lang->testcase->showAutoCase, '', "id='autocase' title='{$lang->testcase->showAutoCase}'");?>
</div>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->autoScript;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform', 'fileCount=1&percent=0.9&filesName=script');?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->precondition;?></th>
<td colspan='2'><?php echo html::textarea('precondition', $precondition, " rows='2' class='form-control'");?></td>
+24
View File
@@ -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.
*
+1
View File
@@ -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']);
+10 -1
View File
@@ -57,7 +57,7 @@
<th class='c-os'><?php common::printOrderLink('t1.osName', $orderBy, $vars, $lang->zanode->osName); ?></th>
<th class='c-status'><?php common::printOrderLink('t1.status', $orderBy, $vars, $lang->zanode->status); ?></th>
<th class='c-host'><?php common::printOrderLink('t2.name', $orderBy, $vars, $lang->zanode->hostName); ?>
<th class='c-actions-5 text-center'><?php echo $lang->actions ?></th>
<th class='c-actions-6 text-center'><?php echo $lang->actions ?></th>
</tr>
</thead>
<tbody>
@@ -93,6 +93,15 @@
common::printLink('zanode', 'suspend', "zanodeID={$node->id}", "<i class='icon icon-pause'></i> ", '', $suspendAttr);
}
if($node->status == "shutoff")
{
common::printLink('zanode', 'start', "zanodeID={$node->id}", "<i class='icon icon-magic'></i> ", '', "class='btn '");
}
else
{
common::printLink('zanode', 'close', "zanodeID={$node->id}", "<i class='icon icon-off'></i> ", '', "class='btn '");
}
common::printLink('zanode', 'reboot', "zanodeID={$node->id}", "<i class='icon icon-restart'></i> ", '', $rebootAttr);
common::printIcon('zanode', 'edit', "id={$node->id}", $node, 'list');