Merge branch 'zenops_46_tanghucheng' of https://gitlab.zcorp.cc/easycorp/zentaopms into zenops_46_tanghucheng

This commit is contained in:
zhaoke
2022-12-17 02:34:52 +00:00
5 changed files with 31 additions and 14 deletions
+1 -1
View File
@@ -257,7 +257,7 @@ class gitlab
$param = new stdclass;
$param->ref = ($revision and $revision != 'HEAD') ? $revision : $this->branch;
$results = $this->fetch($api, $param);
if(isset($results->message)) return array();
if(empty($results) or isset($results->message)) return array();
$blames = array();
$revLine = 0;
+2 -1
View File
@@ -29,7 +29,8 @@ table.diff {margin-bottom: 0px;}
#fileTabs .tab-pane {display: none;}
#fileTabs .tab-pane.active {display: block;}
#fileTabs .tab-nav-item {max-width: none !important;}
#fileTabs .tab-nav-item {max-width: none !important; white-space: nowrap;}
#fileTabs .tab-nav-item > .tab-nav-link > .close {float: none; position: inherit; right: -1px; top: 2px;}
#filesTree #modules {margin-top: 5px;}
#filesTree {overflow-y: auto;}
+19 -11
View File
@@ -111,23 +111,31 @@ function arrowTabs(domID, shift, hideRightBtn)
$('#' + domID + ' > .tabs-navbar > .nav-tabs')[0].style.transform = 'translateX('+ distance +'px)';
}
/**
* Close commit relations.
*
* @access public
* @return void
*/
function closeRelation()
{
$tabs = $('#relationTabs').data('zui.tabs');
if($tabs) $tabs.closeAll();
$('.history').html('');
$('#log').data('line', 0);
$('#log').hide();
$('#codeContainer').css('height', codeHeight);
$('#related').css('height', 0);
};
$(function()
{
$(document).on('click', '.ajaxPager', function()
{
$('#sidebar .side-body').load($(this).attr('data-href'));
return false;
}).on('click', '#log .btn-close', function()
{
$tabs = $('#relationTabs').data('zui.tabs');
if($tabs) $tabs.closeAll();
$('.history').html('');
$('#log').data('line', 0);
$('#log').hide();
$('#codeContainer').css('height', codeHeight);
$('#related').css('height', 0);
});
}).on('click', '#log .btn-close', closeRelation);
if($("main").is(".hide-sidebar"))
{
+1
View File
@@ -1239,6 +1239,7 @@ class testtask extends control
{
$resultID = $this->testtask->initResult($runID, $caseID, $run->case->version, $automation->node);
if(!dao::isError()) $this->zanode->runZTFScript($automation->id, $caseID, $resultID);
if(dao::isError()) return print(js::error(dao::getError()) . js::locate($this->createLink('zanode', 'browse'), 'parent'));
}
if(!empty($_POST))
+8 -1
View File
@@ -725,6 +725,13 @@ class zanodemodel extends model
{
$automation = $this->getAutomationByID($scriptID);
$node = $this->getNodeByID($automation->node);
if(empty($node) or $node->status != 'running' or !$node->ip or !$node->ztf or !$node->tokenSN)
{
$this->dao->delete()->from(TABLE_TESTRESULT)->where('id')->eq($task)->exec();
return dao::$errors = $this->lang->zanode->runTimeout;
}
$params = array(
'cmd' => $automation->shell,
'ids' => strval($caseID),
@@ -733,7 +740,7 @@ class zanodemodel extends model
);
$result = json_decode(commonModel::http("http://{$node->ip}:{$node->ztf}/api/v1/jobs/add", json_encode($params), array(), array("Authorization:$node->tokenSN")));
if($result->code != 0)
if(empty($result) or $result->code != 0)
{
$this->dao->delete()->from(TABLE_TESTRESULT)->where('id')->eq($task)->exec();
return dao::$errors = $this->lang->zanode->runTimeout;