From f1d5b73255e791fef3a781278d4ed43bf4c371d8 Mon Sep 17 00:00:00 2001 From: Zyy Date: Tue, 27 Oct 2026 16:18:41 +0800 Subject: [PATCH] fix(ui): refine admin filters, quota colors and batch actions Simplify group filters and keep date and platform controls aligned. Apply quota warning thresholds independently to each window and move account batch actions into a compact menu. Co-authored-by: Codex --- .../account/account-usage-window/presenter.ts | 5 +- frontend/src/i18n/locales/en/groups.json | 1 - frontend/src/i18n/locales/zh-Hans/groups.json | 1 - frontend/src/i18n/locales/zh-Hant/groups.json | 1 - .../accounts/components/AccountFilters.vue | 109 +++++++++--------- .../groups/components/AccountGroupFilters.vue | 12 +- .../groups/composables/useAccountGroups.ts | 8 -- frontend/src/views/groups/constants.ts | 15 --- frontend/src/views/groups/index.vue | 2 - frontend/src/views/usage/index.vue | 6 +- 10 files changed, 63 insertions(+), 97 deletions(-) diff --git a/frontend/src/components/account/account-usage-window/presenter.ts b/frontend/src/components/account/account-usage-window/presenter.ts index 42a5803b0..83c75aeaa 100644 --- a/frontend/src/components/account/account-usage-window/presenter.ts +++ b/frontend/src/components/account/account-usage-window/presenter.ts @@ -368,9 +368,10 @@ export function quotaWindowPresentation(window: AccountQuotaWindow, minimumWidth function quotaWindowTone(usedPercent: number | null): QuotaWindowTone { if (usedPercent === null) return 'unknown' - if (usedPercent >= 95) + // 每个窗口按自身的已用比例分档,剩余不足 30% / 10% 时分别预警 + if (usedPercent > 90) return 'danger' - if (usedPercent >= 80) + if (usedPercent > 70) return 'warning' return 'success' } diff --git a/frontend/src/i18n/locales/en/groups.json b/frontend/src/i18n/locales/en/groups.json index 9abfcefc8..4d633540e 100644 --- a/frontend/src/i18n/locales/en/groups.json +++ b/frontend/src/i18n/locales/en/groups.json @@ -23,7 +23,6 @@ "filters": { "searchAccountGroup": "Search account group", "searchGroupName": "Search group name", - "filterByGroupStatus": "Filter by group status", "deleteSelected": "Delete ({count})", "createGroup": "Create group" }, diff --git a/frontend/src/i18n/locales/zh-Hans/groups.json b/frontend/src/i18n/locales/zh-Hans/groups.json index 67d79249e..e1cdc6734 100644 --- a/frontend/src/i18n/locales/zh-Hans/groups.json +++ b/frontend/src/i18n/locales/zh-Hans/groups.json @@ -23,7 +23,6 @@ "filters": { "searchAccountGroup": "搜索账号分组", "searchGroupName": "搜索分组名称", - "filterByGroupStatus": "按分组状态筛选", "deleteSelected": "删除 ({count})", "createGroup": "创建分组" }, diff --git a/frontend/src/i18n/locales/zh-Hant/groups.json b/frontend/src/i18n/locales/zh-Hant/groups.json index f48545820..3d7672793 100644 --- a/frontend/src/i18n/locales/zh-Hant/groups.json +++ b/frontend/src/i18n/locales/zh-Hant/groups.json @@ -23,7 +23,6 @@ "filters": { "searchAccountGroup": "搜索賬號分組", "searchGroupName": "搜索分組名稱", - "filterByGroupStatus": "按分組狀態篩選", "deleteSelected": "刪除 ({count})", "createGroup": "創建分組" }, diff --git a/frontend/src/views/accounts/components/AccountFilters.vue b/frontend/src/views/accounts/components/AccountFilters.vue index 36ea29133..c0ee75a89 100644 --- a/frontend/src/views/accounts/components/AccountFilters.vue +++ b/frontend/src/views/accounts/components/AccountFilters.vue @@ -1,8 +1,8 @@ -
clearTimeout(timer)) }) - watch(statusQuery, () => { - void query.reloadFromStart() - }) onMounted(() => { void Promise.all([ query.execute(), @@ -323,7 +316,6 @@ export function useAccountGroups() { loading: query.loading, pagination, searchQuery, - statusQuery, showFormModal, showDeleteModal, showBatchDeleteModal, diff --git a/frontend/src/views/groups/constants.ts b/frontend/src/views/groups/constants.ts index 2a9201fab..e2db9f1fd 100644 --- a/frontend/src/views/groups/constants.ts +++ b/frontend/src/views/groups/constants.ts @@ -62,18 +62,3 @@ export const accountGroupColumns = computed(() => (defineTableColumns ([ - { - label: t('common.status.all'), - value: '', - }, - { - label: t('common.status.enabled'), - value: 'enabled', - }, - { - label: t('common.status.disabled'), - value: 'disabled', - }, -])) diff --git a/frontend/src/views/groups/index.vue b/frontend/src/views/groups/index.vue index ca2691695..ce1763b51 100644 --- a/frontend/src/views/groups/index.vue +++ b/frontend/src/views/groups/index.vue @@ -18,7 +18,6 @@ const { loading, pagination, searchQuery, - statusQuery, showFormModal, showDeleteModal, showBatchDeleteModal, @@ -64,7 +63,6 @@ const { allSelected, indeterminate, selectedRowKeys, toggleSelection, toggleAll