mirror of
https://git.cyberia.club/cyberia/matrix-synapse-diskspace-janitor
synced 2024-05-20 01:16:33 +02:00
cleanup
This commit is contained in:
parent
8c09548fd8
commit
e2667e798d
|
@ -8,7 +8,6 @@
|
|||
<link rel="shortcut icon" href="/static/favicon.png" />
|
||||
<link href="/static/app.css?v={{.CSSHash}}" rel="stylesheet">
|
||||
|
||||
<script src="/static/vendor/chart.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
|
|
@ -20,30 +20,14 @@
|
|||
|
||||
|
||||
|
||||
<script src="static/vendor/chartjs/chart.js"></script>
|
||||
<script type="module" src="static/vendor/chartjs/chart.js"></script>
|
||||
<script>
|
||||
|
||||
const diskUsage = {{ .DiskUsage }};
|
||||
const dbTableSizes = {{ .DBTableSizes }};
|
||||
const rowCountByRoom = {{ .RowCountByRoom }};
|
||||
|
||||
|
||||
const tableIndexes = tableSizeOutput.split("\n").map(rowString => {
|
||||
const row = rowString.split("|").map(raw => raw.trim());
|
||||
const tableSizeElements = row[3].split(" ");
|
||||
const tableSizeSuffixes = {
|
||||
"bytes": 1,
|
||||
"kB": 1000,
|
||||
"MB": 1000*1000,
|
||||
"GB": 1000*1000*1000
|
||||
}
|
||||
return {
|
||||
name: row[0],
|
||||
numRows: Number(row[2]),
|
||||
bytes: Number(tableSizeElements[0])*tableSizeSuffixes[tableSizeElements[1]],
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
dbTableSizes.sort((a, b) => {
|
||||
return b.Bytes - a.Bytes;
|
||||
|
|
Loading…
Reference in a new issue