mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-16 07:33:06 +08:00
feat(settings): channel_monitor_show_quota public setting (default off)
- 新增公开设置 key(迁移 226 已插入默认 false),控制用户端监控页 是否展示配额/余额;管理端不受影响 - 解析 fail-closed:仅字面 "true" 视为开启(对齐 available_channels_enabled 语义,而非 hide_throughput 的 fail-open) - 全链路贯通:domain key 常量 → setting_public(公开读取 + ChannelMonitorRuntime .ShowQuota + 注入 payload)→ settings_view/parse/update → handler DTO (admin/user 响应 + admin 更新请求)→ api_contract_test 两个 wantJSON 块
This commit is contained in:
@@ -374,6 +374,7 @@ func (h *SettingHandler) GetSettings(c *gin.Context) {
|
||||
ChannelMonitorMode: settings.ChannelMonitorMode,
|
||||
ChannelMonitorDefaultIntervalSeconds: settings.ChannelMonitorDefaultIntervalSeconds,
|
||||
ChannelMonitorHideThroughput: settings.ChannelMonitorHideThroughput,
|
||||
ChannelMonitorShowQuota: settings.ChannelMonitorShowQuota,
|
||||
|
||||
GrokDefaultTextModel: settings.GrokDefaultTextModel,
|
||||
GrokCrossClientModelMapEnabled: settings.GrokCrossClientModelMapEnabled,
|
||||
|
||||
Reference in New Issue
Block a user