feat: add Services and Logs modules (systemctl + journalctl via SSH)

Backend:
- modules/services: list, status, start/stop/restart systemctl services
  with pct exec support for LXC targets
- modules/logs: journalctl unit listing + WebSocket live streaming
  (direct SSH connection, journalctl -f, graceful teardown on WS close)
- migrations/003: seed services and logs modules in DB
- main.go: register services.New() and logs.New() in module loader

Frontend:
- services.html: target selector, search/filter, services table with
  active state indicators and start/stop/restart buttons
- logs.html: target + unit selectors, live follow toggle, scrollable
  terminal output with 3000-line cap
- app.js: servicePage() and logsPage() Alpine components + navItems
- locales: services and logs i18n keys (fr + en)
- pages.css: services table, state dots, logs output styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
enzo 2026-03-22 02:03:55 +01:00
parent 98cdabf3e1
commit 5836f2201a
10 changed files with 1012 additions and 2 deletions

View file

@ -17,6 +17,8 @@ import (
sshpool "git.geronzi.fr/proxmoxPanel/core/backend/internal/ssh"
"git.geronzi.fr/proxmoxPanel/core/backend/internal/websocket"
"git.geronzi.fr/proxmoxPanel/core/backend/modules"
"git.geronzi.fr/proxmoxPanel/core/backend/modules/logs"
"git.geronzi.fr/proxmoxPanel/core/backend/modules/services"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
@ -68,8 +70,8 @@ func main() {
// ── Chargement des modules actifs ──────────────────────────────────────
loader := modules.NewLoader(database.DB)
// Les modules sont enregistrés ici (compilés dans le binaire)
// loader.RegisterModule(dashboard.New(...)) ← à décommenter quand implémentés
loader.RegisterModule(services.New(database, sshPool, encryptor))
loader.RegisterModule(logs.New(database, sshPool, encryptor))
if err := loader.LoadActive(); err != nil {
log.Fatalf("Erreur chargement modules : %v", err)
}