From 3239f637399623309d289db002775173ee2026b0 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 3 Jan 2023 08:49:28 +0800 Subject: [PATCH 1/6] * Fix bug #31351. --- module/testcase/lang/de.php | 1 + module/testcase/lang/en.php | 1 + module/testcase/lang/fr.php | 1 + 3 files changed, 3 insertions(+) diff --git a/module/testcase/lang/de.php b/module/testcase/lang/de.php index 1c865a72e3..764ab94e4a 100644 --- a/module/testcase/lang/de.php +++ b/module/testcase/lang/de.php @@ -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'; diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index b50993b46c..d6988bbdec 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -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'; diff --git a/module/testcase/lang/fr.php b/module/testcase/lang/fr.php index da07973081..2bcd5aafb0 100644 --- a/module/testcase/lang/fr.php +++ b/module/testcase/lang/fr.php @@ -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'; From fe30731334a78192fcb68dc32a2bef84dba64f8a Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 3 Jan 2023 09:44:18 +0800 Subject: [PATCH 2/6] * Add loading style for ajaxGetServiceStatus. --- module/zahost/css/view.css | 3 ++- module/zahost/js/view.js | 5 +++++ module/zahost/view/view.html.php | 2 +- module/zanode/css/view.css | 5 +++-- module/zanode/js/view.js | 6 +++++- module/zanode/view/view.html.php | 7 +++---- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/module/zahost/css/view.css b/module/zahost/css/view.css index 3fa66474b0..ebc4b1ff72 100644 --- a/module/zahost/css/view.css +++ b/module/zahost/css/view.css @@ -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;} diff --git a/module/zahost/js/view.js b/module/zahost/js/view.js index aaaa2fb28c..c452fffd48 100644 --- a/module/zahost/js/view.js +++ b/module/zahost/js/view.js @@ -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 diff --git a/module/zahost/view/view.html.php b/module/zahost/view/view.html.php index 2811489b2c..e6377146c4 100644 --- a/module/zahost/view/view.html.php +++ b/module/zahost/view/view.html.php @@ -102,7 +102,7 @@ zahost->init->statusTitle;?> -
+
●KVM
diff --git a/module/zanode/css/view.css b/module/zanode/css/view.css index dbe31a9571..f1c5a6595d 100644 --- a/module/zanode/css/view.css +++ b/module/zanode/css/view.css @@ -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;} \ No newline at end of file +.node-not-wrap{white-space: nowrap;} diff --git a/module/zanode/js/view.js b/module/zanode/js/view.js index 4811670c3e..2510bcf79f 100644 --- a/module/zanode/js/view.js +++ b/module/zanode/js/view.js @@ -2,6 +2,7 @@ var checkInterval; var intervalTimes = 0; $('#checkServiceStatus').click(function(){ + $('#serviceContent').addClass('loading'); $.get(createLink('zanode', 'ajaxGetServiceStatus', 'nodeID=' + nodeID), function(response) { var resultData = JSON.parse(response); @@ -91,6 +92,9 @@ $('#checkServiceStatus').click(function(){ $('.init-success').show(); // $('.init-fail').hide(); } + setTimeout(function() { + $('#serviceContent').removeClass('loading'); + }, 500); }); return }) @@ -161,4 +165,4 @@ $(function(){ } $('#checkServiceStatus').trigger("click") }, 2000); -}) \ No newline at end of file +}) diff --git a/module/zanode/view/view.html.php b/module/zanode/view/view.html.php index 0f89e69f12..e5c282e0fb 100644 --- a/module/zanode/view/view.html.php +++ b/module/zanode/view/view.html.php @@ -110,7 +110,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
- + createLink('action', 'comment', "objectType=zanode&objectID=$zanode->id"); @@ -122,7 +122,7 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou zanode->init->statusTitle; ?>
-
+
●   ZenAgent   @@ -139,7 +139,6 @@ $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->initFailNoticeTitle . '
' . $lang->zanode->init->initFailNoticeDesc;?>
-
@@ -200,4 +199,4 @@ $account = strpos($zanode->osName, "windows") ? $config->zanode->defaultWinAccou
- \ No newline at end of file + From 488761638997e5dca3e6e59ccc37ab47a352e0d5 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 3 Jan 2023 09:56:15 +0800 Subject: [PATCH 3/6] * Fix issue for zanode. --- module/zanode/js/view.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/module/zanode/js/view.js b/module/zanode/js/view.js index 2510bcf79f..f4d5a35e7b 100644 --- a/module/zanode/js/view.js +++ b/module/zanode/js/view.js @@ -3,6 +3,10 @@ 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); @@ -97,7 +101,7 @@ $('#checkServiceStatus').click(function(){ }, 500); }); return -}) +} $('.node-init-install').on('click', function(){ $(this).addClass('load-indicator loading'); @@ -156,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); }) From 6374437b919c6c5848d77dae1f5f62fd587cb9fb Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 3 Jan 2023 11:02:00 +0800 Subject: [PATCH 4/6] * Fix bug #31360. --- db/update18.0.beta3.sql | 4 ++-- module/testcase/css/edit.css | 18 ++++++++++++------ module/testcase/lang/de.php | 2 +- module/testcase/lang/en.php | 2 +- module/testcase/lang/fr.php | 2 +- module/zanode/control.php | 2 +- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/db/update18.0.beta3.sql b/db/update18.0.beta3.sql index 2d735195ee..178a4608a4 100644 --- a/db/update18.0.beta3.sql +++ b/db/update18.0.beta3.sql @@ -107,5 +107,5 @@ CREATE TABLE `zt_automation` ( ALTER TABLE `zt_repofiles` ADD `oldPath` varchar(255) DEFAULT '' AFTER `path`; ALTER TABLE `zt_case` ADD `script` longtext NOT NULL AFTER `howRun`; -ALTER TABLE `zt_testresult` ADD `ZTFResult` text NOT NULL; -ALTER TABLE `zt_testresult` ADD `node` int(8) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `zt_testresult` ADD `ZTFResult` text NOT NULL AFTER `stepResults`; +ALTER TABLE `zt_testresult` ADD `node` int(8) unsigned NOT NULL DEFAULT '0' AFTER `stepResults`; diff --git a/module/testcase/css/edit.css b/module/testcase/css/edit.css index 0d16991789..e0eeacd744 100644 --- a/module/testcase/css/edit.css +++ b/module/testcase/css/edit.css @@ -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;} +} + diff --git a/module/testcase/lang/de.php b/module/testcase/lang/de.php index 764ab94e4a..74a751fc47 100644 --- a/module/testcase/lang/de.php +++ b/module/testcase/lang/de.php @@ -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. diff --git a/module/testcase/lang/en.php b/module/testcase/lang/en.php index d6988bbdec..eff259962d 100644 --- a/module/testcase/lang/en.php +++ b/module/testcase/lang/en.php @@ -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. diff --git a/module/testcase/lang/fr.php b/module/testcase/lang/fr.php index 2bcd5aafb0..bf74a1402e 100644 --- a/module/testcase/lang/fr.php +++ b/module/testcase/lang/fr.php @@ -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. diff --git a/module/zanode/control.php b/module/zanode/control.php index b90c0a2194..02942e120f 100644 --- a/module/zanode/control.php +++ b/module/zanode/control.php @@ -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); From f05e53043b9c3730ca65f3e58e01a619ffe1d944 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Tue, 3 Jan 2023 13:03:25 +0800 Subject: [PATCH 5/6] * Fix code style. --- module/testcase/css/browse.css | 3 +++ module/testtask/model.php | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/module/testcase/css/browse.css b/module/testcase/css/browse.css index b0e70a9c5d..011a343ec1 100644 --- a/module/testcase/css/browse.css +++ b/module/testcase/css/browse.css @@ -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;} diff --git a/module/testtask/model.php b/module/testtask/model.php index 11c07e5f8e..e1ede56b6f 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1500,7 +1500,7 @@ class testtaskModel extends model $failHtml = ': ' . $this->lang->testtask->fail . ''; $passHtml = ': ' . $this->lang->testtask->pass . ''; - + $log = preg_replace(array("/:\x20失败/", "/:\x20fail/", "/:\x20成功/", "/:\x20pass/"), array($failHtml, $failHtml, $passHtml, $passHtml), $log); $logHtml .= "
  • " . $log . "
  • "; @@ -1524,11 +1524,11 @@ class testtaskModel extends model } $caseResult = $passCount ? 'pass':'fail'; - $logHtml .= "
  • " + $logHtml .= "
  • " . sprintf($this->lang->testtask->stepSummary, $total, $passCount, $failCount) . "
  • "; } - + return $logHtml; } From f8a69684b495c08ee2a4e4c0a3ff5a6b1f29f0fd Mon Sep 17 00:00:00 2001 From: zhaoke Date: Tue, 3 Jan 2023 05:26:19 +0000 Subject: [PATCH 6/6] * Fix bug 31348. --- module/common/model.php | 6 +++--- module/zahost/view/view.html.php | 2 +- module/zanode/js/view.js | 2 +- module/zanode/model.php | 2 +- module/zanode/view/view.html.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index cd339bc545..504f4c49a8 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -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); diff --git a/module/zahost/view/view.html.php b/module/zahost/view/view.html.php index 2811489b2c..164f8b876e 100644 --- a/module/zahost/view/view.html.php +++ b/module/zahost/view/view.html.php @@ -149,7 +149,7 @@ - createLink('zanode', 'view', "id=$node->id"), $node->name, '', "");?> + createLink('zanode', 'view', "id=$node->id"), $node->name, '_target', "");?> zanode->os->cpuCores, $node->cpuCores);?> memory . $this->lang->zahost->unitList['GB'];?> diskSize . $this->lang->zahost->unitList['GB'];?> diff --git a/module/zanode/js/view.js b/module/zanode/js/view.js index 4811670c3e..b4083afe00 100644 --- a/module/zanode/js/view.js +++ b/module/zanode/js/view.js @@ -24,7 +24,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 { diff --git a/module/zanode/model.php b/module/zanode/model.php index 7e03759651..896945b79c 100644 --- a/module/zanode/model.php +++ b/module/zanode/model.php @@ -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; diff --git a/module/zanode/view/view.html.php b/module/zanode/view/view.html.php index 0f89e69f12..ae40cb4f34 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;?>