move dashboard script block content into own files with new classes to update, render to have a better code overview
Build and Push Docker Container / build-and-push (push) Successful in 3m55s
Build and Push Docker Container / build-and-push (push) Successful in 3m55s
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
class Utils {
|
||||
static safeString(value) {
|
||||
if (value === null || value === undefined || value === "") return "-";
|
||||
return String(value);
|
||||
}
|
||||
|
||||
static toTitle(value) {
|
||||
if (String(value || "").toLowerCase() === "finished") return "Done";
|
||||
return String(value || "").replace(/_/g, " ").replace(/\b\w/g, (ch) => ch.toUpperCase());
|
||||
}
|
||||
|
||||
static formatObservedAtLocal(value) {
|
||||
if (value === null || value === undefined || value === "") return "-";
|
||||
const raw = String(value).trim();
|
||||
const parsed = new Date(raw);
|
||||
if (Number.isNaN(parsed.getTime())) {
|
||||
return Utils.safeString(raw).slice(11, 19);
|
||||
}
|
||||
return parsed.toLocaleTimeString([], {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
second: "2-digit",
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user