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 += '