From 7c26f0971a081b7481febe943fc37b49be57ea52 Mon Sep 17 00:00:00 2001 From: bonamin Date: Wed, 18 Feb 2026 21:26:12 +0200 Subject: [PATCH] Change to the Contents of some Sections --- frontend/src/devices/DeviceDetail.jsx | 177 ++++++++++++++++---------- 1 file changed, 112 insertions(+), 65 deletions(-) diff --git a/frontend/src/devices/DeviceDetail.jsx b/frontend/src/devices/DeviceDetail.jsx index 5d10129..57190a3 100644 --- a/frontend/src/devices/DeviceDetail.jsx +++ b/frontend/src/devices/DeviceDetail.jsx @@ -459,69 +459,93 @@ export default function DeviceDetail() { const deviceInfoSection = (

Device Information

-
- {/* Row 1, Col 1: Status */} -
-
+ {/* Col 1: Status — fancy card filling vertical space */} +
+ - + {isOnline ? "ON" : "OFF"} + +
+
+ +
+
Status
+
+ {isOnline ? "Online" : "Offline"} +
+ {mqttStatus && ( +
+ {mqttStatus.seconds_since_heartbeat}s ago +
+ )} +
+
+ + {/* Col 2: Serial Number, Hardware Variant, Document ID */} +
+
+
Serial Number
+
{device.device_id}
-
Status
-
- {isOnline ? "Online" : "Offline"} - {mqttStatus && ( - - {mqttStatus.seconds_since_heartbeat}s ago - - )} -
+
Hardware Variant
+
VesperCore
+
+
+
Document ID
+
{device.id}
- {/* Row 1, Col 2: Hardware Variant */} -
-
Hardware Variant
-
VesperCore
-
- - {/* Row 1-2, Col 3: Admin Notes (spans 2 rows, far right) */} -
+ {/* Col 3: Admin Notes */} +
Admin Notes
-
- - {/* Row 2, Col 1: Serial Number */} -
-
Serial Number
-
{device.device_id}
-
- - {/* Row 2, Col 2: Document ID */} -
-
Document ID
-
{device.id}
-
); const subscriptionSection = ( -
+ {/* Row 1: Tier | Last Payment On */} + {sub.subscrTier} + + 3 months ago + + + {/* Row 2: Start Date | Expiration Date | Duration | Time Left */} + {formatDate(sub.subscrStart)} - {sub.subscrDuration ? daysToDisplay(sub.subscrDuration) : "-"} {subscrEnd ? formatDateNice(subscrEnd) : "-"} + {sub.subscrDuration ? daysToDisplay(sub.subscrDuration) : "-"} {subscrDaysLeft === null ? "-" : subscrDaysLeft <= 0 ? ( @@ -533,9 +557,22 @@ export default function DeviceDetail() { )} + + {/* Row 3: Max Users | Max Outputs | Extra Info */} + {sub.maxUsers} {sub.maxOutputs} -
+ + e.preventDefault()} + > + View subscription details + + +
); @@ -715,7 +752,8 @@ export default function DeviceDetail() { const warrantySection = ( -
+ {/* Row 1: Status | Time Remaining */} + {warrantyDaysLeft !== null ? ( warrantyDaysLeft > 0 ? ( @@ -727,20 +765,24 @@ export default function DeviceDetail() { )} - {formatDate(stats.warrantyStart)} - {stats.warrantyPeriod ? daysToDisplay(stats.warrantyPeriod) : "-"} - {warrantyEnd ? formatDateNice(warrantyEnd) : "-"} - + {warrantyDaysLeft === null ? "-" : warrantyDaysLeft <= 0 ? ( Expired ) : ( `${warrantyDaysLeft} days` )} -
+ + {/* Row 2: Start Date | Expiry Date | Period */} + + {formatDate(stats.warrantyStart)} + {warrantyEnd ? formatDateNice(warrantyEnd) : "-"} + {stats.warrantyPeriod ? daysToDisplay(stats.warrantyPeriod) : "-"} +
-
+ {/* Single row: all 3 fields */} + {formatDate(stats.maintainedOn)} {stats.maintainancePeriod ? daysToDisplay(stats.maintainancePeriod) : "-"} @@ -755,29 +797,34 @@ export default function DeviceDetail() { ) : "-"} -
+
-
+ {/* Row 1: Playbacks | Hammer Strikes | Warnings */} + {stats.totalPlaybacks} {stats.totalHammerStrikes} {stats.totalWarningsGiven} + + {/* Row 2: Melodies | Favorites */} + {device.device_melodies_all?.length ?? 0} {device.device_melodies_favorites?.length ?? 0} - {stats.perBellStrikes?.length > 0 && ( -
- -
- {stats.perBellStrikes.slice(0, attr.totalBells || stats.perBellStrikes.length).map((count, i) => ( - - Bell {i + 1}: {count} - - ))} -
-
-
- )} -
+
+ + {stats.perBellStrikes?.length > 0 && ( +
+ +
+ {stats.perBellStrikes.slice(0, attr.totalBells || stats.perBellStrikes.length).map((count, i) => ( + + Bell {i + 1}: {count} + + ))} +
+
+
+ )} );