* Finish task #77673.

This commit is contained in:
tanghucheng
2022-11-30 11:01:35 +08:00
parent 81505a483a
commit 7daee4a6f2
12 changed files with 74 additions and 64 deletions
+14 -6
View File
@@ -89,10 +89,13 @@ class zahost extends control
return $this->send(array('result' => 'fail', 'message' => dao::getError()));
}
return print("<script>showModal($hostID)</script>");
$initLink = $this->createLink('zahost', 'inithost', "hostID=$hostID");
return print("<script>showModal('$initLink')</script>");
}
$this->view->title = $this->lang->zahost->create;
$this->view->title = $this->lang->zahost->create;
$this->view->notice = $this->lang->zahost->initHostNotice;
$this->view->buttonName = $this->lang->zahost->init;
$this->display();
}
@@ -287,10 +290,15 @@ class zahost extends control
*/
public function initHost($hostID)
{
$this->view->title = $this->lang->zahost->init;
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
$this->view->hostID = $hostID;
$this->view->host = $this->zahost->getById($hostID);
$imageList = $this->zahost->getImagePairs($hostID);
$this->view->title = $this->lang->zahost->init;
$this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted');
$this->view->hostID = $hostID;
$this->view->host = $this->zahost->getById($hostID);
$this->view->notice = $imageList ? $this->lang->zahost->createZanodeNotice : $this->lang->zahost->downloadImageNotice;
$this->view->buttonName = $imageList ? $this->lang->zahost->createZanode : $this->lang->zahost->image->downloadImage;
$this->view->modalLink = $imageList ? $this->createLink('zanode', 'create', "hostID=$hostID") : $this->createLink('zahost', 'browseImage', "hostID=$hostID");
$this->display();
}
+7
View File
@@ -0,0 +1,7 @@
#modalLink{color: #2e7fff;text-decoration: underline;}
.modal-dialog .modal-content{border: 2px solid #75e5c4; background-color: #f1fcf9; border-radius: 4px;}
.icon-check-circle{color: #17ce97; margin-right: 10px; font-size: 20px;}
.modal-dialog{width: 384px;}
.modal-dialog{border-radius: 4px;}
.modal-header{padding:9px 18px 0px; margin:0px; border-bottom:0;}
.modal-dialog .modal-body{padding: 5px 5px 20px 15px;}
-8
View File
@@ -1,11 +1,3 @@
#unit {padding: 0px !important; width:0px; border-left: 0px;width: 63px;}
.input-group-addon {border: 0px; width: 100px;}
#memory-addon{text-align: center;width: 63px;}
#initHostLink{color: #2e7fff;}
.modal-dialog .modal-content{border: 2px solid #75e5c4; background-color: #f1fcf9; border-radius: 4px;}
.icon-check-circle{color: #17ce97; margin-right: 10px; font-size: 20px;}
.modal-dialog{width: 384px;}
.modal-dialog{border-radius: 4px;}
.modal-header{padding:9px 18px 0px; margin:0px; border-bottom:0;}
.modal-dialog .modal-body{padding: 5px 5px 20px 15px;}
.modal-dialog .modal-body a{text-decoration: underline;}
+6
View File
@@ -32,3 +32,9 @@ $(function()
$('#osCategory').change();
})
function showModal(url = '')
{
if(url) $("#modalLink").attr('href', url);
$('#successModal').modal('show', 'center');
}
+2 -3
View File
@@ -16,14 +16,13 @@ $('#checkServiceStatus').click(function(){
if(isSuccess){
html += '<h4>' + zahostLang.initHost.initSuccessNotice + '</h4>'
$('#jumpToImageList').removeAttr('disabled');
$('#jumpToImageList').attr('href', createLink('zahost', 'browseImage', 'hostID=' + hostID));
}else{
html += '<h4 style="margin-top:20px;">' + zahostLang.initHost.initFailNoticeTitle + '</h4>';
html += '<div><span class="dot-symbol">' + zahostLang.initHost.initFailNoticeDesc + '<a href="https://github.com/easysoft/zenagent/" target="_blank">https://github.com/easysoft/zenagent/</a></span></div>'
$('#jumpToImageList').attr('disabled', 'disabled')
}
$('#statusContainer').html(html)
if(isSuccess) showModal();
});
return
})
+7 -6
View File
@@ -35,8 +35,10 @@ $lang->zahost->cpuCoreNum = $lang->zahost->cpuCores;
$lang->zahost->os = 'System';
$lang->zahost->imageName = 'Image File';
$lang->zahost->goback = 'Go back';
$lang->zahost->createSuccessNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanode = 'Create Zanode';
$lang->zahost->initHostNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanodeNotice = 'Initialization successful, ready to create the zanode';
$lang->zahost->downloadImageNotice = 'Initialization successful, download the image to create zanode';
$lang->zahost->initHost = new stdclass;
$lang->zahost->initHost->checkStatus = "Check Service Status";
@@ -82,10 +84,9 @@ $lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->langList = array();
$lang->zahost->langList['zh_cn'] = 'Simplified Chinese';
$lang->zahost->langList['zh_tw'] = 'Traditional Chinese';
$lang->zahost->langList['en_us'] = 'American English';
$lang->zahost->image->imageEmpty = 'No Image';
$lang->zahost->image->downloadImageFail = 'Failed to create image task';
$lang->zahost->image->downloadImageSuccess = 'Successed to create image task';
$lang->zahost->empty = 'No Host';
+7 -6
View File
@@ -35,8 +35,10 @@ $lang->zahost->cpuCoreNum = $lang->zahost->cpuCores;
$lang->zahost->os = 'System';
$lang->zahost->imageName = 'Image File';
$lang->zahost->goback = 'Go back';
$lang->zahost->createSuccessNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanode = 'Create Zanode';
$lang->zahost->initHostNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanodeNotice = 'Initialization successful, ready to create the zanode';
$lang->zahost->downloadImageNotice = 'Initialization successful, download the image to create zanode';
$lang->zahost->initHost = new stdclass;
$lang->zahost->initHost->checkStatus = "Check Service Status";
@@ -82,10 +84,9 @@ $lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->langList = array();
$lang->zahost->langList['zh_cn'] = 'Simplified Chinese';
$lang->zahost->langList['zh_tw'] = 'Traditional Chinese';
$lang->zahost->langList['en_us'] = 'American English';
$lang->zahost->image->imageEmpty = 'No Image';
$lang->zahost->image->downloadImageFail = 'Failed to create image task';
$lang->zahost->image->downloadImageSuccess = 'Successed to create image task';
$lang->zahost->empty = 'No Host';
+7 -6
View File
@@ -35,8 +35,10 @@ $lang->zahost->cpuCoreNum = $lang->zahost->cpuCores;
$lang->zahost->os = 'System';
$lang->zahost->imageName = 'Image File';
$lang->zahost->goback = 'Go back';
$lang->zahost->createSuccessNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanode = 'Create Zanode';
$lang->zahost->initHostNotice = 'Save successfully, initialize the ZAhost or return list';
$lang->zahost->createZanodeNotice = 'Initialization successful, ready to create the zanode';
$lang->zahost->downloadImageNotice = 'Initialization successful, download the image to create zanode';
$lang->zahost->initHost = new stdclass;
$lang->zahost->initHost->checkStatus = "Check Service Status";
@@ -82,10 +84,9 @@ $lang->zahost->image->statusList['inprogress'] = 'Inprogress';
$lang->zahost->image->statusList['completed'] = 'Completed';
$lang->zahost->image->statusList['failed'] = 'Failed';
$lang->zahost->langList = array();
$lang->zahost->langList['zh_cn'] = 'Simplified Chinese';
$lang->zahost->langList['zh_tw'] = 'Traditional Chinese';
$lang->zahost->langList['en_us'] = 'American English';
$lang->zahost->image->imageEmpty = 'No Image';
$lang->zahost->image->downloadImageFail = 'Failed to create image task';
$lang->zahost->image->downloadImageSuccess = 'Successed to create image task';
$lang->zahost->empty = 'No Host';
+4 -3
View File
@@ -35,8 +35,10 @@ $lang->zahost->cpuCoreNum = $lang->zahost->cpuCores;
$lang->zahost->os = '操作系统平台';
$lang->zahost->imageName = '镜像文件';
$lang->zahost->goback = '返回列表';
$lang->zahost->createSuccessNotice = '保存成功,请您初始化宿主机或返回列表';
$lang->zahost->createZanode = '创建执行节点';
$lang->zahost->initHostNotice = '保存成功,请您初始化宿主机或返回列表';
$lang->zahost->createZanodeNotice = '初始化成功,您现在可以创建执行节点了。';
$lang->zahost->downloadImageNotice = '初始化成功,请下载镜像用于创建执行节点。';
$lang->zahost->initHost = new stdclass;
$lang->zahost->initHost->statusTitle = "服务状态";
@@ -86,7 +88,6 @@ $lang->zahost->image->imageEmpty = '无镜像';
$lang->zahost->image->downloadImageFail = '创建下载镜像任务失败';
$lang->zahost->image->downloadImageSuccess = '创建下载镜像任务成功';
$lang->zahost->empty = '暂时没有宿主机';
$lang->zahost->statusList['ready'] = '准备中';
+1 -23
View File
@@ -78,27 +78,5 @@
</div>
</div>
</div>
<div class="modal fade" id="successModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<p>
<i class="icon-check-circle icon"></i><?php echo $lang->zahost->createSuccessNotice;?>
<?php echo html::a('', $lang->zahost->init, '', 'id="initHostLink"');?>
</p>
</div>
</div>
</div>
</div>
<script>
function showModal(hostID)
{
var url = createLink('zahost', 'inithost', "hostID=" + hostID);
$("#initHostLink").attr('href', url);
$('#successModal').modal('show', 'center');
}
</script>
<?php include 'successmodal.html.php';?>
<?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>
+3 -3
View File
@@ -14,7 +14,6 @@
<?php include '../../common/view/header.html.php'; ?>
<?php js::set('hostID', $hostID) ?>
<?php js::set('zahostLang', $lang->zahost); ?>
<div id='mainContent' class='main-content'>
<div class='main-col main-content'>
<div class='center-block'>
@@ -31,8 +30,9 @@
<div class="text-center host-action">
<button type='button' id='checkServiceStatus' class='btn btn-info margin-top-18'><?php echo $lang->zahost->initHost->checkStatus; ?></button>
<?php echo html::a($this->createLink('zahost', 'browseImage', "hostID={$hostID}"), $lang->zahost->initHost->next, '', "title='{$lang->zahost->initHost->next}' class='btn btn-primary margin-top-18' disabled='disabled' id='jumpToImageList'"); ?>
</div>
</div>
</div>
<?php include '../../common/view/footer.html.php'; ?>
</div>
<?php include 'successmodal.html.php';?>
<?php include '../../common/view/footer.html.php'; ?>
+16
View File
@@ -0,0 +1,16 @@
<div class="modal fade" id="successModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<?php echo html::a($this->createLink('zahost', 'browse'), '×', '', 'class="close"');?>
</div>
<div class="modal-body">
<p>
<i class="icon-check-circle icon"></i><?php echo $notice;?>
<?php $modalLink = !empty($modalLink) ? $modalLink : '';?>
<?php echo html::a($modalLink, $buttonName, '', 'id="modalLink"');?>
</p>
</div>
</div>
</div>
</div>