feat(ui): add type filter toggles

This commit is contained in:
2026-02-18 23:13:28 -08:00
commit a4cff9894c
14457 changed files with 2204835 additions and 0 deletions

78
server/types.ts Normal file
View File

@@ -0,0 +1,78 @@
/**
* Backend Types for Homelab Topology Visualizer
*
* Type definitions for server-side operations including:
* - Host configuration for SSH connections
* - API response types for discovery, config, files, and stats
*/
export interface HostConfig {
/** Hostname for display in topology */
name: string;
/** IP address for SSH connection */
ip: string;
/** SSH username */
sshUser: string;
/** Optional path to SSH private key file */
sshKeyPath?: string;
/** Optional SSH port (defaults to 22) */
sshPort?: number;
}
export interface DiscoveryResponse {
/** Array of discovered hosts with their status */
hosts: Array<{
name: string;
ip: string;
online: boolean;
containers?: string[];
error?: string;
}>;
/** Timestamp of discovery run */
timestamp: string;
/** Any errors encountered during discovery */
errors: string[];
}
export interface ConfigResponse {
/** Raw YAML configuration content */
yaml: string;
/** Path to the config file */
path: string;
/** Error message if config retrieval failed */
error?: string;
}
export interface VolumeMount {
/** Source path on host */
source: string;
/** Destination path in container */
destination: string;
/** Mount mode (e.g., 'rw', 'ro') */
mode: string;
}
export interface FilesResponse {
/** Array of volume mounts */
volumes: VolumeMount[];
/** Error message if file retrieval failed */
error?: string;
}
export interface NetworkStats {
/** Bytes received */
rx: number;
/** Bytes transmitted */
tx: number;
}
export interface StatsResponse {
/** CPU usage percentage */
cpu: number;
/** Memory usage percentage */
memory: number;
/** Network I/O statistics */
network: NetworkStats;
/** Error message if stats retrieval failed */
error?: string;
}