mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
bfdac2a22a
Add a new "Token Plan" template type in the usage query panel that natively queries quota/usage from Chinese coding plan providers (Kimi For Coding, Zhipu GLM, MiniMax) without requiring custom scripts. - Rust backend: new coding_plan service with provider-specific API queries (Kimi /v1/usages, Zhipu /api/monitor/usage/quota/limit, MiniMax /coding_plan/remains) normalized into UsageResult - Frontend: Token Plan template in UsageScriptModal with auto-detection of provider based on ANTHROPIC_BASE_URL pattern matching - Follows the same pattern as GitHub Copilot template (dedicated API path in queryProviderUsage, no JS script needed)
10 lines
278 B
Rust
10 lines
278 B
Rust
use crate::services::subscription::SubscriptionQuota;
|
|
|
|
#[tauri::command]
|
|
pub async fn get_coding_plan_quota(
|
|
base_url: String,
|
|
api_key: String,
|
|
) -> Result<SubscriptionQuota, String> {
|
|
crate::services::coding_plan::get_coding_plan_quota(&base_url, &api_key).await
|
|
}
|