mirror of
https://github.com/danbulant/mysqlExporter
synced 2026-07-05 11:20:49 +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 = {};
|
var obj = {};
|
||||||
for(var r of result) {
|
for(var r of result) {
|
||||||
try {
|
try {
|
||||||
obj[r] = await query(pool, "DESCRIBE " + r);
|
obj[r] = await query(pool, "SHOW FULL COLUMNS FROM " + r);
|
||||||
} catch(e){
|
} catch(e){
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
if(window.location.hostname !== "localhost") {
|
||||||
|
console.log("Fetching info supported only from localhost!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var res = await fetch("/tables");
|
var res = await fetch("/tables");
|
||||||
var tables = await res.json();
|
var tables = await res.json();
|
||||||
app.innerText = "";
|
app.innerText = "";
|
||||||
|
|
@ -41,6 +46,8 @@
|
||||||
<th>Key?</th>
|
<th>Key?</th>
|
||||||
<th>Default</th>
|
<th>Default</th>
|
||||||
<th>Extra?</th>
|
<th>Extra?</th>
|
||||||
|
<th>Privileges</th>
|
||||||
|
<th>Comment</th>
|
||||||
</tr>
|
</tr>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
@ -54,6 +61,8 @@
|
||||||
<td>${field.Key}</td>
|
<td>${field.Key}</td>
|
||||||
<td>${field.Default}</td>
|
<td>${field.Default}</td>
|
||||||
<td>${field.Extra}</td>
|
<td>${field.Extra}</td>
|
||||||
|
<td>${field.Privileges}</td>
|
||||||
|
<td>${field.Comment}</td>
|
||||||
</tr>
|
</tr>
|
||||||
`))
|
`))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue