From c85272606dfcf8ed017312b8956a2cbbeaf46974 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 +-
frontend/src/components/account/CreateAccountModal.vue | 9 ++++++++-
frontend/src/components/account/EditAccountModal.vue | 9 ++++++++-
frontend/src/components/account/QuotaLimitCard.vue | 8 +++++---
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/backend/cmd/server/VERSION b/backend/cmd/server/VERSION
index 61d129b58f..d641814283 100644
--- a/backend/cmd/server/VERSION
+++ b/backend/cmd/server/VERSION
@@ -1 +1 @@
-0.1.110.22
+0.1.110.23
diff --git a/frontend/src/components/account/CreateAccountModal.vue b/frontend/src/components/account/CreateAccountModal.vue
index fc90df2ae4..e3d2d19a6d 100644
--- a/frontend/src/components/account/CreateAccountModal.vue
+++ b/frontend/src/components/account/CreateAccountModal.vue
@@ -1492,6 +1492,7 @@
:totalLimit="editQuotaLimit"
:dailyLimit="editQuotaDailyLimit"
:weeklyLimit="editQuotaWeeklyLimit"
+ :quotaNotifyGlobalEnabled="quotaNotifyGlobalEnabled"
:dailyResetMode="editDailyResetMode"
:dailyResetHour="editDailyResetHour"
:weeklyResetMode="editWeeklyResetMode"
@@ -1525,6 +1526,7 @@
:totalLimit="editQuotaLimit"
:dailyLimit="editQuotaDailyLimit"
:weeklyLimit="editQuotaWeeklyLimit"
+ :quotaNotifyGlobalEnabled="quotaNotifyGlobalEnabled"
:dailyResetMode="editDailyResetMode"
:dailyResetHour="editDailyResetHour"
:weeklyResetMode="editWeeklyResetMode"
@@ -3038,11 +3040,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 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') }}