export type Widget = { id: string; label: string };

export type Template = { id: number; name: string; group?: string };

export type Address = {
    id?: number | null;
    address: string;
    family?: string;
    gateway?: string | null;
    netmask?: string | null;
    rdns?: string | null;
    resolver1?: string | null;
    resolver2?: string | null;
    mac?: string | null;
    interface?: string | null;
};

export type Nic = {
    id?: number;
    name?: string;
    mac?: string | null;
    type?: string | null;
    tag?: string | number | null;
    in_limit?: number;
    out_limit?: number;
};

export type Disk = {
    id: number;
    drive: string;
    capacity_gb?: number | null;
    primary?: boolean;
    enabled?: boolean;
    type?: string | null;
};

export type LiveStats = {
    running?: boolean;
    cpu_pct?: number | null;
    memory_total_kb?: number | null;
    memory_avail_kb?: number | null;
    disk_used?: number | null;
    disk_total?: number | null;
    traffic_rx?: number | null;
    traffic_tx?: number | null;
};

export type TrafficPoint = {
    start?: string | null;
    end?: string | null;
    rx: number;
    tx: number;
    total: number;
    limit_gb: number;
};

export type Backup = {
    id: number;
    name: string;
    created?: string | null;
    complete?: boolean;
    restoring?: boolean;
    deleting?: boolean;
    type?: string | null;
    storage?: string | null;
};

export type Reveal = {
    kind?: string;
    label?: string;
    value?: string;
    vnc?: {
        ip?: string | null;
        port?: number | null;
        password?: string | null;
        enabled?: boolean;
    };
} | null;
