Skip to content

Commit

Permalink
Add support for displaying labels on I/O graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Oct 3, 2024
1 parent 1d11640 commit 0d99c83
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extensions/stats/stats.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified extensions/stats/stats.min.js.gz
Binary file not shown.
15 changes: 14 additions & 1 deletion extensions/stats/stats.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,20 @@ const stats = {
);

// Remove loader
this[`chart_${type}`].on("created", () => ld.remove());
this[`chart_${type}`].on("created", (data) => {
// Add labels to the first foreign object
const ffObj = data.svg.getNode().querySelector('foreignObject');
if (ffObj) {
const readLbl = this._.language(`dashboard_chart_${type}_read`),
writeLbl = this._.language(`dashboard_chart_${type}_write`);
if (readLbl && writeLbl) {
ffObj.setAttribute('data-label-read', `▪ ${readLbl}`);
ffObj.setAttribute('data-label-write', `▪ ${writeLbl}`);
}
}
// Clean-up loader
ld.remove();
});
}
});
}
Expand Down
9 changes: 8 additions & 1 deletion lang/en
Original file line number Diff line number Diff line change
Expand Up @@ -1473,4 +1473,11 @@ theme_xhred_hotkey_switch_theme=Switch theme
# 21.20.2
theme_xhred_filemanager_upload_status_ok=Upload successful
theme_xhred_filemanager_upload_status_err=Upload failed:
theme_xhred_filemanager_download_status_err=Download failed:
theme_xhred_filemanager_download_status_err=Download failed:


# 21.20.7
theme_xhred_dashboard_chart_disk_read=Read
theme_xhred_dashboard_chart_disk_write=Write
theme_xhred_dashboard_chart_net_read=Fetch
theme_xhred_dashboard_chart_net_write=Send
2 changes: 1 addition & 1 deletion unauthenticated/css/bundle.min.css

Large diffs are not rendered by default.

Binary file modified unauthenticated/css/bundle.min.css.gz
Binary file not shown.
Binary file modified unauthenticated/js/bundle.min.js.gz
Binary file not shown.

0 comments on commit 0d99c83

Please sign in to comment.