From 149096ed6ce0ddc56c055cd8a4ddaacba8549f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=BB=B6=E4=B9=89?= Date: Fri, 16 Dec 2022 01:07:18 +0000 Subject: [PATCH 1/4] * Modify diff page style. --- module/repo/css/diff.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/repo/css/diff.css b/module/repo/css/diff.css index ac7b0f433c..dc24fcc92a 100644 --- a/module/repo/css/diff.css +++ b/module/repo/css/diff.css @@ -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;} From 000824ef958cf75cc09a0548d4071b8fdf75bcb2 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 16 Dec 2022 10:38:52 +0800 Subject: [PATCH 2/4] * Modify chosen error. --- module/repo/js/common.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/module/repo/js/common.js b/module/repo/js/common.js index 0e1d450f02..2de05f673b 100644 --- a/module/repo/js/common.js +++ b/module/repo/js/common.js @@ -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")) { From 59801bf729b252178545f1b7098821e99bfa92d2 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Fri, 16 Dec 2022 13:36:23 +0800 Subject: [PATCH 3/4] * Modify blame get error. --- lib/scm/gitlab.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index 6bee5ad0cf..0843f0001f 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -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; From 26d746598eab75c61be8e43c32eba27b0739c67c Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 16 Dec 2022 20:20:06 +0800 Subject: [PATCH 4/4] * Fix bug for zanode. --- module/testtask/control.php | 1 + module/zanode/model.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 3d3eb21b60..d12e5cae63 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -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)) diff --git a/module/zanode/model.php b/module/zanode/model.php index 72ef622a27..62dc0eca34 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -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;