diff --git a/src/views/system.js b/src/views/system.js index f3794b09b..a6324837a 100644 --- a/src/views/system.js +++ b/src/views/system.js @@ -204,18 +204,21 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati $scope.graphs[chartPropertyName] = new Chart(ctx, { type: 'line', data: graphData, options: options }); } - // var threshold = 1024 * 1024; - // var appsWithHighMemory = Object.keys(result.apps).map(function (appId) { - // result.apps[appId].id = appId; - // return result.apps[appId]; - // }).filter(function (app) { - // if (!app.memory) return false; // not sure why we get empty objects - // return app.memory.datapoints.some(function (d) { return d[0] > threshold; }); - // }).map(function (app) { - // return { data: app.memory, label: app.id }; - // }); + var threshold = 1024 * 1024 * 1024; + var appsWithHighMemory = Object.keys(result.apps).map(function (appId) { + result.apps[appId].id = appId; - var appsWithHighMemory = []; + var app = Client.getInstalledAppsByAppId()[appId]; + if (!app) result.apps[appId].label = appId; + else result.apps[appId].label = app.label || app.fqdn; + + return result.apps[appId]; + }).filter(function (app) { + if (!app.memory) return false; // not sure why we get empty objects + return app.memory.datapoints.some(function (d) { return d[0] > threshold; }); + }).map(function (app) { + return { data: app.memory, label: app.label }; + }); fillGraph('#graphsCPUChart', [{ data: result.cpu, label: 'CPU' }], 'cpuChart', 100, 1); fillGraph('#graphsSystemMemoryChart', [{ data: result.memory, label: 'Memory' }].concat(appsWithHighMemory), 'memoryChart', 1024 * 1024, Number.parseInt($scope.memory.memory / 1024 / 1024));