fix format and null checkbox

This commit is contained in:
Daniel Bulant 2020-04-14 17:27:47 +02:00
parent f73b2acb0d
commit c804fb6d7d

View file

@ -73,7 +73,7 @@
.key {
width: 30px;
}
.null,
.default {
width: 50px;
@ -85,6 +85,28 @@
}
</style>
<!-- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="24"
width="24" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<g transform="translate(0 -1028.4)">
<g transform="matrix(.70711 .70711 -.70711 .70711 740.06 298.16)">
<path
d="m10.541 1028.9c-3.3134 0-5.9997 2.6-5.9997 6 0 3.3 2.6863 6 5.9997 6 3.314 0 6-2.7 6-6 0-3.4-2.686-6-6-6zm0 2c1.105 0 2 0.9 2 2s-0.895 2-2 2c-1.1042 0-1.9997-0.9-1.9997-2s0.8955-2 1.9997-2z"
fill="#f39c12" />
<g fill="#f1c40f">
<path
d="m10 0c-3.3137 0-6 2.6863-6 6s2.6863 6 6 6c3.314 0 6-2.6863 6-6s-2.686-6-6-6zm0 2c1.105 0 2 0.8954 2 2s-0.895 2-2 2c-1.1046 0-2-0.8954-2-2s0.8954-2 2-2z"
transform="translate(0 1028.4)" />
<rect height="2" width="6" y="1039.4" x="7" />
<path d="m8 13v9l2 2 2-2v-1l-2-1 2-1v-1l-1-1 1-1v-3z" transform="translate(0 1028.4)" />
</g>
<path d="m11 1041.4v4l1-1v-3h-1zm0 4v2.5l1-0.5v-1l-1-1zm0 3.5v2.5l1-1v-1l-1-0.5z" fill="#f39c12" />
<path d="m9 1041.4v10l1 1v-4-7h-1z" fill="#f39c12" />
</g>
</g>
</svg> -->
<script>
const app = document.getElementById("app");
@ -143,7 +165,8 @@
} catch (e) {}
function addField(fieldName) {
return fieldsIgnored.includes(fieldName.toLowerCase()) ? "" : `<th class='${fieldName.toLowerCase()}'>${fieldName}</th>`;
return fieldsIgnored.includes(fieldName.toLowerCase()) ? "" :
`<th class='${fieldName.toLowerCase()}'>${fieldName}</th>`;
}
var head = htmlToElement(`
@ -168,25 +191,25 @@
var td = document.createElement("td");
td.className = field.toLowerCase();
switch(field.toLowerCase()) {
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.value = (column[field] === "YES" ? 1 : 0);
cb.disabled = true;
column[field] = cb;
case "extra":
if(column[field] === "auto_increment") {
if (column[field] === "auto_increment") {
column[field] = "AI";
td.title = "Auto increment";
}
}
if (column[field]) {
if(column[field] instanceof HTMLElement) {
if (column[field] instanceof HTMLElement) {
td.appendChild(column[field]);
} else {
td.innerText = column[field];