v0.5.4: monitoring page frontend fixes

- Fix tooltip "Invalid Date" by using raw.x with parsed.x fallback
- Fix chart x-axis bounds by including initial min/max in chartOpts
- Fix sysinfo alignment with fixed 2-column grid and consistent styling
- Fix chart overflow on mobile with min-width:0 and overflow:hidden
- Remove redundant <style> block from monitoring.html (moved to style.css)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 12:04:02 +01:00
parent 71da2938a5
commit c1dda1aec6
2 changed files with 31 additions and 14 deletions
@@ -1,14 +1,6 @@
{{define "monitoring"}} {{define "monitoring"}}
{{template "layout_start" .}} {{template "layout_start" .}}
<style>
/* Monitoring page specific overrides */
.sysinfo-value {
text-align: right;
font-weight: bold;
}
</style>
<div class="page-header"> <div class="page-header">
<h2>Rendszermonitor</h2> <h2>Rendszermonitor</h2>
</div> </div>
@@ -183,6 +175,8 @@
// --- Chart options for line charts with LINEAR x-axis --- // --- Chart options for line charts with LINEAR x-axis ---
function chartOpts(yLabel, beginAtZero) { function chartOpts(yLabel, beginAtZero) {
var now = Date.now();
var defaultRangeMs = parseRangeMs('1h');
return { return {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
@@ -198,8 +192,14 @@
callbacks: { callbacks: {
title: function(items) { title: function(items) {
if (!items.length) return ''; if (!items.length) return '';
// parsed.x is the ms timestamp on a linear axis var raw = items[0].raw;
return formatTimestamp(items[0].parsed.x); if (raw && typeof raw === 'object' && raw.x) {
return formatTimestamp(raw.x);
}
if (items[0].parsed && items[0].parsed.x) {
return formatTimestamp(items[0].parsed.x);
}
return '';
} }
} }
} }
@@ -207,6 +207,8 @@
scales: { scales: {
x: { x: {
type: 'linear', type: 'linear',
min: now - defaultRangeMs,
max: now,
grid: {color: 'rgba(48,54,61,0.5)'}, grid: {color: 'rgba(48,54,61,0.5)'},
ticks: { ticks: {
color: '#8b949e', color: '#8b949e',
+19 -4
View File
@@ -1506,26 +1506,32 @@ a.stat-card:hover {
} }
.sysinfo-grid { .sysinfo-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-template-columns: 1fr 1fr;
gap: .5rem; gap: 0;
} }
.sysinfo-row { .sysinfo-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: baseline;
padding: .35rem .5rem; padding: .5rem .75rem;
border-bottom: 1px solid rgba(48, 54, 61, 0.3); border-bottom: 1px solid rgba(48, 54, 61, 0.3);
font-size: .9rem; font-size: .9rem;
gap: 1rem;
} }
.sysinfo-row:last-child { border-bottom: none; } .sysinfo-row:last-child { border-bottom: none; }
.sysinfo-label { .sysinfo-label {
color: var(--text-secondary); color: var(--text-secondary);
font-weight: 500; font-weight: 500;
white-space: nowrap;
flex-shrink: 0;
} }
.sysinfo-value { .sysinfo-value {
color: var(--text-primary); color: var(--text-primary);
font-family: 'JetBrains Mono', monospace; font-family: 'JetBrains Mono', monospace;
font-size: .85rem; font-size: .85rem;
font-weight: 600;
text-align: right;
word-break: break-word;
} }
.charts-grid { .charts-grid {
display: grid; display: grid;
@@ -1540,6 +1546,8 @@ a.stat-card:hover {
border-radius: 8px; border-radius: 8px;
padding: .75rem; padding: .75rem;
border: 1px solid rgba(48, 54, 61, 0.5); border: 1px solid rgba(48, 54, 61, 0.5);
min-width: 0;
overflow: hidden;
} }
.chart-box-half { .chart-box-half {
flex: 1; flex: 1;
@@ -1556,10 +1564,17 @@ a.stat-card:hover {
.chart-wrap { .chart-wrap {
position: relative; position: relative;
height: 180px; height: 180px;
overflow: hidden;
max-width: 100%;
}
.chart-wrap canvas {
max-width: 100%;
} }
.chart-wrap-bar { .chart-wrap-bar {
position: relative; position: relative;
height: 250px; height: 250px;
overflow: hidden;
max-width: 100%;
} }
.container-charts-row { .container-charts-row {
display: flex; display: flex;