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
@@ -4,6 +4,7 @@ import {
|
||||
addGoogleAccount,
|
||||
deleteCloudAccount,
|
||||
refreshAccountQuota,
|
||||
setAccountProxy,
|
||||
} from '@/actions/cloud';
|
||||
import { CloudAccount } from '@/types/cloudAccount';
|
||||
|
||||
@@ -120,3 +121,41 @@ export function useSyncLocalAccount() {
|
||||
|
||||
import { startAuthFlow } from '@/actions/cloud';
|
||||
export { startAuthFlow };
|
||||
|
||||
export function useSetAccountProxy() {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: setAccountProxy,
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: QUERY_KEYS.cloudAccounts });
|
||||
},
|
||||
onError: (error: any) => {
|
||||
console.error('[Mutation] setAccountProxy failed:', error);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
import { exportCloudAccounts, importCloudAccounts } from '@/actions/cloud';
|
||||
|
||||
export function useExportCloudAccounts() {
|
||||
return useMutation<string, Error, { stripTokens?: boolean }>({
|
||||
mutationFn: exportCloudAccounts,
|
||||
});
|
||||
}
|
||||
|
||||
export function useImportCloudAccounts() {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation<
|
||||
{ imported: number; skipped: number; updated: number; errors: string[] },
|
||||
Error,
|
||||
{ jsonContent: string; strategy?: 'merge' | 'overwrite' | 'skip-existing' }
|
||||
>({
|
||||
mutationFn: importCloudAccounts,
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: QUERY_KEYS.cloudAccounts });
|
||||
},
|
||||
onError: (error: any) => {
|
||||
console.error('[Mutation] importCloudAccounts failed:', error);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user