1
0
Fork 0
mirror of https://github.com/bastienwirtz/homer.git synced 2026-07-17 16:38:59 +00:00

fix: rewrite peanut smartcard status

This commit is contained in:
absinthe 2026-06-14 09:13:53 +08:00 committed by Bastien Wirtz
parent c51951d6a8
commit 7098f01433

View file

@ -32,28 +32,18 @@ export default {
}),
computed: {
status_text: function () {
switch (this.ups_status) {
case "OL":
return "online";
case "OB":
return "on battery";
case "LB":
return "low battery";
default:
return "unknown";
}
const status = this.ups_status;
if (status.includes("LB")) return "low battery";
if (status.includes("OB")) return "on battery";
if (status.includes("OL")) return "online";
return "unknown";
},
status_class: function () {
switch (this.ups_status) {
case "OL":
return "online";
case "OB": // On battery
return "pending";
case "LB": // Low battery
return "offline";
default:
return "unknown";
}
const status = this.ups_status;
if (status.includes("LB")) return "offline";
if (status.includes("OB")) return "pending";
if (status.includes("OL")) return "online";
return "unknown";
},
load: function () {
if (this.ups_load) {