mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-15 23:22:59 +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:
@@ -988,6 +988,7 @@ func TestAPIContracts(t *testing.T) {
|
||||
"channel_monitor_enabled": true,
|
||||
"channel_monitor_mode": "v1",
|
||||
"channel_monitor_hide_throughput": true,
|
||||
"channel_monitor_show_quota": false,
|
||||
"channel_monitor_default_interval_seconds": 60,
|
||||
"available_channels_enabled": false,
|
||||
"model_plaza_enabled": false,
|
||||
@@ -1298,6 +1299,7 @@ func TestAPIContracts(t *testing.T) {
|
||||
"channel_monitor_enabled": true,
|
||||
"channel_monitor_mode": "v1",
|
||||
"channel_monitor_hide_throughput": true,
|
||||
"channel_monitor_show_quota": false,
|
||||
"channel_monitor_default_interval_seconds": 60,
|
||||
"available_channels_enabled": false,
|
||||
"model_plaza_enabled": false,
|
||||
|
||||
Reference in New Issue
Block a user