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 }) } diff --git a/src/components/Apps/AccountListTable/AccountList.vue b/src/components/Apps/AccountListTable/AccountList.vue index 23019526f..fe50f58a8 100644 --- a/src/components/Apps/AccountListTable/AccountList.vue +++ b/src/components/Apps/AccountListTable/AccountList.vue @@ -392,9 +392,18 @@ export default { can: this.$hasPerm('accounts.delete_account'), type: 'primary', callback: ({ row }) => { - this.$axios.delete(`/api/v1/accounts/accounts/${row.id}/`).then(() => { - this.$message.success(this.$tc('common.deleteSuccessMsg')) - this.$refs.ListTable.reloadTable() + const msg = this.$t('accounts.AccountDeleteConfirmMsg') + this.$confirm(msg, this.$tc('common.Info'), { + type: 'warning', + confirmButtonClass: 'el-button--danger', + beforeClose: async(action, instance, done) => { + if (action !== 'confirm') return done() + this.$axios.delete(`/api/v1/accounts/accounts/${row.id}/`).then(() => { + done() + this.$refs.ListTable.reloadTable() + this.$message.success(this.$tc('common.deleteSuccessMsg')) + }) + } }) } } diff --git a/src/components/Apps/ChatAi/components/ChitChat/index.vue b/src/components/Apps/ChatAi/components/ChitChat/index.vue index 445f6a209..25cef6810 100644 --- a/src/components/Apps/ChatAi/components/ChitChat/index.vue +++ b/src/components/Apps/ChatAi/components/ChitChat/index.vue @@ -42,7 +42,6 @@ const { addMessageToActiveChat, newChatAndAddMessageById, removeLoadingMessageInChat, - removeLoadingAndAddMessageToChat, updateChaMessageContentById, addTemporaryLoadingToChat } = useChat() @@ -120,12 +119,11 @@ export default { } }, onChatMessage(data) { - if (!data.message.content && data.conversation_id) { + if (data.conversation_id) { setLoading(true) - removeLoadingAndAddMessageToChat(data) + removeLoadingMessageInChat() this.currentConversationId = data.conversation_id - } else { - updateChaMessageContentById(data.message.id, data.message.content) + updateChaMessageContentById(data.message.id, data) } if (data.message?.type === 'finish') { setLoading(false) diff --git a/src/components/Apps/ChatAi/useChat.js b/src/components/Apps/ChatAi/useChat.js index 269aa09d2..5c2753280 100644 --- a/src/components/Apps/ChatAi/useChat.js +++ b/src/components/Apps/ChatAi/useChat.js @@ -59,13 +59,8 @@ export function useChat() { addChatMessageById(chat) } - const removeLoadingAndAddMessageToChat = (chat) => { - store.commit('chat/removeLoadingMessageInChat') - store.commit('chat/addMessageToActiveChat', chat) - } - - const updateChaMessageContentById = (id, content) => { - store.commit('chat/updateChaMessageContentById', { id, content }) + const updateChaMessageContentById = (id, data) => { + store.commit('chat/updateChaMessageContentById', { id, data }) pageScroll('scrollRef') } @@ -78,7 +73,6 @@ export function useChat() { addMessageToActiveChat, newChatAndAddMessageById, removeLoadingMessageInChat, - removeLoadingAndAddMessageToChat, addChatMessageById, addTemporaryLoadingToChat, updateChaMessageContentById diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 795e00a77..507ba31d8 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -124,7 +124,8 @@ "AddAccountResult": "Add account result", "AutoPush": "Auto Push", "GeneralAccounts": "General Accounts", - "VirtualAccounts": "Virtual Accounts" + "VirtualAccounts": "Virtual Accounts", + "AccountDeleteConfirmMsg": "Delete account, do you want to continue?" }, "acl": { "CommandFilterACLHelpMsg": "You can control whether commands can be executed on assets. Based on the rules, certain commands can be allowed while others are prohibited.", @@ -1757,6 +1758,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", @@ -2110,7 +2112,7 @@ "passwordWillExpiredPrefixMsg": "The password will expire in ", "passwordWillExpiredSuffixMsg": " days.Please change your password as soon as possible.", "dateLastLogin": "Date last login", - "AddAllMembersWarningMsg": "Are you sure you want to add all members" + "AddAllMembersWarningMsg": "Are you sure you want to add all members?" }, "notifications": { "MessageType": "Message Type", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index f420531eb..ec640a813 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -124,7 +124,8 @@ "AddAccountResult": "账号批量添加结果", "AutoPush": "自動プッシュ", "GeneralAccounts": "一般アカウント", - "VirtualAccounts": "仮想アカウント" + "VirtualAccounts": "仮想アカウント", + "AccountDeleteConfirmMsg": "アカウントを削除します,続行しますか?" }, "acl": { "CommandFilterACLHelpMsg": "コマンドフィルタリングを使用すると、コマンドがアセット上で実行されるかどうかを制御できます。ルールに基づいて、特定のコマンドは許可され、他のコマンドは禁止されることがあります。", @@ -1763,6 +1764,7 @@ "LDAPServerInfo": "LDAPサーバー", "LDAPUser": "LDAPユーザー", "ChatAI": "チャットAI", + "Example": "例: {example}", "helpText": { "TempPassword": "一時パスワードの有効期間は300秒で、使用後すぐに失効します", "ApiKeyList": "Api keyを使用してリクエストヘッダに署名します。リクエストのヘッダごとに異なります。使用ドキュメントを参照してください", @@ -2099,7 +2101,7 @@ "passwordExpired": "パスワードが期限切れです", "passwordWillExpiredPrefixMsg": "パスワードはまもなく", "passwordWillExpiredSuffixMsg": "期限が切れた後、できるだけ早くパスワードを変更してください。", - "AddAllMembersWarningMsg": "すべてのメンバーを追加してもよろしいですか" + "AddAllMembersWarningMsg": "すべてのメンバーを追加してもよろしいですか?" }, "notifications": { "MessageType": "メッセージタイプ", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 9cf90c0dc..8e40dd9c7 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -30,6 +30,7 @@ "PleaseClickLeftAssetToViewGatheredUser": "收集用户列表,点击左侧资产进行查看", "AutoCreate": "自动创建", "AccountExportTips": "导出信息中包含账号密文涉及敏感信息,导出的格式为一个加密的zip文件(若没有设置加密密码,请前往个人信息中设置文件加密密码)。", + "AccountDeleteConfirmMsg": "删除账号,是否继续?", "AccountPush": { "WindowsPushHelpText": "windows 资产暂不支持推送密钥", "AccountPushList": "账号推送", @@ -1752,6 +1753,7 @@ "LDAPServerInfo": "LDAP 服务器", "LDAPUser": "LDAP 用户", "ChatAI": "智能问答", + "Example": "例: {example}", "helpText": { "TempPassword": "临时密码有效期为 300 秒,使用后立刻失效", "ApiKeyList": "使用 Api key 签名请求头进行认证,每个请求的头部是不一样的, 相对于 Token 方式,更加安全,请查阅文档使用;
为降低泄露风险,Secret 仅在生成时可以查看, 每个用户最多支持创建 10 个", @@ -1965,7 +1967,7 @@ "KokoSettingUpdate": "Koko 配置设置", "UserSetting": "偏好设置", "AllMembers": "全部成员", - "AddAllMembersWarningMsg": "你确定要添加全部成员", + "AddAllMembersWarningMsg": "你确定要添加全部成员?", "UnbindHelpText": "本地用户为此认证来源用户,无法解绑", "SetStatus": "设置状态", "Set": "已设置", diff --git a/src/store/modules/chat.js b/src/store/modules/chat.js index f90062288..979360154 100644 --- a/src/store/modules/chat.js +++ b/src/store/modules/chat.js @@ -38,10 +38,14 @@ const mutations = { } }, - updateChaMessageContentById(state, { id, content }) { + updateChaMessageContentById(state, { id, data }) { const chats = state.activeChat.chats || [] const filterChat = chats.filter((chat) => chat.message.id === id)?.[0] || {} - filterChat.message.content = content + if (Object.keys(filterChat).length > 0) { + filterChat.message.content = data.message.content + } else { + chats?.push(data) + } } } 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 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 }) => { 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 @@