diff --git a/static/index.html b/static/index.html index b601133..ef0f3aa 100644 --- a/static/index.html +++ b/static/index.html @@ -78,6 +78,9 @@ var res = await fetch("/tables"); var tables = await res.json(); + var re = await fetch("/fieldsIgnored"); + var fieldsIgnored = await re.json(); + fieldsIgnored = fieldsIgnored.map(el => el.toLowerCase()); app.innerText = ""; for (var table in tables) { @@ -102,29 +105,34 @@ var head = htmlToElement(` - Field - Type - Null? - Key? - Default - Extra? - Privileges - Comment + ${fieldsIgnored.includes("field") ? "" : "Field" } + ${fieldsIgnored.includes("type") ? "" : "Type" } + ${fieldsIgnored.includes("collation") ? "" : "Collation" } + ${fieldsIgnored.includes("null") ? "" : "Null?" } + ${fieldsIgnored.includes("key") ? "" : "Key?" } + ${fieldsIgnored.includes("default") ? "" : "Default" } + ${fieldsIgnored.includes("extra") ? "" : "Extra?" } + ${fieldsIgnored.includes("privileges") ? "" : "Privileges" } + ${fieldsIgnored.includes("comment") ? "" : "Comment" } `); tableEl.appendChild(head); - for(var field of data.columns) { + for(var column of data.columns) { + var el = ""; + for(var field in column) { + if(fieldsIgnored.includes(field.toLowerCase())) continue; + if(column[field]) { + el += "" + column[field] + ""; + } else if(field == "Default") { + el += "null"; + } else { + el += ""; + } + } tableEl.appendChild(htmlToElement(` - ${field.Field} - ${field.Type} - ${field.Null} - ${field.Key} - ${field.Default} - ${field.Extra} - ${field.Privileges} - ${field.Comment} + ${el} `)) }