fix issues with icon coloring in chrome by switching to img tags

This commit is contained in:
2025-10-28 18:34:42 +00:00
parent 7db0bea35c
commit 2877f7709a
11 changed files with 115 additions and 108 deletions

View File

@@ -16,7 +16,7 @@
padding: 8px; padding: 8px;
} }
.input-grid svg { .input-grid img {
padding: 0; padding: 0;
} }

View File

@@ -100,6 +100,10 @@ img, svg {
color: var(--main-text-color) color: var(--main-text-color)
} }
a img {
vertical-align: unset;
}
hr { hr {
border-color: var(--main-text-color); border-color: var(--main-text-color);
} }

View File

@@ -74,13 +74,13 @@
<div class="w3-card w3-padding"> <div class="w3-card w3-padding">
<div class="flex row nowrap" style="margin-top: 1em; justify-content: space-between;"> <div class="flex row nowrap" style="margin-top: 1em; justify-content: space-between;">
<form id="vm-search" role="search" class="flex row nowrap" tabindex="0"> <form id="vm-search" role="search" class="flex row nowrap" tabindex="0">
<svg role="img" aria-label="Search Instances"><use href="images/common/search.svg#symb"></use></svg> <img alt="Search Instances" aria-label="Search Instances" src="images/common/search.svg#symb">
<input type="search" id="search" class="w3-input w3-border" style="height: 1lh; max-width: fit-content;" aria-label="search instances by name"> <input type="search" id="search" class="w3-input w3-border" style="height: 1lh; max-width: fit-content;" aria-label="search instances by name">
</form> </form>
<!--Add Instance Button & Dialog Template--> <!--Add Instance Button & Dialog Template-->
<button type="button" id="instance-add" class="w3-button" aria-label="create new instance"> <button type="button" id="instance-add" class="w3-button" aria-label="create new instance">
<span class="large" style="margin: 0;">Create Instance</span> <span class="large" style="margin: 0;">Create Instance</span>
<svg class="small" style="height: 1lh; width: 1lh;" role="img" aria-label="Create New Instance"><use href="images/actions/instance/add.svg#symb"></use></svg> <img class="small" style="height: 1lh; width: 1lh;" alt="Create Instance" aria-label="Create Instance" src="images/actions/instance/add.svg#symb">
</button> </button>
<template id="create-instance-dialog"> <template id="create-instance-dialog">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">

View File

@@ -0,0 +1 @@
<svg id="symb" role="img" aria-label="cpu" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"></svg>

After

Width:  |  Height:  |  Size: 104 B

View File

@@ -1,4 +1,4 @@
import { requestPVE, requestAPI, goToPage, getURIData, setAppearance, setSVGSrc, requestDash } from "./utils.js"; import { requestPVE, requestAPI, goToPage, getURIData, setAppearance, setIconSrc, requestDash } from "./utils.js";
import { alert, dialog } from "./dialog.js"; import { alert, dialog } from "./dialog.js";
window.addEventListener("DOMContentLoaded", init); window.addEventListener("DOMContentLoaded", init);
@@ -48,8 +48,8 @@ class VolumeAction extends HTMLElement {
} }
async setStatusLoading () { async setStatusLoading () {
const svg = document.querySelector(`svg[data-volume="${this.dataset.volume}"]`); const icon = document.querySelector(`img[data-volume="${this.dataset.volume}"]`);
setSVGSrc(svg, "images/status/loading.svg"); setIconSrc(icon, "images/status/loading.svg");
} }
async handleDiskDetach () { async handleDiskDetach () {
@@ -247,8 +247,8 @@ class NetworkAction extends HTMLElement {
} }
async setStatusLoading () { async setStatusLoading () {
const svg = document.querySelector(`svg[data-network="${this.dataset.network}"]`); const icon = document.querySelector(`img[data-network="${this.dataset.network}"]`);
setSVGSrc(svg, "images/status/loading.svg"); setIconSrc(icon, "images/status/loading.svg");
} }
async handleNetworkConfig () { async handleNetworkConfig () {
@@ -277,7 +277,7 @@ class NetworkAction extends HTMLElement {
const netID = this.dataset.network; const netID = this.dataset.network;
dialog(this.template, async (result, form) => { dialog(this.template, async (result, form) => {
if (result === "confirm") { if (result === "confirm") {
setSVGSrc(document.querySelector(`svg[data-network="${netID}"]`), "images/status/loading.svg"); setIconSrc(document.querySelector(`svg[data-network="${netID}"]`), "images/status/loading.svg");
const net = `${netID}`; const net = `${netID}`;
const result = await requestAPI(`/cluster/${node}/${type}/${vmid}/net/${net}/delete`, "DELETE"); const result = await requestAPI(`/cluster/${node}/${type}/${vmid}/net/${net}/delete`, "DELETE");
if (result.status !== 200) { if (result.status !== 200) {
@@ -349,8 +349,8 @@ class DeviceAction extends HTMLElement {
} }
async setStatusLoading () { async setStatusLoading () {
const svg = document.querySelector(`svg[data-device="${this.dataset.device}"]`); const icon = document.querySelector(`img[data-device="${this.dataset.device}"]`);
setSVGSrc(svg, "images/status/loading.svg"); setIconSrc(icon, "images/status/loading.svg");
} }
async handleDeviceConfig () { async handleDeviceConfig () {

View File

@@ -103,7 +103,7 @@ class ErrorDialog extends HTMLElement {
</dialog> </dialog>
`; `;
this.dialog = this.shadowRoot.querySelector("dialog"); this.dialog = this.shadowRoot.querySelector("dialog");
this.errors = this.shadowRoot.querySelector("#errors") this.errors = this.shadowRoot.querySelector("#errors");
for (const control of this.shadowRoot.querySelector("#controls").childNodes) { for (const control of this.shadowRoot.querySelector("#controls").childNodes) {
control.addEventListener("click", async (e) => { control.addEventListener("click", async (e) => {
@@ -113,13 +113,13 @@ class ErrorDialog extends HTMLElement {
} }
this.dialog.addEventListener("close", () => { this.dialog.addEventListener("close", () => {
if (this.dialog.returnValue == "ok") {} if (this.dialog.returnValue === "ok") {}
else if (this.dialog.returnValue == "copy") { else if (this.dialog.returnValue === "copy") {
let errors = "" let errors = "";
for (const error of this.errors.childNodes) { for (const error of this.errors.childNodes) {
errors += `${error.innerText}\n` errors += `${error.innerText}\n`;
} }
navigator.clipboard.writeText(errors) navigator.clipboard.writeText(errors);
} }
this.parentElement.removeChild(this); this.parentElement.removeChild(this);
}); });

View File

@@ -1,5 +1,5 @@
import { requestPVE, requestAPI, setAppearance, getSearchSettings, requestDash, setSVGSrc, setSVGAlt } from "./utils.js"; import { requestPVE, requestAPI, setAppearance, getSearchSettings, requestDash, setIconSrc, setIconAlt } from "./utils.js";
import { alert, dialog } from "./dialog.js"; import { alert, dialog, error } from "./dialog.js";
import { setupClientSync } from "./clientsync.js"; import { setupClientSync } from "./clientsync.js";
import wfaInit from "../modules/wfa.js"; import wfaInit from "../modules/wfa.js";
@@ -120,6 +120,7 @@ class InstanceCard extends HTMLElement {
} }
const powerButton = this.shadowRoot.querySelector("#power-btn"); const powerButton = this.shadowRoot.querySelector("#power-btn");
if (powerButton !== null) {
if (powerButton.classList.contains("clickable")) { if (powerButton.classList.contains("clickable")) {
powerButton.onclick = this.handlePowerButton.bind(this); powerButton.onclick = this.handlePowerButton.bind(this);
powerButton.onkeydown = (event) => { powerButton.onkeydown = (event) => {
@@ -129,8 +130,10 @@ class InstanceCard extends HTMLElement {
} }
}; };
} }
}
const deleteButton = this.shadowRoot.querySelector("#delete-btn"); const deleteButton = this.shadowRoot.querySelector("#delete-btn");
if (deleteButton !== null) {
if (deleteButton.classList.contains("clickable")) { if (deleteButton.classList.contains("clickable")) {
deleteButton.onclick = this.handleDeleteButton.bind(this); deleteButton.onclick = this.handleDeleteButton.bind(this);
deleteButton.onkeydown = (event) => { deleteButton.onkeydown = (event) => {
@@ -141,15 +144,16 @@ class InstanceCard extends HTMLElement {
}; };
} }
} }
}
setStatusLoading () { setStatusLoading () {
this.status = "loading"; this.status = "loading";
const statusicon = this.shadowRoot.querySelector("#status"); const statusicon = this.shadowRoot.querySelector("#status");
const powerbtn = this.shadowRoot.querySelector("#power-btn"); const powerbtn = this.shadowRoot.querySelector("#power-btn");
setSVGSrc(statusicon, "images/status/loading.svg"); setIconSrc(statusicon, "images/status/loading.svg");
setSVGAlt(statusicon, "instance is loading"); setIconAlt(statusicon, "instance is loading");
setSVGSrc(powerbtn, "images/status/loading.svg"); setIconSrc(powerbtn, "images/status/loading.svg");
setSVGAlt(powerbtn, ""); setIconAlt(powerbtn, "");
} }
async handlePowerButton () { async handlePowerButton () {

View File

@@ -192,15 +192,10 @@ export function setAppearance () {
} }
// assumes href is path to svg, and id to grab is #symb // assumes href is path to svg, and id to grab is #symb
export function setSVGSrc (svgElem, href) { export function setIconSrc (icon, path) {
let useElem = svgElem.querySelector("use"); icon.setAttribute("src", path);
if (!useElem) {
useElem = document.createElementNS("http://www.w3.org/2000/svg", "use");
}
useElem.setAttribute("href", `${href}#symb`);
svgElem.append(useElem);
} }
export function setSVGAlt (svgElem, alt) { export function setIconAlt (icon, alt) {
svgElem.setAttribute("aria-label", alt); icon.setAttribute("alt", alt);
} }

View File

@@ -23,9 +23,9 @@
<p class="w3-col l6 m6 hide-small">{{.Notes}}</p> <p class="w3-col l6 m6 hide-small">{{.Notes}}</p>
<p class="w3-col l2 hide-medium">{{.SizeFormatted}}</p> <p class="w3-col l2 hide-medium">{{.SizeFormatted}}</p>
<div class="w3-col l2 m2 s4 flex row nowrap" style="height: 1lh;"> <div class="w3-col l2 m2 s4 flex row nowrap" style="height: 1lh;">
<svg id="edit-btn" class="clickable" aria-label="change notes"><use href="images/actions/backups/config.svg#symb"></svg> <img id="edit-btn" class="clickable" aria-label="change notes" src="images/actions/backups/config.svg#symb">
<svg id="delete-btn" class="clickable" aria-label="delete backup" role="button" tabindex=0><use href="images/actions/backups/delete-active.svg#symb"></svg> <img id="delete-btn" class="clickable" aria-label="delete backup" role="button" tabindex=0 src="images/actions/backups/delete-active.svg#symb">
<svg id="restore-btn" class="clickable" aria-label="restore from backup" role="button" tabindex=0><use href="images/actions/backups/restore.svg#symb"></svg> <img id="restore-btn" class="clickable" aria-label="restore from backup" role="button" tabindex=0 src="images/actions/backups/restore.svg#symb">
</div> </div>
</div> </div>
<template id="edit-dialog"> <template id="edit-dialog">
@@ -100,7 +100,7 @@
{{define "backups-add-backup"}} {{define "backups-add-backup"}}
<button type="button" id="backup-add" class="w3-button" aria-label="Create Backup"> <button type="button" id="backup-add" class="w3-button" aria-label="Create Backup">
<span class="large" style="margin: 0;">Create Backup</span> <span class="large" style="margin: 0;">Create Backup</span>
<svg class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Create Backup"><use href="images/actions/network/add.svg#symb"></use></svg> <img class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Create Backup" src="images/actions/network/add.svg#symb">
</button> </button>
<template id="create-backup-dialog"> <template id="create-backup-dialog">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="modules/w3.css">

View File

@@ -1,26 +1,26 @@
{{define "proctype-input"}} {{define "proctype-input"}}
<svg aria-label="CPU Type"><use href="images/resources/cpu.svg#symb"></svg> <img aria-label="CPU Type" src="images/resources/cpu.svg#symb">
<label for="proctype">CPU Type</label> <label for="proctype">CPU Type</label>
{{template "select" .}} {{template "select" .}}
<div></div> <div></div>
{{end}} {{end}}
{{define "cores-input"}} {{define "cores-input"}}
<svg aria-label="CPU Amount"><use href="images/resources/cpu.svg#symb"></svg> <img aria-label="CPU Amount" src="images/resources/cpu.svg#symb">
<label for="cores">CPU Amount</label> <label for="cores">CPU Amount</label>
<input id="cores" name="cores" class="w3-input w3-border" type="number" required value="{{.}}"> <input id="cores" name="cores" class="w3-input w3-border" type="number" required value="{{.}}">
<p>Cores</p> <p>Cores</p>
{{end}} {{end}}
{{define "memory-input"}} {{define "memory-input"}}
<svg aria-label="Memory Amount"><use href="images/resources/ram.svg#symb"></svg> <img aria-label="Memory Amount" src="images/resources/ram.svg#symb">
<label for="ram">Memory</label> <label for="ram">Memory</label>
<input id="ram" name="ram" class="w3-input w3-border" type="number" required value="{{.}}"> <input id="ram" name="ram" class="w3-input w3-border" type="number" required value="{{.}}">
<p>MiB</p> <p>MiB</p>
{{end}} {{end}}
{{define "swap-input"}} {{define "swap-input"}}
<svg aria-label="Swap Amount"><use href="images/resources/swap.svg#symb"></svg> <img aria-label="Swap Amount" src="images/resources/swap.svg#symb">
<label for="swap">Swap</label> <label for="swap">Swap</label>
<input id="swap" name="swap" class="w3-input w3-border" type="number" required value="{{.}}"> <input id="swap" name="swap" class="w3-input w3-border" type="number" required value="{{.}}">
<p>MiB</p> <p>MiB</p>
@@ -46,7 +46,7 @@
{{define "volumes-add-disk"}} {{define "volumes-add-disk"}}
<button type="button" id="disk-add" class="w3-button" aria-label="Add New Disk"> <button type="button" id="disk-add" class="w3-button" aria-label="Add New Disk">
<span class="large" style="margin: 0;">Add Disk</span> <span class="large" style="margin: 0;">Add Disk</span>
<svg class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Add New Disk"><use href="images/actions/disk/add-disk.svg#symb"></use></svg> <img class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Add New Disk" src="images/actions/disk/add-disk.svg#symb">
</button> </button>
<template id="add-disk-dialog"> <template id="add-disk-dialog">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
@@ -75,7 +75,7 @@
{{define "volumes-add-cd"}} {{define "volumes-add-cd"}}
<button type="button" id="cd-add" class="w3-button" aria-label="Add New CD"> <button type="button" id="cd-add" class="w3-button" aria-label="Add New CD">
<span class="large" style="margin: 0;">Mount CD</span> <span class="large" style="margin: 0;">Mount CD</span>
<svg class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Add New CDROM"><use href="images/actions/disk/add-cd.svg#symb"></use></svg> <img class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Add New CDROM" src="images/actions/disk/add-cd.svg#symb">
</button> </button>
<template id="add-cd-dialog"> <template id="add-cd-dialog">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
@@ -97,7 +97,7 @@
{{end}} {{end}}
{{define "volume-rootfs"}} {{define "volume-rootfs"}}
<svg data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive"><use href="images/resources/drive.svg#symb"></svg> <img data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive" src="images/resources/drive.svg#symb">
<p>{{.Name}}</p> <p>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -109,7 +109,7 @@
{{end}} {{end}}
{{define "volume-mp"}} {{define "volume-mp"}}
<svg data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive"><use href="images/resources/drive.svg#symb"></svg> <img data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive" src="images/resources/drive.svg#symb">
<p>{{.Name}}</p> <p>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -121,7 +121,7 @@
{{end}} {{end}}
{{define "volume-ide"}} {{define "volume-ide"}}
<svg data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive"><use href="images/resources/drive.svg#symb"></svg> <img data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive" src="images/resources/drive.svg#symb">
<p>{{.Name}}</p> <p>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -133,7 +133,7 @@
{{end}} {{end}}
{{define "volume-scsi"}} {{define "volume-scsi"}}
<svg data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive"><use href="images/resources/drive.svg#symb"></svg> <img data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive" src="images/resources/drive.svg#symb">
<p>{{.Name}}</p> <p>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -145,7 +145,7 @@
{{end}} {{end}}
{{define "volume-unused"}} {{define "volume-unused"}}
<svg data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive"><use href="images/resources/drive.svg#symb"></svg> <img data-volume={{.Name}} xmlns="http://www.w3.org/2000/svg" aria-label="Drive" src="images/resources/drive.svg#symb">
<p>{{.Name}}</p> <p>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -160,7 +160,7 @@
<volume-action data-type="move" data-volume="{{.Name}}"> <volume-action data-type="move" data-volume="{{.Name}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Move {{.Name}}"><use href="images/actions/disk/move-active.svg#symb"></svg> <img class="clickable" aria-label="Move {{.Name}}" src="images/actions/disk/move-active.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -186,7 +186,7 @@
<volume-action data-type="none" data-volume="{{.Name}}"> <volume-action data-type="none" data-volume="{{.Name}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg aria-label=""><use href="images/actions/disk/move-inactive.svg#symb"></svg> <img aria-label="" src="images/actions/disk/move-inactive.svg#symb">
</template> </template>
</volume-action> </volume-action>
{{end}} {{end}}
@@ -195,7 +195,7 @@
<volume-action data-type="resize" data-volume="{{.Name}}"> <volume-action data-type="resize" data-volume="{{.Name}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Resize {{.Name}}"><use href="images/actions/disk/resize-active.svg#symb"></svg> <img class="clickable" aria-label="Resize {{.Name}}" src="images/actions/disk/resize-active.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -221,7 +221,7 @@
<volume-action data-type="none" data-volume="{{.Name}}"> <volume-action data-type="none" data-volume="{{.Name}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg aria-label=""><use href="images/actions/disk/resize-inactive.svg#symb"></svg> <img aria-label="" src="images/actions/disk/resize-inactive.svg#symb">
</template> </template>
</volume-action> </volume-action>
{{end}} {{end}}
@@ -230,7 +230,7 @@
<volume-action data-type="delete" data-volume="{{.Name}}"> <volume-action data-type="delete" data-volume="{{.Name}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Delete {{.Name}}"><use href="images/actions/disk/delete-active.svg#symb"></svg> <img class="clickable" aria-label="Delete {{.Name}}" src="images/actions/disk/delete-active.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -255,7 +255,7 @@
<volume-action data-type="none" data-volume="{{.Name}}"> <volume-action data-type="none" data-volume="{{.Name}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg aria-label=""><use href="images/actions/disk/delete-inactive.svg#symb"></svg> <img aria-label="" src="images/actions/disk/delete-inactive.svg#symb">
</template> </template>
</volume-action> </volume-action>
{{end}} {{end}}
@@ -264,7 +264,7 @@
<volume-action data-type="attach" data-volume="{{.Name}}"> <volume-action data-type="attach" data-volume="{{.Name}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Attach {{.Name}}"><use href="images/actions/disk/attach.svg#symb"></svg> <img class="clickable" aria-label="Attach {{.Name}}" src="images/actions/disk/attach.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -297,7 +297,7 @@
<volume-action data-type="detach" data-volume="{{.Name}}"> <volume-action data-type="detach" data-volume="{{.Name}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Detach {{.Name}}"><use href="images/actions/disk/detach.svg#symb"></svg> <img class="clickable" aria-label="Detach {{.Name}}" src="images/actions/disk/detach.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -322,7 +322,7 @@
<volume-action data-type="none"> <volume-action data-type="none">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg aria-label=""></svg> <img aria-label="" src="images/common/blank.svg">
</template> </template>
</volume-action> </volume-action>
{{end}} {{end}}
@@ -336,7 +336,7 @@
{{define "nets-add-net"}} {{define "nets-add-net"}}
<button type="button" id="network-add" class="w3-button" aria-label="Add New Network Interface"> <button type="button" id="network-add" class="w3-button" aria-label="Add New Network Interface">
<span class="large" style="margin: 0;">Add Network</span> <span class="large" style="margin: 0;">Add Network</span>
<svg class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Add New Network Interface"><use href="images/actions/network/add.svg#symb"></use></svg> <img class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Add New Network Interface" src="images/actions/network/add.svg#symb">
</button> </button>
<template id="add-net-dialog"> <template id="add-net-dialog">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
@@ -361,14 +361,14 @@
{{end}} {{end}}
{{define "net"}} {{define "net"}}
<svg data-network="{{.Net_ID}}" aria-label="Net {{.Net_ID}}"><use href="images/resources/network.svg#symb"></svg> <img data-network="{{.Net_ID}}" aria-label="Net {{.Net_ID}}" src="images/resources/network.svg#symb">
<p>{{.Net_ID}}</p> <p>{{.Net_ID}}</p>
<p>{{.Value}}</p> <p>{{.Value}}</p>
<div> <div>
<network-action data-type="config" data-network="{{.Net_ID}}" data-value="{{.Value}}"> <network-action data-type="config" data-network="{{.Net_ID}}" data-value="{{.Value}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Configure Net {{.Net_ID}}"><use href="images/actions/network/config.svg#symb"></svg> <img class="clickable" aria-label="Configure Net {{.Net_ID}}" src="images/actions/network/config.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -390,7 +390,7 @@
<network-action data-type="delete" data-network="{{.Net_ID}}" data-value="{{.Value}}"> <network-action data-type="delete" data-network="{{.Net_ID}}" data-value="{{.Value}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Delete Net {{.Net_ID}}"><use href="images/actions/network/delete-active.svg#symb"></svg> <img class="clickable" aria-label="Delete Net {{.Net_ID}}" src="images/actions/network/delete-active.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -421,7 +421,7 @@
{{define "devices-add-device"}} {{define "devices-add-device"}}
<button type="button" id="device-add" class="w3-button" aria-label="Add New PCIe Device"> <button type="button" id="device-add" class="w3-button" aria-label="Add New PCIe Device">
<span class="large" style="margin: 0;">Add Device</span> <span class="large" style="margin: 0;">Add Device</span>
<svg class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Add New PCIe Device"><use href="images/actions/device/add.svg#symb"></use></svg> <img class="small" role="img" style="height: 1lh; width: 1lh;" aria-label="Add New PCIe Device" src="images/actions/device/add.svg#symb">
</button> </button>
<template id="add-device-dialog"> <template id="add-device-dialog">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
@@ -444,14 +444,14 @@
{{end}} {{end}}
{{define "device"}} {{define "device"}}
<svg data-device="{{.Device_ID}}" aria-label="Device {{.Device_ID}}"><use href="images/resources/device.svg#symb"></svg> <img data-device="{{.Device_ID}}" aria-label="Device {{.Device_ID}}" src="images/resources/device.svg#symb">
<p>{{.Device_ID}}</p> <p>{{.Device_ID}}</p>
<p>{{.Device_Name}}</p> <p>{{.Device_Name}}</p>
<div> <div>
<device-action data-type="config" data-device="{{.Device_ID}}" data-value="{{.Value}}"> <device-action data-type="config" data-device="{{.Device_ID}}" data-value="{{.Value}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Configure Device {{.Device_ID}}"><use href="images/actions/device/config.svg#symb"></svg> <img class="clickable" aria-label="Configure Device {{.Device_ID}}" src="images/actions/device/config.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -473,7 +473,7 @@
<device-action data-type="delete" data-device="{{.Device_ID}}" data-value="{{.Value}}"> <device-action data-type="delete" data-device="{{.Device_ID}}" data-value="{{.Value}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/style.css">
<svg class="clickable" aria-label="Delete Device {{.Device_ID}}"><use href="images/actions/device/delete-active.svg#symb"></svg> <img class="clickable" aria-label="Delete Device {{.Device_ID}}" src="images/actions/device/delete-active.svg#symb">
<template id="dialog-template"> <template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt" style="text-align: center;"> <p class="w3-large" id="prompt" style="text-align: center;">
@@ -537,15 +537,15 @@
{{define "boot-target"}} {{define "boot-target"}}
{{if .volume_id}} {{if .volume_id}}
<div class="draggable-item" data-value="{{.volume_id}}" style="display: grid; grid-template-columns: auto auto 8ch 1fr; column-gap: 10px; align-items: center;"> <div class="draggable-item" data-value="{{.volume_id}}" style="display: grid; grid-template-columns: auto auto 8ch 1fr; column-gap: 10px; align-items: center;">
<svg aria-label="Drag"><use href="images/actions/drag.svg#symb"></use></svg> <img aria-label="Drag" src="images/actions/drag.svg#symb">
<svg aria-label="Volume"><use href="images/resources/drive.svg#symb"></use></svg> <img aria-label="Volume" src="images/resources/drive.svg#symb">
<p style="margin: 0px;">{{.volume_id}}</p> <p style="margin: 0px;">{{.volume_id}}</p>
<p style="margin: 0px; overflow: hidden; white-space: nowrap;">{{.file}}</p> <p style="margin: 0px; overflow: hidden; white-space: nowrap;">{{.file}}</p>
</div> </div>
{{else if .net_id}} {{else if .net_id}}
<div class="draggable-item" data-value="{{.net_id}}" style="display: grid; grid-template-columns: auto auto 8ch 1fr; column-gap: 10px; align-items: center;"> <div class="draggable-item" data-value="{{.net_id}}" style="display: grid; grid-template-columns: auto auto 8ch 1fr; column-gap: 10px; align-items: center;">
<svg aria-label="Drag"><use href="images/actions/drag.svg#symb"></use></svg> <img aria-label="Drag" src="images/actions/drag.svg#symb">
<svg aria-label="Net"><use href="images/resources/network.svg#symb"></use></svg> <img aria-label="Net" src="images/resources/network.svg#symb">
<p style="margin: 0px;">{{.net_id}}</p> <p style="margin: 0px;">{{.net_id}}</p>
<p style="margin: 0px; overflow: hidden; white-space: nowrap;">{{.value}}</p> <p style="margin: 0px; overflow: hidden; white-space: nowrap;">{{.value}}</p>
</div> </div>

View File

@@ -9,13 +9,16 @@
padding: 0; padding: 0;
width: fit-content; width: fit-content;
} }
a, svg { a, svg, img {
line-height: 1em; line-height: 1em;
height: 1em; height: 1em;
width: 1em; width: 1em;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
a img {
vertical-align: unset;
}
#instance-name { #instance-name {
overflow-x: hidden; overflow-x: hidden;
min-width: 0; min-width: 0;
@@ -57,53 +60,53 @@
<p class="hide-small">{{.Type}}</p> <p class="hide-small">{{.Type}}</p>
<div class="flex row nowrap hide-tiny"> <div class="flex row nowrap hide-tiny">
{{if eq .Status "running"}} {{if eq .Status "running"}}
<svg id="status" aria-label="instance is running"><use href="images/status/active.svg#symb"></svg> <img id="status" aria-label="instance is running" src="images/status/active.svg#symb">
{{else if eq .Status "stopped"}} {{else if eq .Status "stopped"}}
<svg id="status" aria-label="instance is stopped"><use href="images/status/inactive.svg#symb"></svg> <img id="status" aria-label="instance is stopped" src="images/status/inactive.svg#symb">
{{else if eq .Status "loading"}} {{else if eq .Status "loading"}}
<svg id="status" aria-label="instance is loading"><use href="images/status/loading.svg#symb"></svg> <img id="status" aria-label="instance is loading" src="images/status/loading.svg#symb">
{{else}} {{else}}
<svg id="status" aria-label="instance is loading"><use href="images/status/loading.svg#symb"></svg> <img id="status" aria-label="instance is loading" src="images/status/loading.svg#symb">
{{end}} {{end}}
<p>{{.Status}}</p> <p>{{.Status}}</p>
</div> </div>
<p class="hide-medium">{{.Node}}</p> <p class="hide-medium">{{.Node}}</p>
<div class="flex row nowrap hide-medium"> <div class="flex row nowrap hide-medium">
{{if eq .NodeStatus "online"}} {{if eq .NodeStatus "online"}}
<svg aria-label="node is online"><use href="images/status/active.svg#symb"></svg> <img aria-label="node is online" src="images/status/active.svg#symb">
{{else if eq .NodeStatus "offline"}} {{else if eq .NodeStatus "offline"}}
<svg aria-label="node is offline"><use href="images/status/inactive.svg#symb"></svg> <img aria-label="node is offline" src="images/status/inactive.svg#symb">
{{else if eq .NodeStatus "unknown"}} {{else if eq .NodeStatus "unknown"}}
<svg aria-label="node is offline"><use href="images/status/inactive.svg#symb"></svg> <img aria-label="node is offline" src="images/status/inactive.svg#symb">
{{else}} {{else}}
{{end}} {{end}}
<p>{{.NodeStatus}}</p> <p>{{.NodeStatus}}</p>
</div> </div>
<div class="flex row nowrap" style="height: 1lh;"> <div class="flex row nowrap" style="height: 1lh;">
{{if and (eq .NodeStatus "online") (eq .Status "running")}} {{if and (eq .NodeStatus "online") (eq .Status "running")}}
<svg id="power-btn" class="clickable" aria-label="shutdown instance" role="button" tabindex=0><use href="images/actions/instance/stop.svg#symb"></svg> <img id="power-btn" class="clickable" aria-label="shutdown instance" role="button" tabindex=0 src="images/actions/instance/stop.svg#symb">
<svg id="configure-btn" aria-disabled="true" role="none"><use href="images/actions/instance/config-inactive.svg#symb"></svg> <img id="configure-btn" aria-disabled="true" role="none" src="images/actions/instance/config-inactive.svg#symb">
<svg id="backup-btn" aria-disabled="true" role="none"><use href="images/actions/instance/backup-inactive.svg#symb"></svg> <img id="backup-btn" aria-disabled="true" role="none" src="images/actions/instance/backup-inactive.svg#symb">
<a href="{{.ConsolePath}}" target="_blank"> <a href="{{.ConsolePath}}" target="_blank">
<svg id="console-btn" class="clickable" aria-label="open console"><use href="images/actions/instance/console-active.svg#symb"></svg> <img id="console-btn" class="clickable" aria-label="open console" src="images/actions/instance/console-active.svg#symb">
</a> </a>
<svg id="delete-btn" aria-disabled="true" role="none"><use href="images/actions/instance/delete-inactive.svg#symb"></svg> <img id="delete-btn" aria-disabled="true" role="none" src="images/actions/instance/delete-inactive.svg#symb">
{{else if and (eq .NodeStatus "online") (eq .Status "stopped")}} {{else if and (eq .NodeStatus "online") (eq .Status "stopped")}}
<svg id="power-btn" class="clickable" aria-label="start instance" role="button" tabindex=0><use href="images/actions/instance/start.svg#symb"></svg> <img id="power-btn" class="clickable" aria-label="start instance" role="button" tabindex=0 src="images/actions/instance/start.svg#symb">
<a href="{{.ConfigPath}}"> <a href="{{.ConfigPath}}">
<svg id="configure-btn" class="clickable" aria-label="change configuration"><use href="images/actions/instance/config-active.svg#symb"></svg> <img id="configure-btn" class="clickable" aria-label="change configuration" src="images/actions/instance/config-active.svg#symb">
</a> </a>
<a href="{{.BackupsPath}}"> <a href="{{.BackupsPath}}">
<svg id="backup-btn" class="clickable" aria-label="manage backups"><use href="images/actions/instance/backup-active.svg#symb"></svg> <img id="backup-btn" class="clickable" aria-label="manage backups" src="images/actions/instance/backup-active.svg#symb">
</a> </a>
<svg id="console-btn" aria-disabled="true" role="none"><use href="images/actions/instance/console-inactive.svg#symb"></svg> <img id="console-btn" aria-disabled="true" role="none" src="images/actions/instance/console-inactive.svg#symb">
<svg id="delete-btn" class="clickable" aria-label="delete instance" role="button" tabindex=0><use href="images/actions/instance/delete-active.svg#symb"></svg> <img id="delete-btn" class="clickable" aria-label="delete instance" role="button" tabindex=0 src="images/actions/instance/delete-active.svg#symb">
{{else if and (eq .NodeStatus "online") (eq .Status "loading")}} {{else if and (eq .NodeStatus "online") (eq .Status "loading")}}
<svg id="power-btn" aria-disabled="true" role="none"><use href="images/actions/instance/loading.svg#symb"></svg> <img id="power-btn" aria-disabled="true" role="none" src="images/actions/instance/loading.svg#symb">
<svg id="configure-btn" aria-disabled="true" role="none"><use href="images/actions/instance/config-inactive.svg#symb"></svg> <img id="configure-btn" aria-disabled="true" role="none" src="images/actions/instance/config-inactive.svg#symb">
<svg id="backup-btn" aria-disabled="true" role="none"><use href="images/actions/instance/backup-inactive.svg#symb"></svg> <img id="backup-btn" aria-disabled="true" role="none" src="images/actions/instance/backup-inactive.svg#symb">
<svg id="console-btn" aria-disabled="true" role="none"><use href="images/actions/instance/console-inactive.svg#symb"></svg> <img id="console-btn" aria-disabled="true" role="none" src="images/actions/instance/console-inactive.svg#symb">
<svg id="delete-btn" aria-disabled="true" role="none"><use href="images/actions/instance/delete-inactive.svg#symb"></svg> <img id="delete-btn" aria-disabled="true" role="none" src="images/actions/instance/delete-inactive.svg#symb">
{{else}} {{else}}
{{end}} {{end}}
</div> </div>