mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-18 02:30:51 +08:00
refactor(quota): modularize QuotaPage into separate section components
This commit is contained in:
@@ -2,6 +2,101 @@
|
||||
* Quota management types.
|
||||
*/
|
||||
|
||||
// Theme types
|
||||
export type ThemeColors = { bg: string; text: string; border?: string };
|
||||
export type TypeColorSet = { light: ThemeColors; dark?: ThemeColors };
|
||||
export type ResolvedTheme = 'light' | 'dark';
|
||||
|
||||
// API payload types
|
||||
export interface GeminiCliQuotaBucket {
|
||||
modelId?: string;
|
||||
model_id?: string;
|
||||
tokenType?: string;
|
||||
token_type?: string;
|
||||
remainingFraction?: number | string;
|
||||
remaining_fraction?: number | string;
|
||||
remainingAmount?: number | string;
|
||||
remaining_amount?: number | string;
|
||||
resetTime?: string;
|
||||
reset_time?: string;
|
||||
}
|
||||
|
||||
export interface GeminiCliQuotaPayload {
|
||||
buckets?: GeminiCliQuotaBucket[];
|
||||
}
|
||||
|
||||
export interface AntigravityQuotaInfo {
|
||||
displayName?: string;
|
||||
quotaInfo?: {
|
||||
remainingFraction?: number | string;
|
||||
remaining_fraction?: number | string;
|
||||
remaining?: number | string;
|
||||
resetTime?: string;
|
||||
reset_time?: string;
|
||||
};
|
||||
quota_info?: {
|
||||
remainingFraction?: number | string;
|
||||
remaining_fraction?: number | string;
|
||||
remaining?: number | string;
|
||||
resetTime?: string;
|
||||
reset_time?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type AntigravityModelsPayload = Record<string, AntigravityQuotaInfo>;
|
||||
|
||||
export interface AntigravityQuotaGroupDefinition {
|
||||
id: string;
|
||||
label: string;
|
||||
identifiers: string[];
|
||||
labelFromModel?: boolean;
|
||||
}
|
||||
|
||||
export interface GeminiCliQuotaGroupDefinition {
|
||||
id: string;
|
||||
label: string;
|
||||
modelIds: string[];
|
||||
}
|
||||
|
||||
export interface GeminiCliParsedBucket {
|
||||
modelId: string;
|
||||
tokenType: string | null;
|
||||
remainingFraction: number | null;
|
||||
remainingAmount: number | null;
|
||||
resetTime: string | undefined;
|
||||
}
|
||||
|
||||
export interface CodexUsageWindow {
|
||||
used_percent?: number | string;
|
||||
usedPercent?: number | string;
|
||||
limit_window_seconds?: number | string;
|
||||
limitWindowSeconds?: number | string;
|
||||
reset_after_seconds?: number | string;
|
||||
resetAfterSeconds?: number | string;
|
||||
reset_at?: number | string;
|
||||
resetAt?: number | string;
|
||||
}
|
||||
|
||||
export interface CodexRateLimitInfo {
|
||||
allowed?: boolean;
|
||||
limit_reached?: boolean;
|
||||
limitReached?: boolean;
|
||||
primary_window?: CodexUsageWindow | null;
|
||||
primaryWindow?: CodexUsageWindow | null;
|
||||
secondary_window?: CodexUsageWindow | null;
|
||||
secondaryWindow?: CodexUsageWindow | null;
|
||||
}
|
||||
|
||||
export interface CodexUsagePayload {
|
||||
plan_type?: string;
|
||||
planType?: string;
|
||||
rate_limit?: CodexRateLimitInfo | null;
|
||||
rateLimit?: CodexRateLimitInfo | null;
|
||||
code_review_rate_limit?: CodexRateLimitInfo | null;
|
||||
codeReviewRateLimit?: CodexRateLimitInfo | null;
|
||||
}
|
||||
|
||||
// Quota state types
|
||||
export interface AntigravityQuotaGroup {
|
||||
id: string;
|
||||
label: string;
|
||||
|
||||
Reference in New Issue
Block a user