From 913175239c78d737c8fdb5c7b1b6cdd29e1f1a0d Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Mon, 19 Dec 2022 16:13:43 -0800 Subject: [PATCH] populate static elements of config.html, add node info to config page search, change login.css to form.css --- config.html | 12 ++++++++++++ css/{login.css => form.css} | 0 login.html | 2 +- scripts/config.js | 10 +++++++++- scripts/elements.js | 2 +- 5 files changed, 23 insertions(+), 3 deletions(-) rename css/{login.css => form.css} (100%) diff --git a/config.html b/config.html index 784b7ed..f26b91f 100644 --- a/config.html +++ b/config.html @@ -5,8 +5,20 @@ tronnet - client + +
+
+
+ Change Configuration +
+ + +
+
+
+
\ No newline at end of file diff --git a/css/login.css b/css/form.css similarity index 100% rename from css/login.css rename to css/form.css diff --git a/login.html b/login.html index 1a91119..1a3712d 100644 --- a/login.html +++ b/login.html @@ -5,7 +5,7 @@ tronnet - client - + diff --git a/scripts/config.js b/scripts/config.js index f52679f..9168826 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -4,5 +4,13 @@ window.addEventListener("DOMContentLoaded", init); async function init () { let uriData = getURIData(); - console.log(uriData); + let node = uriData.node; + let type = uriData.type; + let vmid = uriData.vmid; + await populateForm(node, type, vmid); +} + +async function populateForm (node, type, vmid) { + let config = request(`/nodes/${node}/${type}/${vmid}/config`); + console.log(config); } \ No newline at end of file diff --git a/scripts/elements.js b/scripts/elements.js index b9caace..c20cc6d 100644 --- a/scripts/elements.js +++ b/scripts/elements.js @@ -125,7 +125,7 @@ class Instance extends HTMLElement { configButton.src = data.status === "running" ? "images/actions/config-inactive.svg" : "images/actions/config-active.svg"; configButton.addEventListener("click", () => { if (!this.actionLock && this.status !== "running") { - goToPage("config.html", {type: this.type, vmid: this.vmid}); + goToPage("config.html", {node: this.node, type: this.type, vmid: this.vmid}); } }) }