fix config form icon styling
This commit is contained in:
parent
ffd48cafad
commit
0fe83fa2b8
@ -40,3 +40,7 @@ legend {
|
|||||||
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}`);
|
||||||
|
|
||||||
|
if (icon) {
|
||||||
let icon = document.createElement("img");
|
let icon = document.createElement("img");
|
||||||
icon.src = iconHref;
|
icon.src = iconHref;
|
||||||
field.append(icon);
|
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