* Add view host.
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
.c-number {width: 100px;}
|
||||
.c-os {width: 130px;}
|
||||
.c-lang {width: 150px;}
|
||||
@@ -10,8 +10,8 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/kindeditor.html.php'; ?>
|
||||
<?php $browseLink = $this->session->zahostList ? $this->session->zahostList : $this->createLink('zahost', 'browse', "");?>
|
||||
<?php $vars = "id={$zahost->hostID}&orderBy=%s";?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
@@ -19,7 +19,7 @@
|
||||
<?php echo html::backButton('<i class="icon icon-back icon-sm"></i> ' . $lang->goback, "data-app='{$app->tab}'", 'btn btn-secondary');?>
|
||||
<div class='divider'></div>
|
||||
<div class='page-title'>
|
||||
<span class='label label-id'><?php echo $zahost->assetID;?></span>
|
||||
<span class='label label-id'><?php echo $zahost->id;?></span>
|
||||
<span class='text' title='<?php echo $zahost->name;?>'><?php echo $zahost->name;?></span>
|
||||
<?php if($zahost->deleted):?>
|
||||
<span class='label label-danger'><?php echo $lang->zahost->deleted;?></span>
|
||||
|
||||
@@ -30,7 +30,7 @@ $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']['address'] = $lang->zanode->ip;
|
||||
$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' => '');
|
||||
$config->zanode->search['params']['host'] = array('operator' => '=', 'control' => 'select', 'values' => '');
|
||||
|
||||
+12
-12
@@ -24,7 +24,7 @@ class zanode extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function browse($browseType = 'all', $param = 0, $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$browseType = strtolower($browseType);
|
||||
|
||||
@@ -41,7 +41,7 @@ class zanode extends control
|
||||
$this->config->zanode->search['actionURL'] = $actionURL;
|
||||
$this->config->zanode->search['queryID'] = $queryID;
|
||||
$this->config->zanode->search['onMenuBar'] = 'no';
|
||||
$this->config->zanode->search['params']['hostID']['values'] = array('' => '') + $hosts;
|
||||
$this->config->zanode->search['params']['host']['values'] = array('' => '') + $hosts;
|
||||
$this->loadModel('search')->setSearchParams($this->config->zanode->search);
|
||||
|
||||
$this->view->title = $this->lang->zanode->common;
|
||||
@@ -78,7 +78,7 @@ class zanode extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* View VM.
|
||||
* View Node.
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
@@ -87,7 +87,7 @@ class zanode extends control
|
||||
public function view($id)
|
||||
{
|
||||
$this->view->title = $this->lang->zanode->view;
|
||||
$this->view->node = $this->zanode->getVMByID($id);
|
||||
$this->view->zanode = $this->zanode->getNodeByID($id);
|
||||
$this->view->actions = $this->loadModel('action')->getList('zanode', $id);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
|
||||
@@ -95,7 +95,7 @@ class zanode extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* Suspend VM.
|
||||
* Suspend Node.
|
||||
*
|
||||
* @param int $nodeID
|
||||
* @access public
|
||||
@@ -103,11 +103,11 @@ class zanode extends control
|
||||
*/
|
||||
public function suspend($nodeID)
|
||||
{
|
||||
$this->handleVM($nodeID, 'suspend');
|
||||
$this->handleNode($nodeID, 'suspend');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reboot VM.
|
||||
* Reboot Node.
|
||||
*
|
||||
* @param int $nodeID
|
||||
* @access public
|
||||
@@ -115,11 +115,11 @@ class zanode extends control
|
||||
*/
|
||||
public function reboot($nodeID)
|
||||
{
|
||||
$this->handleVM($nodeID, 'reboot');
|
||||
$this->handleNode($nodeID, 'reboot');
|
||||
}
|
||||
|
||||
/**
|
||||
* Resume VM.
|
||||
* Resume Node.
|
||||
*
|
||||
* @param int $nodeID
|
||||
* @access public
|
||||
@@ -127,7 +127,7 @@ class zanode extends control
|
||||
*/
|
||||
public function resume($nodeID)
|
||||
{
|
||||
$this->handleVM($nodeID, 'resume');
|
||||
$this->handleNode($nodeID, 'resume');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,9 +137,9 @@ class zanode extends control
|
||||
* @param string $type
|
||||
* @return void
|
||||
*/
|
||||
public function handleVM($nodeID, $type)
|
||||
public function handleNode($nodeID, $type)
|
||||
{
|
||||
$error = $this->zanode->handleVM($nodeID, $type);
|
||||
$error = $this->zanode->handleNode($nodeID, $type);
|
||||
|
||||
if($error)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
.zanode-detail .text-right{text-align: right;}
|
||||
.zanode-detail .col-8{padding-left: 10px;}
|
||||
.zanode-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;}
|
||||
@@ -19,7 +19,7 @@ $lang->zanode->name = 'Name';
|
||||
$lang->zanode->start = 'Start After Created';
|
||||
$lang->zanode->hostName = 'Host Name';
|
||||
$lang->zanode->host = $lang->zanode->hostName;
|
||||
$lang->zanode->ip = 'IP';
|
||||
$lang->zanode->extranet = 'IP/Domain';
|
||||
$lang->zanode->osArch = 'Arch';
|
||||
$lang->zanode->cpuCores = 'CPU Cores';
|
||||
$lang->zanode->memory = 'Memory Size';
|
||||
|
||||
@@ -19,7 +19,7 @@ $lang->zanode->name = 'Name';
|
||||
$lang->zanode->start = 'Start After Created';
|
||||
$lang->zanode->hostName = 'Host Name';
|
||||
$lang->zanode->host = $lang->zanode->hostName;
|
||||
$lang->zanode->ip = 'IP';
|
||||
$lang->zanode->extranet = 'IP/Domain';
|
||||
$lang->zanode->osArch = 'Arch';
|
||||
$lang->zanode->cpuCores = 'CPU Cores';
|
||||
$lang->zanode->memory = 'Memory Size';
|
||||
|
||||
@@ -19,7 +19,7 @@ $lang->zanode->name = 'Name';
|
||||
$lang->zanode->start = 'Start After Created';
|
||||
$lang->zanode->hostName = 'Host Name';
|
||||
$lang->zanode->host = $lang->zanode->hostName;
|
||||
$lang->zanode->ip = 'IP';
|
||||
$lang->zanode->extranet = 'IP/Domain';
|
||||
$lang->zanode->osArch = 'Arch';
|
||||
$lang->zanode->cpuCores = 'CPU Cores';
|
||||
$lang->zanode->memory = 'Memory Size';
|
||||
|
||||
@@ -19,7 +19,7 @@ $lang->zanode->name = '执行节点名称';
|
||||
$lang->zanode->start = '创建后自动开启';
|
||||
$lang->zanode->hostName = '所属宿主机';
|
||||
$lang->zanode->host = $lang->zanode->hostName;
|
||||
$lang->zanode->ip = 'IP/域名';
|
||||
$lang->zanode->extranet = 'IP/域名';
|
||||
$lang->zanode->osArch = '架构';
|
||||
$lang->zanode->cpuCores = 'CPU核心数';
|
||||
$lang->zanode->memory = '内存';
|
||||
|
||||
+21
-5
@@ -236,7 +236,7 @@ class zanodemodel extends model
|
||||
* @param object $pager
|
||||
* @return void
|
||||
*/
|
||||
public function getListByQuery($browseType = 'all', $param = 0, $orderBy = 'id_desc', $pager = null)
|
||||
public function getListByQuery($browseType = 'all', $param = 0, $orderBy = 't1.id_desc', $pager = null)
|
||||
{
|
||||
$query = '';
|
||||
if($browseType == 'bysearch')
|
||||
@@ -246,12 +246,12 @@ class zanodemodel extends model
|
||||
$query = $this->loadModel('search')->getQuery($param);
|
||||
if($query)
|
||||
{
|
||||
$this->session->set('vmQuery', $query->sql);
|
||||
$this->session->set('vmForm', $query->form);
|
||||
$this->session->set('nodeQuery', $query->sql);
|
||||
$this->session->set('nodeForm', $query->form);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('vmQuery', ' 1 = 1');
|
||||
$this->session->set('nodeQuery', ' 1 = 1');
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -264,9 +264,10 @@ class zanodemodel extends model
|
||||
$query = str_replace('`status`', 't1.`status`', $query);
|
||||
$query = str_replace('`os`', 't1.`os`', $query);
|
||||
$query = str_replace('`parent`', 't1.`parent`', $query);
|
||||
$query = str_replace('`hostID`', 't2.`id`', $query);
|
||||
}
|
||||
|
||||
return $this->dao->select('t1.*, t1.name as hostName, t2.extranet as hostIP,t3.osName')->from(TABLE_ZAHOST)->alias('t1')
|
||||
return $this->dao->select('t1.*, t1.name as hostName, t2.extranet,t3.osName')->from(TABLE_ZAHOST)->alias('t1')
|
||||
->leftJoin(TABLE_ZAHOST)->alias('t2')->on('t1.parent = t2.id')
|
||||
->leftJoin(TABLE_IMAGE)->alias('t3')->on('t3.id = t1.image')
|
||||
->where('t1.deleted')->eq(0)
|
||||
@@ -436,4 +437,19 @@ class zanodemodel extends model
|
||||
$returnData->token = $result->data->token;
|
||||
return $returnData;
|
||||
}
|
||||
|
||||
public function buildOperateMenu($node)
|
||||
{
|
||||
if($node->deleted) return '';
|
||||
|
||||
$menu = '';
|
||||
$params = "id=$node->id";
|
||||
|
||||
$menu .= $this->buildMenu('zanode', 'edit', $params, $node, 'view');
|
||||
|
||||
$params = "id=$node->id";
|
||||
$menu .= $this->buildMenu('zanode', 'delete', $params, $node, 'view', 'trash', 'hiddenwin');
|
||||
|
||||
return $menu;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The browse view file of zanode module of ZenTaoPMS.
|
||||
*
|
||||
@@ -10,91 +11,91 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
|
||||
<?php js::set('confirmDelete', $lang->zanode->confirmDelete)?>
|
||||
<?php js::set('confirmBoot', $lang->zanode->confirmBoot)?>
|
||||
<?php js::set('confirmReboot', $lang->zanode->confirmReboot)?>
|
||||
<?php js::set('confirmShutdown', $lang->zanode->confirmShutdown)?>
|
||||
<?php js::set('actionSuccess', $lang->zanode->actionSuccess)?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/header.html.php'; ?>
|
||||
<?php js::set('confirmDelete', $lang->zanode->confirmDelete) ?>
|
||||
<?php js::set('confirmBoot', $lang->zanode->confirmBoot) ?>
|
||||
<?php js::set('confirmReboot', $lang->zanode->confirmReboot) ?>
|
||||
<?php js::set('confirmShutdown', $lang->zanode->confirmShutdown) ?>
|
||||
<?php js::set('actionSuccess', $lang->zanode->actionSuccess) ?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='pull-left btn-toolbar'>
|
||||
<?php echo html::a($this->createLink('zanode', 'browse'), "<span class='text'>{$lang->zanode->all}</span>", '', "class='btn btn-link btn-active-text'");?>
|
||||
<a href='#' id='bysearchTab' class='btn btn-link querybox-toggle'><i class='icon-search icon'></i> <?php echo $lang->zanode->byQuery;?></a>
|
||||
<?php echo html::a($this->createLink('zanode', 'browse'), "<span class='text'>{$lang->zanode->all}</span>", '', "class='btn btn-link btn-active-text'"); ?>
|
||||
<a href='#' id='bysearchTab' class='btn btn-link querybox-toggle'><i class='icon-search icon'></i> <?php echo $lang->zanode->byQuery; ?></a>
|
||||
</div>
|
||||
|
||||
<?php if(common::hasPriv('zanode', 'create')):?>
|
||||
<div class="btn-toolbar pull-right" id='createActionMenu'>
|
||||
<?php
|
||||
$misc = "class='btn btn-primary' data-width='600px'";
|
||||
$link = $this->createLink('zanode', 'create');
|
||||
echo html::a($link, "<i class='icon icon-plus'></i>" . $lang->zanode->create, '', $misc);
|
||||
?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div id='queryBox' class='cell <?php if($browseType =='bysearch') echo 'show';?>' data-module='zanode'></div>
|
||||
<div id='mainContent' class='main-table'>
|
||||
<?php $vars = "browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<div class="table-responsive">
|
||||
<?php if(empty($nodeList)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->zanode->empty;?></span>
|
||||
<?php if(common::hasPriv('zanode', 'create')) common::printLink('zanode', 'create', '', '<i class="icon icon-plus"></i> ' . $lang->zanode->create, '', 'class="btn btn-info"');?>
|
||||
</p>
|
||||
<?php if (common::hasPriv('zanode', 'create')) : ?>
|
||||
<div class="btn-toolbar pull-right" id='createActionMenu'>
|
||||
<?php
|
||||
$misc = "class='btn btn-primary' data-width='600px'";
|
||||
$link = $this->createLink('zanode', 'create');
|
||||
echo html::a($link, "<i class='icon icon-plus'></i>" . $lang->zanode->create, '', $misc);
|
||||
?>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<table class='table has-sort-head table-fixed' id='nodeList'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='c-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='c-name'><?php common::printOrderLink('name', $orderBy, $vars, $lang->zanode->name);?></th>
|
||||
<th class='c-ip'><?php common::printOrderLink('extranet', $orderBy, $vars, $lang->zanode->extranet);?></th>
|
||||
<th class='c-cpu'><?php common::printOrderLink('cpuCores', $orderBy, $vars, $lang->zanode->cpuCores);?></th>
|
||||
<th class='c-number'><?php common::printOrderLink('memory', $orderBy, $vars, $lang->zanode->memory);?></th>
|
||||
<th class='c-number'><?php common::printOrderLink('diskSize', $orderBy, $vars, $lang->zanode->diskSize);?></th>
|
||||
<th class='c-os'><?php common::printOrderLink('osName', $orderBy, $vars, $lang->zanode->osName);?></th>
|
||||
<th class='c-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->zanode->status);?></th>
|
||||
<th class='c-host'><?php common::printOrderLink('hostID', $orderBy, $vars, $lang->zanode->hostName);?>
|
||||
<th class='c-actions-4'><?php echo $lang->actions?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($nodeList as $node):?>
|
||||
<tr>
|
||||
<td><?php echo $node->id;?></td>
|
||||
<td title="<?php echo $node->name;?>"><?php echo $node->name;?></td>
|
||||
<td><?php echo $node->hostIP;?></td>
|
||||
<td><?php echo zget($config->zanode->os->cpu, $node->cpu);?></td>
|
||||
<td><?php echo $node->memory . $this->lang->zahost->unitList['GB'];?></td>
|
||||
<td><?php echo $node->disk . zget($this->lang->zahost->unitList, $node->unit);?></td>
|
||||
<td><?php echo zget($config->zanode->os->list, $node->os);?></td>
|
||||
<td><?php echo zget($lang->zanode->statusList, $node->status);?></td>
|
||||
<td title="<?php echo $node->hostName;?>"><?php echo $node->hostName;?></td>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
$suspendAttr = "title='{$lang->zanode->suspend}' class='btn btn-primary' target='hiddenwin'";
|
||||
$suspendAttr .= $node->status == 'suspend' ? ' disabled' : " target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id='queryBox' class='cell <?php if ($browseType == 'bysearch') echo 'show'; ?>' data-module='zanode'></div>
|
||||
<div id='mainContent' class='main-table'>
|
||||
<?php $vars = "browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<div class="table-responsive">
|
||||
<?php if (empty($nodeList)) : ?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->zanode->empty; ?></span>
|
||||
<?php if (common::hasPriv('zanode', 'create')) common::printLink('zanode', 'create', '', '<i class="icon icon-plus"></i> ' . $lang->zanode->create, '', 'class="btn btn-info"'); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<table class='table has-sort-head table-fixed' id='nodeList'>
|
||||
<thead>
|
||||
<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-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-number'><?php common::printOrderLink('t1.memory', $orderBy, $vars, $lang->zanode->memory); ?></th>
|
||||
<th class='c-number'><?php common::printOrderLink('t1.diskSize', $orderBy, $vars, $lang->zanode->diskSize); ?></th>
|
||||
<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.id', $orderBy, $vars, $lang->zanode->hostName); ?>
|
||||
<th class='c-actions-4'><?php echo $lang->actions ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($nodeList as $node) : ?>
|
||||
<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><?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>
|
||||
<td><?php echo $node->diskSize . $this->lang->zahost->unitList['GB']; ?></td>
|
||||
<td><?php echo $node->osName; ?></td>
|
||||
<td><?php echo zget($lang->zanode->statusList, $node->status); ?></td>
|
||||
<td title="<?php echo $node->hostName; ?>"><?php echo $node->hostName; ?></td>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
$suspendAttr = "title='{$lang->zanode->suspend}' class='btn btn-primary' target='hiddenwin'";
|
||||
$suspendAttr .= $node->status == 'suspend' ? ' disabled' : " target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'";
|
||||
|
||||
$resumeAttr = "title='{$lang->zanode->resume}' class='btn btn-primary' target='hiddenwin'";
|
||||
$resumeAttr .= $node->status == 'running' ? 'disabled' : " target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'";
|
||||
$rebootAttr = "title='{$lang->zanode->reboot}' class='btn btn-primary' target='hiddenwin'";
|
||||
$rebootAttr .= $node->status == 'suspend' ? ' disabled' : " target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
|
||||
common::printLink('zanode', 'suspend', "zanodeID={$node->id}", "<i class='icon icon-pause'></i> ", '', $suspendAttr);
|
||||
common::printLink('zanode', 'resume', "zanodeID={$node->id}", "<i class='icon icon-back'></i> ", '', $resumeAttr);
|
||||
common::printLink('zanode', 'reboot', "zanodeID={$node->id}", "<i class='icon icon-restart'></i> ", '', $rebootAttr);
|
||||
common::printLink('zanode', 'destroy', "zanodeID={$node->id}", "<i class='icon icon-trash'></i> ", '', "title='{$lang->zanode->destroy}' class='btn btn-primary' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmDelete}\")==false) return false;'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
$resumeAttr = "title='{$lang->zanode->resume}' class='btn btn-primary' target='hiddenwin'";
|
||||
$resumeAttr .= $node->status == 'running' ? 'disabled' : " target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'";
|
||||
$rebootAttr = "title='{$lang->zanode->reboot}' class='btn btn-primary' target='hiddenwin'";
|
||||
$rebootAttr .= $node->status == 'suspend' ? ' disabled' : " target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmReboot}\")==false) return false;'";
|
||||
common::printLink('zanode', 'suspend', "zanodeID={$node->id}", "<i class='icon icon-pause'></i> ", '', $suspendAttr);
|
||||
common::printLink('zanode', 'resume', "zanodeID={$node->id}", "<i class='icon icon-back'></i> ", '', $resumeAttr);
|
||||
common::printLink('zanode', 'reboot', "zanodeID={$node->id}", "<i class='icon icon-restart'></i> ", '', $rebootAttr);
|
||||
common::printLink('zanode', 'destroy', "zanodeID={$node->id}", "<i class='icon icon-trash'></i> ", '', "title='{$lang->zanode->destroy}' class='btn btn-primary' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmDelete}\")==false) return false;'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class='table-footer'>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
<?php $pager->show('right', 'pagerjs'); ?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/footer.html.php'; ?>
|
||||
@@ -1,79 +1,119 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* The view view file of vm module of ZenTaoPMS.
|
||||
* The view file of zanode module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author xiawenlong <xiawenlong@cnezsoft.com>
|
||||
* @package host
|
||||
* @version $Id$
|
||||
* @author Ke Zhao <zhaoke@cnezsoft.com>
|
||||
* @package zanode
|
||||
* @version $Id: view.html.php $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
|
||||
<?php js::set('confirmDelete', $lang->vm->confirmDelete)?>
|
||||
<?php js::set('confirmBoot', $lang->vm->confirmBoot)?>
|
||||
<?php js::set('confirmReboot', $lang->vm->confirmReboot)?>
|
||||
<?php js::set('confirmShutdown', $lang->vm->confirmShutdown)?>
|
||||
<?php js::set('actionSuccess', $lang->vm->actionSuccess)?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->vm->view;?></h2>
|
||||
</div>
|
||||
<div class='main'>
|
||||
<div class='detail'>
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<th class='thWidth'><?php echo $lang->vm->name;?></th>
|
||||
<td><?php echo $vm->name;?></td>
|
||||
<th></th><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->vm->osType;?></th>
|
||||
<td><?php echo $config->vm->os->type[$vm->osCategory][$vm->osType];?></td>
|
||||
<th><?php echo $lang->vm->osCategory;?></th>
|
||||
<td><?php echo $config->vm->os->list[$vm->osCategory];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->vm->osVersion;?></th>
|
||||
<td><?php echo $lang->vm->versionList[$vm->osType][$vm->osVersion];?></td>
|
||||
<th><?php echo $lang->vm->osLang;?></th>
|
||||
<td><?php echo $lang->vm->langList[$vm->osLang];?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->vm->ip;?></th>
|
||||
<td><?php echo $vm->ip;?></td>
|
||||
<th><?php echo $lang->vm->macAddress;?></th>
|
||||
<td><?php echo $vm->macAddress;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->vm->vnc;?></th>
|
||||
<td><?php echo $vm->vnc;?></td>
|
||||
<th><?php echo $lang->vm->status;?></th>
|
||||
<td><?php echo zget($lang->vm->statusList, $vm->status);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->vm->createdDate;?></th>
|
||||
<td><?php echo $vm->createdDate;?></td>
|
||||
<th><?php echo $lang->vm->destroyAt;?></th>
|
||||
<td><?php echo $vm->destroyAt;?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php include $app->getModuleRoot() . 'common/view/action.html.php'?>
|
||||
</div>
|
||||
<div id='mainActions' class='main-actions'>
|
||||
<nav class='container'></nav>
|
||||
<div class='btn-toolbar'>
|
||||
<?php
|
||||
if(empty($vm->destroyAt))
|
||||
{
|
||||
common::printLink('vm', 'reboot', "vmID={$vm->id}", "<i class='icon icon-restart'></i> ". $lang->vm->reboot, '', "title='{$lang->vm->reboot}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->vm->confirmReboot}\")==false) return false;'");
|
||||
common::printLink('vm', 'destroy', "vmID={$vm->id}", "<i class='icon icon-trash'></i> " . $lang->vm->destroy, '', "title='{$lang->vm->destroy}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->vm->confirmDelete}\")==false) return false;'");
|
||||
}
|
||||
if(!isonlybody()) common::printLink('vm', 'browse', "", "<i class='icon-goback icon-back'></i> " . $lang->goback, '', "class='btn'");
|
||||
?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/header.html.php'; ?>
|
||||
<?php include $app->getModuleRoot() . 'common/view/kindeditor.html.php'; ?>
|
||||
<?php js::set('confirmDelete', $lang->zanode->confirmDelete) ?>
|
||||
<?php js::set('confirmBoot', $lang->zanode->confirmBoot) ?>
|
||||
<?php js::set('confirmReboot', $lang->zanode->confirmReboot) ?>
|
||||
<?php js::set('confirmShutdown', $lang->zanode->confirmShutdown) ?>
|
||||
<?php js::set('actionSuccess', $lang->zanode->actionSuccess) ?>
|
||||
<?php $browseLink = $this->session->zanodeList ? $this->session->zanodeList : $this->createLink('zanode', 'browse', ""); ?>
|
||||
<?php $vars = "id={$zanode->id}&orderBy=%s"; ?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::backButton('<i class="icon icon-back icon-sm"></i> ' . $lang->goback, "data-app='{$app->tab}'", 'btn btn-secondary'); ?>
|
||||
<div class='divider'></div>
|
||||
<div class='page-title'>
|
||||
<span class='label label-id'><?php echo $zanode->id; ?></span>
|
||||
<span class='text' title='<?php echo $zanode->name; ?>'><?php echo $zanode->name; ?></span>
|
||||
<?php if ($zanode->deleted) : ?>
|
||||
<span class='label label-danger'><?php echo $lang->zanode->deleted; ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class="col-8 main-col">
|
||||
<div class="cell">
|
||||
<div class="detail zanode-detail">
|
||||
<div class="detail-title"><?php echo $lang->zanode->view; ?></div>
|
||||
<div class="detail-content article-content">
|
||||
<div class="main-row">
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-4 text-right"><?php echo $lang->zanode->status; ?>:</div>
|
||||
<div class="col-8"><?php echo zget($lang->zanode->statusList, $zanode->status); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-4 text-right"><?php echo $lang->zanode->osName; ?>:</div>
|
||||
<div class="col-8"><?php echo $zanode->osName; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-4 text-right"><?php echo $lang->zanode->memory; ?>:</div>
|
||||
<div class="col-8"><?php echo $zanode->memory; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-row">
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-4 text-right"><?php echo $lang->zanode->hostName; ?>:</div>
|
||||
<div class="col-8"><?php echo $zanode->hostName; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-4 text-right"><?php echo $lang->zanode->cpuCores; ?>:</div>
|
||||
<div class="col-8"><?php echo $zanode->cpuCores; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="main-row">
|
||||
<div class="col-4 text-right"><?php echo $lang->zanode->diskSize; ?>:</div>
|
||||
<div class="col-8"><?php echo $zanode->diskSize; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail zanode-detail">
|
||||
<div class="detail-title"><?php echo $lang->zanode->desc; ?></div>
|
||||
<div class="detail-content article-content"><?php echo !empty($zanode->desc) ? $zanode->desc : $lang->noData; ?></div>
|
||||
</div>
|
||||
<?php
|
||||
$canBeChanged = common::canBeChanged('zanode', $zanode);
|
||||
if ($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=zanode&objectID=$zanode->id");
|
||||
?>
|
||||
</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)) {
|
||||
if(in_array($zanode->status, array("suspend", "")))
|
||||
common::printLink('zanode', 'suspend', "id={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->suspend, '', "title='{$lang->zanode->suspend}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmSuspend}\")==false) return false;'");
|
||||
common::printLink('zanode', 'resume', "id={$zanode->id}", "<i class='icon icon-restart'></i> " . $lang->zanode->resume, '', "title='{$lang->zanode->resume}' class='btn' target='hiddenwin' onclick='if(confirm(\"{$lang->zanode->confirmResume}\")==false) return false;'");
|
||||
common::printLink('zanode', 'getVNC', "id={$zanode->id}", "<i class='icon icon-desktop'></i> " . $lang->zanode->getVNC, '', "title='{$lang->zanode->getVNC}' class='btn' target='hiddenwin'");
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div id='mainActions' class='main-actions'>
|
||||
<?php common::printPreAndNext($browseLink); ?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php'; ?>
|
||||
Reference in New Issue
Block a user