Files
homelab-topology/server/types.ts
Christopher Mayor 3dc5d236a2 feat: expand discovery with systemd services, LXC/VMs, SSH terminal, and filebrowser
- Add systemd service discovery to backend
- Add Proxmox LXC/VM detection
- Add hostType field to config for better host categorization
- Fix SSH trust between hosts (ubuntu/grizzley -> truenas/proxmox)
- Add SSH terminal support via xterm.js
- Add filebrowser for browsing host filesystems
- Update frontend types and components for new node types
2026-02-20 17:18:33 -08:00

83 lines
2.0 KiB
TypeScript

/**
* 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;
/** Host type: proxmox, truenas, docker-host, etc */
hostType?: string;
}
export interface DiscoveryResponse {
/** Array of discovered hosts with their status */
hosts: Array<{
name: string;
ip: string;
online: boolean;
containers?: string[];
services?: string[];
vms?: Array<{ id: string; name: string; status: string; type: 'lxc' | 'qemu' }>;
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;
}