Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
421b4c0a
Unverified
Commit
421b4c0a
authored
Mar 07, 2026
by
Wesley Liddick
Committed by
GitHub
Mar 07, 2026
Browse files
Merge pull request #830 from ckken/pr/ccswitch-import-improvements
fix(ccswitch): improve import provider name and usage parsing
parents
cd69a7cb
97bf1d85
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/views/user/KeysView.vue
View file @
421b4c0a
...
@@ -1638,17 +1638,21 @@ const executeCcsImport = (row: ApiKey, clientType: 'claude' | 'gemini') => {
...
@@ -1638,17 +1638,21 @@ const executeCcsImport = (row: ApiKey, clientType: 'claude' | 'gemini') => {
headers: { "Authorization": "Bearer {{apiKey}}" }
headers: { "Authorization": "Bearer {{apiKey}}" }
},
},
extractor: function(response) {
extractor: function(response) {
const remaining = response?.remaining ?? response?.quota?.remaining ?? response?.balance;
const unit = response?.unit ?? response?.quota?.unit ?? "USD";
return {
return {
isValid: response.is_active
||
true,
isValid: response
?
.is_active
?? response?.isValid ??
true,
remaining
: response.balance
,
remaining,
unit
: "USD"
unit
};
};
}
}
})`
})`
const
providerName
=
(
publicSettings
.
value
?.
site_name
||
'
sub2api
'
).
trim
()
||
'
sub2api
'
const
params
=
new
URLSearchParams
({
const
params
=
new
URLSearchParams
({
resource
:
'
provider
'
,
resource
:
'
provider
'
,
app
:
app
,
app
:
app
,
name
:
'
sub2api
'
,
name
:
providerName
,
homepage
:
baseUrl
,
homepage
:
baseUrl
,
endpoint
:
endpoint
,
endpoint
:
endpoint
,
apiKey
:
row
.
key
,
apiKey
:
row
.
key
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment