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:
@@ -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);
|
||||
}]);
|
||||
})();
|
||||
|
Reference in New Issue
Block a user