feat(dashboard): hide zero-count path and transport rows
This commit is contained in:
@@ -939,10 +939,12 @@ function renderMemory(mem, stats) {
|
|||||||
|
|
||||||
function renderBarChart(containerId, defs, data, total) {
|
function renderBarChart(containerId, defs, data, total) {
|
||||||
total = total || 1;
|
total = total || 1;
|
||||||
document.getElementById(containerId).innerHTML = defs.map(d => {
|
document.getElementById(containerId).innerHTML = defs
|
||||||
const count = data[d.key] || 0;
|
.filter(d => (data[d.key] || 0) > 0)
|
||||||
const pct = ((count / total) * 100).toFixed(1);
|
.map(d => {
|
||||||
return `
|
const count = data[d.key] || 0;
|
||||||
|
const pct = ((count / total) * 100).toFixed(1);
|
||||||
|
return `
|
||||||
<div class="path-bar-row">
|
<div class="path-bar-row">
|
||||||
<span class="path-label">${d.label}</span>
|
<span class="path-label">${d.label}</span>
|
||||||
<div class="path-bar-track">
|
<div class="path-bar-track">
|
||||||
@@ -950,7 +952,7 @@ function renderBarChart(containerId, defs, data, total) {
|
|||||||
</div>
|
</div>
|
||||||
<span class="path-pct">${pct}%</span>
|
<span class="path-pct">${pct}%</span>
|
||||||
</div>`;
|
</div>`;
|
||||||
}).join('');
|
}).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
function encryptionPct(transport) {
|
function encryptionPct(transport) {
|
||||||
|
|||||||
Reference in New Issue
Block a user