style(design): apply Minimal Dark Mode design system\n\n- Switched to complete Dark Mode (OLED-friendly)\n- Established standard color palette matching modern technical aesthetics\n- Changed font to Plus Jakarta Sans for increased legibility\n- Enforced dark mode as default in App.tsx\n- Fixed several React cascading render (setState in useEffect) warnings
This commit is contained in:
1 parent
b80531f8a8
commit
bac7b5591e
738 files changed
+138513
-138123
No files matched your search
+138
-138
@@ -1,138 +1,138 @@
|
||||
import { z } from 'zod';
|
||||
import {
|
||||
DeviceProfileSchema,
|
||||
DeviceProfileVersionSchema,
|
||||
type DeviceProfile,
|
||||
type DeviceProfileVersion,
|
||||
} from './account';
|
||||
|
||||
export interface CloudTokenData {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
expires_in: number;
|
||||
expiry_timestamp: number;
|
||||
token_type: string;
|
||||
email?: string;
|
||||
project_id?: string;
|
||||
oauth_client_key?: string;
|
||||
session_id?: string;
|
||||
upstream_proxy_url?: string;
|
||||
is_gcp_tos?: boolean;
|
||||
}
|
||||
|
||||
export interface CloudQuotaModelInfo {
|
||||
percentage: number;
|
||||
resetTime: string;
|
||||
display_name?: string;
|
||||
supports_images?: boolean;
|
||||
supports_thinking?: boolean;
|
||||
thinking_budget?: number;
|
||||
recommended?: boolean;
|
||||
max_tokens?: number;
|
||||
max_output_tokens?: number;
|
||||
supported_mime_types?: Record<string, boolean>;
|
||||
}
|
||||
|
||||
export interface CloudQuotaData {
|
||||
models: Record<string, CloudQuotaModelInfo>;
|
||||
model_forwarding_rules?: Record<string, string>;
|
||||
subscription_tier?: string;
|
||||
is_forbidden?: boolean;
|
||||
isForbidden?: boolean;
|
||||
ai_credits?: { credits: number; expiryDate: string };
|
||||
}
|
||||
|
||||
export interface CloudAccount {
|
||||
id: string; // UUID
|
||||
provider: 'google' | 'anthropic';
|
||||
email: string;
|
||||
name?: string | null;
|
||||
avatar_url?: string | null;
|
||||
token: CloudTokenData;
|
||||
quota?: CloudQuotaData;
|
||||
device_profile?: DeviceProfile;
|
||||
device_history?: DeviceProfileVersion[];
|
||||
created_at: number;
|
||||
last_used: number; // Unix timestamp
|
||||
status?: 'active' | 'rate_limited' | 'expired';
|
||||
status_reason?: string;
|
||||
is_active?: boolean;
|
||||
proxy_url?: string;
|
||||
}
|
||||
|
||||
// Zod Schemas
|
||||
export const CloudTokenDataSchema = z.object({
|
||||
access_token: z.string(),
|
||||
refresh_token: z.string(),
|
||||
expires_in: z.number(),
|
||||
expiry_timestamp: z.number(),
|
||||
token_type: z.string(),
|
||||
email: z.string().optional(),
|
||||
project_id: z.string().optional(),
|
||||
oauth_client_key: z.string().optional(),
|
||||
session_id: z.string().optional(),
|
||||
upstream_proxy_url: z.string().optional(),
|
||||
is_gcp_tos: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const CloudQuotaModelInfoSchema = z.object({
|
||||
percentage: z.number(),
|
||||
resetTime: z.string(),
|
||||
display_name: z.string().optional(),
|
||||
supports_images: z.boolean().optional(),
|
||||
supports_thinking: z.boolean().optional(),
|
||||
thinking_budget: z.number().optional(),
|
||||
recommended: z.boolean().optional(),
|
||||
max_tokens: z.number().optional(),
|
||||
max_output_tokens: z.number().optional(),
|
||||
supported_mime_types: z.record(z.string(), z.boolean()).optional(),
|
||||
});
|
||||
|
||||
export const CloudQuotaDataSchema = z.object({
|
||||
models: z.record(z.string(), CloudQuotaModelInfoSchema),
|
||||
model_forwarding_rules: z.record(z.string(), z.string()).optional(),
|
||||
subscription_tier: z.string().optional(),
|
||||
is_forbidden: z.boolean().optional(),
|
||||
isForbidden: z.boolean().optional(),
|
||||
ai_credits: z.object({ credits: z.number(), expiryDate: z.string() }).optional(),
|
||||
});
|
||||
|
||||
export const CloudAccountSchema = z.object({
|
||||
id: z.string(),
|
||||
provider: z.enum(['google', 'anthropic']),
|
||||
email: z.string(), // Relaxed: was z.string().email() but caused validation issues with some formats
|
||||
name: z.string().optional().nullable(),
|
||||
avatar_url: z.string().optional().nullable(),
|
||||
token: CloudTokenDataSchema,
|
||||
quota: CloudQuotaDataSchema.optional(),
|
||||
device_profile: DeviceProfileSchema.optional(),
|
||||
device_history: z.array(DeviceProfileVersionSchema).optional(),
|
||||
created_at: z.number(),
|
||||
last_used: z.number(),
|
||||
status: z.enum(['active', 'rate_limited', 'expired']).optional(),
|
||||
status_reason: z.string().optional(),
|
||||
is_active: z.boolean().optional(),
|
||||
proxy_url: z.string().optional(),
|
||||
});
|
||||
|
||||
export const CloudAccountExportSchema = z.object({
|
||||
version: z.literal('1.0'),
|
||||
exportedAt: z.number(),
|
||||
accounts: z.array(
|
||||
z.object({
|
||||
provider: z.enum(['google', 'anthropic']),
|
||||
email: z.string(),
|
||||
name: z.string().optional().nullable(),
|
||||
avatar_url: z.string().optional().nullable(),
|
||||
token: CloudTokenDataSchema,
|
||||
quota: CloudQuotaDataSchema.optional(),
|
||||
device_profile: z.any().optional(),
|
||||
device_history: z.any().optional(),
|
||||
proxy_url: z.string().optional().nullable(),
|
||||
status: z.enum(['active', 'rate_limited', 'expired']).optional(),
|
||||
status_reason: z.string().optional(),
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
export type CloudAccountExport = z.infer<typeof CloudAccountExportSchema>;
|
||||
import { z } from 'zod';
|
||||
import {
|
||||
DeviceProfileSchema,
|
||||
DeviceProfileVersionSchema,
|
||||
type DeviceProfile,
|
||||
type DeviceProfileVersion,
|
||||
} from './account';
|
||||
|
||||
export interface CloudTokenData {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
expires_in: number;
|
||||
expiry_timestamp: number;
|
||||
token_type: string;
|
||||
email?: string;
|
||||
project_id?: string;
|
||||
oauth_client_key?: string;
|
||||
session_id?: string;
|
||||
upstream_proxy_url?: string;
|
||||
is_gcp_tos?: boolean;
|
||||
}
|
||||
|
||||
export interface CloudQuotaModelInfo {
|
||||
percentage: number;
|
||||
resetTime: string;
|
||||
display_name?: string;
|
||||
supports_images?: boolean;
|
||||
supports_thinking?: boolean;
|
||||
thinking_budget?: number;
|
||||
recommended?: boolean;
|
||||
max_tokens?: number;
|
||||
max_output_tokens?: number;
|
||||
supported_mime_types?: Record<string, boolean>;
|
||||
}
|
||||
|
||||
export interface CloudQuotaData {
|
||||
models: Record<string, CloudQuotaModelInfo>;
|
||||
model_forwarding_rules?: Record<string, string>;
|
||||
subscription_tier?: string;
|
||||
is_forbidden?: boolean;
|
||||
isForbidden?: boolean;
|
||||
ai_credits?: { credits: number; expiryDate: string };
|
||||
}
|
||||
|
||||
export interface CloudAccount {
|
||||
id: string; // UUID
|
||||
provider: 'google' | 'anthropic';
|
||||
email: string;
|
||||
name?: string | null;
|
||||
avatar_url?: string | null;
|
||||
token: CloudTokenData;
|
||||
quota?: CloudQuotaData;
|
||||
device_profile?: DeviceProfile;
|
||||
device_history?: DeviceProfileVersion[];
|
||||
created_at: number;
|
||||
last_used: number; // Unix timestamp
|
||||
status?: 'active' | 'rate_limited' | 'expired';
|
||||
status_reason?: string;
|
||||
is_active?: boolean;
|
||||
proxy_url?: string;
|
||||
}
|
||||
|
||||
// Zod Schemas
|
||||
export const CloudTokenDataSchema = z.object({
|
||||
access_token: z.string(),
|
||||
refresh_token: z.string(),
|
||||
expires_in: z.number(),
|
||||
expiry_timestamp: z.number(),
|
||||
token_type: z.string(),
|
||||
email: z.string().optional(),
|
||||
project_id: z.string().optional(),
|
||||
oauth_client_key: z.string().optional(),
|
||||
session_id: z.string().optional(),
|
||||
upstream_proxy_url: z.string().optional(),
|
||||
is_gcp_tos: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const CloudQuotaModelInfoSchema = z.object({
|
||||
percentage: z.number(),
|
||||
resetTime: z.string(),
|
||||
display_name: z.string().optional(),
|
||||
supports_images: z.boolean().optional(),
|
||||
supports_thinking: z.boolean().optional(),
|
||||
thinking_budget: z.number().optional(),
|
||||
recommended: z.boolean().optional(),
|
||||
max_tokens: z.number().optional(),
|
||||
max_output_tokens: z.number().optional(),
|
||||
supported_mime_types: z.record(z.string(), z.boolean()).optional(),
|
||||
});
|
||||
|
||||
export const CloudQuotaDataSchema = z.object({
|
||||
models: z.record(z.string(), CloudQuotaModelInfoSchema),
|
||||
model_forwarding_rules: z.record(z.string(), z.string()).optional(),
|
||||
subscription_tier: z.string().optional(),
|
||||
is_forbidden: z.boolean().optional(),
|
||||
isForbidden: z.boolean().optional(),
|
||||
ai_credits: z.object({ credits: z.number(), expiryDate: z.string() }).optional(),
|
||||
});
|
||||
|
||||
export const CloudAccountSchema = z.object({
|
||||
id: z.string(),
|
||||
provider: z.enum(['google', 'anthropic']),
|
||||
email: z.string(), // Relaxed: was z.string().email() but caused validation issues with some formats
|
||||
name: z.string().optional().nullable(),
|
||||
avatar_url: z.string().optional().nullable(),
|
||||
token: CloudTokenDataSchema,
|
||||
quota: CloudQuotaDataSchema.optional(),
|
||||
device_profile: DeviceProfileSchema.optional(),
|
||||
device_history: z.array(DeviceProfileVersionSchema).optional(),
|
||||
created_at: z.number(),
|
||||
last_used: z.number(),
|
||||
status: z.enum(['active', 'rate_limited', 'expired']).optional(),
|
||||
status_reason: z.string().optional(),
|
||||
is_active: z.boolean().optional(),
|
||||
proxy_url: z.string().optional(),
|
||||
});
|
||||
|
||||
export const CloudAccountExportSchema = z.object({
|
||||
version: z.literal('1.0'),
|
||||
exportedAt: z.number(),
|
||||
accounts: z.array(
|
||||
z.object({
|
||||
provider: z.enum(['google', 'anthropic']),
|
||||
email: z.string(),
|
||||
name: z.string().optional().nullable(),
|
||||
avatar_url: z.string().optional().nullable(),
|
||||
token: CloudTokenDataSchema,
|
||||
quota: CloudQuotaDataSchema.optional(),
|
||||
device_profile: z.any().optional(),
|
||||
device_history: z.any().optional(),
|
||||
proxy_url: z.string().optional().nullable(),
|
||||
status: z.enum(['active', 'rate_limited', 'expired']).optional(),
|
||||
status_reason: z.string().optional(),
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
export type CloudAccountExport = z.infer<typeof CloudAccountExportSchema>;
|
||||
Reference in new issue
Block a user