From f8a69684b495c08ee2a4e4c0a3ff5a6b1f29f0fd Mon Sep 17 00:00:00 2001 From: zhaoke Date: Tue, 3 Jan 2023 05:26:19 +0000 Subject: [PATCH 1/4] * 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;?>
From b9e1381d11bfd2738fea273b8e15f9fb20c793ea Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 3 Jan 2023 13:31:19 +0800 Subject: [PATCH 2/4] * Fix bug #31375. --- module/repo/js/diff.js | 10 ++++++---- module/repo/js/monaco.js | 10 ++++++---- module/repo/view/diffeditor.html.php | 1 + 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/module/repo/js/diff.js b/module/repo/js/diff.js index e1e7d2b26d..8c9c22dcb6 100644 --- a/module/repo/js/diff.js +++ b/module/repo/js/diff.js @@ -83,10 +83,11 @@ function createTab(filename, filepath) $('[data-path="' + decodeURIComponent(filepath) + '"]').closest('li').addClass('selected'); var tabID = Base64.encode(filepath).replaceAll('=', '-'); return { - title: filename, - id: tabID, - type: 'iframe', - url: createLink('repo', 'ajaxGetDiffEditorContent', urlParams.replace('%s', Base64.encode(encodeURIComponent(filepath)))) + id: tabID, + url: createLink('repo', 'ajaxGetDiffEditorContent', urlParams.replace('%s', Base64.encode(encodeURIComponent(filepath)))), + type: 'iframe', + title: filename, + forbidClose: isonlybody }; } @@ -105,6 +106,7 @@ $(document).ready(function() $('.btn-left').click(function() {arrowTabs('fileTabs', 1);}); $('.btn-right').click(function() {arrowTabs('fileTabs', -2);}); if(file) $('#fileTabs').tabs({tabs: [createTab(file['basename'], entry)]}); + if(isonlybody) $('#fileTabs .tab-nav-item .tab-nav-close').hide(); /** * Set pane height. diff --git a/module/repo/js/monaco.js b/module/repo/js/monaco.js index 0ec0979c98..26df5dd680 100644 --- a/module/repo/js/monaco.js +++ b/module/repo/js/monaco.js @@ -11,10 +11,11 @@ function createTab(filename, filepath) $('[data-path="' + decodeURIComponent(filepath) + '"]').closest('li').addClass('selected'); var tabID = Base64.encode(filepath).replaceAll('=', '-'); return { - title: filename, - id: tabID, - type: 'iframe', - url: createLink('repo', 'ajaxGetEditorContent', urlParams.replace('%s', Base64.encode(encodeURIComponent(filepath)))) + id: tabID, + url: createLink('repo', 'ajaxGetEditorContent', urlParams.replace('%s', Base64.encode(encodeURIComponent(filepath)))), + type: 'iframe', + title: filename, + forbidClose: isonlybody }; } @@ -23,6 +24,7 @@ $(function() $('.btn-left').click(function() {arrowTabs('fileTabs', 1);}); $('.btn-right').click(function() {arrowTabs('fileTabs', -2);}); $('#fileTabs').tabs({tabs: [createTab(file['basename'], entry)]}); + if(isonlybody) $('#fileTabs .tab-nav-item .tab-nav-close').hide(); /** * Set pane height. diff --git a/module/repo/view/diffeditor.html.php b/module/repo/view/diffeditor.html.php index 1b147d8f64..36241af861 100644 --- a/module/repo/view/diffeditor.html.php +++ b/module/repo/view/diffeditor.html.php @@ -10,6 +10,7 @@ js::set('diffs', $diffs); js::set('file', $file); js::set('entry', $entry); js::set('openedFiles', array($entry)); +js::set('isonlybody', isonlybody()); js::set('urlParams', "repoID=$repoID&objectID=$objectID&entry=%s&oldRevision=$oldRevision&newRevision=$newRevision&showBug=$showBug&encoding=$encoding"); ?> From 32fd823243b049ea13b04ba27bd7a4df08f2f795 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 3 Jan 2023 13:31:53 +0800 Subject: [PATCH 3/4] * Modify tutorial error. --- module/tutorial/model.php | 44 +++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/module/tutorial/model.php b/module/tutorial/model.php index f549488e83..a8ba9edb7d 100644 --- a/module/tutorial/model.php +++ b/module/tutorial/model.php @@ -98,26 +98,30 @@ class tutorialModel extends model { $product = $this->getProduct(); $product->stories = array(); - $product->stories[0] = ''; - $product->stories[1] = 'draft'; - $product->stories[2] = 'reviewing'; - $product->stories[3] = 'active'; - $product->stories[4] = 'closed'; - $product->stories[5] = 'changing'; - $product->stories[''] = 0; - $product->stories['draft'] = 0; - $product->stories['reviewing'] = 0; - $product->stories['active'] = 0; - $product->stories['closed'] = 0; - $product->stories['changing'] = 0; - $product->requirements = $product->stories; - $product->plans = 0; - $product->releases = 0; - $product->bugs = 0; - $product->unResolved = 0; - $product->closedBugs = 0; - $product->fixedBugs = 0; - $product->assignToNull = 0; + $product->stories[0] = ''; + $product->stories[1] = 'draft'; + $product->stories[2] = 'reviewing'; + $product->stories[3] = 'active'; + $product->stories[4] = 'closed'; + $product->stories[5] = 'changing'; + $product->stories[6] = 'finishClosed'; + $product->stories[7] = 'unclosed'; + $product->stories[''] = 0; + $product->stories['draft'] = 0; + $product->stories['reviewing'] = 0; + $product->stories['active'] = 0; + $product->stories['closed'] = 0; + $product->stories['changing'] = 0; + $product->stories['finishClosed'] = 0; + $product->stories['unclosed'] = 0; + $product->requirements = $product->stories; + $product->plans = 0; + $product->releases = 0; + $product->bugs = 0; + $product->unResolved = 0; + $product->closedBugs = 0; + $product->fixedBugs = 0; + $product->assignToNull = 0; $productStat[$product->program][$product->line]['products'][$product->id] = $product; return $productStat; From 3b5531b6941e686d690ed7699d61b6b2896eabea Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 3 Jan 2023 13:32:10 +0800 Subject: [PATCH 4/4] * Modify chosen. --- module/file/view/export.html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/file/view/export.html.php b/module/file/view/export.html.php index 6e338cdc44..fde20ab715 100644 --- a/module/file/view/export.html.php +++ b/module/file/view/export.html.php @@ -279,18 +279,18 @@ if($isCustomExport) file->extension;?> - exportFileTypeList, '', 'onchange=switchEncode(this.value) class="form-control"');?> + exportFileTypeList, '', 'onchange=switchEncode(this.value) class="form-control chosen"');?> file->encoding;?> - charsets[$this->cookie->lang], 'utf-8', key($lang->exportFileTypeList) == 'csv' ? "class='form-control'" : "class='form-control'");?> + charsets[$this->cookie->lang], 'utf-8', "class='form-control chosen'");?> > file->exportRange;?> exportTypeList['selected']);?> - exportTypeList, 'all', "class='form-control'");?> + exportTypeList, 'all', "class='form-control chosen'");?> $lang->file->batchExport), '', "onclick='setPart(this);'");?>