diff --git a/module/zahost/control.php b/module/zahost/control.php index 4104185a31..07b8138ff6 100644 --- a/module/zahost/control.php +++ b/module/zahost/control.php @@ -89,10 +89,13 @@ class zahost extends control return $this->send(array('result' => 'fail', 'message' => dao::getError())); } - return print(""); + $initLink = $this->createLink('zahost', 'inithost', "hostID=$hostID"); + return print(""); } - $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(); } diff --git a/module/zahost/css/common.css b/module/zahost/css/common.css new file mode 100644 index 0000000000..a3e1e2fdd6 --- /dev/null +++ b/module/zahost/css/common.css @@ -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;} diff --git a/module/zahost/css/create.css b/module/zahost/css/create.css index ffcc587882..ae37eb5805 100644 --- a/module/zahost/css/create.css +++ b/module/zahost/css/create.css @@ -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;} diff --git a/module/zahost/js/common.js b/module/zahost/js/common.js index 65357a2674..58462cdc7d 100755 --- a/module/zahost/js/common.js +++ b/module/zahost/js/common.js @@ -32,3 +32,9 @@ $(function() $('#osCategory').change(); }) + +function showModal(url = '') +{ + if(url) $("#modalLink").attr('href', url); + $('#successModal').modal('show', 'center'); +} diff --git a/module/zahost/js/inithost.js b/module/zahost/js/inithost.js index 670a4ce40d..62e2113a06 100644 --- a/module/zahost/js/inithost.js +++ b/module/zahost/js/inithost.js @@ -16,14 +16,12 @@ $('#checkServiceStatus').click(function(){ if(isSuccess){ html += '

' + zahostLang.initHost.initSuccessNotice + '

' - $('#jumpToImageList').removeAttr('disabled'); - $('#jumpToImageList').attr('href', createLink('zahost', 'browseImage', 'hostID=' + hostID)); }else{ html += '

' + zahostLang.initHost.initFailNoticeTitle + '

'; html += '
' + zahostLang.initHost.initFailNoticeDesc + 'https://github.com/easysoft/zenagent/
' - $('#jumpToImageList').attr('disabled', 'disabled') } $('#statusContainer').html(html) + if(isSuccess) showModal(); }); return }) diff --git a/module/zahost/lang/de.php b/module/zahost/lang/de.php index 6d9e6193ae..5c6fd64540 100644 --- a/module/zahost/lang/de.php +++ b/module/zahost/lang/de.php @@ -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'; diff --git a/module/zahost/lang/en.php b/module/zahost/lang/en.php index 6d9e6193ae..5c6fd64540 100644 --- a/module/zahost/lang/en.php +++ b/module/zahost/lang/en.php @@ -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'; diff --git a/module/zahost/lang/fr.php b/module/zahost/lang/fr.php index 5d575d1c07..21184aeeea 100644 --- a/module/zahost/lang/fr.php +++ b/module/zahost/lang/fr.php @@ -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'; diff --git a/module/zahost/lang/zh-cn.php b/module/zahost/lang/zh-cn.php index 35e13a7fb1..1e74cfeaf2 100644 --- a/module/zahost/lang/zh-cn.php +++ b/module/zahost/lang/zh-cn.php @@ -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'] = '准备中'; diff --git a/module/zahost/view/create.html.php b/module/zahost/view/create.html.php index 5e99065c8d..7eccdf9827 100644 --- a/module/zahost/view/create.html.php +++ b/module/zahost/view/create.html.php @@ -78,27 +78,5 @@ - - + getModuleRoot() . 'common/view/footer.html.php';?> diff --git a/module/zahost/view/inithost.html.php b/module/zahost/view/inithost.html.php index 21070cf6c7..f21adfbf5c 100644 --- a/module/zahost/view/inithost.html.php +++ b/module/zahost/view/inithost.html.php @@ -14,7 +14,6 @@ zahost); ?> -
@@ -31,8 +30,9 @@
- 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'"); ?>
- \ No newline at end of file +
+ + diff --git a/module/zahost/view/successmodal.html.php b/module/zahost/view/successmodal.html.php new file mode 100644 index 0000000000..e1ccea7c5a --- /dev/null +++ b/module/zahost/view/successmodal.html.php @@ -0,0 +1,16 @@ +