feat: websearch quota enhancements and balance notify hint

- QuotaLimit changed to *int64 (null=unlimited, >0=limited)
- Add reset-usage endpoint (POST /admin/settings/web-search-emulation/reset-usage)
- Show quota usage in header always (collapsed and expanded)
- Add reset quota button in expanded provider view
- Quota input: empty=unlimited with ∞ placeholder, must be >0 if set
- Add email verification hint on balance notify card
This commit is contained in:
erio
2026-04-14 08:03:27 +08:00
parent 1e6912ea2e
commit 7c7292935e
12 changed files with 121 additions and 28 deletions

View File

@@ -502,7 +502,7 @@ export interface WebSearchProviderConfig {
type: 'brave' | 'tavily'
api_key: string
api_key_configured: boolean
quota_limit: number
quota_limit: number | null
subscribed_at: number | null
quota_used?: number
proxy_id: number | null
@@ -547,6 +547,12 @@ export async function testWebSearchEmulation(
return data
}
export async function resetWebSearchUsage(
payload: { provider_type: string }
): Promise<void> {
await apiClient.post('/admin/settings/web-search-emulation/reset-usage', payload)
}
export const settingsAPI = {
getSettings,
updateSettings,
@@ -565,7 +571,8 @@ export const settingsAPI = {
updateBetaPolicySettings,
getWebSearchEmulationConfig,
updateWebSearchEmulationConfig,
testWebSearchEmulation
testWebSearchEmulation,
resetWebSearchUsage
}
export default settingsAPI