Merge branch 'zenops_46' into 'master'

Merge Zenops 46 into master

See merge request easycorp/zentaopms!6759
This commit is contained in:
王怡栋
2023-01-13 07:05:17 +00:00
37 changed files with 178 additions and 325 deletions
-33
View File
@@ -1,33 +0,0 @@
<style>
#successModal #modalLink{color: #2e7fff;text-decoration: underline;}
#successModal .modal-dialog .modal-content{border: 2px solid #75e5c4; background-color: #f1fcf9; border-radius: 4px;}
#successModal .icon-check-circle{color: #17ce97; margin-right: 10px; font-size: 20px;}
#successModal .modal-dialog{width: fit-content;}
#successModal .modal-dialog{border-radius: 4px;}
#successModal .modal-header{padding:9px 15px 0px; margin:0px; border-bottom:0;}
#successModal .modal-dialog .modal-body{padding: 5px 15px 20px 15px;}
</style>
<div class="modal fade" id="successModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<?php echo html::a($closeLink, '×', '', 'class="close"');?>
</div>
<div class="modal-body">
<p>
<i class="icon-check-circle icon"></i><?php echo $notice;?>
<?php $modalLink = !empty($modalLink) ? $modalLink : '';?>
<?php $class = !empty($modalClass) ? $modalClass : '';?>
<?php echo html::a($modalLink, $buttonName, '', "id='modalLink' class='$class'");?>
</p>
</div>
</div>
</div>
</div>
<script>
function showModal(url = '')
{
if(url) $("#modalLink").attr('href', url);
$('#successModal').modal('show', 'center');
}
</script>
+3 -1
View File
@@ -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%;}
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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(<?php echo json_encode($this->lang->file->dangerFile);?>);
$(file).val('');
+1 -1
View File
@@ -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';
-23
View File
@@ -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.
*
+2
View File
@@ -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;}
-6
View File
@@ -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;}
+2 -2
View File
@@ -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;}
+4 -4
View File
@@ -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');
})
+1 -1
View File
@@ -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');
-47
View File
@@ -1,47 +0,0 @@
$('#checkServiceStatus').click(function(){
$.get(createLink('zahost', 'ajaxGetServiceStatus', 'hostID=' + hostID), function(response)
{
var resultData = JSON.parse(response);
let html = "<h4 style='margin-top: 20px;'>" + zahostLang.init.statusTitle + "</h4>";
let isSuccess = true
for (let key in resultData.data) {
if(resultData.data[key] == 'ready'){
html += "<div class='text-success'><span class='dot-symbol'>●</span><span>" + key + ' ' + zahostLang.init[resultData.data[key]] + "</span></div>"
}else{
isSuccess = false
html += "<div class='text-danger'><span class='dot-symbol'>●</span><span>" + key + ' ' + zahostLang.init[resultData.data[key]] + "</span></div>"
}
};
if(!isSuccess){
html += '<h4 style="margin-top:20px;">' + zahostLang.init.initFailNoticeTitle + '</h4>';
html += '<div><span class="dot-symbol">' + zahostLang.init.initFailNoticeDesc + '<a href="https://github.com/easysoft/zenagent/" target="_blank">https://github.com/easysoft/zenagent/</a></span></div>'
}
$('#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)
})
+15
View File
@@ -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)
}
}
}
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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'] = '下载失败';
+11 -1
View File
@@ -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;
-44
View File
@@ -1,44 +0,0 @@
<?php
/**
* The view file of zahost module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Ke zhao <zhaoke@cnezsoft.com>
* @package automation
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?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'>
<div class='main-header'>
<h2><?php echo $lang->zahost->init->title; ?></h2>
</div>
<div class="host-desc-container">
<h4><?php echo $lang->zahost->init->descTitle; ?></h4>
<div>
<span class='dot-symbol'></span>
<span class='zahost-init-desc'>
<textarea style="display:none;" id="initBash"><?php echo $initBash; ?></textarea>
<?php echo sprintf($lang->zahost->init->initDesc, $initBash, "<button type='button' class='btn btn-info btn-mini btn-init-copy'><i class='icon-common-copy icon-copy' title='" . $lang->zahost->copy . "'></i></button>"); ?>
</span>
</div>
<div id="statusContainer">
</div>
</div>
<div class="text-center host-action">
<button type='button' id='checkServiceStatus' class='btn btn-info margin-top-18'><?php echo $lang->zahost->init->checkStatus; ?></button>
</div>
</div>
</div>
</div>
<?php include $app->getModuleRoot() . 'common/view/successmodal.html.php';?>
<?php include '../../common/view/footer.html.php'; ?>
+3 -2
View File
@@ -135,7 +135,8 @@
<div class="detail">
<div class="detail-title"><?php echo $lang->zahost->browseNode;?></div>
<div class="detail-content article-content">
<table class='table has-sort-head table-fixed' id='nodeList'>
<?php echo "<iframe width='100%' id='nodesIframe' src='" . $this->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;'></iframe>";?>
<!-- <table class='table has-sort-head table-fixed' id='nodeList'>
<thead>
<tr>
<th class='c-name'><?php common::printOrderLink('name', $orderBy, $vars, $lang->zahost->name);?></th>
@@ -158,7 +159,7 @@
</tr>
<?php endforeach;?>
</tbody>
</table>
</table> -->
</div>
</div>
<?php endif; ?>
+1 -1
View File
@@ -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');
+23 -22
View File
@@ -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.
*
-7
View File
@@ -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}
+8
View File
@@ -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;}
+4 -4
View File
@@ -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');
})
-68
View File
@@ -1,68 +0,0 @@
$('#checkServiceStatus').click(function(){
$.get(createLink('zanode', 'ajaxGetServiceStatus', 'nodeID=' + nodeID), function(response)
{
var resultData = JSON.parse(response);
var html = "<h4 style='margin-top: 20px;'>" + zanodeLang.init.statusTitle + "</h4>";
var isSuccess = true
for (var key in resultData.data)
{
var installHtml = "";
if(key == "ZTF")
{
installHtml = "<a class='node-init-install' target='hiddenwin' herf='javascript:;' data-href='"+createLink('zanode', 'ajaxInstallService', 'nodeID=' + nodeID + '&service=' + key)+"'>"+zanodeLang.install+"</a>";
}
if(resultData.data[key] == 'ready')
{
html += "<div class='text-success'><span class='dot-symbol'>●</span><span>" + key + ' ' + zanodeLang.init[resultData.data[key]] + "</span>"+installHtml+"</div>"
}
else
{
isSuccess = false
html += "<div class='text-danger'><span class='dot-symbol'>●</span><span>" + key + ' ' + zanodeLang.init[resultData.data[key]] + "</span>"+installHtml+"</div>"
}
};
if(!isSuccess)
{
html += '<h4 style="margin-top:20px;">' + zanodeLang.init.initFailNoticeTitle + '</h4>';
html += '<div><span class="dot-symbol">' + zanodeLang.init.initFailNoticeDesc + '<a href="https://github.com/easysoft/zenagent/" target="_blank">https://github.com/easysoft/zenagent/</a></span></div>'
}
$('#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)
})
+1
View File
@@ -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 nodeThis 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';
+1
View File
@@ -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 nodeThis 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';
+1
View File
@@ -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 nodeThis 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';
+1
View File
@@ -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 = '镜像导出失败';
+1
View File
@@ -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;
}
}
+29 -8
View File
@@ -15,6 +15,7 @@
<?php if($task):?>
<?php js::set('taskID', $task->task);?>
<?php js::set('nodeID', $node->id);?>
<?php js::set('zanodeLang', $lang->zanode); ?>
<style>.body-modal #mainContent{width:90%}
</style>
<?php endif;?>
@@ -26,13 +27,17 @@
</h2>
</div>
<?php if($task):?>
<h5 class='text-center'><?php echo $lang->zanode->createImaging;?></h5>
<h5 class='text-center status-title'><?php echo $lang->zanode->pending;?></h5>
<div class="progress progress-striped">
<div class="progress-bar progress-bar-success rate" role="progressbar" aria-valuenow="<?php echo $task->rate;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $task->rate;?>%">
</div>
</div>
<?php helper::createLink('zanode', 'create');?>
<h6 class='hide text-center success'><?php echo $lang->zanode->createImageSuccess . html::a(inLink('create'), $lang->zanode->createImageButton, "_parent");?></h6>
<?php
$link = helper::createLink('zanode', 'create', "hostID={$node->parent}");
$link = str_replace('onlybody=yes', '', $link);
$link = trim($link, '?');
?>
<h6 class='hide text-center success'><?php echo $lang->zanode->createImageSuccess . html::a($link, $lang->zanode->createImageButton, "_parent", "style='color:#2e7fff;'");?></h6>
<h6 class='hide text-center fail'><?php echo $lang->zanode->createImageFail;?></h6>
<?php else:?>
<form class="load-indicator main-form form-ajax" method='post' enctype='multipart/form-data' id='dataform'>
@@ -48,7 +53,7 @@
</tr>
<tr>
<td colspan='3' class='text-center'>
<?php echo html::submitButton('', "onclick='if(confirm(\"{$lang->zanode->createImageNotice}\")==false) return false;'");?>
<?php echo in_array($node->status, array('shutdown', 'shutoff')) ? html::submitButton('', "") : html::submitButton('', "onclick='if(confirm(\"{$lang->zanode->createImageNotice}\")==false) return false;'");?>
</td>
</tr>
</table>
@@ -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');
}
</script>
<?php endif;;?>
<?php endif;?>
<?php include '../../common/view/footer.html.php';?>
+1 -1
View File
@@ -12,7 +12,7 @@
?>
<?php include $app->getModuleRoot() . 'common/view/header.lite.html.php';?>
<div class='clearfix'>
<?php echo "<iframe width='100%' id='urlIframe' src='http://$url/novnc?port=6080&path=websockify/?token=$token&password=pass'></iframe>";?>
<?php echo "<iframe width='100%' id='urlIframe' src='http://$url/novnc/vnc.html?resize=scale&autoconnect=true&port=6080&path=websockify/?token=$token&password=pass&resize=scale&autoconnect=true'></iframe>";?>
</div>
<script>
$(function()
-45
View File
@@ -1,45 +0,0 @@
<?php
/**
* The view file of zanode module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Ke zhao <zhaoke@cnezsoft.com>
* @package automation
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php'; ?>
<?php js::set('nodeID', $nodeID) ?>
<?php js::set('zanodeLang', $lang->zanode); ?>
<div id='mainContent' class='main-content'>
<div class='main-col main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->zanode->init->title; ?></h2>
</div>
<div class="host-desc-container">
<h4><?php echo $lang->zanode->init->descTitle; ?></h4>
<div>
<span class='dot-symbol'></span>
<span class='zanode-init-desc'>
<textarea style="display:none;" id="initBash"><?php echo $initBash; ?></textarea>
<?php echo sprintf($lang->zanode->init->initDesc, $initBash, "<button type='button' class='btn btn-info btn-mini btn-init-copy'><i class='icon-common-copy icon-copy' title='" . $lang->zanode->copy . "'></i></button>"); ?>
</span>
</div>
<div id="statusContainer">
</div>
</div>
<div class="text-center host-action">
<button type='button' id='checkServiceStatus' class='btn btn-info margin-top-18'><?php echo $lang->zanode->init->checkStatus; ?></button>
<?php echo html::backButton('' . $lang->goback, "data-app='{$app->tab}'", 'btn'); ?>
</div>
</div>
</div>
</div>
<?php include '../../common/view/successmodal.html.php';?>
<?php include '../../common/view/footer.html.php'; ?>
+56
View File
@@ -0,0 +1,56 @@
<?php
/**
* The browse view file of zanode module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author xiawenlong <xiawenlong@cnezsoft.com>
* @package zanode
* @version $Id$
* @link http://www.zentao.net
*/
?>
<?php include $app->getModuleRoot() . 'common/view/header.html.php'; ?>
<div id='mainContent' class='main-table'>
<?php $vars = "id={$hostID}&orderBy=%s"; ?>
<?php if (empty($nodeList)) : ?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->zanode->empty; ?></span>
<?php if (common::hasPriv('zanode', 'create')) common::printLink('zanode', 'create', '', '<i class="icon icon-plus"></i> ' . $lang->zanode->create, '', 'class="btn btn-info"'); ?>
</p>
</div>
<?php else : ?>
<table class='table has-sort-head table-fixed' id='nodeList'>
<thead>
<tr>
<th class='c-name'><?php common::printOrderLink('name', $orderBy, $vars, $lang->zahost->name);?></th>
<th class='c-cpu'><?php common::printOrderLink('cpuCores', $orderBy, $vars, $lang->zanode->cpuCores);?></th>
<th class='c-memory'><?php common::printOrderLink('memory', $orderBy, $vars, $lang->zanode->memory);?></th>
<th class='c-diskSize'><?php common::printOrderLink('diskSize', $orderBy, $vars, $lang->zanode->diskSize);?></th>
<th class='c-os'><?php common::printOrderLink('osName', $orderBy, $vars, $lang->zanode->osName);?></th>
<th class='c-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->zanode->status);?></th>
</tr>
</thead>
<tbody>
<?php foreach ($nodeList as $node) : ?>
<tr>
<td title='<?php echo $node->name ?>'><?php echo html::a($this->inlink('view', "id=$node->id"), $node->name, '', ""); ?></td>
<td><?php echo zget($config->zanode->os->cpuCores, $node->cpuCores); ?></td>
<td><?php echo $node->memory . $this->lang->zahost->unitList['GB']; ?></td>
<td><?php echo $node->diskSize . $this->lang->zahost->unitList['GB']; ?></td>
<td><?php echo $node->osName; ?></td>
<td><?php echo zget($lang->zanode->statusList, $node->status); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
<?php include $app->getModuleRoot() . 'common/view/footer.html.php'; ?>
<script>
// $('body').addClass('body-modal')
</script>
+1 -1
View File
@@ -137,7 +137,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
</span>
</div>
<div class="status-notice">
<span class='init-success hide'><?php echo sprintf($lang->zanode->init->initSuccessNoticeTitle, "<a href='https://www.zentao.net/book/zentaopms/configure-environment-974.html' target='_blank'>{$lang->zanode->manual}</a>", html::a(helper::createLink('testcase', 'automation', "", '', true), $lang->zanode->automation, '', "class='iframe' title='{$lang->zanode->automation}' data-width='50%'", '')); ?></span>
<span class='init-success hide'><?php echo sprintf($lang->zanode->init->initSuccessNoticeTitle, "<a id='jumpManual' href='javascript:;'>{$lang->zanode->manual}</a>", html::a(helper::createLink('testcase', 'automation', "", '', true), $lang->zanode->automation, '', "class='iframe' title='{$lang->zanode->automation}' data-width='50%'", '')); ?></span>
<span class='init-fail hide'><?php echo $lang->zanode->init->initFailNoticeTitle . '<br/>' . $lang->zanode->init->initFailNoticeDesc;?></span>
</div>
</div>