fix config form icon styling
This commit is contained in:
parent
7f4c006385
commit
e37c19de77
@ -39,4 +39,8 @@ legend {
|
|||||||
top: -0.6em;
|
top: -0.6em;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
form > img {
|
||||||
|
width: 16px;
|
||||||
}
|
}
|
@ -25,7 +25,7 @@ async function populateForm (node, type, vmid) {
|
|||||||
console.log(config);
|
console.log(config);
|
||||||
|
|
||||||
let name = type === "qemu" ? "name" : "hostname";
|
let name = type === "qemu" ? "name" : "hostname";
|
||||||
addFormLine("name", "Name", {type: "text", value: config.data[name]});
|
addFormLine("name", null, "Name", {type: "text", value: config.data[name]});
|
||||||
addFormLine("resources", "images/resources/cpu.svg", "Cores", {type: "number", value: config.data.cores, min: 1, max: 8192}, "Threads");
|
addFormLine("resources", "images/resources/cpu.svg", "Cores", {type: "number", value: config.data.cores, min: 1, max: 8192}, "Threads");
|
||||||
addFormLine("resources", "images/resources/ram.svg", "Memory", {type: "number", value: config.data.memory / 1024, min: 0, step: 0.001}, "GiB");
|
addFormLine("resources", "images/resources/ram.svg", "Memory", {type: "number", value: config.data.memory / 1024, min: 0, step: 0.001}, "GiB");
|
||||||
if (type === "lxc") {
|
if (type === "lxc") {
|
||||||
@ -57,9 +57,11 @@ async function populateForm (node, type, vmid) {
|
|||||||
function addFormLine (fieldset, iconHref, labelText, inputAttr, unitText=null) {
|
function addFormLine (fieldset, iconHref, labelText, inputAttr, unitText=null) {
|
||||||
let field = document.querySelector(`#${fieldset}`);
|
let field = document.querySelector(`#${fieldset}`);
|
||||||
|
|
||||||
let icon = document.createElement("img");
|
if (icon) {
|
||||||
icon.src = iconHref;
|
let icon = document.createElement("img");
|
||||||
field.append(icon);
|
icon.src = iconHref;
|
||||||
|
field.append(icon);
|
||||||
|
}
|
||||||
|
|
||||||
let label = document.createElement("label");
|
let label = document.createElement("label");
|
||||||
label.innerHTML = labelText;
|
label.innerHTML = labelText;
|
||||||
|
Loading…
Reference in New Issue
Block a user