mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-09-11 03:08:42 -06:00
Fixed Datetime Formatting and Changed Default Password to "Password"
This commit is contained in:
@@ -35,6 +35,23 @@ export default function DeviceDetails({ device, onBack }) {
|
|||||||
|
|
||||||
const statusColor = (s) => (s === "Online" ? "#00d18c" : "#ff4f4f");
|
const statusColor = (s) => (s === "Online" ? "#00d18c" : "#ff4f4f");
|
||||||
|
|
||||||
|
const formatLastSeen = (tsSec, offlineAfter = 15) => {
|
||||||
|
if (!tsSec) return "unknown";
|
||||||
|
const now = Date.now() / 1000;
|
||||||
|
if (now - tsSec <= offlineAfter) return "Currently Online";
|
||||||
|
const d = new Date(tsSec * 1000);
|
||||||
|
const date = d.toLocaleDateString("en-US", {
|
||||||
|
month: "2-digit",
|
||||||
|
day: "2-digit",
|
||||||
|
year: "numeric",
|
||||||
|
});
|
||||||
|
const time = d.toLocaleTimeString("en-US", {
|
||||||
|
hour: "numeric",
|
||||||
|
minute: "2-digit",
|
||||||
|
});
|
||||||
|
return `${date} @ ${time}`;
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!device || !device.hostname) return;
|
if (!device || !device.hostname) return;
|
||||||
const load = async () => {
|
const load = async () => {
|
||||||
@@ -134,7 +151,8 @@ export default function DeviceDetails({ device, onBack }) {
|
|||||||
{ label: "Internal IP", value: summary.internal_ip || "unknown" },
|
{ label: "Internal IP", value: summary.internal_ip || "unknown" },
|
||||||
{ label: "External IP", value: summary.external_ip || "unknown" },
|
{ label: "External IP", value: summary.external_ip || "unknown" },
|
||||||
{ label: "Last Reboot", value: summary.last_reboot ? formatDateTime(summary.last_reboot) : "unknown" },
|
{ label: "Last Reboot", value: summary.last_reboot ? formatDateTime(summary.last_reboot) : "unknown" },
|
||||||
{ label: "Created", value: summary.created ? formatDateTime(summary.created) : "unknown" }
|
{ label: "Created", value: summary.created ? formatDateTime(summary.created) : "unknown" },
|
||||||
|
{ label: "Last Seen", value: formatLastSeen(agent.last_seen || device?.lastSeen) }
|
||||||
];
|
];
|
||||||
|
|
||||||
const renderSummary = () => (
|
const renderSummary = () => (
|
||||||
@@ -483,4 +501,3 @@ export default function DeviceDetails({ device, onBack }) {
|
|||||||
</Paper>
|
</Paper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
"users": [
|
"users": [
|
||||||
{
|
{
|
||||||
"username": "admin",
|
"username": "admin",
|
||||||
"password": "18ec3210467c363a6cf96901261be4431bb4a75285ccd362b8cf8eae504ce6250ea4d64264a75486bf446051e3d4a6ac004410914ae706d29a01e96ba53f49a3"
|
"password": "e6c83b282aeb2e022844595721cc00bbda47cb24537c1779f9bb84f04039e1676e6ba8573e588da1052510e3aa0a32a9e55879ae22b0c2d62136fc0a3e85f8bb"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user