Mise a jour automatique globale programmee par serveur
- planification crontab par serveur (hostauto.json) : toutes les stacks de la
derniere analyse, une par une, hors exclues, arretees et stacks ayant leur
propre planification (celle de la stack prime)
- attente d'une connexion occupee (30 min max), resultat par stack conserve
- API PUT /api/servers/{id}/auto {"schedule"} ; vue de fleet : servers[].auto
- interface : bouton horloge par serveur (dialogue de planification), badge,
section Serveurs dans la vue "Mises a jour auto", statut bleu pendant l'execution
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LNfwm6UCYFyvNQNSF5i9Gy
This commit is contained in:
1 parent
ef259ae27a
commit
eac873266c
10 files changed
+824
-109
No files matched your search
@@ -88,6 +88,34 @@ export interface AutoInfo {
|
||||
pending?: boolean;
|
||||
}
|
||||
|
||||
/** Resultat d'une stack lors d'une mise a jour globale programmee. */
|
||||
export interface HostStackResult {
|
||||
target: string;
|
||||
user: string;
|
||||
dir: string;
|
||||
name: string;
|
||||
ok: boolean;
|
||||
/** Rien a faire (deja a jour, stack arretee). */
|
||||
skipped?: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
/** Mise a jour globale programmee d'un serveur. */
|
||||
export interface HostAutoInfo {
|
||||
schedule: string;
|
||||
by?: string;
|
||||
since: string;
|
||||
next?: string;
|
||||
lastRun?: string;
|
||||
lastOk: boolean;
|
||||
lastMessage?: string;
|
||||
results?: HostStackResult[];
|
||||
pending?: boolean;
|
||||
running?: boolean;
|
||||
/** Stack en cours pendant une execution. */
|
||||
current?: string;
|
||||
}
|
||||
|
||||
export interface Scan {
|
||||
running: boolean;
|
||||
task?: "scan" | "apply";
|
||||
@@ -116,6 +144,8 @@ export interface Server extends ServerInput {
|
||||
targets: Target[];
|
||||
/** Résultat de chaque connexion, par identifiant de connexion. */
|
||||
scans: Record<string, Scan>;
|
||||
/** Mise a jour globale programmee du serveur. */
|
||||
auto?: HostAutoInfo;
|
||||
}
|
||||
|
||||
export interface Summary {
|
||||
@@ -236,6 +266,11 @@ export const api = {
|
||||
await request(`/api/servers/${q(serverId)}/targets/${q(targetId)}/auto`, json({ dir, schedule }, "PUT"));
|
||||
},
|
||||
|
||||
/** Programme la mise a jour globale d'un serveur (crontab) ; schedule vide : la desactive. */
|
||||
autoServer: async (serverId: string, schedule: string): Promise<void> => {
|
||||
await request(`/api/servers/${q(serverId)}/auto`, json({ schedule }, "PUT"));
|
||||
},
|
||||
|
||||
/** Valide une planification et renvoie ses prochaines executions. */
|
||||
cronPreview: async (expr: string): Promise<string[]> => (await (await request(`/api/cron?expr=${q(expr)}`)).json()).next,
|
||||
|
||||
|
||||
Reference in new issue
Block a user