populate static elements of config.html,

add node info to config page search,
change login.css to form.css
This commit is contained in:
Arthur Lu 2022-12-19 16:13:43 -08:00
parent 818748ef2b
commit ef4597490a
5 changed files with 23 additions and 3 deletions

View File

@ -5,8 +5,20 @@
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<title>tronnet - client</title> <title>tronnet - client</title>
<link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" href="css/style.css" type="text/css">
<link rel="stylesheet" href="css/form.css" type="text/css">
<script src="scripts/config.js" type="module"></script> <script src="scripts/config.js" type="module"></script>
</head> </head>
<body> <body>
<div class="center-div">
<form>
<fieldset id="user-configurable">
<legend>Change Configuration</legend>
<div class="btn-group" id="form-actions">
<button id="submit">CANCEL</button>
<button id="submit">SUBMIT</button>
</div>
</fieldset>
</form>
</div>
</body> </body>
</html> </html>

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<title>tronnet - client</title> <title>tronnet - client</title>
<link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" href="css/style.css" type="text/css">
<link rel="stylesheet" href="css/login.css" type="text/css"> <link rel="stylesheet" href="css/form.css" type="text/css">
<script src="scripts/login.js" type="module"></script> <script src="scripts/login.js" type="module"></script>
</head> </head>
<body> <body>

View File

@ -4,5 +4,13 @@ window.addEventListener("DOMContentLoaded", init);
async function init () { async function init () {
let uriData = getURIData(); 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);
} }

View File

@ -125,7 +125,7 @@ class Instance extends HTMLElement {
configButton.src = data.status === "running" ? "images/actions/config-inactive.svg" : "images/actions/config-active.svg"; configButton.src = data.status === "running" ? "images/actions/config-inactive.svg" : "images/actions/config-active.svg";
configButton.addEventListener("click", () => { configButton.addEventListener("click", () => {
if (!this.actionLock && this.status !== "running") { 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});
} }
}) })
} }