feat: account management overhaul + 7 issue resolutions (#147)
- Add smart JSON export/import with schema validation and deduplication - Add per-account proxy configurations (Issue #79) - Add advanced account sorting engine (Issues #126 & #99) - Add compact horizontal layout, AI credits, inline model visibility (Issues #145 & #134) - Add desktop push notifications for low quota (Issue #53) - Fix Arch Linux AUR process detection bug (Issue #117) - Default theme set to Dark Mode (it's better) - UI Polishing: Improved sort dropdown and symmetrical dialog layouts - Dev Mode: Resolved port conflicts and single-instance locks - Updated README and README.zh-CN with new features
This commit is contained in:
37 files changed
+1989
-455
No files matched your search
@@ -37,6 +37,7 @@ export interface CloudQuotaData {
|
||||
subscription_tier?: string;
|
||||
is_forbidden?: boolean;
|
||||
isForbidden?: boolean;
|
||||
ai_credits?: { credits: number; expiryDate: string };
|
||||
}
|
||||
|
||||
export interface CloudAccount {
|
||||
@@ -53,6 +54,7 @@ export interface CloudAccount {
|
||||
last_used: number; // Unix timestamp
|
||||
status?: 'active' | 'rate_limited' | 'expired';
|
||||
is_active?: boolean;
|
||||
proxy_url?: string;
|
||||
}
|
||||
|
||||
// Zod Schemas
|
||||
@@ -87,6 +89,7 @@ export const CloudQuotaDataSchema = z.object({
|
||||
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({
|
||||
@@ -103,4 +106,25 @@ export const CloudAccountSchema = z.object({
|
||||
last_used: z.number(),
|
||||
status: z.enum(['active', 'rate_limited', 'expired']).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(),
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
export type CloudAccountExport = z.infer<typeof CloudAccountExportSchema>;
|
||||
Reference in new issue
Block a user