Merge branch 'zenops_46' of https://gitlab.zcorp.cc/easycorp/zentaopms into zenops_46
This commit is contained in:
@@ -149,7 +149,7 @@
|
||||
<tbody>
|
||||
<?php foreach($nodeList as $node):?>
|
||||
<tr>
|
||||
<td title="<?php echo $node->name;?>"><?php echo $node->name;?></td>
|
||||
<td title="<?php echo $node->name;?>"><?php echo html::a($this->createLink('zanode', 'view', "id=$node->id"), $node->name, '', "");?></td>
|
||||
<td><?php echo zget($config->zanode->os->cpuCores, $node->cpuCores);?></td>
|
||||
<td><?php echo $node->memory . $this->lang->zahost->unitList['GB'];?></td>
|
||||
<td><?php echo $node->diskSize . $this->lang->zahost->unitList['GB'];?></td>
|
||||
|
||||
@@ -36,7 +36,6 @@ $config->zanode->search['fields']['status'] = $lang->zanode->status;
|
||||
$config->zanode->search['fields']['cpuCores'] = $lang->zanode->cpuCores;
|
||||
$config->zanode->search['fields']['memory'] = $lang->zanode->memory;
|
||||
$config->zanode->search['fields']['diskSize'] = $lang->zanode->diskSize;
|
||||
$config->zanode->search['fields']['mac'] = $lang->zanode->mac;
|
||||
$config->zanode->search['fields']['extranet'] = $lang->zanode->extranet;
|
||||
$config->zanode->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
|
||||
$config->zanode->search['params']['osName'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
|
||||
|
||||
@@ -407,6 +407,7 @@ class zanode extends control
|
||||
$serviceStatus['ZenAgent'] = "unknown";
|
||||
$serviceStatus['ZTF'] = "unknown";
|
||||
}
|
||||
$serviceStatus['node'] = $node->status;
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => '', 'data' => $serviceStatus));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
.status-notice a{color: #2463c7;}
|
||||
.service-status a{color: #2463c7;}
|
||||
.service-status{margin-top: 10px;}
|
||||
.vnc-detail{min-height: 60vh;}
|
||||
.vnc-mask{width: 100%;height:100%;background-color: rgba(0,0,0,0);position: absolute;}
|
||||
.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;}
|
||||
#checkServiceStatus{background-color:unset;}
|
||||
.checkStatus{color: #313c52;}
|
||||
.checkStatus{color: #313c52;}
|
||||
.node-not-wrap{white-space: nowrap;}
|
||||
+35
-11
@@ -1,11 +1,3 @@
|
||||
var ifm = document.getElementById("vncIframe");
|
||||
ifm.height=$('.vnc-detail').css('height')
|
||||
$('.vnc-mask').click(function(){
|
||||
window.open(createLink('zanode', 'getVNC', "id=" + nodeID))
|
||||
})
|
||||
$('.vnc-mask').css('width', $('.vnc-detail').css('width'));
|
||||
$('.vnc-mask').css('height', $('.vnc-detail').css('height'));
|
||||
|
||||
|
||||
$('#checkServiceStatus').click(function(){
|
||||
$.get(createLink('zanode', 'ajaxGetServiceStatus', 'nodeID=' + nodeID), function(response)
|
||||
@@ -45,6 +37,13 @@ $('#checkServiceStatus').click(function(){
|
||||
$('.ztf-install').text(zanodeLang.install);
|
||||
}
|
||||
}
|
||||
else if(key == "node")
|
||||
{
|
||||
if(nodeStatus != resultData.data[key])
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(resultData.data[key] == 'ready')
|
||||
@@ -105,14 +104,36 @@ $('.node-init-install').on('click', function(){
|
||||
})
|
||||
})
|
||||
|
||||
$('.btn-init-copy').live('click', function()
|
||||
$('.btn-ssh-copy').live('click', function()
|
||||
{
|
||||
var copyText = $('#initBash');
|
||||
var copyText = $('#ssh-copy');
|
||||
copyText.show();
|
||||
copyText .select();
|
||||
document.execCommand("Copy");
|
||||
copyText.hide();
|
||||
$('.btn-init-copy').tooltip({
|
||||
$('.btn-ssh-copy').tooltip({
|
||||
trigger: 'click',
|
||||
placement: 'bottom',
|
||||
title: zanodeLang.copied,
|
||||
tipClass: 'tooltip-success'
|
||||
});
|
||||
|
||||
$(this).tooltip('show');
|
||||
var that = this;
|
||||
setTimeout(function()
|
||||
{
|
||||
$(that).tooltip('hide')
|
||||
}, 2000)
|
||||
})
|
||||
|
||||
$('.btn-pwd-copy').live('click', function()
|
||||
{
|
||||
var copyText = $('#pwd-copy');
|
||||
copyText.show();
|
||||
copyText .select();
|
||||
document.execCommand("Copy");
|
||||
copyText.hide();
|
||||
$('.btn-pwd-copy').tooltip({
|
||||
trigger: 'click',
|
||||
placement: 'bottom',
|
||||
title: zanodeLang.copied,
|
||||
@@ -129,4 +150,7 @@ $('.btn-init-copy').live('click', function()
|
||||
|
||||
$(function(){
|
||||
$('#checkServiceStatus').trigger("click")
|
||||
setInterval(() => {
|
||||
$('#checkServiceStatus').trigger("click")
|
||||
}, 2000);
|
||||
})
|
||||
@@ -96,7 +96,7 @@ $lang->zanode->statusList['destroy'] = 'Destroyed';
|
||||
$lang->zanode->statusList['shutoff'] = 'Shutoff';
|
||||
$lang->zanode->statusList['shutdown'] = 'shutdown';
|
||||
$lang->zanode->statusList['destroy_fail'] = 'Destroy Fail';
|
||||
$lang->zanode->statusList['wait'] = 'Waiting For Init';
|
||||
$lang->zanode->statusList['wait'] = 'Initializing';
|
||||
$lang->zanode->statusList['online'] = 'Online';
|
||||
|
||||
$lang->zanode->initNotice = "Succeeded. Please initialize the execution node or return to the list.";
|
||||
|
||||
@@ -96,7 +96,7 @@ $lang->zanode->statusList['destroy'] = 'Destroyed';
|
||||
$lang->zanode->statusList['shutoff'] = 'Shutoff';
|
||||
$lang->zanode->statusList['shutdown'] = 'shutdown';
|
||||
$lang->zanode->statusList['destroy_fail'] = 'Destroy Fail';
|
||||
$lang->zanode->statusList['wait'] = 'Waiting For Init';
|
||||
$lang->zanode->statusList['wait'] = 'Initializing';
|
||||
$lang->zanode->statusList['online'] = 'Online';
|
||||
|
||||
$lang->zanode->initNotice = "Succeeded. Please initialize the execution node or return to the list.";
|
||||
|
||||
@@ -96,7 +96,7 @@ $lang->zanode->statusList['destroy'] = 'Destroyed';
|
||||
$lang->zanode->statusList['shutoff'] = 'Shutoff';
|
||||
$lang->zanode->statusList['shutdown'] = 'shutdown';
|
||||
$lang->zanode->statusList['destroy_fail'] = 'Destroy Fail';
|
||||
$lang->zanode->statusList['wait'] = 'Waiting For Init';
|
||||
$lang->zanode->statusList['wait'] = 'Initializing';
|
||||
$lang->zanode->statusList['online'] = 'Online';
|
||||
|
||||
$lang->zanode->initNotice = "Succeeded. Please initialize the execution node or return to the list.";
|
||||
|
||||
@@ -96,7 +96,7 @@ $lang->zanode->statusList['destroy'] = '已销毁';
|
||||
$lang->zanode->statusList['shutoff'] = '已关机';
|
||||
$lang->zanode->statusList['shutodown'] = '已关机';
|
||||
$lang->zanode->statusList['destroy_fail'] = '销毁失败';
|
||||
$lang->zanode->statusList['wait'] = '待初始化';
|
||||
$lang->zanode->statusList['wait'] = '初始化中';
|
||||
$lang->zanode->statusList['online'] = '已上架';
|
||||
|
||||
$lang->zanode->initNotice = "保存成功,请初始化执行节点或返回列表。";
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<?php js::set('actionSuccess', $lang->zanode->actionSuccess) ?>
|
||||
<?php js::set('nodeID', $zanode->id) ?>
|
||||
<?php js::set('zanodeLang', $lang->zanode); ?>
|
||||
<?php js::set('vncLink', "http://$url/novnc?port=6080&path=websockify/?token=$token&password=pass") ?>
|
||||
<?php js::set('nodeStatus', $zanode->status); ?>
|
||||
<?php $browseLink = $this->session->zanodeList ? $this->session->zanodeList : $this->createLink('zanode', 'browse', ""); ?>
|
||||
<?php
|
||||
$vars = "id={$zanode->id}&orderBy=%s";
|
||||
@@ -55,13 +55,14 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-3 text-right"><?php echo $lang->zanode->sshAddress; ?>:</div>
|
||||
<div class="col-8">ssh <?php echo $account . '@' . $zanode->ip . ' -p ' . $zanode->ssh; ?></div>
|
||||
<div class="col-8 node-not-wrap">ssh <?php echo $account . '@' . $zanode->ip . ' -p ' . $zanode->ssh; ?> <?php echo "<button type='button' class='btn btn-info btn-mini btn-ssh-copy'><i class='icon-common-copy icon-copy' title='" . $lang->zanode->copy . "'></i></button>"; ?></div>
|
||||
</div>
|
||||
<textarea style="display:none;" id="ssh-copy"><?php echo $account . '@' . $zanode->ip . ' -p ' . $zanode->ssh; ?></textarea>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-3 text-right"><?php echo $lang->zanode->cpuCores; ?>:</div>
|
||||
<div class="col-8"><?php echo $zanode->cpuCores; ?></div>
|
||||
<div class="col-8"><?php echo $zanode->cpuCores . ' ' . $lang->zahost->cpuUnit; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,7 +82,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-3 text-right"><?php echo $lang->zanode->memory; ?>:</div>
|
||||
<div class="col-8"><?php echo $zanode->memory; ?>GB</div>
|
||||
<div class="col-8"><?php echo $zanode->memory; ?> GB</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,13 +96,14 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-3 text-right"><?php echo $lang->zanode->defaultPwd; ?>:</div>
|
||||
<div class="col-8"><?php echo $config->zanode->defaultPwd; ?></div>
|
||||
<div class="col-8"><?php echo $config->zanode->defaultPwd . ' ' . "<button type='button' class='btn btn-info btn-mini btn-pwd-copy'><i class='icon-common-copy icon-copy' title='" . $lang->zanode->copy . "'></i></button>"; ?></div>
|
||||
<textarea style="display:none;" id="pwd-copy"><?php echo $config->zanode->defaultPwd; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-3 text-right"><?php echo $lang->zanode->diskSize; ?>:</div>
|
||||
<div class="col-8"><?php echo $zanode->diskSize; ?>GB</div>
|
||||
<div class="col-8"><?php echo $zanode->diskSize; ?> GB</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4"></div>
|
||||
@@ -115,57 +117,6 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
|
||||
?>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class="detail vnc-detail">
|
||||
<div class='vnc-mask'></div>
|
||||
<?php echo "<iframe width='100%' id='vncIframe' src='http://$url/novnc?port=6080&path=websockify/?token=$token&password=pass'></iframe>";?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->printExtendFields($zanode, 'div', "position=left&inForm=0&inCell=1"); ?>
|
||||
<div class='main-actions'>
|
||||
<div class="btn-toolbar">
|
||||
<?php echo html::backButton('<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', 'btn btn-secondary'); ?>
|
||||
<div class='divider'></div>
|
||||
<?php
|
||||
if (empty($zanode->deleted)) {
|
||||
$suspendAttr = "title='{$lang->zanode->suspend}' target='hiddenwin'";
|
||||
$suspendAttr .= $zanode->status != 'running' && $zanode->status != 'wait' ? ' 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' || $zanode->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 .= $zanode->status == 'shutoff' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
|
||||
|
||||
if($zanode->status == "suspend")
|
||||
{
|
||||
common::printLink('zanode', 'resume', "zanodeID={$zanode->id}", "<i class='icon icon-back'></i> " . $lang->zanode->resumeNode, '', $resumeAttr);
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printLink('zanode', 'suspend', "zanodeID={$zanode->id}", "<i class='icon icon-pause'></i> " . $lang->zanode->suspendNode, '', $suspendAttr);
|
||||
}
|
||||
|
||||
if($zanode->status == "shutoff")
|
||||
{
|
||||
common::printLink('zanode', 'start', "zanodeID={$zanode->id}", "<i class='icon icon-magic'></i> " . $lang->zanode->bootNode, '', "title='{$lang->zanode->boot}' class='btn '");
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printLink('zanode', 'close', "zanodeID={$zanode->id}", "<i class='icon icon-off'></i> " . $lang->zanode->shutdownNode, '', "title='{$lang->zanode->shutdown}' class='btn '");
|
||||
}
|
||||
|
||||
common::printLink('zanode', 'reboot', "zanodeID={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->rebootNode, '', $rebootAttr);
|
||||
|
||||
common::printLink('zanode', 'getVNC', "id={$zanode->id}", "<i class='icon icon-desktop'></i> " . $lang->zanode->getVNC, '_blank', "title='{$lang->zanode->getVNC}' class='btn desktop " . (in_array($zanode->status ,array('running', 'launch', 'wait')) ? '':'disabled') . "'", '');
|
||||
}
|
||||
?>
|
||||
<div class='divider'></div>
|
||||
<?php echo $this->zanode->buildOperateMenu($zanode, 'view'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 side-col">
|
||||
<div class="cell">
|
||||
<div class="detail zanode-detail">
|
||||
<div class="detail-title status-container">
|
||||
<?php echo $lang->zanode->init->statusTitle; ?>
|
||||
@@ -199,6 +150,51 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
|
||||
<div class="detail-content article-content"><?php echo !empty($zanode->desc) ? htmlspecialchars_decode($zanode->desc) : $lang->noData; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->printExtendFields($zanode, 'div', "position=left&inForm=0&inCell=1"); ?>
|
||||
<div class='main-actions'>
|
||||
<div class="btn-toolbar">
|
||||
<?php echo html::backButton('<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', 'btn btn-secondary'); ?>
|
||||
<div class='divider'></div>
|
||||
<?php
|
||||
if (empty($zanode->deleted)) {
|
||||
$suspendAttr = "title='{$lang->zanode->suspend}' target='hiddenwin'";
|
||||
$suspendAttr .= $zanode->status != 'running' && $zanode->status != 'wait' ? ' 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' || $zanode->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 .= $zanode->status == 'shutoff' ? ' class="btn disabled"' : "class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
|
||||
common::printLink('zanode', 'getVNC', "id={$zanode->id}", "<i class='icon icon-desktop'></i> " . $lang->zanode->getVNC, '_blank', "title='{$lang->zanode->getVNC}' class='btn desktop " . (in_array($zanode->status ,array('running', 'launch', 'wait')) ? '':'disabled') . "'", '');
|
||||
|
||||
if($zanode->status == "suspend")
|
||||
{
|
||||
common::printLink('zanode', 'resume', "zanodeID={$zanode->id}", "<i class='icon icon-back'></i> " . $lang->zanode->resumeNode, '', $resumeAttr);
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printLink('zanode', 'suspend', "zanodeID={$zanode->id}", "<i class='icon icon-pause'></i> " . $lang->zanode->suspendNode, '', $suspendAttr);
|
||||
}
|
||||
|
||||
if($zanode->status == "shutoff")
|
||||
{
|
||||
common::printLink('zanode', 'start', "zanodeID={$zanode->id}", "<i class='icon icon-magic'></i> " . $lang->zanode->bootNode, '', "title='{$lang->zanode->boot}' class='btn '");
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printLink('zanode', 'close', "zanodeID={$zanode->id}", "<i class='icon icon-off'></i> " . $lang->zanode->shutdownNode, '', "title='{$lang->zanode->shutdown}' class='btn '");
|
||||
}
|
||||
|
||||
common::printLink('zanode', 'reboot', "zanodeID={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->rebootNode, '', $rebootAttr);
|
||||
|
||||
}
|
||||
?>
|
||||
<div class='divider'></div>
|
||||
<?php echo $this->zanode->buildOperateMenu($zanode, 'view'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 side-col">
|
||||
<div class='cell'><?php include '../../common/view/action.html.php'; ?></div>
|
||||
|
||||
<div id='mainActions' class='main-actions'>
|
||||
|
||||
Reference in New Issue
Block a user