🔔 feat: Add subscription-aware quota notifications and update UI copy

Routes quota alerts through a subscription-specific check when billing from subscriptions, preventing wallet-based thresholds from triggering false warnings.
Updates the notification settings description and localization keys to clarify that both wallet and subscription balances are monitored.
This commit is contained in:
t0ng7u
2026-02-07 01:15:59 +08:00
parent 8b8ea60b1e
commit 82138fc0b0
9 changed files with 61 additions and 9 deletions

View File

@@ -58,9 +58,13 @@ func SettleBilling(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, actualQuo
return err
}
// 发送额度通知
// 发送额度通知(订阅计费使用订阅剩余额度)
if actualQuota != 0 {
checkAndSendQuotaNotify(relayInfo, actualQuota-preConsumed, preConsumed)
if relayInfo.BillingSource == BillingSourceSubscription {
checkAndSendSubscriptionQuotaNotify(relayInfo)
} else {
checkAndSendQuotaNotify(relayInfo, actualQuota-preConsumed, preConsumed)
}
}
return nil
}