mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-04 17:33:21 +08:00
Query DinD instances for running containers and list the published ports
so the user can reverse proxy to the instance/port easily.
This commit is contained in:
@@ -141,10 +141,11 @@
|
||||
$scope.connected = true;
|
||||
});
|
||||
|
||||
socket.on('instance stats', function(name, mem, cpu, isManager) {
|
||||
socket.on('instance stats', function(name, mem, cpu, isManager, ports) {
|
||||
$scope.idx[name].mem = mem;
|
||||
$scope.idx[name].cpu = cpu;
|
||||
$scope.idx[name].isManager = isManager;
|
||||
$scope.idx[name].ports = ports;
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
@@ -167,6 +168,12 @@
|
||||
});
|
||||
}
|
||||
|
||||
$scope.getProxyUrl = function(instance, port) {
|
||||
var url = window.location.protocol + '//ip' + instance.ip.replace(/\./g, '_') + '-' + port + '.' + window.location.host;
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
$scope.showInstance = function(instance) {
|
||||
$scope.selectedInstance = instance;
|
||||
if (!instance.creatingTerminal) {
|
||||
|
Reference in New Issue
Block a user