responsive Uptime Page

This commit is contained in:
headlessdev 2025-04-15 14:21:51 +02:00
parent 1088806921
commit a3b47bd314

View File

@ -47,10 +47,10 @@ const timeFormats = {
}) })
}; };
const gridColumns = { const minBoxWidths = {
1: 30, 1: 24,
2: 56, 2: 24,
3: 30 3: 24
}; };
interface UptimeData { interface UptimeData {
@ -193,10 +193,9 @@ export default function Uptime() {
<Tooltip.Provider> <Tooltip.Provider>
<div <div
className="grid gap-0.5 w-full overflow-x-auto pb-2" className="grid gap-0.5 w-full pb-2"
style={{ style={{
gridTemplateColumns: `repeat(${gridColumns[timespan]}, minmax(0, 1fr))`, gridTemplateColumns: `repeat(auto-fit, minmax(${minBoxWidths[timespan]}px, 1fr))`
minWidth: `${gridColumns[timespan] * 24}px`
}} }}
> >
{reversedSummary.map((entry) => ( {reversedSummary.map((entry) => (