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:
parent
98cdabf3e1
commit
5836f2201a
10 changed files with 1012 additions and 2 deletions
|
|
@ -826,6 +826,131 @@
|
|||
.toast--info { border-left-color: var(--neu-info); }
|
||||
.toast--info > i:first-child { color: var(--neu-info); }
|
||||
|
||||
/* ── Page Services ───────────────────────────────────────────────────────────── */
|
||||
.services-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .75rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.services-target-sel { min-width: 12rem; }
|
||||
.services-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .5rem;
|
||||
flex: 1;
|
||||
min-width: 10rem;
|
||||
background: var(--neu-bg);
|
||||
border: 1px solid var(--neu-border);
|
||||
border-radius: var(--neu-radius);
|
||||
padding: 0 .75rem;
|
||||
}
|
||||
.services-search i { color: var(--neu-text-muted); font-size: .9rem; flex-shrink: 0; }
|
||||
.services-search .neu-input {
|
||||
border: none;
|
||||
background: transparent;
|
||||
padding: .45rem 0;
|
||||
flex: 1;
|
||||
box-shadow: none;
|
||||
min-width: 0;
|
||||
}
|
||||
.services-table-wrap { padding: 0; overflow-x: auto; }
|
||||
.services-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: .875rem;
|
||||
}
|
||||
.services-table thead tr {
|
||||
border-bottom: 1px solid var(--neu-border);
|
||||
}
|
||||
.services-table th {
|
||||
padding: .6rem 1rem;
|
||||
text-align: left;
|
||||
font-weight: 600;
|
||||
color: var(--neu-text-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.services-table td {
|
||||
padding: .5rem 1rem;
|
||||
border-bottom: 1px solid var(--neu-border);
|
||||
vertical-align: middle;
|
||||
}
|
||||
.services-table tbody tr:last-child td { border-bottom: none; }
|
||||
.services-table tbody tr:hover { background: var(--neu-bg-raised); }
|
||||
|
||||
.svc-state-dot {
|
||||
display: inline-block;
|
||||
width: .5rem;
|
||||
height: .5rem;
|
||||
border-radius: 50%;
|
||||
margin-right: .4rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.state-active .svc-state-dot { background: var(--neu-success); }
|
||||
.state-failed .svc-state-dot { background: var(--neu-danger); }
|
||||
.state-inactive .svc-state-dot { background: var(--neu-text-muted); }
|
||||
.state-other .svc-state-dot { background: var(--neu-warning); }
|
||||
|
||||
.state-active .svc-state-label { color: var(--neu-success); }
|
||||
.state-failed .svc-state-label { color: var(--neu-danger); }
|
||||
.state-inactive .svc-state-label { color: var(--neu-text-muted); }
|
||||
|
||||
.svc-name { font-weight: 500; font-family: var(--neu-font-mono, monospace); white-space: nowrap; }
|
||||
.svc-sub { color: var(--neu-text-muted); font-size: .8rem; white-space: nowrap; }
|
||||
.svc-desc { color: var(--neu-text-muted); font-size: .8rem; max-width: 22rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.svc-actions { display: flex; gap: .35rem; white-space: nowrap; }
|
||||
|
||||
/* ── Page Logs ───────────────────────────────────────────────────────────────── */
|
||||
.logs-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .75rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.logs-sel { min-width: 10rem; }
|
||||
.logs-sel-sm { min-width: 5rem; width: 5rem; }
|
||||
|
||||
.logs-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: .5rem;
|
||||
font-size: .8rem;
|
||||
color: var(--neu-success);
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
.logs-status-dot {
|
||||
width: .45rem;
|
||||
height: .45rem;
|
||||
border-radius: 50%;
|
||||
background: var(--neu-success);
|
||||
animation: pulse 1.2s ease-in-out infinite;
|
||||
}
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: .35; }
|
||||
}
|
||||
|
||||
.logs-output-wrap { padding: 0; min-height: 22rem; display: flex; flex-direction: column; }
|
||||
.logs-output {
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
margin: 0;
|
||||
font-family: var(--neu-font-mono, 'Courier New', monospace);
|
||||
font-size: .78rem;
|
||||
line-height: 1.5;
|
||||
color: var(--neu-text);
|
||||
overflow-y: auto;
|
||||
max-height: 65vh;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
.logs-empty {
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ── Éditeur de raccourcis ───────────────────────────────────────────────────── */
|
||||
.shortcuts-editor { display: flex; flex-direction: column; gap: .5rem; }
|
||||
.shortcut-row {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue