| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- <?php
- /**
- * The view view file of zahost module of ZenTaoPMS.
- * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
- * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
- * @author Zeng Gang<zenggang@easycorp.ltd>
- * @package zahost
- * @link https://www.zentao.net
- */
- namespace zin;
- jsVar('hostID', $zahost->id);
- jsVar('zahostLang', $lang->zahost);
- $imageLink = html::a($this->createLink('zahost', 'browseImage', "hostID=$zahost->id", '', true), $lang->zahost->image->downloadImage, '', "data-toggle='modal'");
- $createNode = html::a($this->createLink('zanode', 'create', "hostID=$zahost->id"), $lang->zahost->createZanode);
- $mainActions = array();
- $commonActions = array();
- foreach($config->zahost->view->operateList as $operate)
- {
- if(!common::hasPriv('zahost', $operate)) continue;
- $action = $config->zahost->dtable->fieldList['actions']['list'][$operate];
- if($operate == 'delete')
- {
- $nodeList = $this->loadModel('zanode')->getListByHost($zahost->id);
- if($nodeList)
- {
- $action['disabled'] = true;
- $action['hint'] = $lang->zahost->undeletedNotice;
- }
- }
- if($operate === 'edit' || $operate === 'delete')
- {
- $commonActions[] = $action;
- continue;
- }
- $mainActions[] = $action;
- }
- detailHeader
- (
- to::title
- (
- entityLabel
- (
- set::entityID($zahost->id),
- set::level(1),
- set::text($zahost->name)
- ),
- $zahost->deleted ? span(setClass('label danger'), $lang->zahost->deleted) : null
- )
- );
- detailBody
- (
- sectionList
- (
- section
- (
- set::title($lang->zahost->baseInfo),
- h::table
- (
- setClass('w-full'),
- h::tr
- (
- h::td
- (
- div
- (
- setClass('flex flex-wrap pt-2 mx-4'),
- div
- (
- setClass('w-1/3'),
- span
- (
- setClass('text-gray'),
- $lang->zahost->extranet
- ),
- span
- (
- setClass('ml-2'),
- $zahost->extranet
- )
- ),
- div
- (
- setClass('w-1/3'),
- span
- (
- setClass('text-gray'),
- $lang->zahost->cpuCores
- ),
- span
- (
- setClass('ml-2'),
- $zahost->cpuCores . '' . $lang->zahost->cpuUnit
- )
- ),
- div
- (
- setClass('w-1/3'),
- span
- (
- setClass('text-gray'),
- $lang->zahost->zaHostType
- ),
- span
- (
- setClass('ml-2'),
- $lang->zahost->zaHostTypeList[$zahost->hostType]
- )
- ),
- div
- (
- setClass('w-1/3 mt-4'),
- span
- (
- setClass('text-gray'),
- $lang->zahost->status
- ),
- span
- (
- setClass('ml-2'),
- zget($lang->zahost->statusList, $zahost->status)
- )
- ),
- div
- (
- setClass('w-1/3 mt-4'),
- span
- (
- setClass('text-gray'),
- $lang->zahost->memory
- ),
- span
- (
- setClass('ml-2'),
- $zahost->memory . '' . $lang->zahost->unitList['GB']
- )
- ),
- div
- (
- setClass('w-1/3 mt-4'),
- span
- (
- setClass('text-gray'),
- $lang->zahost->vsoft
- ),
- span
- (
- setClass('ml-2'),
- zget($lang->zahost->softwareList, $zahost->vsoft)
- )
- ),
- div
- (
- setClass('w-1/3 mt-4'),
- span
- (
- setClass('text-gray'),
- $lang->zahost->registerDate
- ),
- span
- (
- setClass('ml-2'),
- helper::isZeroDate($zahost->heartbeat) ? '' : $zahost->heartbeat
- )
- ),
- div
- (
- setClass('w-1/3 mt-4'),
- span
- (
- setClass('text-gray'),
- $lang->zahost->diskSize
- ),
- span
- (
- setClass('ml-2'),
- $zahost->diskSize . '' . $lang->zahost->unitList['GB']
- )
- )
- )
- )
- )
- )
- ),
- section
- (
- set::title($lang->zahost->desc),
- set::content($zahost->desc),
- set::useHtml(true)
- )
- ),
- sectionList
- (
- div
- (
- setClass('text-lg font-bold'),
- $lang->zahost->init->statusTitle,
- button
- (
- setClass('ghost btn'),
- icon('refresh', setClass('text-primary')),
- $lang->zahost->init->checkStatus,
- on::click('ajaxGetServiceStatus')
- )
- ),
- div
- (
- set::id('statusContainer')
- ),
- div
- (
- setClass('init-success hidden'),
- html(sprintf($lang->zahost->init->initSuccessNotice, $imageLink, $createNode))
- ),
- div
- (
- setClass('init-fail hidden'),
- html($lang->zahost->init->initFailNotice),
- textarea
- (
- set::id('initBash'),
- setClass('hidden'),
- $initBash
- ),
- div
- (
- setClass('zahost-init'),
- $initBash,
- h::button
- (
- setClass('ghost btn btn-info btn-mini btn-init-copy text-primary'),
- icon
- (
- setClass('icon-common-copy icon-copy'),
- set::title($lang->zahost->copy),
- set::name('')
- ),
- on::click('onCopy')
- )
- )
- )
- ),
- common::hasPriv('zanode', 'browse') ? sectionList
- (
- section
- (
- set::title($lang->zahost->browseNode)
- ),
- !empty($nodeList) ? div
- (
- setID('nodeList'),
- h::js('loadTarget("' . createLink('zanode', 'nodeList', "hostID={$zahost->id}") . '", "#nodeList")')
- ) : $lang->noData
- ) : null,
- floatToolbar
- (
- to::prefix(backBtn(set::icon('back'), $lang->goback)),
- set::main($mainActions),
- set::suffix($commonActions),
- set::object($zahost)
- ),
- detailSide
- (
- history()
- )
- );
- render();
|