1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-05 09:53:21 +08:00

Return swarm info to be displayed in the FE

This requires that PWD is working as a container in the same
network as all dinds

Add icons to swarmInfo
This commit is contained in:
Marcos Lilljedahl
2016-11-23 13:50:21 -03:00
parent 0f4aea4de3
commit 10bdf3d5f2
7 changed files with 72 additions and 8 deletions

View File

@@ -3,6 +3,7 @@
var app = angular.module('DockerPlay', ['ngMaterial']);
app.controller('PlayController', ['$scope', '$log', '$http', '$location', '$timeout', '$mdDialog', '$window', function($scope, $log, $http, $location, $timeout, $mdDialog, $window) {
$scope.sessionId = window.location.pathname.replace('/p/', '');
$scope.instances = [];
@@ -132,9 +133,10 @@
$scope.connected = true;
});
socket.on('instance stats', function(name, mem, cpu) {
socket.on('instance stats', function(name, mem, cpu, isManager) {
$scope.idx[name].mem = mem;
$scope.idx[name].cpu = cpu;
$scope.idx[name].isManager = isManager;
$scope.$apply();
});
@@ -210,7 +212,7 @@
});
term.open(terminalContainer);
// Set geometry during the next tick, to avoid race conditions.
setTimeout(function() {
$scope.resize(term.proposeGeometry());
@@ -231,5 +233,9 @@
cb();
}
}
}]);
}])
.config(['$mdIconProvider', function($mdIconProvider) {
$mdIconProvider.defaultIconSet('../assets/social-icons.svg', 24);
}]);
})();