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" "log"
"proxmoxaas-dashboard/app/common" "proxmoxaas-dashboard/app/common"
"proxmoxaas-dashboard/app/routes" "proxmoxaas-dashboard/app/routes"
"strings"
"web" // go will complain here until the first build "web" // go will complain here until the first build
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@@ -49,31 +50,12 @@ func Run() {
// setup static resources under web (css, images, modules, scripts) // setup static resources under web (css, images, modules, scripts)
func ServeStatic(router *gin.Engine, m *minify.M) { func ServeStatic(router *gin.Engine, m *minify.M) {
css := common.MinifyStatic(m, web.CSS_fs) static := common.MinifyStatic(m, web.Static)
router.GET("/css/*css", func(c *gin.Context) { router.GET("/websrc/*path", func(c *gin.Context) {
path, _ := c.Params.Get("css") path, _ := c.Params.Get("path")
data := css[fmt.Sprintf("css%s", path)] trimed_path := strings.Replace(path, "/", "", 1) // replace leading "/" captured by *path
c.Header("Content-Encoding", data.MimeType.Encoding) data := static[trimed_path]
c.Data(200, data.MimeType.Type, []byte(data.Data)) fmt.Println(path)
})
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)]
c.Header("Content-Encoding", data.MimeType.Encoding) c.Header("Content-Encoding", data.MimeType.Encoding)
c.Data(200, data.MimeType.Type, []byte(data.Data)) c.Data(200, data.MimeType.Type, []byte(data.Data))
}) })
+1 -7
View File
@@ -5,16 +5,10 @@ import (
) )
//go:embed css/* //go:embed css/*
var CSS_fs embed.FS
//go:embed images/* //go:embed images/*
var Images_fs embed.FS
//go:embed modules/* //go:embed modules/*
var Modules_fs embed.FS
//go:embed scripts/* //go:embed scripts/*
var Scripts_fs embed.FS var Static embed.FS
//go:embed html/* //go:embed html/*
//go:embed templates/* //go:embed templates/*
+6 -6
View File
@@ -2,9 +2,9 @@
<html lang="en"> <html lang="en">
<head> <head>
{{template "head" .}} {{template "head" .}}
<script src="scripts/account.js" type="module"></script> <script src="websrc/scripts/account.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js"> <link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js"> <link rel="modulepreload" href="websrc/scripts/dialog.js">
<style> <style>
@media screen and (width >= 1264px){ @media screen and (width >= 1264px){
.resource-container { .resource-container {
@@ -48,9 +48,9 @@
{{end}} {{end}}
</main> </main>
<template id="change-password-dialog"> <template id="change-password-dialog">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt"> <p class="w3-large" id="prompt">
Change Password Change Password
+3 -3
View File
@@ -2,9 +2,9 @@
<html lang="en"> <html lang="en">
<head> <head>
{{template "head" .}} {{template "head" .}}
<script src="scripts/backups.js" type="module"></script> <script src="websrc/scripts/backups.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js"> <link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js"> <link rel="modulepreload" href="websrc/scripts/dialog.js">
<style> <style>
</style> </style>
</head> </head>
+5 -5
View File
@@ -2,11 +2,11 @@
<html lang="en"> <html lang="en">
<head> <head>
{{template "head" .}} {{template "head" .}}
<script src="scripts/config.js" type="module"></script> <script src="websrc/scripts/config.js" type="module"></script>
<script src="scripts/draggable.js" type="module"></script> <script src="websrc/scripts/draggable.js" type="module"></script>
<script src="modules/Sortable.min.js"></script> <script src="websrc/modules/Sortable.min.js"></script>
<link rel="modulepreload" href="scripts/utils.js"> <link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js"> <link rel="modulepreload" href="websrc/scripts/dialog.js">
<style> <style>
.input-grid p, .input-grid div { .input-grid p, .input-grid div {
margin-top: 0; margin-top: 0;
+7 -7
View File
@@ -2,11 +2,11 @@
<html lang="en"> <html lang="en">
<head> <head>
{{template "head" .}} {{template "head" .}}
<script src="scripts/index.js" type="module"></script> <script src="websrc/scripts/index.js" type="module"></script>
<script src="modules/wfa.js" type="module"></script> <script src="websrc/modules/wfa.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js"> <link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js"> <link rel="modulepreload" href="websrc/scripts/dialog.js">
<link rel="modulepreload" href="scripts/clientsync.js"> <link rel="modulepreload" href="websrc/scripts/clientsync.js">
<style> <style>
@media screen and (width >= 440px) { @media screen and (width >= 440px) {
#vm-search { #vm-search {
@@ -72,13 +72,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">
<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"> <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>
<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> </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">
+3 -3
View File
@@ -2,9 +2,9 @@
<html lang="en"> <html lang="en">
<head> <head>
{{template "head" .}} {{template "head" .}}
<script src="scripts/login.js" type="module"></script> <script src="websrc/scripts/login.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js"> <link rel="modulepreload" href="websrc/scripts/utils.js">
<link rel="modulepreload" href="scripts/dialog.js"> <link rel="modulepreload" href="websrc/scripts/dialog.js">
</head> </head>
<body> <body>
{{template "header" .}} {{template "header" .}}
+2 -2
View File
@@ -2,8 +2,8 @@
<html lang="en"> <html lang="en">
<head> <head>
{{template "head" .}} {{template "head" .}}
<script src="scripts/settings.js" type="module"></script> <script src="websrc/scripts/settings.js" type="module"></script>
<link rel="modulepreload" href="scripts/utils.js"> <link rel="modulepreload" href="websrc/scripts/utils.js">
<style> <style>
label { label {
display: flex; display: flex;
+3 -3
View File
@@ -50,9 +50,9 @@ class ErrorDialog extends HTMLElement {
super(); super();
this.shadowRoot = this.attachShadow({ mode: "open" }); this.shadowRoot = this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = ` this.shadowRoot.innerHTML = `
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
<style> <style>
#errors { #errors {
margin-bottom: 0; margin-bottom: 0;
+1 -1
View File
@@ -1,5 +1,5 @@
const blank = document.createElement("img"); 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 { class DraggableContainer extends HTMLElement {
shadowRoot = null; shadowRoot = null;
+1 -1
View File
@@ -10,7 +10,7 @@ var wfa;
async function init () { async function init () {
setAppearance(); setAppearance();
wfa = await wfaInit("modules/wfa.wasm.gz"); wfa = await wfaInit("websrc/modules/wfa.wasm.gz");
initInstances(); initInstances();
document.querySelector("#instance-add").addEventListener("click", handleInstanceAddButton); document.querySelector("#instance-add").addEventListener("click", handleInstanceAddButton);
+18 -18
View File
@@ -1,8 +1,8 @@
{{define "backup-card"}} {{define "backup-card"}}
<backup-card data-volid="{{.Volid}}"> <backup-card data-volid="{{.Volid}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<style> <style>
* { * {
margin: 0; margin: 0;
@@ -19,15 +19,15 @@
<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;">
<img id="edit-btn" class="clickable" alt="change notes" src="images/actions/backups/config.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="images/actions/backups/delete-active.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="images/actions/backups/restore.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>
</div> </div>
<template id="edit-dialog"> <template id="edit-dialog">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt"> <p class="w3-large" id="prompt">
Edit Backup Edit Backup
@@ -45,9 +45,9 @@
</dialog> </dialog>
</template> </template>
<template id="delete-dialog"> <template id="delete-dialog">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt"> <p class="w3-large" id="prompt">
Delete Backup Delete Backup
@@ -66,9 +66,9 @@
</dialog> </dialog>
</template> </template>
<template id="restore-dialog"> <template id="restore-dialog">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt"> <p class="w3-large" id="prompt">
Restore From Backup? Restore From Backup?
@@ -96,12 +96,12 @@
{{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>
<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> </button>
<template id="create-backup-dialog"> <template id="create-backup-dialog">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt"> <p class="w3-large" id="prompt">
Create Backup Create Backup
+5 -5
View File
@@ -3,16 +3,16 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{.global.Organization}} - dashboard</title> <title>{{.global.Organization}} - dashboard</title>
<link rel="icon" href="images/favicon.svg" sizes="any" type="image/svg+xml"> <link rel="icon" href="websrc/images/favicon.svg" sizes="any" type="image/svg+xml">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<script> <script>
window.PVE = "{{.global.PVE}}"; window.PVE = "{{.global.PVE}}";
window.API = "{{.global.API}}"; window.API = "{{.global.API}}";
window.DASH = "{{.global.DASH}}"; window.DASH = "{{.global.DASH}}";
</script> </script>
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/nav.css"> <link rel="stylesheet" href="websrc/css/nav.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
{{end}} {{end}}
{{/* <header> common across all pages */}} {{/* <header> common across all pages */}}
+45 -45
View File
@@ -1,26 +1,26 @@
{{define "proctype-input"}} {{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> <label for="proctype">CPU Type</label>
{{template "select" .}} {{template "select" .}}
<div></div> <div></div>
{{end}} {{end}}
{{define "cores-input"}} {{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> <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"}}
<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> <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"}}
<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> <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>
<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> </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>
<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> </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"}}
<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>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -109,7 +109,7 @@
{{end}} {{end}}
{{define "volume-mp"}} {{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>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -121,7 +121,7 @@
{{end}} {{end}}
{{define "volume-ide"}} {{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>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -133,7 +133,7 @@
{{end}} {{end}}
{{define "volume-scsi"}} {{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>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -145,7 +145,7 @@
{{end}} {{end}}
{{define "volume-unused"}} {{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>{{.Name}}</p>
<p>{{.Volume.File}}</p> <p>{{.Volume.File}}</p>
<div> <div>
@@ -159,8 +159,8 @@
{{define "volume-action-move"}} {{define "volume-action-move"}}
<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="websrc/css/style.css">
<img class="clickable" alt="Move {{.Name}}" src="images/actions/disk/move-active.svg#symb"> <img class="clickable" alt="Move {{.Name}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -185,8 +185,8 @@
{{define "volume-action-move-inactive"}} {{define "volume-action-move-inactive"}}
<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="websrc/css/style.css">
<img alt="" src="images/actions/disk/move-inactive.svg#symb"> <img alt="" src="websrc/images/actions/disk/move-inactive.svg#symb">
</template> </template>
</volume-action> </volume-action>
{{end}} {{end}}
@@ -194,8 +194,8 @@
{{define "volume-action-resize"}} {{define "volume-action-resize"}}
<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="websrc/css/style.css">
<img class="clickable" alt="Resize {{.Name}}" src="images/actions/disk/resize-active.svg#symb"> <img class="clickable" alt="Resize {{.Name}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -220,8 +220,8 @@
{{define "volume-action-resize-inactive"}} {{define "volume-action-resize-inactive"}}
<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="websrc/css/style.css">
<img alt="" src="images/actions/disk/resize-inactive.svg#symb"> <img alt="" src="websrc/images/actions/disk/resize-inactive.svg#symb">
</template> </template>
</volume-action> </volume-action>
{{end}} {{end}}
@@ -229,8 +229,8 @@
{{define "volume-action-delete"}} {{define "volume-action-delete"}}
<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="websrc/css/style.css">
<img class="clickable" alt="Delete {{.Name}}" src="images/actions/disk/delete-active.svg#symb"> <img class="clickable" alt="Delete {{.Name}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -254,8 +254,8 @@
{{define "volume-action-delete-inactive"}} {{define "volume-action-delete-inactive"}}
<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="websrc/css/style.css">
<img alt="" src="images/actions/disk/delete-inactive.svg#symb"> <img alt="" src="websrc/images/actions/disk/delete-inactive.svg#symb">
</template> </template>
</volume-action> </volume-action>
{{end}} {{end}}
@@ -263,8 +263,8 @@
{{define "volume-action-attach"}} {{define "volume-action-attach"}}
<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="websrc/css/style.css">
<img class="clickable" alt="Attach {{.Name}}" src="images/actions/disk/attach.svg#symb"> <img class="clickable" alt="Attach {{.Name}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -296,8 +296,8 @@
{{define "volume-action-detach"}} {{define "volume-action-detach"}}
<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="websrc/css/style.css">
<img class="clickable" alt="Detach {{.Name}}" src="images/actions/disk/detach.svg#symb"> <img class="clickable" alt="Detach {{.Name}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -321,8 +321,8 @@
{{define "volume-action-none"}} {{define "volume-action-none"}}
<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="websrc/css/style.css">
<img alt="" src="images/common/blank.svg"> <img alt="" src="websrc/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>
<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> </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"}}
<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>{{.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="websrc/css/style.css">
<img class="clickable" alt="Configure Net {{.Net_ID}}" src="images/actions/network/config.svg#symb"> <img class="clickable" alt="Configure Net {{.Net_ID}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -389,8 +389,8 @@
</network-action> </network-action>
<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="websrc/css/style.css">
<img class="clickable" alt="Delete Net {{.Net_ID}}" src="images/actions/network/delete-active.svg#symb"> <img class="clickable" alt="Delete Net {{.Net_ID}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -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>
<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> </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"}}
<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_ID}}</p>
<p>{{.Device_Name}}</p> <p>{{.Device_Name}}</p>
<div> <div>
<device-action data-type="config" data-device="{{.Device_ID}}" data-value="{{.Device_ID}}"> <device-action data-type="config" data-device="{{.Device_ID}}" data-value="{{.Device_ID}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Configure Device {{.Device_ID}}" src="images/actions/device/config.svg#symb"> <img class="clickable" alt="Configure Device {{.Device_ID}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -472,8 +472,8 @@
</device-action> </device-action>
<device-action data-type="delete" data-device="{{.Device_ID}}" data-value="{{.Device_ID}}"> <device-action data-type="delete" data-device="{{.Device_ID}}" data-value="{{.Device_ID}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<img class="clickable" alt="Delete Device {{.Device_ID}}" src="images/actions/device/delete-active.svg#symb"> <img class="clickable" alt="Delete Device {{.Device_ID}}" src="websrc/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"> <p class="w3-large" id="prompt">
@@ -544,15 +544,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: 0.5em; align-items: center;"> <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="Drag" src="websrc/images/actions/drag.svg#symb">
<img alt="Volume" src="images/resources/drive.svg#symb"> <img alt="Volume" src="websrc/images/resources/drive.svg#symb">
<p class="volume-id">{{.volume_id}}</p> <p class="volume-id">{{.volume_id}}</p>
<p class="volume-file">{{.file}}</p> <p class="volume-file">{{.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: 0.5em; align-items: center;"> <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="Drag" src="websrc/images/actions/drag.svg#symb">
<img alt="Net" src="images/resources/network.svg#symb"> <img alt="Net" src="websrc/images/resources/network.svg#symb">
<p class="volume-id">{{.net_id}}</p> <p class="volume-id">{{.net_id}}</p>
<p class="volume-file">{{.value}}</p> <p class="volume-file">{{.value}}</p>
</div> </div>
+30 -30
View File
@@ -1,8 +1,8 @@
{{define "instance-card"}} {{define "instance-card"}}
<instance-card data-type="{{.Type}}" data-status="{{.Status}}" data-vmid="{{.VMID}}" data-name="{{.Name}}" data-node="{{.Node}}" data-nodestatus="{{.NodeStatus}}"> <instance-card data-type="{{.Type}}" data-status="{{.Status}}" data-vmid="{{.VMID}}" data-name="{{.Name}}" data-node="{{.Node}}" data-nodestatus="{{.NodeStatus}}">
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<style> <style>
* { * {
margin: 0; margin: 0;
@@ -60,60 +60,60 @@
<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"}}
<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"}} {{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"}} {{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}} {{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}} {{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"}}
<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"}} {{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"}} {{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}} {{else}}
{{end}} {{end}}
<p>{{.NodeStatus}}</p> <p>{{.NodeStatus}}</p>
</div> </div>
<div class="flex row nowrap"> <div class="flex row nowrap">
{{if and (eq .NodeStatus "online") (eq .Status "running")}} {{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="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="images/actions/instance/config-inactive.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="images/actions/instance/backup-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"> <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> </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")}} {{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}}"> <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>
<a href="{{.BackupsPath}}"> <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> </a>
<img id="console-btn" alt="" aria-disabled="true" role="none" src="images/actions/instance/console-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" class="clickable" alt="delete instance" role="button" tabindex=0 src="images/actions/instance/delete-active.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")}} {{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="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="images/actions/instance/config-inactive.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="images/actions/instance/backup-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="images/actions/instance/console-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="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}} {{else}}
{{end}} {{end}}
</div> </div>
<template id="power-dialog"> <template id="power-dialog">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt"> <p class="w3-large" id="prompt">
{{if eq .Status "running"}} {{if eq .Status "running"}}
@@ -140,9 +140,9 @@
</dialog> </dialog>
</template> </template>
<template id="delete-dialog"> <template id="delete-dialog">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<link rel="stylesheet" href="css/form.css"> <link rel="stylesheet" href="websrc/css/form.css">
<dialog class="w3-container w3-card w3-border-0"> <dialog class="w3-container w3-card w3-border-0">
<p class="w3-large" id="prompt"> <p class="w3-large" id="prompt">
Delete {{.VMID}} Delete {{.VMID}}
+2 -2
View File
@@ -1,8 +1,8 @@
{{define "resource-chart"}} {{define "resource-chart"}}
<resource-chart> <resource-chart>
<template shadowrootmode="open"> <template shadowrootmode="open">
<link rel="stylesheet" href="modules/w3.css"> <link rel="stylesheet" href="websrc/modules/w3.css">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="websrc/css/style.css">
<style> <style>
#container{ #container{
margin: 0; margin: 0;