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:
@@ -447,6 +447,15 @@ func (m *Manager) GetAllUsage(ctx context.Context) map[string]int64 {
|
||||
return result
|
||||
}
|
||||
|
||||
// ResetUsage deletes the Redis quota key for the given provider, resetting usage to 0.
|
||||
func (m *Manager) ResetUsage(ctx context.Context, providerType string) error {
|
||||
if m.redis == nil {
|
||||
return nil
|
||||
}
|
||||
key := quotaRedisKey(providerType)
|
||||
return m.redis.Del(ctx, key).Err()
|
||||
}
|
||||
|
||||
// --- Provider factory ---
|
||||
|
||||
func (m *Manager) buildProvider(cfg ProviderConfig, client *http.Client) Provider {
|
||||
|
||||
Reference in New Issue
Block a user