admin ui fixes
This commit is contained in:
@@ -83,11 +83,7 @@ DirectoryElement.prototype.addFile = function(icon, name, href, type, size, size
|
||||
}
|
||||
|
||||
DirectoryElement.prototype.renderFiles = function() {
|
||||
this.visibleFiles = []
|
||||
for (let i in this.allFiles) {
|
||||
this.visibleFiles.push(i)
|
||||
}
|
||||
this.sortBy("")
|
||||
this.search(this.lastSearchTerm)
|
||||
}
|
||||
|
||||
// search filters the allFiles array on a search term. All files which match the
|
||||
@@ -129,7 +125,7 @@ DirectoryElement.prototype.sortBy = function(field) {
|
||||
this.currentSortAscending = true
|
||||
this.currentSortField = field
|
||||
} else if (this.currentSortField === field) {
|
||||
// If it is the same field as before re reverse the sort order
|
||||
// If it is the same field as before we reverse the sort order
|
||||
this.currentSortAscending = !this.currentSortAscending
|
||||
}
|
||||
}
|
||||
|
@@ -150,15 +150,13 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<td onclick="getStats('query_name')">Query</td>
|
||||
<td onclick="getStats('events')">Events</td>
|
||||
<td onclick="getStats('calls')">Calls</td>
|
||||
<td onclick="getStats('average_duration')">Average Duration</td>
|
||||
<td onclick="getStats('total_duration')">Total Duration</td>
|
||||
<td>Callers</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tstat_body">
|
||||
|
||||
</tbody>
|
||||
<tbody id="tstat_body"></tbody>
|
||||
</table>
|
||||
<script>
|
||||
function getStats(order) {
|
||||
@@ -180,6 +178,7 @@
|
||||
|
||||
resp.query_statistics.forEach((v) => {
|
||||
let callers = ""
|
||||
v.callers.sort((a, b) => b.count - a.count)
|
||||
v.callers.forEach((v1) => {
|
||||
callers += `${v1.count}x ${v1.name}<br/>`
|
||||
})
|
||||
@@ -187,7 +186,7 @@
|
||||
let row = document.createElement("tr")
|
||||
row.innerHTML = `\
|
||||
<td>${v.query_name}</td>
|
||||
<td>${v.events}</td>
|
||||
<td>${v.calls}</td>
|
||||
<td>${v.average_duration}ms</td>
|
||||
<td>${v.total_duration}ms</td>
|
||||
<td>${callers}</td>`
|
||||
|
Reference in New Issue
Block a user