- {monitor.certExpiryDaysRemaining !== undefined && (
- <>
-
- {getCertText(monitor.certExpiryDaysRemaining)}
-
+ {isMobile ? (
+ <>
+
+
+ {monitor.name}
+
+
+ {monitor.certExpiryDaysRemaining !== undefined && (
toggleBadge(monitor.id, 'cert')}
style={{ cursor: 'pointer', position: 'relative' }}
@@ -333,19 +345,11 @@ export default function UptimeStatusIsland() {
)}
- >
- )}
-
-
- {monitor.avgPing !== undefined && (
- <>
-
- Avg: {monitor.avgPing} ms
-
+ )}
+ {monitor.avgPing !== undefined && (
toggleBadge(monitor.id, 'avgPing')}
style={{ cursor: 'pointer', position: 'relative' }}
>
@@ -356,18 +360,11 @@ export default function UptimeStatusIsland() {
)}
- >
- )}
-
-
- {monitor.uptime24h !== undefined && (
- <>
-
- 24h: {monitor.uptime24h.toFixed(1)}%
-
+ )}
+ {monitor.uptime24h !== undefined && (
toggleBadge(monitor.id, 'uptime')}
style={{ cursor: 'pointer', position: 'relative' }}
>
@@ -378,17 +375,122 @@ export default function UptimeStatusIsland() {
)}
- >
- )}
+ )}
+
+ >
+ ) : (
+
+
+
+ {monitor.name}
+
+
+ {monitor.certExpiryDaysRemaining !== undefined && (
+ <>
+
+ {getCertText(monitor.certExpiryDaysRemaining)}
+
+ toggleBadge(monitor.id, 'cert')}
+ style={{ cursor: 'pointer', position: 'relative' }}
+ >
+
+ {openBadge[monitor.id]?.cert && (
+
+ {monitor.certExpiryDaysRemaining < 0
+ ? 'Expired!'
+ : `Expires in ${monitor.certExpiryDaysRemaining} days`}
+
+ )}
+
+ >
+ )}
+
+
+ {monitor.avgPing !== undefined && (
+ <>
+
+ Avg: {monitor.avgPing} ms
+
+ toggleBadge(monitor.id, 'avgPing')}
+ style={{ cursor: 'pointer', position: 'relative' }}
+ >
+
+ {openBadge[monitor.id]?.avgPing && (
+
+ {monitor.avgPing} ms
+
+ )}
+
+ >
+ )}
+
+
+ {monitor.uptime24h !== undefined && (
+ <>
+
+ 24h: {monitor.uptime24h.toFixed(1)}%
+
+ toggleBadge(monitor.id, 'uptime')}
+ style={{ cursor: 'pointer', position: 'relative' }}
+ >
+
+ {openBadge[monitor.id]?.uptime && (
+
+ {monitor.uptime24h.toFixed(1)}%
+
+ )}
+
+ >
+ )}
+
-
+ )}
{monitor.heartbeatHistory && monitor.heartbeatHistory.length > 0 && (
-
-
- {Array.from({ length: 40 }).map((_, i) => {
+
{ if (el && isMobile) heartbeatContainerRefs.current[monitor.id] = el; }}
+ onScroll={e => handleHeartbeatScroll(monitor.id, e)}
+ >
+ {/* Left shadow overlay for mobile, only if scrolled */}
+ {isMobile && showLeftShadow && (
+
+ )}
+
+ {(() => {
const hbArr = monitor.heartbeatHistory ?? [];
- const hb = hbArr.slice(-40)[i];
- return (
+ const slice = isMobile ? hbArr.slice(-10) : hbArr.slice(-40);
+ // Show most recent first (left), so reverse the slice
+ const ordered = slice;
+ return ordered.map((hb, i) => (
}
@@ -402,8 +504,8 @@ export default function UptimeStatusIsland() {
style={{ cursor: 'pointer' }}
>
- );
- })}
+ ));
+ })()}
)}
@@ -421,6 +523,28 @@ export default function UptimeStatusIsland() {
display: grid;
grid-template-columns: repeat(40, minmax(0, 1fr));
}
+ .grid-cols-10 {
+ display: grid;
+ grid-template-columns: repeat(10, 1fr);
+ }
+ .heartbeat-history-container.mobile {
+ overflow-x: auto;
+ -webkit-overflow-scrolling: touch;
+ min-width: 0;
+ width: 100%;
+ position: relative;
+ max-width: 100vw;
+ }
+ .heartbeat-left-shadow {
+ position: absolute;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ width: 24px;
+ pointer-events: none;
+ z-index: 10;
+ background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.00) 100%);
+ }
`}
);