mirror of
https://github.com/danbulant/mysqlExporterDeno
synced 2026-05-19 04:08:50 +00:00
Show comments and privileges
This commit is contained in:
parent
3135102d3c
commit
962ebf5b98
2 changed files with 10 additions and 1 deletions
2
index.js
2
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 @@
|
|||
<th>Key?</th>
|
||||
<th>Default</th>
|
||||
<th>Extra?</th>
|
||||
<th>Privileges</th>
|
||||
<th>Comment</th>
|
||||
</tr>
|
||||
`);
|
||||
|
||||
|
|
@ -54,6 +61,8 @@
|
|||
<td>${field.Key}</td>
|
||||
<td>${field.Default}</td>
|
||||
<td>${field.Extra}</td>
|
||||
<td>${field.Privileges}</td>
|
||||
<td>${field.Comment}</td>
|
||||
</tr>
|
||||
`))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue