diff --git a/module/common/view/successmodal.html.php b/module/common/view/successmodal.html.php deleted file mode 100644 index 4933fc4dfa..0000000000 --- a/module/common/view/successmodal.html.php +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/module/testcase/css/browse.css b/module/testcase/css/browse.css index 011a343ec1..4062f4a723 100644 --- a/module/testcase/css/browse.css +++ b/module/testcase/css/browse.css @@ -3,8 +3,10 @@ body {margin-bottom: 25px;} .w-170px {width: 170px;} #createActionMenu .dropdown-menu {width: 100%;} -#caseForm table tbody tr td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} +#caseForm table tbody tr td {overflow: hidden; white-space: nowrap;} #caseForm .setting {height: 25px;} +#caseForm table tbody .c-name {overflow: hidden; padding-right: 65px;} +#caseForm table tbody .c-name a:first-child {overflow: hidden; display: inline-block; width: 100%;} .dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;} .dropdown-menu > .menu-search .input-group {width: 100%;} diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 662ef81bce..41de154757 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -83,7 +83,7 @@ js::set('cancelURL', $this->createLink('testtask', 'batchRun', "productID=$ if($useDatatable) include '../../common/view/datatable.html.php'; else include '../../common/view/tablesorter.html.php'; - if($config->testcase->needReview or !empty($config->testcase->forceReview)) $config->testcase->datatable->fieldList['actions']['width'] = '180'; + if($config->testcase->needReview or !empty($config->testcase->forceReview)) $config->testcase->datatable->fieldList['actions']['width'] = '190'; $setting = $this->datatable->getSetting('testcase'); $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; diff --git a/module/testcase/view/buildscriptform.php b/module/testcase/view/buildscriptform.php index 0319c1c943..0d10412215 100644 --- a/module/testcase/view/buildscriptform.php +++ b/module/testcase/view/buildscriptform.php @@ -3,7 +3,7 @@ $this->loadModel('file'); $filesName = 'scriptFile'; $labelsName = 'scriptName'; $maxUploadSize = strtoupper(ini_get('upload_max_filesize')); -$dangerFiles = 'zip'; +$dangerFiles = 'php,py,js,go,sh,bat,lua,rb,tcl,pl'; js::set('scriptDangerExtensions', ',' . $dangerFiles . ','); js::set('maxUploadSize', $maxUploadSize); @@ -74,7 +74,7 @@ function checkDangerExtensions(file) if(index >= 0) { extension = fileName.substr(index + 1); - if(scriptDangerExtensions.lastIndexOf(',' + extension + ',') >= 0) + if(scriptDangerExtensions.lastIndexOf(',' + extension + ',') < 0) { alert(lang->file->dangerFile);?>); $(file).val(''); diff --git a/module/zahost/config.php b/module/zahost/config.php index c7eacc5875..bd15e339b9 100644 --- a/module/zahost/config.php +++ b/module/zahost/config.php @@ -50,7 +50,7 @@ $config->zahost->search['params']['editedDate'] = array('operator' => '=', $config->zahost->editor = new stdclass(); $config->zahost->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); $config->zahost->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools'); -$config->zahost->editor->view = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->zahost->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools'); $config->zahost->automation = new stdclass(); $config->zahost->automation->zenAgentURL = 'https://github.com/easysoft/zenagent/blob/main/guide/deploy/index.md'; diff --git a/module/zahost/control.php b/module/zahost/control.php index 78cb1ee6ca..e201c83b2d 100644 --- a/module/zahost/control.php +++ b/module/zahost/control.php @@ -333,29 +333,6 @@ class zahost extends control return $this->send(array('result' => 'fail', 'message' => array('imageName' => array($this->lang->zahost->notice->noImage)))); } - /* - * Init host. - * - * @param int $hostID - * @return void - */ - public function init($hostID) - { - $imageList = $this->zahost->getImagePairs($hostID); - - $this->view->title = $this->lang->zahost->init->title; - $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted'); - $this->view->hostID = $hostID; - $this->view->host = $this->zahost->getById($hostID); - $this->view->initBash = sprintf($this->config->zahost->initBash, $this->view->host->secret, getWebRoot(true)); - $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->view->closeLink = $this->createLink('zahost', 'browse'); - - $this->display(); - } - /** * Introduction. * diff --git a/module/zahost/css/browseimage.css b/module/zahost/css/browseimage.css index 18731fc5c2..ef7500cb63 100644 --- a/module/zahost/css/browseimage.css +++ b/module/zahost/css/browseimage.css @@ -1,2 +1,4 @@ .c-name,.c-status,.c-progress,.c-osName{width: 130px;} .main-header-image{border:none;margin-left: 0!important;padding-left:0;} +.body-modal #mainContent{padding-top: 85px; padding-bottom: 50px;} +.dropdown-menu>li>a {margin: 1px 0;} diff --git a/module/zahost/css/init.css b/module/zahost/css/init.css deleted file mode 100644 index 0e1d888e3c..0000000000 --- a/module/zahost/css/init.css +++ /dev/null @@ -1,6 +0,0 @@ -.dot-symbol {margin-right: 10px;} -#statusContainer h5 {line-height: 20px;} -.host-desc-container {margin-top: 20px;} -.host-action {margin-top: 60px;} -.host-action .btn {margin-left: 20px;min-width: 100px;} -.zahost-init-desc {display: inline-block;} \ No newline at end of file diff --git a/module/zahost/css/view.css b/module/zahost/css/view.css index 4aabb20003..a01465a8bb 100644 --- a/module/zahost/css/view.css +++ b/module/zahost/css/view.css @@ -6,8 +6,9 @@ .c-os {width: 200px;} .c-memory, .c-diskSize, .c-status, .c-software, .c-instanceNum {width: 90px;} .c-datetime {width: 150px;} -.status-wait {color: #f00;} .c-actions {overflow: visible!important;} +.c-number {width: 120px;} +.status-wait {color: #f00;} .zanode-mt-8{margin-top: 8px;} .zahost-init{padding:15px;background: #f4f5f7;margin:10px 0;} .fail{color:red;} @@ -19,4 +20,3 @@ .btn-info {background-color: unset;} .icon-refresh {font-size: 15px;} .load-indicator:after {top: 33%;} -.c-number {width: 120px;} diff --git a/module/zahost/js/browse.js b/module/zahost/js/browse.js index 31399f3d9f..5ce8f99b34 100644 --- a/module/zahost/js/browse.js +++ b/module/zahost/js/browse.js @@ -6,12 +6,12 @@ $('#hostList tr[data-status="wait"]').hover(function(){ if(showFeature) { - /* Show features dialog. */ - new $.zui.ModalTrigger({url: $.createLink('zahost', 'introduction'), type: 'iframe', width: 900, className: 'showFeatures', showHeader: false, backdrop: 'static'}).show(); + $.apps.close('help'); + $.apps.open('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao', 'help'); } $('#helpTab').click(function() { - /* Show features dialog. */ - new $.zui.ModalTrigger({url: $.createLink('zahost', 'introduction'), type: 'iframe', width: 900, className: 'showFeatures', showHeader: false, backdrop: 'static'}).show(); + $.apps.close('help'); + $.apps.open('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao', 'help'); }) diff --git a/module/zahost/js/browseimage.js b/module/zahost/js/browseimage.js index c0c7f8f0cd..d142876596 100644 --- a/module/zahost/js/browseimage.js +++ b/module/zahost/js/browseimage.js @@ -21,7 +21,7 @@ function updateProgress() { var hasInprogress = false; for (var imageID in statusList) { if (statusList[imageID].statusCode) { - if (statusList[imageID].statusCode == 'inprogress' || statusList[imageID].statusCode == 'created') + if (statusList[imageID].statusCode == 'inprogress' || statusList[imageID].statusCode == 'created' || statusList[imageID].statusCode == 'pending') { hasInprogress = true; $('.image-download-' + imageID).addClass('disabled'); diff --git a/module/zahost/js/init.js b/module/zahost/js/init.js deleted file mode 100644 index f82503d64d..0000000000 --- a/module/zahost/js/init.js +++ /dev/null @@ -1,47 +0,0 @@ -$('#checkServiceStatus').click(function(){ - $.get(createLink('zahost', 'ajaxGetServiceStatus', 'hostID=' + hostID), function(response) - { - var resultData = JSON.parse(response); - let html = "

" + zahostLang.init.statusTitle + "

"; - let isSuccess = true - - for (let key in resultData.data) { - if(resultData.data[key] == 'ready'){ - html += "
" + key + ' ' + zahostLang.init[resultData.data[key]] + "
" - }else{ - isSuccess = false - html += "
" + key + ' ' + zahostLang.init[resultData.data[key]] + "
" - } - }; - - if(!isSuccess){ - html += '

' + zahostLang.init.initFailNoticeTitle + '

'; - html += '
' + zahostLang.init.initFailNoticeDesc + 'https://github.com/easysoft/zenagent/
' - } - $('#statusContainer').html(html) - if(isSuccess) showModal(); - }); - return -}) - -$('.btn-init-copy').live('click', function() -{ - var copyText = $('#initBash'); - copyText.show(); - copyText .select(); - document.execCommand("Copy"); - copyText.hide(); - $('.btn-init-copy').tooltip({ - trigger: 'click', - placement: 'bottom', - title: zahostLang.copied, - tipClass: 'tooltip-success' - }); - - $(this).tooltip('show'); - var that = this; - setTimeout(function() - { - $(that).tooltip('hide') - }, 2000) -}) \ No newline at end of file diff --git a/module/zahost/js/view.js b/module/zahost/js/view.js index c452fffd48..4df1246224 100644 --- a/module/zahost/js/view.js +++ b/module/zahost/js/view.js @@ -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) + } + } +} \ No newline at end of file diff --git a/module/zahost/lang/de.php b/module/zahost/lang/de.php index db5a2d8846..e4cf451830 100644 --- a/module/zahost/lang/de.php +++ b/module/zahost/lang/de.php @@ -91,6 +91,7 @@ $lang->zahost->image->statusList['notDownloaded'] = 'Not Downloaded'; $lang->zahost->image->statusList['created'] = 'Inprogress'; $lang->zahost->image->statusList['canceled'] = 'Not Downloaded'; $lang->zahost->image->statusList['inprogress'] = 'Inprogress'; +$lang->zahost->image->statusList['pending'] = 'Waiting for download'; $lang->zahost->image->statusList['completed'] = 'Completed'; $lang->zahost->image->statusList['failed'] = 'Failed'; diff --git a/module/zahost/lang/en.php b/module/zahost/lang/en.php index db5a2d8846..e4cf451830 100644 --- a/module/zahost/lang/en.php +++ b/module/zahost/lang/en.php @@ -91,6 +91,7 @@ $lang->zahost->image->statusList['notDownloaded'] = 'Not Downloaded'; $lang->zahost->image->statusList['created'] = 'Inprogress'; $lang->zahost->image->statusList['canceled'] = 'Not Downloaded'; $lang->zahost->image->statusList['inprogress'] = 'Inprogress'; +$lang->zahost->image->statusList['pending'] = 'Waiting for download'; $lang->zahost->image->statusList['completed'] = 'Completed'; $lang->zahost->image->statusList['failed'] = 'Failed'; diff --git a/module/zahost/lang/fr.php b/module/zahost/lang/fr.php index db5a2d8846..e4cf451830 100644 --- a/module/zahost/lang/fr.php +++ b/module/zahost/lang/fr.php @@ -91,6 +91,7 @@ $lang->zahost->image->statusList['notDownloaded'] = 'Not Downloaded'; $lang->zahost->image->statusList['created'] = 'Inprogress'; $lang->zahost->image->statusList['canceled'] = 'Not Downloaded'; $lang->zahost->image->statusList['inprogress'] = 'Inprogress'; +$lang->zahost->image->statusList['pending'] = 'Waiting for download'; $lang->zahost->image->statusList['completed'] = 'Completed'; $lang->zahost->image->statusList['failed'] = 'Failed'; diff --git a/module/zahost/lang/vi.php b/module/zahost/lang/vi.php index 7c252fd147..3db09c4781 100644 --- a/module/zahost/lang/vi.php +++ b/module/zahost/lang/vi.php @@ -90,6 +90,7 @@ $lang->zahost->image->statusList['notDownloaded'] = 'Not Downloaded'; $lang->zahost->image->statusList['created'] = 'Inprogress'; $lang->zahost->image->statusList['canceled'] = 'Not Downloaded'; $lang->zahost->image->statusList['inprogress'] = 'Inprogress'; +$lang->zahost->image->statusList['pending'] = 'Waiting for download'; $lang->zahost->image->statusList['completed'] = 'Completed'; $lang->zahost->image->statusList['failed'] = 'Failed'; diff --git a/module/zahost/lang/zh-cn.php b/module/zahost/lang/zh-cn.php index a4771a9fc4..60804004a3 100644 --- a/module/zahost/lang/zh-cn.php +++ b/module/zahost/lang/zh-cn.php @@ -91,6 +91,7 @@ $lang->zahost->image->statusList['notDownloaded'] = '可下载'; $lang->zahost->image->statusList['created'] = '下载中'; $lang->zahost->image->statusList['canceled'] = '可下载'; $lang->zahost->image->statusList['inprogress'] = '下载中'; +$lang->zahost->image->statusList['pending'] = '排队下载中'; $lang->zahost->image->statusList['completed'] = '可使用'; $lang->zahost->image->statusList['failed'] = '下载失败'; diff --git a/module/zahost/model.php b/module/zahost/model.php index 0751265257..b7f37b3e74 100644 --- a/module/zahost/model.php +++ b/module/zahost/model.php @@ -323,10 +323,13 @@ class zahostModel extends model } $currentTask = null; + $is_finish = false; foreach($result->data as $status => $group) { + if($is_finish) break; foreach($group as $task) { + if($is_finish) break; if($task->task == $image->id) { $task->endDate = substr($task->endDate, 0, 19); @@ -334,6 +337,12 @@ class zahostModel extends model { $currentTask = $task; } + if($task->status == 'inprogress') + { + $currentTask = $task; + $is_finish = true; + break; + } } } } @@ -343,6 +352,8 @@ class zahostModel extends model $image->rate = $currentTask->rate; $image->status = $currentTask->status; + if(!empty($result->data->inprogress) && $currentTask->task != $result->data->inprogress[0]->task && $currentTask->status == 'created') $image->status = 'pending'; + $this->dao->update(TABLE_IMAGE) ->set('status')->eq($image->status) ->set('path')->eq(!empty($currentTask->path) ? $currentTask->path : '') @@ -372,7 +383,6 @@ class zahostModel extends model $response = json_decode(commonModel::http($statusApi, array(), array(CURLOPT_CUSTOMREQUEST => 'GET'), array("Authorization:$host->tokenSN"), 'json')); - a($response); if($response->code == 200) return true; dao::$errors[] = $response->msg; diff --git a/module/zahost/view/init.html.php b/module/zahost/view/init.html.php deleted file mode 100644 index 0da41a9072..0000000000 --- a/module/zahost/view/init.html.php +++ /dev/null @@ -1,44 +0,0 @@ - - * @package automation - * @version $Id$ - * @link http://www.zentao.net - */ -?> - - -zahost); ?> -
-
-
-
-

zahost->init->title; ?>

-
- -
-

zahost->init->descTitle; ?>

-
- - - - zahost->init->initDesc, $initBash, ""); ?> - -
-
-
-
- -
- -
-
-
-
-getModuleRoot() . 'common/view/successmodal.html.php';?> - diff --git a/module/zahost/view/view.html.php b/module/zahost/view/view.html.php index 3a3f9b9db0..ab54e22f53 100644 --- a/module/zahost/view/view.html.php +++ b/module/zahost/view/view.html.php @@ -135,7 +135,8 @@
zahost->browseNode;?>
- + 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;'>";?> + diff --git a/module/zanode/config.php b/module/zanode/config.php index 75dd808f6b..1096e4e057 100644 --- a/module/zanode/config.php +++ b/module/zanode/config.php @@ -49,4 +49,4 @@ $config->zanode->editor = new stdclass(); $config->zanode->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); $config->zanode->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools'); $config->zanode->editor->createimage = array('id' => 'desc', 'tools' => 'simpleTools'); -$config->zanode->editor->view = array('id' => 'comment', 'tools' => 'simpleTools'); +$config->zanode->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools'); diff --git a/module/zanode/control.php b/module/zanode/control.php index 4038bcc4b7..e2866dbdc4 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -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. * @@ -138,28 +161,6 @@ class zanode extends control $this->display(); } - /* - * Init node. - * - * @param int $hostID - * @return void - */ - public function init($nodeID) - { - $this->view->title = $this->lang->zanode->initTitle; - $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted'); - $this->view->nodeID = $nodeID; - $this->view->node = $this->zanode->getNodeById($nodeID); - $this->view->initBash = sprintf($this->config->zanode->initBash, getWebRoot(true)); - $this->view->notice = $this->lang->zanode->init->initSuccessNoticeTitle; - $this->view->buttonName = $this->lang->zanode->init->button; - $this->view->modalLink = $this->createLink('testcase', 'automation', 0, '', true); - $this->view->modalClass = 'iframe'; - $this->view->closeLink = $this->createLink('zanode', 'browse'); - - $this->display(); - } - /** * start Node. * diff --git a/module/zanode/css/init.css b/module/zanode/css/init.css deleted file mode 100644 index f8b50a8d7d..0000000000 --- a/module/zanode/css/init.css +++ /dev/null @@ -1,7 +0,0 @@ -.dot-symbol{margin-right: 10px;} -#statusContainer h5{line-height: 20px;} -.host-desc-container{margin-top: 20px;} -.host-action{margin-top: 60px;} -.host-action .btn{margin-left: 20px;min-width: 100px;} -.zahost-init-desc{display: inline-block;} -.node-init-install{margin-left: 10px;color: #2463c7} \ No newline at end of file diff --git a/module/zanode/css/list.css b/module/zanode/css/list.css new file mode 100644 index 0000000000..afab8ded96 --- /dev/null +++ b/module/zanode/css/list.css @@ -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;} diff --git a/module/zanode/js/browse.js b/module/zanode/js/browse.js index ea3d670380..882c7a4cc0 100644 --- a/module/zanode/js/browse.js +++ b/module/zanode/js/browse.js @@ -1,11 +1,11 @@ if(showFeature) { - /* Show features dialog. */ - new $.zui.ModalTrigger({url: $.createLink('zahost', 'introduction'), type: 'iframe', width: 900, className: 'showFeatures', showHeader: false, backdrop: 'static'}).show(); + $.apps.close('help'); + $.apps.open('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao', 'help'); } $('#helpTab').click(function() { - /* Show features dialog. */ - new $.zui.ModalTrigger({url: $.createLink('zahost', 'introduction'), type: 'iframe', width: 900, className: 'showFeatures', showHeader: false, backdrop: 'static'}).show(); + $.apps.close('help'); + $.apps.open('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao', 'help'); }) diff --git a/module/zanode/js/init.js b/module/zanode/js/init.js deleted file mode 100644 index 4a841198a0..0000000000 --- a/module/zanode/js/init.js +++ /dev/null @@ -1,68 +0,0 @@ -$('#checkServiceStatus').click(function(){ - $.get(createLink('zanode', 'ajaxGetServiceStatus', 'nodeID=' + nodeID), function(response) - { - var resultData = JSON.parse(response); - var html = "

" + zanodeLang.init.statusTitle + "

"; - var isSuccess = true - - for (var key in resultData.data) - { - var installHtml = ""; - if(key == "ZTF") - { - installHtml = ""+zanodeLang.install+""; - } - if(resultData.data[key] == 'ready') - { - html += "
" + key + ' ' + zanodeLang.init[resultData.data[key]] + ""+installHtml+"
" - } - else - { - isSuccess = false - html += "
" + key + ' ' + zanodeLang.init[resultData.data[key]] + ""+installHtml+"
" - } - }; - - if(!isSuccess) - { - html += '

' + zanodeLang.init.initFailNoticeTitle + '

'; - html += '
' + zanodeLang.init.initFailNoticeDesc + 'https://github.com/easysoft/zenagent/
' - } - $('#statusContainer').html(html) - if(isSuccess) showModal(); - }); - return -}) - -$('#statusContainer').on('click', '.node-init-install', function(){ - $(this).addClass('load-indicator loading'); - var link = $(this).data('href') - $.get(link, function(response) - { - $(this).removeClass('load-indicator'); - $(this).removeClass('loading'); - $('#checkServiceStatus').trigger("click") - }) -}) - -$('.btn-init-copy').live('click', function() -{ - var copyText = $('#initBash'); - copyText.show(); - copyText .select(); - document.execCommand("Copy"); - copyText.hide(); - $('.btn-init-copy').tooltip({ - trigger: 'click', - placement: 'bottom', - title: zanodeLang.copied, - tipClass: 'tooltip-success' - }); - - $(this).tooltip('show'); - var that = this; - setTimeout(function() - { - $(that).tooltip('hide') - }, 2000) -}) \ No newline at end of file diff --git a/module/zanode/lang/de.php b/module/zanode/lang/de.php index 703d1fe112..f32d767fbc 100644 --- a/module/zanode/lang/de.php +++ b/module/zanode/lang/de.php @@ -73,6 +73,7 @@ $lang->zanode->runCaseConfirm = 'The system detects the presence of an automatio $lang->zanode->createImage = 'Create Image'; $lang->zanode->createImaging = 'Creating'; +$lang->zanode->pending = 'Waiting for create'; $lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the ZenAgent Node to be shut down. Do you want to continue?'; $lang->zanode->createImageSuccess = 'Successed, You can use this image to create node.'; $lang->zanode->createImageFail = 'Failed to create'; diff --git a/module/zanode/lang/en.php b/module/zanode/lang/en.php index 703d1fe112..f32d767fbc 100644 --- a/module/zanode/lang/en.php +++ b/module/zanode/lang/en.php @@ -73,6 +73,7 @@ $lang->zanode->runCaseConfirm = 'The system detects the presence of an automatio $lang->zanode->createImage = 'Create Image'; $lang->zanode->createImaging = 'Creating'; +$lang->zanode->pending = 'Waiting for create'; $lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the ZenAgent Node to be shut down. Do you want to continue?'; $lang->zanode->createImageSuccess = 'Successed, You can use this image to create node.'; $lang->zanode->createImageFail = 'Failed to create'; diff --git a/module/zanode/lang/fr.php b/module/zanode/lang/fr.php index 703d1fe112..f32d767fbc 100644 --- a/module/zanode/lang/fr.php +++ b/module/zanode/lang/fr.php @@ -73,6 +73,7 @@ $lang->zanode->runCaseConfirm = 'The system detects the presence of an automatio $lang->zanode->createImage = 'Create Image'; $lang->zanode->createImaging = 'Creating'; +$lang->zanode->pending = 'Waiting for create'; $lang->zanode->createImageNotice = 'The system will be created based on the current node,This process requires the ZenAgent Node to be shut down. Do you want to continue?'; $lang->zanode->createImageSuccess = 'Successed, You can use this image to create node.'; $lang->zanode->createImageFail = 'Failed to create'; diff --git a/module/zanode/lang/zh-cn.php b/module/zanode/lang/zh-cn.php index dacdf4b979..30bb81be88 100644 --- a/module/zanode/lang/zh-cn.php +++ b/module/zanode/lang/zh-cn.php @@ -73,6 +73,7 @@ $lang->zanode->runCaseConfirm = '系统检测到选择的用例存在自动化 $lang->zanode->createImage = '导出镜像'; $lang->zanode->createImaging = '正在导出镜像'; +$lang->zanode->pending = '等待导出镜像'; $lang->zanode->createImageNotice = '系统将基于当前执行节点导出镜像,该过程需要关闭该执行节点,确定要继续么?'; $lang->zanode->createImageSuccess = '镜像导出成功,您可以使用此镜像创建执行节点。'; $lang->zanode->createImageFail = '镜像导出失败'; diff --git a/module/zanode/model.php b/module/zanode/model.php index 217a586c2e..591d14fed0 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -675,6 +675,7 @@ class zanodemodel extends model foreach($tasks as $task) { + if(!empty($tasks['inprogress']) && $task->task != $tasks['inprogress'][0]->task && $task->status == 'created') $task->status = 'pending'; if($type == $task->type and $taskID == $task->task) return $task; } } diff --git a/module/zanode/view/createimage.html.php b/module/zanode/view/createimage.html.php index d9d18dcf6b..f5fbccb92a 100644 --- a/module/zanode/view/createimage.html.php +++ b/module/zanode/view/createimage.html.php @@ -15,6 +15,7 @@ task);?> id);?> +zanode); ?> @@ -26,13 +27,17 @@ -
zanode->createImaging;?>
+
zanode->pending;?>
- -
zanode->createImageSuccess . html::a(inLink('create'), $lang->zanode->createImageButton, "_parent");?>
+ parent}"); + $link = str_replace('onlybody=yes', '', $link); + $link = trim($link, '?'); + ?> +
zanode->createImageSuccess . html::a($link, $lang->zanode->createImageButton, "_parent", "style='color:#2e7fff;'");?>
zanode->createImageFail;?>
@@ -48,7 +53,7 @@
- zanode->createImageNotice}\")==false) return false;'");?> + status, array('shutdown', 'shutoff')) ? html::submitButton('', "") : html::submitButton('', "onclick='if(confirm(\"{$lang->zanode->createImageNotice}\")==false) return false;'");?>
@@ -78,8 +83,17 @@ function getTaskProgress() if(rate == 1 || status == 'completed') rate = 1; if(status == 'inprogress' && rate >= 1) rate = 0.97; + if(status == 'pending') + { + $('.status-title').text(zanodeLang.pending) + } + else + { + $('.status-title').text(zanodeLang.createImaging) + } + $('.rate').css('width', rate*100 + '%'); - if(rate == 1 || (status != 'inprogress' && status != 'created')) + if(rate == 1 || (status != 'inprogress' && status != 'created' && status != 'pending')) { updateStatus(data); clearInterval(setProgress); @@ -94,10 +108,17 @@ function updateStatus(data) $.post(url, postData, function(result) { - if(data.status == 'completed') $('.success').removeClass('hide'); - else $('.fail').removeClass('hide'); + if(data.status == 'completed') + { + $('.success').removeClass('hide'); + $('.status-title').text('') + } + else + { + $('.status-title').text(zanodeLang.createImageFail) + } }, 'json'); } - + diff --git a/module/zanode/view/getvnc.html.php b/module/zanode/view/getvnc.html.php index b439daa0f4..4eb04c8fbd 100644 --- a/module/zanode/view/getvnc.html.php +++ b/module/zanode/view/getvnc.html.php @@ -12,7 +12,7 @@ ?> getModuleRoot() . 'common/view/header.lite.html.php';?>
- ";?> + ";?>
\ No newline at end of file diff --git a/module/zanode/view/view.html.php b/module/zanode/view/view.html.php index b1a066fc59..b5a2a99303 100644 --- a/module/zanode/view/view.html.php +++ b/module/zanode/view/view.html.php @@ -137,7 +137,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
- zanode->init->initSuccessNoticeTitle, "{$lang->zanode->manual}", html::a(helper::createLink('testcase', 'automation', "", '', true), $lang->zanode->automation, '', "class='iframe' title='{$lang->zanode->automation}' data-width='50%'", '')); ?> + zanode->init->initSuccessNoticeTitle, "{$lang->zanode->manual}", html::a(helper::createLink('testcase', 'automation', "", '', true), $lang->zanode->automation, '', "class='iframe' title='{$lang->zanode->automation}' data-width='50%'", '')); ?> zanode->init->initFailNoticeTitle . '
' . $lang->zanode->init->initFailNoticeDesc;?>