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:
parent
c51951d6a8
commit
7098f01433
1 changed files with 10 additions and 20 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue