move all static assets under /websrc/* endpoint
tronnet/workflows: Static Analysis -- Golang / static-go (push) Failing after 8s
tronnet/workflows: Code Style -- Web Components / style-web (push) Successful in 34s

This commit is contained in:
alu committed 2026-10-20 23:27:28 +00:00
1 parent f3aa769fb7
commit db8ed2e830
16 files changed
+139 -163

No files matched your search

+7 -25
View File
@@ -6,6 +6,7 @@ import (
"log"
"proxmoxaas-dashboard/app/common"
"proxmoxaas-dashboard/app/routes"
"strings"
"web" // go will complain here until the first build
"github.com/gin-gonic/gin"
@@ -49,31 +50,12 @@ func Run() {
// setup static resources under web (css, images, modules, scripts)
func ServeStatic(router *gin.Engine, m *minify.M) {
css := common.MinifyStatic(m, web.CSS_fs)
router.GET("/css/*css", func(c *gin.Context) {
path, _ := c.Params.Get("css")
data := css[fmt.Sprintf("css%s", path)]
c.Header("Content-Encoding", data.MimeType.Encoding)
c.Data(200, data.MimeType.Type, []byte(data.Data))
})
images := common.MinifyStatic(m, web.Images_fs)
router.GET("/images/*image", func(c *gin.Context) {
path, _ := c.Params.Get("image")
data := images[fmt.Sprintf("images%s", path)]
c.Header("Content-Encoding", data.MimeType.Encoding)
c.Data(200, data.MimeType.Type, []byte(data.Data))
})
modules := common.MinifyStatic(m, web.Modules_fs)
router.GET("/modules/*module", func(c *gin.Context) {
path, _ := c.Params.Get("module")
data := modules[fmt.Sprintf("modules%s", path)]
c.Header("Content-Encoding", data.MimeType.Encoding)
c.Data(200, data.MimeType.Type, []byte(data.Data))
})
scripts := common.MinifyStatic(m, web.Scripts_fs)
router.GET("/scripts/*script", func(c *gin.Context) {
path, _ := c.Params.Get("script")
data := scripts[fmt.Sprintf("scripts%s", path)]
static := common.MinifyStatic(m, web.Static)
router.GET("/websrc/*path", func(c *gin.Context) {
path, _ := c.Params.Get("path")
trimed_path := strings.Replace(path, "/", "", 1) // replace leading "/" captured by *path
data := static[trimed_path]
fmt.Println(path)
c.Header("Content-Encoding", data.MimeType.Encoding)
c.Data(200, data.MimeType.Type, []byte(data.Data))
})
+1 -7
View File
@@ -5,16 +5,10 @@ import (
)
//go:embed css/*
var CSS_fs embed.FS
//go:embed images/*
var Images_fs embed.FS
//go:embed modules/*
var Modules_fs embed.FS
//go:embed scripts/*
var Scripts_fs embed.FS
var Static embed.FS
//go:embed html/*
//go:embed templates/*
+6 -6
View File
@@ -2,9 +2,9 @@
<html lang="en">
<head>
{{template "head" .}}
<script src="scripts/account.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js">
<script src="websrc/scripts/account.js" type="module"></script>
<link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="websrc/scripts/dialog.js">
<style>
@media screen and (width >= 1264px){
.resource-container {
@@ -48,9 +48,9 @@
{{end}}
</main>
<template id="change-password-dialog">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
Change Password
+3 -3
View File
@@ -2,9 +2,9 @@
<html lang="en">
<head>
{{template "head" .}}
<script src="scripts/backups.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js">
<script src="websrc/scripts/backups.js" type="module"></script>
<link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="websrc/scripts/dialog.js">
<style>
</style>
</head>
+5 -5
View File
@@ -2,11 +2,11 @@
<html lang="en">
<head>
{{template "head" .}}
<script src="scripts/config.js" type="module"></script>
<script src="scripts/draggable.js" type="module"></script>
<script src="modules/Sortable.min.js"></script>
<link rel="modulepreload" href="scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js">
<script src="websrc/scripts/config.js" type="module"></script>
<script src="websrc/scripts/draggable.js" type="module"></script>
<script src="websrc/modules/Sortable.min.js"></script>
<link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="websrc/scripts/dialog.js">
<style>
.input-grid p, .input-grid div {
margin-top: 0;
+7 -7
View File
@@ -2,11 +2,11 @@
<html lang="en">
<head>
{{template "head" .}}
<script src="scripts/index.js" type="module"></script>
<script src="modules/wfa.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js">
<link rel="modulepreload" href="scripts/clientsync.js">
<script src="websrc/scripts/index.js" type="module"></script>
<script src="websrc/modules/wfa.js" type="module"></script>
<link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="websrc/scripts/dialog.js">
<link rel="modulepreload" href="websrc/scripts/clientsync.js">
<style>
@media screen and (width >= 440px) {
#vm-search {
@@ -72,13 +72,13 @@
<div class="w3-card w3-padding">
<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">
<button type="submit" id="submit" class="w3-button" style="padding: 0; width: 1em; height: 1em; line-height: 1em;"><img alt="Search Instances" aria-label="Search Instances" src="images/common/search.svg#symb"></button>
<button type="submit" id="submit" class="w3-button" style="padding: 0; width: 1em; height: 1em; line-height: 1em;"><img alt="Search Instances" aria-label="Search Instances" src="websrc/images/common/search.svg#symb"></button>
<input type="search" id="search" class="w3-input w3-border" style="height: 1lh; max-width: fit-content;" aria-label="search instances by name">
</form>
<!--Add Instance Button & Dialog Template-->
<button type="button" id="instance-add" class="w3-button" aria-label="create new instance">
<span class="large" style="margin: 0;">Create Instance</span>
<img class="small" style="height: 1lh; width: 1lh;" alt="Create Instance" aria-label="Create Instance" src="images/actions/instance/add.svg#symb">
<img class="small" style="height: 1lh; width: 1lh;" alt="Create Instance" aria-label="Create Instance" src="websrc/images/actions/instance/add.svg#symb">
</button>
<template id="create-instance-dialog">
<dialog class="w3-container w3-card w3-border-0">
+3 -3
View File
@@ -2,9 +2,9 @@
<html lang="en">
<head>
{{template "head" .}}
<script src="scripts/login.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js">
<script src="websrc/scripts/login.js" type="module"></script>
<link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="websrc/scripts/dialog.js">
</head>
<body>
{{template "header" .}}
+2 -2
View File
@@ -2,8 +2,8 @@
<html lang="en">
<head>
{{template "head" .}}
<script src="scripts/settings.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js">
<script src="websrc/scripts/settings.js" type="module"></script>
<link rel="modulepreload" href="websrc/scripts/utils.js">
<style>
label {
display: flex;
+3 -3
View File
@@ -50,9 +50,9 @@ class ErrorDialog extends HTMLElement {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = `
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/form.css">
<style>
#errors {
margin-bottom: 0;
+1 -1
View File
@@ -1,5 +1,5 @@
const blank = document.createElement("img");
blank.src = "images/common/blank.png"; // for whatever reason an svg does NOT work here
blank.src = "websrc/images/common/blank.png"; // for whatever reason an svg does NOT work here
class DraggableContainer extends HTMLElement {
shadowRoot = null;
+1 -1
View File
@@ -10,7 +10,7 @@ var wfa;
async function init () {
setAppearance();
wfa = await wfaInit("modules/wfa.wasm.gz");
wfa = await wfaInit("websrc/modules/wfa.wasm.gz");
initInstances();
document.querySelector("#instance-add").addEventListener("click", handleInstanceAddButton);
+18 -18
View File
@@ -1,8 +1,8 @@
{{define "backup-card"}}
<backup-card data-volid="{{.Volid}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<style>
* {
margin: 0;
@@ -19,15 +19,15 @@
<p class="w3-col l6 m6 hide-small">{{.Notes}}</p>
<p class="w3-col l2 hide-medium">{{.SizeFormatted}}</p>
<div class="w3-col l2 m2 s4 flex row nowrap" style="height: 1lh;">
<img id="edit-btn" class="clickable" alt="change notes" src="images/actions/backups/config.svg#symb">
<img id="delete-btn" class="clickable" alt="delete backup" role="button" tabindex=0 src="images/actions/backups/delete-active.svg#symb">
<img id="restore-btn" class="clickable" alt="restore from backup" role="button" tabindex=0 src="images/actions/backups/restore.svg#symb">
<img id="edit-btn" class="clickable" alt="change notes" src="websrc/images/actions/backups/config.svg#symb">
<img id="delete-btn" class="clickable" alt="delete backup" role="button" tabindex=0 src="websrc/images/actions/backups/delete-active.svg#symb">
<img id="restore-btn" class="clickable" alt="restore from backup" role="button" tabindex=0 src="websrc/images/actions/backups/restore.svg#symb">
</div>
</div>
<template id="edit-dialog">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
Edit Backup
@@ -45,9 +45,9 @@
</dialog>
</template>
<template id="delete-dialog">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
Delete Backup
@@ -66,9 +66,9 @@
</dialog>
</template>
<template id="restore-dialog">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
Restore From Backup?
@@ -96,12 +96,12 @@
{{define "backups-add-backup"}}
<button type="button" id="backup-add" class="w3-button" aria-label="Create Backup">
<span class="large" style="margin: 0;">Create Backup</span>
<img class="small" role="img" style="height: 1lh; width: 1lh;" alt="Create Backup" src="images/actions/network/add.svg#symb">
<img class="small" role="img" style="height: 1lh; width: 1lh;" alt="Create Backup" src="websrc/images/actions/network/add.svg#symb">
</button>
<template id="create-backup-dialog">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
Create Backup
+5 -5
View File
@@ -3,16 +3,16 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{.global.Organization}} - dashboard</title>
<link rel="icon" href="images/favicon.svg" sizes="any" type="image/svg+xml">
<link rel="stylesheet" href="modules/w3.css">
<link rel="icon" href="websrc/images/favicon.svg" sizes="any" type="image/svg+xml">
<link rel="stylesheet" href="websrc/modules/w3.css">
<script>
window.PVE = "{{.global.PVE}}";
window.API = "{{.global.API}}";
window.DASH = "{{.global.DASH}}";
</script>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/nav.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/nav.css">
<link rel="stylesheet" href="websrc/css/form.css">
{{end}}
{{/* <header> common across all pages */}}
+45 -45
View File
@@ -1,26 +1,26 @@
{{define "proctype-input"}}
<img alt="CPU Type" src="images/resources/cpu.svg#symb">
<img alt="CPU Type" src="websrc/images/resources/cpu.svg#symb">
<label for="proctype">CPU Type</label>
{{template "select" .}}
<div></div>
{{end}}
{{define "cores-input"}}
<img alt="CPU Amount" src="images/resources/cpu.svg#symb">
<img alt="CPU Amount" src="websrc/images/resources/cpu.svg#symb">
<label for="cores">CPU Amount</label>
<input id="cores" name="cores" class="w3-input w3-border" type="number" required value="{{.}}">
<p>Cores</p>
{{end}}
{{define "memory-input"}}
<img alt="Memory Amount" src="images/resources/ram.svg#symb">
<img alt="Memory Amount" src="websrc/images/resources/ram.svg#symb">
<label for="ram">Memory</label>
<input id="ram" name="ram" class="w3-input w3-border" type="number" required value="{{.}}">
<p>MiB</p>
{{end}}
{{define "swap-input"}}
<img alt="Swap Amount" src="images/resources/swap.svg#symb">
<img alt="Swap Amount" src="websrc/images/resources/swap.svg#symb">
<label for="swap">Swap</label>
<input id="swap" name="swap" class="w3-input w3-border" type="number" required value="{{.}}">
<p>MiB</p>
@@ -46,7 +46,7 @@
{{define "volumes-add-disk"}}
<button type="button" id="disk-add" class="w3-button" aria-label="Add New Disk">
<span class="large" style="margin: 0;">Add Disk</span>
<img class="small" style="height: 1lh; width: 1lh;" alt="Add New Disk" src="images/actions/disk/add-disk.svg#symb">
<img class="small" style="height: 1lh; width: 1lh;" alt="Add New Disk" src="websrc/images/actions/disk/add-disk.svg#symb">
</button>
<template id="add-disk-dialog">
<dialog class="w3-container w3-card w3-border-0">
@@ -75,7 +75,7 @@
{{define "volumes-add-cd"}}
<button type="button" id="cd-add" class="w3-button" aria-label="Add New CD">
<span class="large" style="margin: 0;">Mount CD</span>
<img class="small" style="height: 1lh; width: 1lh;" alt="Add New CDROM" src="images/actions/disk/add-cd.svg#symb">
<img class="small" style="height: 1lh; width: 1lh;" alt="Add New CDROM" src="websrc/images/actions/disk/add-cd.svg#symb">
</button>
<template id="add-cd-dialog">
<dialog class="w3-container w3-card w3-border-0">
@@ -97,7 +97,7 @@
{{end}}
{{define "volume-rootfs"}}
<img data-volume={{.Name}} alt="Drive" src="images/resources/drive.svg#symb">
<img data-volume={{.Name}} alt="Drive" src="websrc/images/resources/drive.svg#symb">
<p>{{.Name}}</p>
<p>{{.Volume.File}}</p>
<div>
@@ -109,7 +109,7 @@
{{end}}
{{define "volume-mp"}}
<img data-volume={{.Name}} alt="Drive" src="images/resources/drive.svg#symb">
<img data-volume={{.Name}} alt="Drive" src="websrc/images/resources/drive.svg#symb">
<p>{{.Name}}</p>
<p>{{.Volume.File}}</p>
<div>
@@ -121,7 +121,7 @@
{{end}}
{{define "volume-ide"}}
<img data-volume={{.Name}} alt="Drive" src="images/resources/drive.svg#symb">
<img data-volume={{.Name}} alt="Drive" src="websrc/images/resources/drive.svg#symb">
<p>{{.Name}}</p>
<p>{{.Volume.File}}</p>
<div>
@@ -133,7 +133,7 @@
{{end}}
{{define "volume-scsi"}}
<img data-volume={{.Name}} alt="Drive" src="images/resources/drive.svg#symb">
<img data-volume={{.Name}} alt="Drive" src="websrc/images/resources/drive.svg#symb">
<p>{{.Name}}</p>
<p>{{.Volume.File}}</p>
<div>
@@ -145,7 +145,7 @@
{{end}}
{{define "volume-unused"}}
<img data-volume={{.Name}} alt="Drive" src="images/resources/drive.svg#symb">
<img data-volume={{.Name}} alt="Drive" src="websrc/images/resources/drive.svg#symb">
<p>{{.Name}}</p>
<p>{{.Volume.File}}</p>
<div>
@@ -159,8 +159,8 @@
{{define "volume-action-move"}}
<volume-action data-type="move" data-volume="{{.Name}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Move {{.Name}}" src="images/actions/disk/move-active.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Move {{.Name}}" src="websrc/images/actions/disk/move-active.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -185,8 +185,8 @@
{{define "volume-action-move-inactive"}}
<volume-action data-type="none" data-volume="{{.Name}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img alt="" src="images/actions/disk/move-inactive.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img alt="" src="websrc/images/actions/disk/move-inactive.svg#symb">
</template>
</volume-action>
{{end}}
@@ -194,8 +194,8 @@
{{define "volume-action-resize"}}
<volume-action data-type="resize" data-volume="{{.Name}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Resize {{.Name}}" src="images/actions/disk/resize-active.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Resize {{.Name}}" src="websrc/images/actions/disk/resize-active.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -220,8 +220,8 @@
{{define "volume-action-resize-inactive"}}
<volume-action data-type="none" data-volume="{{.Name}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img alt="" src="images/actions/disk/resize-inactive.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img alt="" src="websrc/images/actions/disk/resize-inactive.svg#symb">
</template>
</volume-action>
{{end}}
@@ -229,8 +229,8 @@
{{define "volume-action-delete"}}
<volume-action data-type="delete" data-volume="{{.Name}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Delete {{.Name}}" src="images/actions/disk/delete-active.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Delete {{.Name}}" src="websrc/images/actions/disk/delete-active.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -254,8 +254,8 @@
{{define "volume-action-delete-inactive"}}
<volume-action data-type="none" data-volume="{{.Name}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img alt="" src="images/actions/disk/delete-inactive.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img alt="" src="websrc/images/actions/disk/delete-inactive.svg#symb">
</template>
</volume-action>
{{end}}
@@ -263,8 +263,8 @@
{{define "volume-action-attach"}}
<volume-action data-type="attach" data-volume="{{.Name}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Attach {{.Name}}" src="images/actions/disk/attach.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Attach {{.Name}}" src="websrc/images/actions/disk/attach.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -296,8 +296,8 @@
{{define "volume-action-detach"}}
<volume-action data-type="detach" data-volume="{{.Name}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Detach {{.Name}}" src="images/actions/disk/detach.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Detach {{.Name}}" src="websrc/images/actions/disk/detach.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -321,8 +321,8 @@
{{define "volume-action-none"}}
<volume-action data-type="none">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img alt="" src="images/common/blank.svg">
<link rel="stylesheet" href="websrc/css/style.css">
<img alt="" src="websrc/images/common/blank.svg">
</template>
</volume-action>
{{end}}
@@ -336,7 +336,7 @@
{{define "nets-add-net"}}
<button type="button" id="network-add" class="w3-button" aria-label="Add New Network Interface">
<span class="large" style="margin: 0;">Add Network</span>
<img class="small" style="height: 1lh; width: 1lh;" alt="Add New Network Interface" src="images/actions/network/add.svg#symb">
<img class="small" style="height: 1lh; width: 1lh;" alt="Add New Network Interface" src="websrc/images/actions/network/add.svg#symb">
</button>
<template id="add-net-dialog">
<dialog class="w3-container w3-card w3-border-0">
@@ -361,14 +361,14 @@
{{end}}
{{define "net"}}
<img data-network="{{.Net_ID}}" alt="Net {{.Net_ID}}" src="images/resources/network.svg#symb">
<img data-network="{{.Net_ID}}" alt="Net {{.Net_ID}}" src="websrc/images/resources/network.svg#symb">
<p>{{.Net_ID}}</p>
<p>{{.Value}}</p>
<div>
<network-action data-type="config" data-network="{{.Net_ID}}" data-value="{{.Value}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Configure Net {{.Net_ID}}" src="images/actions/network/config.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Configure Net {{.Net_ID}}" src="websrc/images/actions/network/config.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -389,8 +389,8 @@
</network-action>
<network-action data-type="delete" data-network="{{.Net_ID}}" data-value="{{.Value}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Delete Net {{.Net_ID}}" src="images/actions/network/delete-active.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Delete Net {{.Net_ID}}" src="websrc/images/actions/network/delete-active.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -421,7 +421,7 @@
{{define "devices-add-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>
<img class="small" style="height: 1lh; width: 1lh;" alt="Add New PCIe Device" src="images/actions/device/add.svg#symb">
<img class="small" style="height: 1lh; width: 1lh;" alt="Add New PCIe Device" src="websrc/images/actions/device/add.svg#symb">
</button>
<template id="add-device-dialog">
<dialog class="w3-container w3-card w3-border-0">
@@ -444,14 +444,14 @@
{{end}}
{{define "device"}}
<img data-device="{{.Device_ID}}" alt="Device {{.Device_ID}}" src="images/resources/device.svg#symb">
<img data-device="{{.Device_ID}}" alt="Device {{.Device_ID}}" src="websrc/images/resources/device.svg#symb">
<p>{{.Device_ID}}</p>
<p>{{.Device_Name}}</p>
<div>
<device-action data-type="config" data-device="{{.Device_ID}}" data-value="{{.Device_ID}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Configure Device {{.Device_ID}}" src="images/actions/device/config.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Configure Device {{.Device_ID}}" src="websrc/images/actions/device/config.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -472,8 +472,8 @@
</device-action>
<device-action data-type="delete" data-device="{{.Device_ID}}" data-value="{{.Device_ID}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css">
<img class="clickable" alt="Delete Device {{.Device_ID}}" src="images/actions/device/delete-active.svg#symb">
<link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Delete Device {{.Device_ID}}" src="websrc/images/actions/device/delete-active.svg#symb">
<template id="dialog-template">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
@@ -544,15 +544,15 @@
{{define "boot-target"}}
{{if .volume_id}}
<div class="draggable-item" data-value="{{.volume_id}}" style="display: grid; grid-template-columns: auto auto 8ch 1fr; column-gap: 0.5em; align-items: center;">
<img alt="Drag" src="images/actions/drag.svg#symb">
<img alt="Volume" src="images/resources/drive.svg#symb">
<img alt="Drag" src="websrc/images/actions/drag.svg#symb">
<img alt="Volume" src="websrc/images/resources/drive.svg#symb">
<p class="volume-id">{{.volume_id}}</p>
<p class="volume-file">{{.file}}</p>
</div>
{{else if .net_id}}
<div class="draggable-item" data-value="{{.net_id}}" style="display: grid; grid-template-columns: auto auto 8ch 1fr; column-gap: 0.5em; align-items: center;">
<img alt="Drag" src="images/actions/drag.svg#symb">
<img alt="Net" src="images/resources/network.svg#symb">
<img alt="Drag" src="websrc/images/actions/drag.svg#symb">
<img alt="Net" src="websrc/images/resources/network.svg#symb">
<p class="volume-id">{{.net_id}}</p>
<p class="volume-file">{{.value}}</p>
</div>
+30 -30
View File
@@ -1,8 +1,8 @@
{{define "instance-card"}}
<instance-card data-type="{{.Type}}" data-status="{{.Status}}" data-vmid="{{.VMID}}" data-name="{{.Name}}" data-node="{{.Node}}" data-nodestatus="{{.NodeStatus}}">
<template shadowrootmode="open">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<style>
* {
margin: 0;
@@ -60,60 +60,60 @@
<p class="hide-small">{{.Type}}</p>
<div class="flex row nowrap hide-tiny">
{{if eq .Status "running"}}
<img id="status" alt="instance is running" src="images/status/active.svg#symb">
<img id="status" alt="instance is running" src="websrc/images/status/active.svg#symb">
{{else if eq .Status "stopped"}}
<img id="status" alt="instance is stopped" src="images/status/inactive.svg#symb">
<img id="status" alt="instance is stopped" src="websrc/images/status/inactive.svg#symb">
{{else if eq .Status "loading"}}
<img id="status" alt="instance is loading" src="images/status/loading.svg#symb">
<img id="status" alt="instance is loading" src="websrc/images/status/loading.svg#symb">
{{else}}
<img id="status" alt="instance is loading" src="images/status/loading.svg#symb">
<img id="status" alt="instance is loading" src="websrc/images/status/loading.svg#symb">
{{end}}
<p>{{.Status}}</p>
</div>
<p class="hide-medium">{{.Node}}</p>
<div class="flex row nowrap hide-medium">
{{if eq .NodeStatus "online"}}
<img alt="node is online" src="images/status/active.svg#symb">
<img alt="node is online" src="websrc/images/status/active.svg#symb">
{{else if eq .NodeStatus "offline"}}
<img alt="node is offline" src="images/status/inactive.svg#symb">
<img alt="node is offline" src="websrc/images/status/inactive.svg#symb">
{{else if eq .NodeStatus "unknown"}}
<img alt="node is offline" src="images/status/inactive.svg#symb">
<img alt="node is offline" src="websrc/images/status/inactive.svg#symb">
{{else}}
{{end}}
<p>{{.NodeStatus}}</p>
</div>
<div class="flex row nowrap">
{{if and (eq .NodeStatus "online") (eq .Status "running")}}
<img id="power-btn" class="clickable" alt="shutdown instance" role="button" tabindex=0 src="images/actions/instance/stop.svg#symb">
<img id="configure-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/config-inactive.svg#symb">
<img id="backup-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/backup-inactive.svg#symb">
<img id="power-btn" class="clickable" alt="shutdown instance" role="button" tabindex=0 src="websrc/images/actions/instance/stop.svg#symb">
<img id="configure-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/config-inactive.svg#symb">
<img id="backup-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/backup-inactive.svg#symb">
<a href="{{.ConsolePath}}" target="_blank">
<img id="console-btn" class="clickable" alt="open console" src="images/actions/instance/console-active.svg#symb">
<img id="console-btn" class="clickable" alt="open console" src="websrc/images/actions/instance/console-active.svg#symb">
</a>
<img id="delete-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/delete-inactive.svg#symb">
<img id="delete-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/delete-inactive.svg#symb">
{{else if and (eq .NodeStatus "online") (eq .Status "stopped")}}
<img id="power-btn" class="clickable" alt="start instance" role="button" tabindex=0 src="images/actions/instance/start.svg#symb">
<img id="power-btn" class="clickable" alt="start instance" role="button" tabindex=0 src="websrc/images/actions/instance/start.svg#symb">
<a href="{{.ConfigPath}}">
<img id="configure-btn" class="clickable" alt="change configuration" src="images/actions/instance/config-active.svg#symb">
<img id="configure-btn" class="clickable" alt="change configuration" src="websrc/images/actions/instance/config-active.svg#symb">
</a>
<a href="{{.BackupsPath}}">
<img id="backup-btn" class="clickable" alt="manage backups" src="images/actions/instance/backup-active.svg#symb">
<img id="backup-btn" class="clickable" alt="manage backups" src="websrc/images/actions/instance/backup-active.svg#symb">
</a>
<img id="console-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/console-inactive.svg#symb">
<img id="delete-btn" class="clickable" alt="delete instance" role="button" tabindex=0 src="images/actions/instance/delete-active.svg#symb">
<img id="console-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/console-inactive.svg#symb">
<img id="delete-btn" class="clickable" alt="delete instance" role="button" tabindex=0 src="websrc/images/actions/instance/delete-active.svg#symb">
{{else if and (eq .NodeStatus "online") (eq .Status "loading")}}
<img id="power-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/loading.svg#symb">
<img id="configure-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/config-inactive.svg#symb">
<img id="backup-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/backup-inactive.svg#symb">
<img id="console-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/console-inactive.svg#symb">
<img id="delete-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/delete-inactive.svg#symb">
<img id="power-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/loading.svg#symb">
<img id="configure-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/config-inactive.svg#symb">
<img id="backup-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/backup-inactive.svg#symb">
<img id="console-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/console-inactive.svg#symb">
<img id="delete-btn" alt="" aria-disabled="true" role="none" src="websrc/images/actions/instance/delete-inactive.svg#symb">
{{else}}
{{end}}
</div>
<template id="power-dialog">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
{{if eq .Status "running"}}
@@ -140,9 +140,9 @@
</dialog>
</template>
<template id="delete-dialog">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/form.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt">
Delete {{.VMID}}
+2 -2
View File
@@ -1,8 +1,8 @@
{{define "resource-chart"}}
<resource-chart>
<template shadowrootmode="open">
<link rel="stylesheet" href="modules/w3.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="websrc/css/style.css">
<style>
#container{
margin: 0;