This commit is contained in:
zhaoke
2023-01-12 05:00:46 +00:00
parent 55ad3049c7
commit 4b1bb58383
5 changed files with 106 additions and 3 deletions
+15
View File
@@ -65,3 +65,18 @@ $('.btn-init-copy').live('click', function()
$(that).tooltip('hide')
}, 2000)
})
function setIframeHeight(iframe)
{
if (iframe)
{
var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
if (iframeWin.document.body)
{
var height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight
iframe.height = height+10;
console.log(1111, iframe.height)
}
}
}
+4 -3
View File
@@ -134,8 +134,9 @@
<?php if(!empty($nodeList)): ?>
<div class="detail">
<div class="detail-title"><?php echo $lang->zahost->browseNode;?></div>
<div class="detail-content article-content" style="padding: 0px; max-height: 789px; overflow: visible; height: 306px;">
<table class='table has-sort-head table-fixed' id='nodeList'>
<div class="detail-content article-content">
<?php echo "<iframe width='100%' id='nodesIframe' src='" . $this->createLink('zanode', 'list', "hostID=$zahost->id", '', true) . "' frameborder='no' allowfullscreen='true' mozallowfullscreen='true' webkitallowfullscreen='true' allowtransparency='true' scrolling='auto' onload='setIframeHeight(this)' style='min-height:300px;'></iframe>";?>
<!-- <table class='table has-sort-head table-fixed' id='nodeList'>
<thead>
<tr>
<th class='c-name'><?php common::printOrderLink('name', $orderBy, $vars, $lang->zahost->name);?></th>
@@ -158,7 +159,7 @@
</tr>
<?php endforeach;?>
</tbody>
</table>
</table> -->
</div>
</div>
<?php endif; ?>
+23
View File
@@ -59,6 +59,29 @@ class zanode extends control
$this->display();
}
/**
* Browse ZenAgent Node list in zahost view.
*
* @param string $browseType
* @param string $param
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function list($hostID, $orderBy = 'id_desc')
{
$this->view->title = $this->lang->zanode->common;
$this->view->nodeList = $this->loadModel("zanode")->getListByHost($hostID, $orderBy);
$this->view->orderBy = $orderBy;
$this->view->hostID = $hostID;
$this->display();
}
/**
* Create node.
*
+8
View File
@@ -0,0 +1,8 @@
.c-cpu,.c-memory,.c-diskSize,.c-status {width: 90px;}
.c-os {width: 150px;}
.c-number {width: 120px;}
.desktop, .createImage{margin-right: 4px;}
#helpTab .icon-help {line-height: unset;}
#bysearchTab {margin-right: 0px;}
#main{min-width: 0!important;padding:0!important;}
body{background-color: #fff!important;}
+56
View File
@@ -0,0 +1,56 @@
<?php
/**
* The browse 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 zanode
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include $app->getModuleRoot() . 'common/view/header.html.php'; ?>
<div id='mainContent' class='main-table'>
<?php $vars = "id={$hostID}&orderBy=%s"; ?>
<?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-name'><?php common::printOrderLink('name', $orderBy, $vars, $lang->zahost->name);?></th>
<th class='c-cpu'><?php common::printOrderLink('cpuCores', $orderBy, $vars, $lang->zanode->cpuCores);?></th>
<th class='c-memory'><?php common::printOrderLink('memory', $orderBy, $vars, $lang->zanode->memory);?></th>
<th class='c-diskSize'><?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>
</tr>
</thead>
<tbody>
<?php foreach ($nodeList as $node) : ?>
<tr>
<td title='<?php echo $node->name ?>'><?php echo html::a($this->inlink('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>
<td><?php echo $node->osName; ?></td>
<td><?php echo zget($lang->zanode->statusList, $node->status); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<?php include $app->getModuleRoot() . 'common/view/footer.html.php'; ?>
<script>
// $('body').addClass('body-modal')
</script>