add button titles to instance

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-02-01 00:02:10 +00:00
parent 7f9130b33f
commit 1ae3ffe886
2 changed files with 9 additions and 7 deletions

View File

@ -66,11 +66,13 @@ export class Instance extends HTMLElement {
let powerButton = this.shadowElement.querySelector("#power-btn"); let powerButton = this.shadowElement.querySelector("#power-btn");
powerButton.src = instances[this.status].powerButtonSrc; powerButton.src = instances[this.status].powerButtonSrc;
powerButton.alt = instances[this.status].powerButtonAlt; powerButton.alt = instances[this.status].powerButtonAlt;
powerButton.title = instances[this.status].powerButtonAlt;
powerButton.addEventListener("click", this.handlePowerButton.bind(this)); powerButton.addEventListener("click", this.handlePowerButton.bind(this));
let configButton = this.shadowElement.querySelector("#configure-btn"); let configButton = this.shadowElement.querySelector("#configure-btn");
configButton.src = instances[this.status].configButtonSrc; configButton.src = instances[this.status].configButtonSrc;
configButton.alt = instances[this.status].configButtonAlt; configButton.alt = instances[this.status].configButtonAlt;
configButton.title = instances[this.status].configButtonAlt;
configButton.addEventListener("click", this.handleConfigButton.bind(this)); configButton.addEventListener("click", this.handleConfigButton.bind(this));
if (this.node.status !== "online") { if (this.node.status !== "online") {

View File

@ -36,21 +36,21 @@ export const resources = {
export const instances = { export const instances = {
running: { running: {
powerButtonSrc: "images/actions/stop.svg", powerButtonSrc: "images/actions/stop.svg",
powerButtonAlt: "shutdown instance", powerButtonAlt: "Shutdown Instance",
configButtonSrc: "images/actions/config-inactive.svg", configButtonSrc: "images/actions/config-inactive.svg",
configButtonAlt: "configuration disabled" configButtonAlt: "Configuration Disabled"
}, },
stopped: { stopped: {
powerButtonSrc: "images/actions/start.svg", powerButtonSrc: "images/actions/start.svg",
powerButtonAlt: "start instance", powerButtonAlt: "Start Instance",
configButtonSrc: "images/actions/config-active.svg", configButtonSrc: "images/actions/config-active.svg",
configButtonAlt: "configure instance" configButtonAlt: "Configure Instance"
}, },
loading: { loading: {
powerButtonSrc: "images/actions/loading.svg", powerButtonSrc: "images/actions/loading.svg",
powerButtonAlt: "loading instance", powerButtonAlt: "Loading Instance",
configButtonSrc: "images/actions/config-inactive.svg", 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) { 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; return response;
} }