diff --git a/0001-fixed-errors-in-field-verification-related-to-repo-names.patch b/0001-fixed-errors-in-field-verification-related-to-repo-names.patch deleted file mode 100644 index 4bbda5946506d0e202d64e091fdd042dbc314876..0000000000000000000000000000000000000000 --- a/0001-fixed-errors-in-field-verification-related-to-repo-names.patch +++ /dev/null @@ -1,297 +0,0 @@ -From 5733d028e042ce982bb155203084baa591f8142c Mon Sep 17 00:00:00 2001 -From: Hu Gang <18768366022@163.com> -Date: Mon, 10 Mar 2025 19:14:43 +0800 -Subject: [PATCH 1/4] fix: fixed errors in field verification related to repo - names - ---- - src/api/paths/account/index.ts | 5 +++++ - src/api/request.ts | 2 +- - src/components/GlobalHeader/AvatarDropdown.vue | 4 ++-- - src/locales/lang/en.json | 5 +++-- - src/locales/lang/zh-cn.json | 5 +++-- - src/store/useAccountStore.ts | 1 + - src/views/configuration/DomainDetail.vue | 6 +----- - src/views/configuration/components/CurrentConf.vue | 4 ++-- - src/views/configuration/constants.ts | 5 ++--- - src/views/dashboard/Dashboard.vue | 5 +++-- - .../vulnerability/components/CreateRepoModal.vue | 13 +++++++++---- - src/views/vulnerability/components/CveTask.vue | 6 +++++- - src/views/vulnerability/components/RepoTask.vue | 7 +++++-- - 13 files changed, 42 insertions(+), 26 deletions(-) - -diff --git a/src/api/paths/account/index.ts b/src/api/paths/account/index.ts -index 9d90006..4af03cd 100644 ---- a/src/api/paths/account/index.ts -+++ b/src/api/paths/account/index.ts -@@ -103,6 +103,10 @@ function queryTokenByAuthCode(code: string) { - }>('/accounts/login', { code }) - } - -+function logoutAssistant() { -+ return http.get('/api/auth/logout') -+} -+ - function refreshAuthToken() { - return http.get<{ - token: string -@@ -127,4 +131,5 @@ export const accountApi = { - queryTokenByAuthCode, - refreshAuthToken, - queryAuthRedirectUrl, -+ logoutAssistant, - } -diff --git a/src/api/request.ts b/src/api/request.ts -index d7f93db..866454c 100644 ---- a/src/api/request.ts -+++ b/src/api/request.ts -@@ -35,7 +35,7 @@ const requestQueue: { - }[] = [] - - const request = axios.create({ -- timeout: 60 * 1000, -+ timeout: 60 * 3 * 1000, - }) - - const formDataUrl = [ -diff --git a/src/components/GlobalHeader/AvatarDropdown.vue b/src/components/GlobalHeader/AvatarDropdown.vue -index 1f80c03..171a55a 100644 ---- a/src/components/GlobalHeader/AvatarDropdown.vue -+++ b/src/components/GlobalHeader/AvatarDropdown.vue -@@ -37,14 +37,14 @@ const isModalVisible = ref(false) - - -diff --git a/src/locales/lang/en.json b/src/locales/lang/en.json -index 10cead8..8fe4ff3 100644 ---- a/src/locales/lang/en.json -+++ b/src/locales/lang/en.json -@@ -228,7 +228,8 @@ - "uploadSuccess": "Upload Succeed", - "uploading": "Uploading", - "validateMsg": { -- "LeadingAndTrailingNoSpaces": "No leading or trailing spaces are allowed" -+ "LeadingAndTrailingNoSpaces": "No leading or trailing spaces are allowed", -+ "noMoreThanCharacters": "No more than {count} characters" - }, - "welcomeAops": "Welcome to A-Ops", - "yes": "Yes" -@@ -348,7 +349,7 @@ - "statusDetail": "Detail", - "syncStatus": "Sync Status", - "synchronized": "synchronized", -- "unknownStatus": "Unknown", -+ "partialSynchronization": "partial synchronization", - "unsynchronized": "unsynchronized" - } - }, -diff --git a/src/locales/lang/zh-cn.json b/src/locales/lang/zh-cn.json -index 6d8edf6..85398bd 100644 ---- a/src/locales/lang/zh-cn.json -+++ b/src/locales/lang/zh-cn.json -@@ -228,7 +228,8 @@ - "uploadSuccess": "上传成功", - "uploading": "上传中", - "validateMsg": { -- "LeadingAndTrailingNoSpaces": "首尾不允许空格" -+ "LeadingAndTrailingNoSpaces": "首尾不允许空格", -+ "noMoreThanCharacters": "不超过{count}个字符" - }, - "welcomeAops": "欢迎来到A-Ops系统", - "yes": "是" -@@ -348,7 +349,7 @@ - "statusDetail": "状态详情", - "syncStatus": "同步状态", - "synchronized": "已同步", -- "unknownStatus": "未知状态", -+ "partialSynchronization": "部分同步", - "unsynchronized": "未同步" - } - }, -diff --git a/src/store/useAccountStore.ts b/src/store/useAccountStore.ts -index f612991..2a123cb 100644 ---- a/src/store/useAccountStore.ts -+++ b/src/store/useAccountStore.ts -@@ -67,6 +67,7 @@ export const useAccountStore = defineStore( - * account logout - */ - const logout = async (): Promise => { -+ await api.logoutAssistant() - const [_, res] = await api.logout() - if (_) return false - if (res) { -diff --git a/src/views/configuration/DomainDetail.vue b/src/views/configuration/DomainDetail.vue -index 436a9ce..1f5d6bf 100644 ---- a/src/views/configuration/DomainDetail.vue -+++ b/src/views/configuration/DomainDetail.vue -@@ -306,11 +306,7 @@ onMounted(() => { - two-tone-color="#ff0000" - /> - -- {{ -- record.sync_status -- ? t(`conftrace.domainDetail.${DOMAIN_STATUS_LABEL_ENUM[record.sync_status]}`) -- : t('conftrace.domainDetail.unknownStatus') -- }} -+ {{ t(`conftrace.domainDetail.${DOMAIN_STATUS_LABEL_ENUM[record.sync_status]}`) }} - - - -diff --git a/src/views/configuration/components/CurrentConf.vue b/src/views/configuration/components/CurrentConf.vue -index 4ec638d..e169d34 100644 ---- a/src/views/configuration/components/CurrentConf.vue -+++ b/src/views/configuration/components/CurrentConf.vue -@@ -133,8 +133,8 @@ function useConfOperationRecord() { - - async function getConfsOperationTrace(confName?: string) { - const [, res] = await api.queryConfsOperationTrace({ -- // page: pagination.current, -- // per_page: pagination.pageSize, -+ sort: 'create_time', -+ direction: 'desc', - domain_name: props.domainName, - conf_name: confName, - host_id: props.hostId, -diff --git a/src/views/configuration/constants.ts b/src/views/configuration/constants.ts -index 86320f6..e46e2d6 100644 ---- a/src/views/configuration/constants.ts -+++ b/src/views/configuration/constants.ts -@@ -7,12 +7,11 @@ export enum DOMAIN_STATUS_ENUM { - export enum DOMAIN_STATUS_LABEL_ENUM { - unsynchronized = 0, - synchronized, -- unknownStatus, -+ partialSynchronization, - } - - export enum DOMAIN_STATUS_LABEL { - 'SYNCHRONIZED' = 'synchronized', - 'NOT SYNCHRONIZE' = 'unsynchronized', -- 'NOT FOUND' = 'unknownStatus', -+ 'NOT FOUND' = 'partialSynchronization', - } -- -diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue -index 4dbd6b2..762e2d2 100644 ---- a/src/views/dashboard/Dashboard.vue -+++ b/src/views/dashboard/Dashboard.vue -@@ -119,6 +119,7 @@ onMounted(() => { - queryHostsCount() - queryHostsAlarms() - queryClusters() -+ queryCveOverview() - getDomainSyncStatistic() - chart = init(cvePieRef.value) - }) -@@ -190,14 +191,14 @@ onBeforeUnmount(() => { - - {{ $t('dashboard.domianSync') }} - -- {{ Math.round(domainSyncStatistic.syncRate * 100)}}% -+ {{ Math.round(domainSyncStatistic.syncRate * 100) }}% - -
- - - {{ $t('dashboard.domainUnSync') }} - --
{{ Math.round((100 - domainSyncStatistic.syncRate * 100) ) }}%
-+
{{ Math.round(100 - domainSyncStatistic.syncRate * 100) }}%
-
- - -diff --git a/src/views/vulnerability/components/CreateRepoModal.vue b/src/views/vulnerability/components/CreateRepoModal.vue -index 3c07092..da6591b 100644 ---- a/src/views/vulnerability/components/CreateRepoModal.vue -+++ b/src/views/vulnerability/components/CreateRepoModal.vue -@@ -42,8 +42,10 @@ async function handleSubmit() { - repo_name, - repo_data, - } -- const [_] = await api.createNewRepo(params) -- if (!_) { -+ const [_, res] = await api.createNewRepo(params) -+ if (res && Object.values(res)[0].label !== 'Succeed') { -+ message.error(t('common.fail')) -+ }else { - message.success(t('common.succeed')) - formRef.value?.resetFields() - fileList.value = [] -@@ -134,7 +136,7 @@ async function handleDownLoad() { - :label="$t('vul.repo.repoName')" - :rules="[ - { required: true, message: $t('vul.repo.placeHolder.repoContent') }, -- { max: 20, message: '20个字符以内' }, -+ { max: 20, message: $t('common.validateMsg.noMoreThanCharacters', { count: 20 }) } - ]" - > - -@@ -142,7 +144,10 @@ async function handleDownLoad() { - - -