From 10526d1a6725d3a76a7beb8c55f056635a1b9169 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Thu, 15 Dec 2022 18:04:20 -0800 Subject: [PATCH] add power button html and css --- index.html | 5 +++-- scripts/elements.js | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 6c635bf..2f58f07 100644 --- a/index.html +++ b/index.html @@ -45,8 +45,9 @@
-
- +
+ +
diff --git a/scripts/elements.js b/scripts/elements.js index bbed608..71fce14 100644 --- a/scripts/elements.js +++ b/scripts/elements.js @@ -49,6 +49,9 @@ class Instance extends HTMLElement { let resourceDISK = this.shadowElement.querySelector("#resource-disk"); resourceDISK.innerText = (data.maxdisk / 1073741824).toFixed(3); + + let powerButton = this.shadowElement.querySelector("#power-btn"); + powerButton.innerText = data.status === "running" ? "Shutdown" : "Start" } }