1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 21:39:40 +02:00

Moved LineChart to services, cleaned up remaining functions in controller, cleanup.

This commit is contained in:
Kevan Ahlquist 2014-11-29 00:06:06 -06:00
parent e3eb37ba56
commit ada1c6a4e4
9 changed files with 82 additions and 83 deletions

View file

@ -1,15 +1,15 @@
angular.module('dashboard', [])
.controller('DashboardController', ['$scope', 'Container', 'Image', 'Settings', function($scope, Container, Image, Settings) {
.controller('DashboardController', ['$scope', 'Container', 'Image', 'Settings', 'LineChart', function($scope, Container, Image, Settings, LineChart) {
$scope.predicate = '-Created';
$scope.containers = [];
var getStarted = function(data) {
$scope.totalContainers = data.length;
newLineChart('#containers-started-chart', data, function(c) { return new Date(c.Created * 1000).toLocaleDateString(); });
LineChart.build('#containers-started-chart', data, function(c) { return new Date(c.Created * 1000).toLocaleDateString(); });
var s = $scope;
Image.query({}, function(d) {
s.totalImages = d.length;
newLineChart('#images-created-chart', d, function(c) { return new Date(c.Created * 1000).toLocaleDateString(); });
LineChart.build('#images-created-chart', d, function(c) { return new Date(c.Created * 1000).toLocaleDateString(); });
});
};
@ -46,7 +46,7 @@ angular.module('dashboard', [])
getStarted(d);
var c = getChart('#containers-chart');
var c = new Chart($('#containers-chart').get(0).getContext("2d"));
var data = [
{
value: running,