From ccb221559a86267ccf3b7d35b0b310eeaa4c8f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Fri, 22 Dec 2023 11:32:54 +0800 Subject: [PATCH 01/17] =?UTF-8?q?perf:=20=E8=B4=A6=E5=8F=B7=E6=94=B6?= =?UTF-8?q?=E9=9B=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/accounts/AccountGather/AccountGatherList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/accounts/AccountGather/AccountGatherList.vue b/src/views/accounts/AccountGather/AccountGatherList.vue index c4e86e995..1cfeae9f3 100644 --- a/src/views/accounts/AccountGather/AccountGatherList.vue +++ b/src/views/accounts/AccountGather/AccountGatherList.vue @@ -146,7 +146,7 @@ export default { }, { name: 'BulkSyncDelete', - title: this.$t('common.BulkSyncDelete'), + title: this.$t('accounts.BulkSyncDelete'), type: 'primary', icon: 'fa fa-exchange', can: ({ selectedRows }) => { From cfe6db6ec5844d0adfbf2aabfa6850f5b036aa72 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 22 Dec 2023 14:58:28 +0800 Subject: [PATCH 02/17] =?UTF-8?q?perf:=20=E8=99=9A=E6=8B=9F=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=A2=9E=E5=8A=A0=E8=AE=B8=E5=8F=AF=E8=AF=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/settings/Applet/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/settings/Applet/index.vue b/src/views/settings/Applet/index.vue index e5062bb36..81a933fef 100644 --- a/src/views/settings/Applet/index.vue +++ b/src/views/settings/Applet/index.vue @@ -39,14 +39,14 @@ export default { title: this.$t('terminal.VirtualApp'), name: 'VirtualApp', hidden: () => { - return !store.getters.publicSettings['VIRTUAL_APP_ENABLED'] + return !store.getters.publicSettings['VIRTUAL_APP_ENABLED'] || !this.$store.getters.hasValidLicense } }, { title: this.$t('terminal.AppProvider'), name: 'AppProvider', hidden: () => { - return !store.getters.publicSettings['VIRTUAL_APP_ENABLED'] + return !store.getters.publicSettings['VIRTUAL_APP_ENABLED'] || !this.$store.getters.hasValidLicense } } ] From a36a9e764592a000703a2765f531e95af49e8983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Fri, 22 Dec 2023 16:08:05 +0800 Subject: [PATCH 03/17] =?UTF-8?q?perf:=20=E6=99=BA=E8=83=BD=E9=97=AE?= =?UTF-8?q?=E7=AD=94=E7=A6=81=E6=AD=A2=E5=AF=86=E7=A0=81=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=A1=AB=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/en.json | 1 + src/i18n/langs/ja.json | 1 + src/i18n/langs/zh.json | 1 + src/views/settings/Feature/Chat.vue | 16 ++++++++++++++++ 4 files changed, 19 insertions(+) diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 795e00a77..800d446f7 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -1757,6 +1757,7 @@ "LDAPServerInfo": "LDAP Server", "LDAPUser": "LDAP User", "ChatAI": "Chat ai", + "Example": "Example: {example}", "InsecureCommandAlert": "Insecure command alert", "helpText": { "TempPassword": "For a while, there is a period of 300 seconds, failure immediately after use", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index f420531eb..ebc1333ff 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -1763,6 +1763,7 @@ "LDAPServerInfo": "LDAPサーバー", "LDAPUser": "LDAPユーザー", "ChatAI": "チャットAI", + "Example": "例: {example}", "helpText": { "TempPassword": "一時パスワードの有効期間は300秒で、使用後すぐに失効します", "ApiKeyList": "Api keyを使用してリクエストヘッダに署名します。リクエストのヘッダごとに異なります。使用ドキュメントを参照してください", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 9cf90c0dc..957d0fadf 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -1752,6 +1752,7 @@ "LDAPServerInfo": "LDAP 服务器", "LDAPUser": "LDAP 用户", "ChatAI": "智能问答", + "Example": "例: {example}", "helpText": { "TempPassword": "临时密码有效期为 300 秒,使用后立刻失效", "ApiKeyList": "使用 Api key 签名请求头进行认证,每个请求的头部是不一样的, 相对于 Token 方式,更加安全,请查阅文档使用;
为降低泄露风险,Secret 仅在生成时可以查看, 每个用户最多支持创建 10 个", diff --git a/src/views/settings/Feature/Chat.vue b/src/views/settings/Feature/Chat.vue index e746888fa..6f3638dcc 100644 --- a/src/views/settings/Feature/Chat.vue +++ b/src/views/settings/Feature/Chat.vue @@ -51,6 +51,22 @@ export default { ] ] ], + fieldsMeta: { + GPT_BASE_URL: { + el: { + autocomplete: 'new-password' + }, + helpText: this.$t('setting.Example', { example: 'https://api.openai.com/v1' }) + }, + GPT_API_KEY: { + el: { + autocomplete: 'new-password' + } + }, + GPT_PROXY: { + helpText: this.$t('setting.Example', { example: 'http://ip:port' }) + } + }, submitMethod() { return 'patch' } From 81f0b13730f6103aac05431194943b7026934e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 25 Dec 2023 15:09:19 +0800 Subject: [PATCH 04/17] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=BD=91?= =?UTF-8?q?=E5=85=B3=E5=85=8B=E9=9A=86=E5=B9=B3=E5=8F=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Domain/DomainDetail/GatewayList.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/assets/Domain/DomainDetail/GatewayList.vue b/src/views/assets/Domain/DomainDetail/GatewayList.vue index 8d66af8b0..2ba0c5182 100644 --- a/src/views/assets/Domain/DomainDetail/GatewayList.vue +++ b/src/views/assets/Domain/DomainDetail/GatewayList.vue @@ -117,6 +117,7 @@ export default { name: 'GatewayCreate', query: { domain: this.object.id, + platform_type: row.type.value, clone_from: row.id } } From 111aafb4bba0287c1a5da8770758067069b3cde6 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Mon, 25 Dec 2023 14:15:08 +0800 Subject: [PATCH 05/17] =?UTF-8?q?fix:=20=E3=80=90=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BC=9A=E8=AF=9D=E5=A4=B1=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=91SESSION=5FCOOKIE=5FAGE=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/startup.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/utils/startup.js b/src/utils/startup.js index 04cec7553..8022861ba 100644 --- a/src/utils/startup.js +++ b/src/utils/startup.js @@ -15,6 +15,17 @@ function reject(msg) { return new Promise((resolve, reject) => reject(msg)) } +function isRenewalExpired(renewalTime) { + const currentTimeStamp = Math.floor(new Date().getTime() / 1000) + const sessionExpireTimestamp = VueCookie.get('jms_session_expire_timestamp') + + if (!sessionExpireTimestamp) { + return false + } + const timeDifferenceInSeconds = currentTimeStamp - parseInt(sessionExpireTimestamp, 10) + return timeDifferenceInSeconds > renewalTime +} + async function checkLogin({ to, from, next }) { if (whiteList.indexOf(to.path) !== -1) { next() @@ -28,12 +39,16 @@ async function checkLogin({ to, from, next }) { return reject('No session mark found in cookie') } else if (sessionExpire === 'close') { let startTime = new Date().getTime() - setInterval(() => { + const intervalId = setInterval(() => { const endTime = new Date().getTime() const delta = (endTime - startTime) startTime = endTime Vue.$log.debug('Set session expire: ', delta) - VueCookie.set('jms_session_expire', 'close', { expires: '2m' }) + if (!isRenewalExpired(120)) { + VueCookie.set('jms_session_expire', 'close', { expires: '2m' }) + } else { + clearInterval(intervalId) + } }, 10 * 1000) } else if (sessionExpire === 'age') { Vue.$log.debug('Session expire on age') @@ -156,7 +171,9 @@ export async function changeCurrentViewIfNeed({ to, from, next }) { export async function startup({ to, from, next }) { // if (store.getters.inited) { return true } - if (store.getters.inited) { return true } + if (store.getters.inited) { + return true + } await store.dispatch('app/init') // set page title From 51a4c013d3363e9fd9e99261afe1f69f368867a7 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Mon, 25 Dec 2023 16:55:55 +0800 Subject: [PATCH 06/17] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ops.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/ops.js b/src/api/ops.js index 3c22f6938..d0adf0cd0 100644 --- a/src/api/ops.js +++ b/src/api/ops.js @@ -58,7 +58,7 @@ export function JobUploadFile(form) { url: '/api/v1/ops/jobs/upload/', method: 'post', headers: { 'Content-Type': 'multipart/form-data' }, - timeout: 10 * 60 * 1000, + timeout: 60 * 60 * 1000, data: form }) } From cdd51a9c167aff57ceaa12a6a6d01627bbede277 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Fri, 22 Dec 2023 16:25:17 +0800 Subject: [PATCH 07/17] =?UTF-8?q?perf:=20=E7=BB=9F=E8=AE=A1=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=89=A7=E8=A1=8C=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ops/File/index.vue | 43 ++++++++++++++++++++++++---------- src/views/ops/Job/QuickJob.vue | 5 ++-- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/views/ops/File/index.vue b/src/views/ops/File/index.vue index 4854cd75b..51a1fe651 100644 --- a/src/views/ops/File/index.vue +++ b/src/views/ops/File/index.vue @@ -82,16 +82,18 @@ {{ $tc('ops.output') }}: - + {{ $tc('common.Status') }}: {{ $tc('ops.' + executionInfo.status) }} + v-if="executionInfo.status==='timeout'" + class="status_warning" + >{{ $tc('ops.timeout') }} + + {{ $tc('ops.success') + ': ' + summary.success }} + {{ $tc('ops.Skip') + ': ' + summary.skip }} + {{ $tc('ops.failed') + ': ' + summary.failed }} + {{ $tc('ops.timeDelta') }}: @@ -210,7 +212,12 @@ export default { ShowProgress: false, upload_interval: null, uploadFileList: [], - SizeLimitMb: store.getters.publicSettings['FILE_UPLOAD_SIZE_LIMIT_MB'] + SizeLimitMb: store.getters.publicSettings['FILE_UPLOAD_SIZE_LIMIT_MB'], + summary: { + 'success': 0, + 'failed': 0, + 'skip': 0 + } } }, computed: { @@ -273,9 +280,21 @@ export default { } } }, + taskStatusStat(summary) { + const { ok, failures, dark, excludes, skipped } = summary + + const failedKeys = Object.keys(failures) + const darkKeys = Object.keys(dark) + const excludesKeys = Object.keys(excludes) + + this.summary['success'] = ok.length + this.summary['failed'] = failedKeys.length + darkKeys.length + this.summary['skip'] = excludesKeys.length + skipped.length + }, getTaskStatus() { getTaskDetail(this.currentTaskId).then(data => { this.executionInfo.status = data['status'] + this.taskStatusStat(data['summary']) if (this.executionInfo.status === 'success') { this.$message.success(this.$tc('ops.runSucceed')) clearInterval(this.upload_interval) @@ -334,11 +353,11 @@ export default { const filenameList = fileList.map((file) => file.name) const filenameCount = _.countBy(filenameList) for (const file of fileList) { - file.is_same = filenameCount[file.name] > 1 + file.isSame = filenameCount[file.name] > 1 } }, sameFileStyle(file) { - if (file.is_same) { + if (file.isSame) { return { backgroundColor: 'var(--color-danger)' } } return '' @@ -362,7 +381,7 @@ export default { execute() { const { hosts, nodes } = this.getSelectedNodesAndHosts() for (const file of this.uploadFileList) { - if (file.is_same) { + if (file.isSame) { this.$message.error(this.$tc('ops.DuplicateFileExists')) return } @@ -476,7 +495,7 @@ export default { } .status_success { - color: var(--color-success); + color: var(--color-primary); } .status_warning { diff --git a/src/views/ops/Job/QuickJob.vue b/src/views/ops/Job/QuickJob.vue index eee38bbbc..e2efe994e 100644 --- a/src/views/ops/Job/QuickJob.vue +++ b/src/views/ops/Job/QuickJob.vue @@ -80,8 +80,7 @@ export default { timeCost: 0, cancel: 0 }, - xtermConfig: { - }, + xtermConfig: {}, showHelpDialog: false, showOpenAdhocDialog: false, showOpenAdhocSaveDialog: false, @@ -484,7 +483,7 @@ export default { } .status_success { - color: var(--color-success); + color: var(--color-primary); } .status_warning { From 7df11b907f6b636a6e0cb89e8ccb79c169400b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Wed, 27 Dec 2023 15:26:20 +0800 Subject: [PATCH 08/17] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Asset/AssetDetail/AssetCommand.vue | 4 ++-- src/views/assets/Asset/AssetDetail/AssetSession.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/assets/Asset/AssetDetail/AssetCommand.vue b/src/views/assets/Asset/AssetDetail/AssetCommand.vue index fda0e783d..031af0613 100644 --- a/src/views/assets/Asset/AssetDetail/AssetCommand.vue +++ b/src/views/assets/Asset/AssetDetail/AssetCommand.vue @@ -1,6 +1,6 @@