Merge remote-tracking branch 'origin/zenops_zg' into zenops_66

This commit is contained in:
zhaoke
2023-03-13 11:19:33 +08:00
13 changed files with 88 additions and 18 deletions
+1
View File
@@ -0,0 +1 @@
table a.refresh {border-color: white;}
+8
View File
@@ -0,0 +1,8 @@
function loadNodes()
{
var nodeLink = createLink('zanode', 'ajaxGetNodes');
$('#nodeIdBox').load(nodeLink, function()
{
$('#nodeIdBox').find('#node').picker();
});
}
+7 -6
View File
@@ -33,26 +33,27 @@
<?php endif;?>
<tr>
<th class='w-100px'><?php echo $lang->zanode->common;?></th>
<td class='required'><?php echo html::select('node', $nodeList, !empty($automation->node) ? $automation->node : '', "class='form-control picker-select'");?></td>
<td></td>
<td class='required' id='nodeIdBox'><?php echo html::select('node', $nodeList, !empty($automation->node) ? $automation->node : '', "class='form-control picker-select'");?></td>
<td>
<?php echo html::a($this->createLink('zanode', 'create'), $lang->zanode->create, '', "class='text-primary' target='_blank'");?>
<?php echo html::a("javascript:void(0)", "<i class='icon icon-refresh'></i>", '', "class='btn btn-icon refresh' data-toggle='tooltip' title='{$lang->refresh}' onclick='loadNodes()'");?>
</td>
<td></td>
</tr>
<tr>
<th>
<?php echo $lang->zanode->scriptPath;?>
</th>
<td class='required'><?php echo html::input('scriptPath', !empty($automation->scriptPath) ? $automation->scriptPath : '', "class='form-control'");?></td>
<td class='required'><?php echo html::input('scriptPath', !empty($automation->scriptPath) ? $automation->scriptPath : '', "class='form-control' placeholder='{$lang->zanode->scriptTips}'");?></td>
<td>
<icon class='icon icon-help' data-toggle='popover' data-trigger='focus hover' data-placement='left' data-tip-class='text-muted popover-sm' data-content="<?php echo $lang->zanode->scriptTips;?>"></icon>
</td>
</tr>
<tr>
<th>
<?php echo $lang->zanode->shell;?>
</th>
<td colspan='2'><?php echo html::textarea('shell', !empty($automation->shell) ? $automation->shell : '', "rows='6' class='form-control'");?></td>
<td colspan='2'><?php echo html::textarea('shell', !empty($automation->shell) ? $automation->shell : '', "rows='6' class='form-control' placeholder='{$lang->zanode->shellTips}'");?></td>
<td>
<icon class='icon icon-help' data-toggle='popover' data-trigger='focus hover' data-placement='left' data-tip-class='text-muted popover-sm' data-content="<?php echo $lang->zanode->shellTips;?>"></icon>
</td>
</tr>
<tr>
+14 -1
View File
@@ -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'"));
}
}
+12
View File
@@ -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'"));
}
}
+3
View File
@@ -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);}
+1
View File
@@ -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;}
+22 -1
View File
@@ -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();
});
}
+2 -2
View File
@@ -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');
}
+3 -3
View File
@@ -53,7 +53,7 @@
<tr>
<th class='c-id'><?php common::printOrderLink('t1.id', $orderBy, $vars, $lang->idAB); ?></th>
<th class='c-name'><?php common::printOrderLink('t1.name', $orderBy, $vars, $lang->zanode->name); ?></th>
<th class='c-type hidden'><?php common::printOrderLink('t1.type', $orderBy, $vars, $lang->zahost->type); ?></th>
<th class='c-type'><?php common::printOrderLink('t1.type', $orderBy, $vars, $lang->zahost->type); ?></th>
<th class='c-ip'><?php common::printOrderLink('t1.extranet', $orderBy, $vars, $lang->zanode->extranet); ?></th>
<th class='c-cpu'><?php common::printOrderLink('t1.cpuCores', $orderBy, $vars, $lang->zanode->cpuCores); ?></th>
<th class='c-memory'><?php common::printOrderLink('t1.memory', $orderBy, $vars, $lang->zanode->memory); ?></th>
@@ -69,7 +69,7 @@
<tr>
<td><?php echo $node->id; ?></td>
<td title='<?php echo $node->name ?>'><?php echo html::a($this->inlink('view', "id=$node->id"), $node->name, '', ""); ?></td>
<td class='hidden'><?php echo zget($this->lang->zanode->typeList, $node->type); ?></td>
<td><?php echo zget($this->lang->zanode->typeList, $node->type); ?></td>
<td><?php echo $node->extranet; ?></td>
<td><?php echo zget($config->zanode->os->cpuCores, $node->cpuCores); ?></td>
<td><?php echo $node->memory . $this->lang->zahost->unitList['GB']; ?></td>
@@ -119,7 +119,7 @@
}
common::printLink('zanode', 'reboot', "zanodeID={$node->id}", "<i class='icon icon-restart'></i> ", '', $rebootAttr);
common::printLink('zanode', 'createSnapshot', "zanodeID={$node->id}", "<i class='icon icon-plus'></i> ", '', $snapshotAttr, true, true);
common::printLink('zanode', 'createSnapshot', "zanodeID={$node->id}", "<img src='static/svg/snapshot.svg' /> ", '', $snapshotAttr, true, true);
if(common::hasPriv('zanode', 'createImage') or common::hasPriv('zanode', 'destroy'))
{
+4 -4
View File
@@ -22,15 +22,15 @@
</div>
<form method='post' target='hiddenwin' id='ajaxForm' class="load-indicator main-form form-ajax">
<table class='table table-form'>
<tr class='hidden'>
<tr>
<th><?php echo $lang->zahost->type;?></th>
<td><?php echo html::select('type', $lang->zanode->typeList, 'virtual', "class='form-control chosen' onchange='zahostType()'")?></td>
<td><?php echo html::select('type', $lang->zanode->typeList, 'virtual', "class='form-control chosen' onchange='zanodeType()'")?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->zanode->hostName;?></th>
<td><?php echo html::select('parent', $hostPairs, $hostID, "class='form-control chosen'")?></td>
<td></td>
<td id='hostIdBox'><?php echo html::select('parent', $hostPairs, $hostID, "class='form-control chosen'")?></td>
<td><?php echo html::a($this->createLink('zahost', 'create', array(), '', true), $lang->zahost->create, '', "class='text-primary iframe'");?></td>
</tr>
<tr>
<th class='w-120px'><?php echo $lang->zanode->name;?></th>
+1 -1
View File
@@ -223,7 +223,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
}
common::printLink('zanode', 'reboot', "zanodeID={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->rebootNode, '', $rebootAttr);
common::printLink('zanode', 'createSnapshot', "zanodeID={$zanode->id}", "<i class='icon icon-plus'></i> " . $lang->zanode->createSnapshot, '', $snapshotAttr, true, true);
common::printLink('zanode', 'createSnapshot', "zanodeID={$zanode->id}", "<img src='static/svg/snapshot.svg' /> " . $lang->zanode->createSnapshot, '', $snapshotAttr, true, true);
}
?>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>相机_o</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="相机_o" fill-rule="nonzero">
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="14" height="14"></rect>
<path d="M5.66666667,3 L5.66666667,3.66666667 L2.33333333,3.66666667 L2.33333333,11 L12.3333333,11 L12.3333333,3.66666667 L9,3.66666667 L9,3 L5.66666667,3 Z M5,3 L5,2.33333333 L9.66666667,2.33333333 L9.66666667,3 L13,3 L13,11.6666667 L1.66666667,11.6666667 L1.66666667,3 L5,3 Z M7.33333333,9.66666667 C6.06666667,9.66666667 5,8.6 5,7.33333333 C5,6.06666666 6.06666667,5 7.33333333,5 C8.59999998,5 9.66666667,6.06666667 9.66666667,7.33333333 C9.66666667,8.59999998 8.6,9.66666667 7.33333333,9.66666667 L7.33333333,9.66666667 Z M7.33333333,9 C8.26666666,9 9,8.26666667 9,7.33333333 C9,6.39999998 8.26666667,5.66666667 7.33333333,5.66666667 C6.39999998,5.66666667 5.66666667,6.4 5.66666667,7.33333333 C5.66666667,8.26666666 6.4,9 7.33333333,9 Z" id="形状" fill="#ffffff"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB