diff --git a/index.js b/index.js index 8a79575..afccad9 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,7 @@ app.get("/tables", (req, res) => { var obj = {}; for(var r of result) { try { - obj[r] = await query(pool, "DESCRIBE " + r); + obj[r] = await query(pool, "SHOW FULL COLUMNS FROM " + r); } catch(e){ console.error(e); } diff --git a/static/index.html b/static/index.html index f6bd21e..484b1ad 100644 --- a/static/index.html +++ b/static/index.html @@ -21,6 +21,11 @@ } (async () => { + if(window.location.hostname !== "localhost") { + console.log("Fetching info supported only from localhost!"); + return; + } + var res = await fetch("/tables"); var tables = await res.json(); app.innerText = ""; @@ -41,6 +46,8 @@ Key? Default Extra? + Privileges + Comment `); @@ -54,6 +61,8 @@ ${field.Key} ${field.Default} ${field.Extra} + ${field.Privileges} + ${field.Comment} `)) }