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.
This commit is contained in:
erio
2026-04-13 15:13:56 +08:00
parent b1875f0b82
commit 48e8efe3e8
4 changed files with 62 additions and 10 deletions

View File

@@ -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) => {
</p>
<!-- 日配额告警 -->
<QuotaNotifyToggle
v-if="dailyLimit && dailyLimit > 0"
v-if="quotaNotifyGlobalEnabled && dailyLimit && dailyLimit > 0"
:enabled="props.quotaNotifyDailyEnabled"
:threshold="props.quotaNotifyDailyThreshold"
:threshold-type="props.quotaNotifyDailyThresholdType"
@@ -300,7 +302,7 @@ const onWeeklyModeChange = (e: Event) => {
</p>
<!-- 周配额告警 -->
<QuotaNotifyToggle
v-if="weeklyLimit && weeklyLimit > 0"
v-if="quotaNotifyGlobalEnabled && weeklyLimit && weeklyLimit > 0"
:enabled="props.quotaNotifyWeeklyEnabled"
:threshold="props.quotaNotifyWeeklyThreshold"
:threshold-type="props.quotaNotifyWeeklyThresholdType"
@@ -340,7 +342,7 @@ const onWeeklyModeChange = (e: Event) => {
<p class="input-hint">{{ t('admin.accounts.quotaTotalLimitHint') }}</p>
<!-- 总配额告警 -->
<QuotaNotifyToggle
v-if="totalLimit && totalLimit > 0"
v-if="quotaNotifyGlobalEnabled && totalLimit && totalLimit > 0"
:enabled="props.quotaNotifyTotalEnabled"
:threshold="props.quotaNotifyTotalThreshold"
:threshold-type="props.quotaNotifyTotalThresholdType"