Merge pull request #830 from ckken/pr/ccswitch-import-improvements
fix(ccswitch): improve import provider name and usage parsing
This commit is contained in:
@@ -1638,17 +1638,21 @@ const executeCcsImport = (row: ApiKey, clientType: 'claude' | 'gemini') => {
|
||||
headers: { "Authorization": "Bearer {{apiKey}}" }
|
||||
},
|
||||
extractor: function(response) {
|
||||
const remaining = response?.remaining ?? response?.quota?.remaining ?? response?.balance;
|
||||
const unit = response?.unit ?? response?.quota?.unit ?? "USD";
|
||||
return {
|
||||
isValid: response.is_active || true,
|
||||
remaining: response.balance,
|
||||
unit: "USD"
|
||||
isValid: response?.is_active ?? response?.isValid ?? true,
|
||||
remaining,
|
||||
unit
|
||||
};
|
||||
}
|
||||
})`
|
||||
const providerName = (publicSettings.value?.site_name || 'sub2api').trim() || 'sub2api'
|
||||
|
||||
const params = new URLSearchParams({
|
||||
resource: 'provider',
|
||||
app: app,
|
||||
name: 'sub2api',
|
||||
name: providerName,
|
||||
homepage: baseUrl,
|
||||
endpoint: endpoint,
|
||||
apiKey: row.key,
|
||||
|
||||
Reference in New Issue
Block a user