Skip to content

Commit 5c7c362

Browse files
committed
fix: polish OAuth model policy UI
1 parent 47c25c3 commit 5c7c362

7 files changed

Lines changed: 249 additions & 107 deletions

File tree

cliproxyapi-pro-management/apply_customizations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@
251251
}
252252

253253
OAUTH_MODEL_POLICY_NAV_LOCALE_KEYS = {
254-
'en.json': {'label': 'OAuth Model Policy', 'meta': 'Per-plan model availability rules'},
255-
'ru.json': {'label': 'Политика OAuth-моделей', 'meta': 'Правила доступности моделей по тарифам'},
256-
'zh-CN.json': {'label': 'OAuth 模型策略', 'meta': '按账号套餐配置模型可用范围'},
257-
'zh-TW.json': {'label': 'OAuth 模型策略', 'meta': '依帳號套餐設定模型可用範圍'},
254+
'en.json': {'label': 'Model Policy', 'meta': 'Per-plan model availability rules'},
255+
'ru.json': {'label': 'Политика моделей', 'meta': 'Правила доступности моделей по тарифам'},
256+
'zh-CN.json': {'label': '模型策略', 'meta': '按账号套餐配置模型可用范围'},
257+
'zh-TW.json': {'label': '模型策略', 'meta': '依帳號套餐設定模型可用範圍'},
258258
}
259259

260260
def load_overlay_replacement_manifest(path: Path) -> dict[str, set[str]]:

cliproxyapi-pro-management/monitoring-locales.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@
244244
"discovery_hint": "Auth metadata is preferred; supported provider APIs are queried only when the plan is missing.",
245245
"cache_ttl": "Plan cache TTL",
246246
"resolve_timeout": "Provider resolve timeout",
247+
"unit_minutes": "minutes",
248+
"unit_seconds": "seconds",
247249
"priority": "Plugin priority",
248250
"xai_rules": "xAI plan rules",
249251
"xai_rules_hint": "Each enabled rule subtracts matching model IDs from that account only.",
@@ -2708,6 +2710,8 @@
27082710
"discovery_hint": "优先使用认证元数据;缺少套餐时才查询支持的提供商接口。",
27092711
"cache_ttl": "套餐缓存时间",
27102712
"resolve_timeout": "提供商探测超时",
2713+
"unit_minutes": "分钟",
2714+
"unit_seconds": "",
27112715
"priority": "插件优先级",
27122716
"xai_rules": "xAI 套餐规则",
27132717
"xai_rules_hint": "每条启用的规则只会从对应账号中减去匹配的模型 ID。",
@@ -4098,6 +4102,8 @@
40984102
"discovery_hint": "優先使用驗證中繼資料;缺少套餐時才查詢支援的供應商介面。",
40994103
"cache_ttl": "套餐快取時間",
41004104
"resolve_timeout": "供應商探測逾時",
4105+
"unit_minutes": "分鐘",
4106+
"unit_seconds": "",
41014107
"priority": "外掛優先級",
41024108
"xai_rules": "xAI 套餐規則",
41034109
"xai_rules_hint": "每條啟用的規則只會從對應帳號中移除符合的模型 ID。",

cliproxyapi-pro-management/overlay/src/pages/OAuthModelPolicyPage.module.scss

Lines changed: 39 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
}
88

99
.pageWithSave {
10-
padding-bottom: 106px;
10+
padding-bottom: calc(
11+
var(--oauth-model-policy-action-bar-height, 46px) + 38px
12+
);
1113
}
1214

1315
.header,
@@ -20,8 +22,6 @@
2022
.patternInputRow,
2123
.inheritedRule,
2224
.behaviorNote,
23-
.saveBar,
24-
.saveActions,
2525
.noticeCard {
2626
display: flex;
2727
align-items: center;
@@ -248,6 +248,34 @@
248248
margin: 0;
249249
}
250250

251+
.durationControl {
252+
display: grid;
253+
grid-template-columns: minmax(0, 1fr) auto;
254+
}
255+
256+
.durationControl input {
257+
min-width: 0;
258+
border-top-right-radius: 0;
259+
border-bottom-right-radius: 0;
260+
}
261+
262+
.durationControl > span {
263+
display: inline-flex;
264+
min-width: 64px;
265+
align-items: center;
266+
justify-content: center;
267+
box-sizing: border-box;
268+
padding: 0 11px;
269+
border: 1px solid var(--border-color);
270+
border-left: 0;
271+
border-radius: 0 8px 8px 0;
272+
color: var(--text-secondary);
273+
background: var(--muted-bg, rgba(148, 163, 184, 0.1));
274+
font-size: 11px;
275+
font-weight: 600;
276+
white-space: nowrap;
277+
}
278+
251279
.policyPanel {
252280
padding: 16px;
253281
}
@@ -557,6 +585,8 @@
557585
color-mix(in srgb, var(--primary-color) 14%, transparent);
558586
}
559587

588+
.header > button > span,
589+
.customPlanRow button > span,
560590
.patternInputRow button > span {
561591
display: inline-flex;
562592
align-items: center;
@@ -596,47 +626,6 @@
596626
color: var(--primary-color);
597627
}
598628

599-
.saveBar {
600-
position: fixed;
601-
z-index: 50;
602-
right: max(22px, env(safe-area-inset-right));
603-
bottom: max(18px, env(safe-area-inset-bottom));
604-
left: max(calc(var(--sidebar-width, 260px) + 22px), 22px);
605-
justify-content: space-between;
606-
gap: 18px;
607-
padding: 11px 14px;
608-
border: 1px solid
609-
color-mix(in srgb, var(--primary-color) 32%, var(--border-color));
610-
border-radius: 13px;
611-
background: color-mix(in srgb, var(--bg-secondary) 94%, transparent);
612-
box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
613-
backdrop-filter: blur(18px);
614-
}
615-
616-
.saveBar > div:first-child {
617-
min-width: 0;
618-
}
619-
620-
.saveBar strong,
621-
.saveBar span {
622-
display: block;
623-
}
624-
625-
.saveBar strong {
626-
font-size: 12px;
627-
}
628-
629-
.saveBar span {
630-
margin-top: 2px;
631-
color: var(--text-secondary);
632-
font-size: 10px;
633-
}
634-
635-
.saveActions {
636-
flex: 0 0 auto;
637-
gap: 7px;
638-
}
639-
640629
@media (max-width: 980px) {
641630
.statusGrid,
642631
.settingsGrid {
@@ -651,10 +640,6 @@
651640
border-bottom: 1px solid var(--border-color);
652641
}
653642

654-
.saveBar {
655-
left: 22px;
656-
}
657-
658643
.providerTabs {
659644
grid-template-columns: repeat(3, minmax(0, 1fr));
660645
}
@@ -666,6 +651,12 @@
666651
padding: 0 0 20px;
667652
}
668653

654+
.pageWithSave {
655+
padding-bottom: calc(
656+
var(--oauth-model-policy-action-bar-height, 46px) + 28px
657+
);
658+
}
659+
669660
.header {
670661
align-items: flex-start;
671662
padding: 13px;
@@ -737,20 +728,4 @@
737728
width: 100%;
738729
}
739730

740-
.saveBar {
741-
right: 10px;
742-
bottom: max(10px, env(safe-area-inset-bottom));
743-
left: 10px;
744-
align-items: stretch;
745-
flex-direction: column;
746-
gap: 9px;
747-
}
748-
749-
.saveActions {
750-
width: 100%;
751-
}
752-
753-
.saveActions button {
754-
flex: 1 1 0;
755-
}
756731
}

0 commit comments

Comments
 (0)