feat: enhance server stats widgets and fix TypeScript/ESLint errors #394

Merged
ZacharyZcR merged 50 commits from feature-server-stats-customization into dev-1.8.0 2025-10-10 03:48:34 +00:00
Showing only changes of commit a5188cad0b - Show all commits
+3 -12
View File
@@ -4,10 +4,6 @@ import type {
SSHHostData, SSHHostData,
TunnelConfig, TunnelConfig,
TunnelStatus, TunnelStatus,
Credential,
CredentialData,
HostInfo,
ApiResponse,
FileManagerFile, FileManagerFile,
FileManagerShortcut, FileManagerShortcut,
} from "../types/index.js"; } from "../types/index.js";
@@ -339,13 +335,8 @@ function isDev(): boolean {
} }
const apiHost = import.meta.env.VITE_API_HOST || "localhost"; const apiHost = import.meta.env.VITE_API_HOST || "localhost";
let apiPort = 30001;
let configuredServerUrl: string | null = null; let configuredServerUrl: string | null = null;
if (isElectron()) {
apiPort = 30001;
}
export interface ServerConfig { export interface ServerConfig {
serverUrl: string; serverUrl: string;
lastUpdated: string; lastUpdated: string;
@@ -991,7 +982,7 @@ export async function getFileManagerRecent(
`/file_manager/recent?hostId=${hostId}`, `/file_manager/recent?hostId=${hostId}`,
); );
return response.data || []; return response.data || [];
} catch (error) { } catch {
return []; return [];
} }
} }
@@ -1028,7 +1019,7 @@ export async function getFileManagerPinned(
`/file_manager/pinned?hostId=${hostId}`, `/file_manager/pinned?hostId=${hostId}`,
); );
return response.data || []; return response.data || [];
} catch (error) { } catch {
return []; return [];
} }
} }
@@ -1065,7 +1056,7 @@ export async function getFileManagerShortcuts(
`/file_manager/shortcuts?hostId=${hostId}`, `/file_manager/shortcuts?hostId=${hostId}`,
); );
return response.data || []; return response.data || [];
} catch (error) { } catch {
return []; return [];
} }
} }