fix(usage): add fallback to provider config for usage credentials (#360)

- Make usage script credential fields optional with provider config fallback
- Optimize multi-plan card display: show plan count by default, expandable for details
- Add hint text to explain credential fallback mechanism
This commit is contained in:
Sirhexs
2025-12-15 17:09:46 +08:00
committed by GitHub
parent c49cfa5ac5
commit 1172209f49
6 changed files with 177 additions and 26 deletions
+8 -1
View File
@@ -365,7 +365,10 @@
"justNow": "Just now",
"minutesAgo": "{{count}} min ago",
"hoursAgo": "{{count}} hr ago",
"daysAgo": "{{count}} day ago"
"daysAgo": "{{count}} day ago",
"multiplePlans": "{{count}} plans",
"expand": "Expand",
"collapse": "Collapse"
},
"usageScript": {
"title": "Configure Usage Query",
@@ -378,6 +381,10 @@
"templateGeneral": "General",
"templateNewAPI": "NewAPI",
"credentialsConfig": "Credentials",
"credentialsHint": "Leave empty to use provider config",
"optional": "optional",
"apiKeyPlaceholder": "Leave empty to use provider's API Key",
"baseUrlPlaceholder": "Leave empty to use provider's base URL",
"baseUrl": "Base URL",
"accessToken": "Access Token",
"accessTokenPlaceholder": "Generate in 'Security Settings'",
+8 -1
View File
@@ -365,7 +365,10 @@
"justNow": "たった今",
"minutesAgo": "{{count}} 分前",
"hoursAgo": "{{count}} 時間前",
"daysAgo": "{{count}} 日前"
"daysAgo": "{{count}} 日前",
"multiplePlans": "{{count}} プラン",
"expand": "展開",
"collapse": "折りたたむ"
},
"usageScript": {
"title": "利用状況を設定",
@@ -378,6 +381,10 @@
"templateGeneral": "General",
"templateNewAPI": "NewAPI",
"credentialsConfig": "認証情報",
"credentialsHint": "空欄の場合はプロバイダー設定を使用",
"optional": "オプション",
"apiKeyPlaceholder": "空欄の場合はプロバイダーの API Key を使用",
"baseUrlPlaceholder": "空欄の場合はプロバイダーの Base URL を使用",
"baseUrl": "Base URL",
"accessToken": "Access Token",
"accessTokenPlaceholder": "「Security Settings」で生成",
+8 -1
View File
@@ -365,7 +365,10 @@
"justNow": "刚刚",
"minutesAgo": "{{count}} 分钟前",
"hoursAgo": "{{count}} 小时前",
"daysAgo": "{{count}} 天前"
"daysAgo": "{{count}} 天前",
"multiplePlans": "{{count}} 个套餐",
"expand": "展开",
"collapse": "收起"
},
"usageScript": {
"title": "配置用量查询",
@@ -378,6 +381,10 @@
"templateGeneral": "通用模板",
"templateNewAPI": "NewAPI",
"credentialsConfig": "凭证配置",
"credentialsHint": "留空则自动使用供应商配置",
"optional": "可选",
"apiKeyPlaceholder": "留空则使用供应商的 API Key",
"baseUrlPlaceholder": "留空则使用供应商的请求地址",
"baseUrl": "请求地址",
"accessToken": "访问令牌(在个人安全设置里获取)",
"accessTokenPlaceholder": "在'安全设置'里生成",