mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
feat: redesign user host defaults system
This commit is contained in:
1 parent
3028ab1176
commit
a4a4d4f27b
144 files changed
+24609
-2555
No files matched your search
@@ -112,37 +112,3 @@ export async function updateBranding(
|
||||
handleApiError(error, "update branding settings");
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// HOST DEFAULTS SETTINGS
|
||||
// ============================================================================
|
||||
|
||||
export type HostDefaults = {
|
||||
useSocks5?: boolean;
|
||||
socks5Host?: string;
|
||||
socks5Port?: number;
|
||||
socks5Username?: string;
|
||||
socks5Password?: string;
|
||||
credentialId?: number | null;
|
||||
statusCheckEnabled?: boolean;
|
||||
};
|
||||
|
||||
export async function getHostDefaults(): Promise<HostDefaults> {
|
||||
try {
|
||||
const response = await authApi.get("/users/host-defaults");
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, "fetch host defaults");
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateHostDefaults(
|
||||
defaults: HostDefaults,
|
||||
): Promise<HostDefaults> {
|
||||
try {
|
||||
const response = await authApi.patch("/users/host-defaults", defaults);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
handleApiError(error, "update host defaults");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user