Merge branch 'zenops_46' into 'master'
Merge branch 'zenops_46' into master See merge request easycorp/zentaopms!6662
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -3204,7 +3204,7 @@ EOD;
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public static function http($url, $data = null, $options = array(), $headers = array(), $dataType = 'data', $method = 'POST')
|
||||
public static function http($url, $data = null, $options = array(), $headers = array(), $dataType = 'data', $method = 'POST', $timeout = 30)
|
||||
{
|
||||
global $lang, $app;
|
||||
if(!extension_loaded('curl'))
|
||||
@@ -3226,8 +3226,8 @@ EOD;
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, 'Sae T OAuth2 v0.1');
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
curl_setopt($curl, CURLOPT_ENCODING, "");
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
|
||||
@@ -25,3 +25,6 @@ tbody > tr > td .icon-share {font-size: 9px;}
|
||||
#importToLib .select-lib {width: 100px; text-align: right;}
|
||||
#subHeader #currentBranch + #dropMenu .col-left {padding-bottom: 30px;}
|
||||
.status-blocked {left: -5px;}
|
||||
|
||||
#mainMenu .pull-left .dividing-line {margin: 7px 5px 0 0;}
|
||||
.btn-toolbar>.btn, .btn-toolbar>.btn-group, .btn-toolbar>.dropdown {margin-right: 5px;}
|
||||
|
||||
@@ -2,9 +2,15 @@
|
||||
.col-side .chosen-container {width: 218px !important;}
|
||||
.table-form > tbody > tr > td .btn.addbutton {display: block; margin: 1px 0px; width: 40px; padding: 1px 6px;}
|
||||
.table-form > tbody > tr > td .btn.delbutton {display: block; margin: 1px 0px; width: 40px; padding: 1px 6px;}
|
||||
#branch {width: 95px!important;}
|
||||
.detail > table > tbody th {width: 100px !important;}
|
||||
[lang^=en] .detail > table > tbody th, [lang^=fr] .detail > table > tbody th {width: 100px !important;}
|
||||
[lang^=de] .detail > table > tbody th {width: 125px !important;}
|
||||
.linkCaseTitle, .linkBugTitle {white-space: nowrap;}
|
||||
#type_chosen{display: table-cell;}
|
||||
#branch {width: 95px!important;}
|
||||
.detail > table > tbody th {width: 100px !important;}
|
||||
[lang^=en] .detail > table > tbody th, [lang^=fr] .detail > table > tbody th {width: 100px !important;}
|
||||
[lang^=de] .detail > table > tbody th {width: 125px !important;}
|
||||
.linkCaseTitle, .linkBugTitle {white-space: nowrap;}
|
||||
#type_chosen{display: table-cell;}
|
||||
.autoScript .file-input .file-title{max-width: 70px;}
|
||||
|
||||
@media screen and (max-width: 1366px) {
|
||||
#module_chosen{min-width: 60px;}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ $lang->testcase->suite = 'Test Suite';
|
||||
$lang->testcase->executionStatus = 'executionStatus';
|
||||
$lang->testcase->caseType = 'Case Type';
|
||||
$lang->testcase->allType = 'All Types';
|
||||
$lang->testcase->showAutoCase = 'Automated Test Cases';
|
||||
$lang->testcase->showAutoCase = 'Automated';
|
||||
$lang->testcase->automation = 'Automation Test';
|
||||
|
||||
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
|
||||
@@ -152,6 +152,7 @@ $lang->testcase->stepChild = 'Teilschritt';
|
||||
$lang->testcase->viewAll = 'Alle anziegen';
|
||||
$lang->testcase->importToLib = "Import To Library";
|
||||
$lang->testcase->showScript = 'Show Script';
|
||||
$lang->testcase->autoScript = 'Script';
|
||||
|
||||
$lang->testcase->new = 'Neu';
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ $lang->testcase->suite = 'Test Suite';
|
||||
$lang->testcase->executionStatus = 'executionStatus';
|
||||
$lang->testcase->caseType = 'Case Type';
|
||||
$lang->testcase->allType = 'All Types';
|
||||
$lang->testcase->showAutoCase = 'Automated Test Cases';
|
||||
$lang->testcase->showAutoCase = 'Automated';
|
||||
$lang->testcase->automation = 'Automation Test';
|
||||
|
||||
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
|
||||
@@ -152,6 +152,7 @@ $lang->testcase->stepChild = 'Child Steps';
|
||||
$lang->testcase->viewAll = 'All Cases';
|
||||
$lang->testcase->importToLib = "Import To Library";
|
||||
$lang->testcase->showScript = 'Show Script';
|
||||
$lang->testcase->autoScript = 'Script';
|
||||
|
||||
$lang->testcase->new = 'New';
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ $lang->testcase->suite = 'Test Suite';
|
||||
$lang->testcase->executionStatus = 'executionStatus';
|
||||
$lang->testcase->caseType = 'Case Type';
|
||||
$lang->testcase->allType = 'All Types';
|
||||
$lang->testcase->showAutoCase = 'Automated Test Cases';
|
||||
$lang->testcase->showAutoCase = 'Automated';
|
||||
$lang->testcase->automation = 'Automation Test';
|
||||
|
||||
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
|
||||
@@ -152,6 +152,7 @@ $lang->testcase->stepChild = 'Sous-Etapes';
|
||||
$lang->testcase->viewAll = 'Tous les CasTests';
|
||||
$lang->testcase->importToLib = "Import To Library";
|
||||
$lang->testcase->showScript = 'Show Script';
|
||||
$lang->testcase->autoScript = 'Script';
|
||||
|
||||
$lang->testcase->new = 'Nouveau';
|
||||
|
||||
|
||||
@@ -1500,7 +1500,7 @@ class testtaskModel extends model
|
||||
|
||||
$failHtml = ': <span class="result-testcase fail">' . $this->lang->testtask->fail . '</span>';
|
||||
$passHtml = ': <span class="result-testcase pass">' . $this->lang->testtask->pass . '</span>';
|
||||
|
||||
|
||||
$log = preg_replace(array("/:\x20失败/", "/:\x20fail/", "/:\x20成功/", "/:\x20pass/"), array($failHtml, $failHtml, $passHtml, $passHtml), $log);
|
||||
|
||||
$logHtml .= "<li>" . $log . "</li>";
|
||||
@@ -1524,11 +1524,11 @@ class testtaskModel extends model
|
||||
}
|
||||
|
||||
$caseResult = $passCount ? 'pass':'fail';
|
||||
$logHtml .= "<li class='result-testcase {$caseResult}'>"
|
||||
$logHtml .= "<li class='result-testcase {$caseResult}'>"
|
||||
. sprintf($this->lang->testtask->stepSummary, $total, $passCount, $failCount)
|
||||
. "</li>";
|
||||
}
|
||||
|
||||
|
||||
return $logHtml;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
.fail{color:red;}
|
||||
.dot-symbol{padding-right:10px;}
|
||||
#statusContainer{margin:0px 0px 10px 0px;}
|
||||
#checkServiceStatus{background-color:unset;}
|
||||
#checkServiceStatus{background-color: #ffffff;}
|
||||
#checkServiceStatus:hover{background-color: #f0fdfb;}
|
||||
.service-check{margin-top: 0px;}
|
||||
.checkStatus{color: #313c52;}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ajaxGetServiceStatus();
|
||||
function ajaxGetServiceStatus()
|
||||
{
|
||||
$('#serviceContent').addClass('loading');
|
||||
$.get(createLink('zahost', 'ajaxGetServiceStatus', 'hostID=' + hostID), function(response)
|
||||
{
|
||||
var resultData = JSON.parse(response);
|
||||
@@ -31,6 +32,10 @@ function ajaxGetServiceStatus()
|
||||
$('.result .init-fail').addClass('hide')
|
||||
$('.result .init-success').removeClass('hide')
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
$('#serviceContent').removeClass('loading');
|
||||
}, 500);
|
||||
});
|
||||
return
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<?php echo $lang->zahost->init->statusTitle;?>
|
||||
<button type='button' id='checkServiceStatus' class='btn btn-info'><i class="icon icon-refresh"></i> <span class='checkStatus'><?php echo $lang->zahost->init->checkStatus;?></span></button>
|
||||
</div>
|
||||
<div class="detail-content article-content">
|
||||
<div class="detail-content article-content load-indicator" id='serviceContent'>
|
||||
<div class="main-row">
|
||||
<div id="statusContainer">
|
||||
<div class="text-kvm"><span class="dot-symbol fail"> ●</span><span>KVM</span></div>
|
||||
@@ -149,7 +149,7 @@
|
||||
<tbody>
|
||||
<?php foreach($nodeList as $node):?>
|
||||
<tr>
|
||||
<td title="<?php echo $node->name;?>"><?php echo html::a($this->createLink('zanode', 'view', "id=$node->id"), $node->name, '', "");?></td>
|
||||
<td title="<?php echo $node->name;?>"><?php echo html::a($this->createLink('zanode', 'view', "id=$node->id"), $node->name, '_target', "");?></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>
|
||||
|
||||
@@ -285,7 +285,7 @@ class zanode extends control
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
return print(js::confirm($this->lang->zanode->confirmDelete, inlink('delete', "zanodeID={$nodeID}&confirm=yes")));
|
||||
return print(js::confirm($this->lang->zanode->confirmDelete, inlink('destroy', "zanodeID={$nodeID}&confirm=yes")));
|
||||
}
|
||||
|
||||
$error = $this->zanode->destroy($nodeID);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
.service-status{margin-top: 10px;}
|
||||
.vnc-detail{height: 60vh;min-height: 550px;}
|
||||
.vnc-mask{width: 100%;height:100%;background-color: rgba(0,0,0,0);position: absolute;z-index: 1;}
|
||||
#checkServiceStatus{background-color:unset;}
|
||||
#checkServiceStatus{background-color: #ffffff;}
|
||||
#checkServiceStatus:hover{background-color: #f0fdfb;}
|
||||
.checkStatus{color: #313c52;}
|
||||
.node-not-wrap{white-space: nowrap;}
|
||||
.node-not-wrap{white-space: nowrap;}
|
||||
|
||||
@@ -2,6 +2,11 @@ var checkInterval;
|
||||
var intervalTimes = 0;
|
||||
|
||||
$('#checkServiceStatus').click(function(){
|
||||
$('#serviceContent').addClass('loading');
|
||||
checkServiceStatus();
|
||||
})
|
||||
|
||||
function checkServiceStatus(){
|
||||
$.get(createLink('zanode', 'ajaxGetServiceStatus', 'nodeID=' + nodeID), function(response)
|
||||
{
|
||||
var resultData = JSON.parse(response);
|
||||
@@ -24,7 +29,7 @@ $('#checkServiceStatus').click(function(){
|
||||
if(resultData.data[key] == 'ready' || resultData.data[key] == 'not_available')
|
||||
{
|
||||
$('.ztf-status').text(zanodeLang.init[resultData.data[key]])
|
||||
$('.ztf-install').text(zanodeLang.reinstall);
|
||||
$('.ztf-install').text('');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -91,9 +96,12 @@ $('#checkServiceStatus').click(function(){
|
||||
$('.init-success').show();
|
||||
// $('.init-fail').hide();
|
||||
}
|
||||
setTimeout(function() {
|
||||
$('#serviceContent').removeClass('loading');
|
||||
}, 500);
|
||||
});
|
||||
return
|
||||
})
|
||||
}
|
||||
|
||||
$('.node-init-install').on('click', function(){
|
||||
$(this).addClass('load-indicator loading');
|
||||
@@ -152,13 +160,13 @@ $('.btn-pwd-copy').live('click', function()
|
||||
})
|
||||
|
||||
$(function(){
|
||||
$('#checkServiceStatus').trigger("click")
|
||||
checkServiceStatus();
|
||||
checkInterval = setInterval(() => {
|
||||
intervalTimes++;
|
||||
if(intervalTimes > 300)
|
||||
{
|
||||
clearInterval(checkInterval)
|
||||
}
|
||||
$('#checkServiceStatus').trigger("click")
|
||||
checkServiceStatus();
|
||||
}, 2000);
|
||||
})
|
||||
})
|
||||
|
||||
@@ -695,7 +695,7 @@ class zanodemodel extends model
|
||||
*/
|
||||
public function getServiceStatus($node)
|
||||
{
|
||||
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->zap}/api/v1/service/check", json_encode(array("services" => "all")), array(), array("Authorization:$node->tokenSN")));
|
||||
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->zap}/api/v1/service/check", json_encode(array("services" => "all")), array(), array("Authorization:$node->tokenSN"), 'data', 'POST', 2));
|
||||
if(empty($result->data->ztfStatus) || $result->code != 'success')
|
||||
{
|
||||
$result = new stdclass;
|
||||
|
||||
@@ -110,7 +110,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
$canBeChanged = common::canBeChanged('zanode', $zanode);
|
||||
if ($canBeChanged) $actionFormLink = $this->createLink('action', 'comment', "objectType=zanode&objectID=$zanode->id");
|
||||
@@ -122,7 +122,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
|
||||
<?php echo $lang->zanode->init->statusTitle; ?>
|
||||
<button type='button' id='checkServiceStatus' class='btn btn-info'><i class="icon icon-refresh"></i> <span class='checkStatus'><?php echo $lang->zanode->init->checkStatus;?></span></button>
|
||||
</div>
|
||||
<div class="detail-content statusContainer">
|
||||
<div class="detail-content statusContainer load-indicator" id='serviceContent'>
|
||||
<div class="service-status">
|
||||
<span class='dot-symbol dot-zenagent text-danger'>●</span>
|
||||
<span> ZenAgent
|
||||
@@ -137,9 +137,8 @@ $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/971.html'>{$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 href='https://www.zentao.net/book/zentaopms/configure-environment-974.html'>{$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>
|
||||
</div>
|
||||
@@ -200,4 +199,4 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
|
||||
<div id='mainActions' class='main-actions'>
|
||||
<?php common::printPreAndNext($browseLink); ?>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php'; ?>
|
||||
<?php include '../../common/view/footer.html.php'; ?>
|
||||
|
||||
Reference in New Issue
Block a user