From 1ae3ffe886718a885cc37370aac956e00b04014a Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 1 Feb 2023 00:02:10 +0000 Subject: [PATCH] add button titles to instance Signed-off-by: Arthur Lu --- scripts/elements.js | 2 ++ scripts/utils.js | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/elements.js b/scripts/elements.js index ded8414..7bba101 100644 --- a/scripts/elements.js +++ b/scripts/elements.js @@ -66,11 +66,13 @@ export class Instance extends HTMLElement { let powerButton = this.shadowElement.querySelector("#power-btn"); powerButton.src = instances[this.status].powerButtonSrc; powerButton.alt = instances[this.status].powerButtonAlt; + powerButton.title = instances[this.status].powerButtonAlt; powerButton.addEventListener("click", this.handlePowerButton.bind(this)); let configButton = this.shadowElement.querySelector("#configure-btn"); configButton.src = instances[this.status].configButtonSrc; configButton.alt = instances[this.status].configButtonAlt; + configButton.title = instances[this.status].configButtonAlt; configButton.addEventListener("click", this.handleConfigButton.bind(this)); if (this.node.status !== "online") { diff --git a/scripts/utils.js b/scripts/utils.js index a0f4efb..61c053e 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -36,21 +36,21 @@ export const resources = { export const instances = { running: { powerButtonSrc: "images/actions/stop.svg", - powerButtonAlt: "shutdown instance", + powerButtonAlt: "Shutdown Instance", configButtonSrc: "images/actions/config-inactive.svg", - configButtonAlt: "configuration disabled" + configButtonAlt: "Configuration Disabled" }, stopped: { powerButtonSrc: "images/actions/start.svg", - powerButtonAlt: "start instance", + powerButtonAlt: "Start Instance", configButtonSrc: "images/actions/config-active.svg", - configButtonAlt: "configure instance" + configButtonAlt: "Configure Instance" }, loading: { powerButtonSrc: "images/actions/loading.svg", - powerButtonAlt: "loading instance", + powerButtonAlt: "Loading Instance", configButtonSrc: "images/actions/config-inactive.svg", - configButtonAlt: "configuration disabled" + configButtonAlt: "Configuration Disabled" } } @@ -71,7 +71,7 @@ function getCookie(cname) { } export async function requestTicket (username, password) { - let response = await requestPVE("/access/ticket", "POST", {username: `${username}@pve`, password: password}, false); + let response = await requestPVE("/access/ticket", "POST", {username: `${username}@ldap`, password: password}, false); return response; }