From 48e8efe3e8489a34dea34528caefcb4a64fec4cc Mon Sep 17 00:00:00 2001 From: erio Date: Mon, 13 Apr 2026 15:13:56 +0800 Subject: [PATCH] fix(frontend): hide quota notify toggle when global setting is disabled QuotaLimitCard now requires quotaNotifyGlobalEnabled prop to control visibility of QuotaNotifyToggle components. When the global account quota notification is disabled in admin settings, per-account threshold toggles are hidden in both Edit and Create account modals. --- backend/cmd/server/VERSION | 2 +- .../components/account/CreateAccountModal.vue | 53 +++++++++++++++++-- .../components/account/EditAccountModal.vue | 9 +++- .../src/components/account/QuotaLimitCard.vue | 8 +-- 4 files changed, 62 insertions(+), 10 deletions(-) diff --git a/backend/cmd/server/VERSION b/backend/cmd/server/VERSION index 49e7ca5721..d641814283 100644 --- a/backend/cmd/server/VERSION +++ b/backend/cmd/server/VERSION @@ -1 +1 @@ -0.1.110.21 +0.1.110.23 diff --git a/frontend/src/components/account/CreateAccountModal.vue b/frontend/src/components/account/CreateAccountModal.vue index e83e061eb1..e3d2d19a6d 100644 --- a/frontend/src/components/account/CreateAccountModal.vue +++ b/frontend/src/components/account/CreateAccountModal.vue @@ -1477,10 +1477,47 @@ - -
+ +
-

{{ t('admin.accounts.quotaLimit') }}

+

{{ t('admin.accounts.quotaControl.title') }}

+

+ {{ t('admin.accounts.quotaControl.hint') }} +

+
+ +
+ + +
+
+

{{ t('admin.accounts.quotaControl.title') }}

{{ t('admin.accounts.quotaLimitHint') }}

@@ -1489,6 +1526,7 @@ :totalLimit="editQuotaLimit" :dailyLimit="editQuotaDailyLimit" :weeklyLimit="editQuotaWeeklyLimit" + :quotaNotifyGlobalEnabled="quotaNotifyGlobalEnabled" :dailyResetMode="editDailyResetMode" :dailyResetHour="editDailyResetHour" :weeklyResetMode="editWeeklyResetMode" @@ -1823,7 +1861,7 @@
- +
{ webSearchGlobalEnabled.value = cfg?.enabled === true && (cfg?.providers?.length ?? 0) > 0 }).catch(() => { webSearchGlobalEnabled.value = false }) + +adminAPI.settings.getSettings().then(settings => { + quotaNotifyGlobalEnabled.value = settings.account_quota_notify_enabled === true +}).catch(() => { quotaNotifyGlobalEnabled.value = false }) const mixedScheduling = ref(false) // For antigravity accounts: enable mixed scheduling const allowOverages = ref(false) // For antigravity accounts: enable AI Credits overages const antigravityAccountType = ref<'oauth' | 'upstream'>('oauth') // For antigravity: oauth or upstream diff --git a/frontend/src/components/account/EditAccountModal.vue b/frontend/src/components/account/EditAccountModal.vue index 74e5fc1f8f..89f1fb18f3 100644 --- a/frontend/src/components/account/EditAccountModal.vue +++ b/frontend/src/components/account/EditAccountModal.vue @@ -1190,6 +1190,7 @@ :weeklyResetDay="editWeeklyResetDay" :weeklyResetHour="editWeeklyResetHour" :resetTimezone="editResetTimezone" + :quotaNotifyGlobalEnabled="quotaNotifyGlobalEnabled" :quotaNotifyDailyEnabled="editQuotaNotifyDailyEnabled" :quotaNotifyDailyThreshold="editQuotaNotifyDailyThreshold" :quotaNotifyDailyThresholdType="editQuotaNotifyDailyThresholdType" @@ -1240,6 +1241,7 @@ :weeklyResetDay="editWeeklyResetDay" :weeklyResetHour="editWeeklyResetHour" :resetTimezone="editResetTimezone" + :quotaNotifyGlobalEnabled="quotaNotifyGlobalEnabled" :quotaNotifyDailyEnabled="editQuotaNotifyDailyEnabled" :quotaNotifyDailyThreshold="editQuotaNotifyDailyThreshold" :quotaNotifyDailyThresholdType="editQuotaNotifyDailyThresholdType" @@ -1991,11 +1993,16 @@ const codexCLIOnlyEnabled = ref(false) const anthropicPassthroughEnabled = ref(false) const webSearchEmulationMode = ref('default') const webSearchGlobalEnabled = ref(false) +const quotaNotifyGlobalEnabled = ref(false) -// Load web search global state once +// Load global feature states once adminAPI.settings.getWebSearchEmulationConfig().then(cfg => { webSearchGlobalEnabled.value = cfg?.enabled === true && (cfg?.providers?.length ?? 0) > 0 }).catch(() => { webSearchGlobalEnabled.value = false }) + +adminAPI.settings.getSettings().then(settings => { + quotaNotifyGlobalEnabled.value = settings.account_quota_notify_enabled === true +}).catch(() => { quotaNotifyGlobalEnabled.value = false }) const editQuotaLimit = ref(null) const editQuotaDailyLimit = ref(null) const editQuotaWeeklyLimit = ref(null) diff --git a/frontend/src/components/account/QuotaLimitCard.vue b/frontend/src/components/account/QuotaLimitCard.vue index 64bdb08a61..38ab647994 100644 --- a/frontend/src/components/account/QuotaLimitCard.vue +++ b/frontend/src/components/account/QuotaLimitCard.vue @@ -15,6 +15,7 @@ const props = withDefaults(defineProps<{ weeklyResetDay: number | null weeklyResetHour: number | null resetTimezone: string | null + quotaNotifyGlobalEnabled?: boolean quotaNotifyDailyEnabled?: boolean | null quotaNotifyDailyThreshold?: number | null quotaNotifyDailyThresholdType?: string | null @@ -25,6 +26,7 @@ const props = withDefaults(defineProps<{ quotaNotifyTotalThreshold?: number | null quotaNotifyTotalThresholdType?: string | null }>(), { + quotaNotifyGlobalEnabled: false, quotaNotifyDailyEnabled: null, quotaNotifyDailyThreshold: null, quotaNotifyDailyThresholdType: null, @@ -234,7 +236,7 @@ const onWeeklyModeChange = (e: Event) => {

{

{

{{ t('admin.accounts.quotaTotalLimitHint') }}