Skip to content

Commit

Permalink
improving sync docker graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
oxmix committed Jun 26, 2022
1 parent 38a8cf4 commit 5f97d48
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,13 @@ var hgls = (function () {
}

if (data.event === 'docker-cpu') {
Object.keys(data.docker).forEach(function (name, k) {
chart.data.datasets[k].data.push([timeFormat(data.time), data.docker[name][0]]);
Object.keys(chart.data.datasets).forEach(function (k) {
var label = chart.data.datasets[k].label;
var val = 0;
if (label in data.docker)
val = data.docker[label][0];

chart.data.datasets[k].data.push([timeFormat(data.time), val]);
});
chart.update();
chartCutting(chart);
Expand Down

0 comments on commit 5f97d48

Please sign in to comment.