47fe952240
- service dbBackup : createBackup (VACUUM INTO → archive .db cohérente), validateSqlite (header + integrity_check + schéma), prepareRestore (sauvegarde de sécurité auto + dépôt <db>.incoming) - swap hors-ligne au démarrage (db/client.ts) : aucune corruption d'une base ouverte ; restauration appliquée au redémarrage - routes GET /system/db/info|backup, POST /system/db/restore - lib api : dbInfo / dbBackup (download navigateur) / dbRestore (upload) - SettingsModal : onglet « Base de données » (taille, télécharger, restaurer avec confirmation Popup), icônes database/upload, styles DS variables only Testé end-to-end : backup 184 Ko valide, restore + safety .bak + swap au boot, fichier invalide rejeté. tsc 0 erreur · 91 tests · build OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
763 B
TypeScript
18 lines
763 B
TypeScript
// server/routes/index.ts
|
|
import { Hono } from "hono";
|
|
import { machinesRoutes } from "./machines.js";
|
|
import { actionsRoutes } from "./actions.js";
|
|
import { actionRequestsRoutes } from "./actionRequests.js";
|
|
import { dbRoutes } from "./db.js";
|
|
import { getServerCapabilities } from "../services/capabilities.js";
|
|
import { getSystemMetrics, getSystemStatus } from "../services/system.js";
|
|
|
|
export const api = new Hono();
|
|
api.get("/capabilities", (c) => c.json(getServerCapabilities()));
|
|
api.get("/system/status", (c) => c.json(getSystemStatus()));
|
|
api.get("/system/metrics", (c) => c.json(getSystemMetrics()));
|
|
api.route("/system/db", dbRoutes);
|
|
api.route("/machines", machinesRoutes);
|
|
api.route("/machines", actionsRoutes);
|
|
api.route("/", actionRequestsRoutes);
|