Files
system_update/shared/types.ts
T
2026-06-04 20:57:16 +02:00

57 lines
1.4 KiB
TypeScript

// shared/types.ts
export type OsFamily = "debian" | "ubuntu" | "unknown";
export type MachineStatus = "unknown" | "ok" | "updates_available" | "error" | "running";
export type AptProxyMode = "direct" | "runtime";
export type ActionType = "apt_full_upgrade" | "reboot";
export type ExecutionStatus = "ok" | "warning" | "error";
export interface AptPackage {
name: string;
currentVersion: string | null;
targetVersion: string;
origin: string | null;
}
export interface UpdateSnapshot {
machineId: string;
hostname: string;
os: { family: OsFamily; version: string };
checkedAt: string; // ISO 8601
status: MachineStatus;
apt: {
enabled: boolean;
count: number;
rebootRequired: boolean;
packages: AptPackage[];
};
rawHints?: { logImportantLines: string[] };
}
export interface ExecutionResult {
executionId: string;
machineId: string;
startedAt: string;
finishedAt: string;
mode: "manual";
action: ActionType;
status: ExecutionStatus;
rebootRequiredAfterRun: boolean;
importantLogLines: string[];
rawLogRef: string;
reportRef: string;
}
/** Vue machine renvoyée par l'API — NE CONTIENT JAMAIS de secret. */
export interface MachineView {
id: string;
name: string;
hostname: string;
port: number;
osFamily: OsFamily;
username: string;
aptProxyMode: AptProxyMode;
aptProxyUrl: string | null;
status: MachineStatus;
lastCheckedAt: string | null;
}