This commit is contained in:
Heidi
2026-05-16 11:28:29 +01:00
parent 4819cd2cab
commit 29f06c5e0b
+9 -2
View File
@@ -2952,7 +2952,14 @@ function UptimePage({ uptime }) {
</p> </p>
</div> </div>
<div className="relative mt-5 flex h-28 items-end gap-1 rounded-md border border-border bg-bg p-3"> <div
className="relative mt-5 grid h-28 items-end gap-px rounded-md border border-border bg-bg p-3"
style={{
gridTemplateColumns: history.length
? `repeat(${history.length}, minmax(0, 1fr))`
: '1fr',
}}
>
{history.map((sample, index) => { {history.map((sample, index) => {
const height = `${Math.max(12, (sample.onlineChecks / sample.totalChecks) * 100)}%` const height = `${Math.max(12, (sample.onlineChecks / sample.totalChecks) * 100)}%`
const left = history.length > 1 ? (index / (history.length - 1)) * 100 : 50 const left = history.length > 1 ? (index / (history.length - 1)) * 100 : 50
@@ -2960,7 +2967,7 @@ function UptimePage({ uptime }) {
return ( return (
<div <div
aria-label={`${sample.ok ? 'Uptime' : 'Downtime'} at ${dateFormat.format(new Date(sample.timestamp))}`} aria-label={`${sample.ok ? 'Uptime' : 'Downtime'} at ${dateFormat.format(new Date(sample.timestamp))}`}
className={`min-w-2 flex-1 rounded-sm ${sample.ok ? 'bg-success' : 'bg-danger'}`} className={`w-full min-w-0 rounded-sm ${sample.ok ? 'bg-success' : 'bg-danger'}`}
key={sample.timestamp} key={sample.timestamp}
onBlur={() => setHoveredSnapshot(null)} onBlur={() => setHoveredSnapshot(null)}
onFocus={() => setHoveredSnapshot({ ...sample, left })} onFocus={() => setHoveredSnapshot({ ...sample, left })}