diff --git a/static/index.html b/static/index.html index ca7a7cd..f986b20 100644 --- a/static/index.html +++ b/static/index.html @@ -139,7 +139,7 @@ function addField(fieldName) { return fieldsIgnored.includes(fieldName.toLowerCase()) ? "" : `${fieldName}`; } - + var head = htmlToElement(` ${addField("Field")} @@ -156,25 +156,37 @@ tableEl.appendChild(head); for (var column of data.columns) { - var el = ""; + var el = document.createElement("tr"); for (var field in column) { if (fieldsIgnored.includes(field.toLowerCase())) continue; + var td = document.createElement("td"); + td.className = field.toLowerCase(); - if (field.toLowerCase() === "privileges") { - column[field] = column[field].split(",").join(", "); + switch(field.toLowerCase()) { + case "privileges": + column[field] = column[field].split(",").join(", "); + break; + case "null": + let cb = document.createElement("input"); + cb.type = "checkbox"; + cb.value = (column[field] === "YES"); + cb.disabled = true; + column[field] = cb; } if (column[field]) { - el += `${column[field]}`; + if(column[field] instanceof HTMLElement) { + td.appendChild(column[field]); + } else { + td.innerText = column[field]; + } } else if (field == "Default") { - el += "null"; - } else { - el += ``; + td.innerText = "null"; } - + el.appendChild(td); } - tableEl.appendChild(htmlToElement(`${el}`)); + tableEl.appendChild(el); } app.appendChild(tableEl);