From 829ff5da73e392b5c751f1711226344673436ec2 Mon Sep 17 00:00:00 2001 From: Hendrik Hofstadt Date: Sat, 7 Feb 2015 23:02:35 +0100 Subject: [PATCH 01/11] fixed loss of hostconfig when starting with batch --- app/components/containers/containersController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/containers/containersController.js b/app/components/containers/containersController.js index 7d26cba87..089c28f9f 100644 --- a/app/components/containers/containersController.js +++ b/app/components/containers/containersController.js @@ -27,7 +27,7 @@ function($scope, Container, Settings, Messages, ViewSpinner) { angular.forEach(items, function(c) { if (c.Checked) { counter = counter + 1; - action({id: c.Id}, function(d) { + action({id: c.Id, HostConfig: c.HostConfig}, function(d) { Messages.send("Container " + msg, c.Id); var index = $scope.containers.indexOf(c); complete(); From dabb1926a52a39e9776c901b79583307c5a4ca90 Mon Sep 17 00:00:00 2001 From: Hendrik Hofstadt Date: Sun, 8 Feb 2015 19:59:26 +0100 Subject: [PATCH 02/11] fixed all HostConfigs being lost when starting from the list --- .../containers/containersController.js | 44 ++++++++++++++---- dist/dockerui.js | 46 +++++++++++++++---- 2 files changed, 71 insertions(+), 19 deletions(-) diff --git a/app/components/containers/containersController.js b/app/components/containers/containersController.js index 089c28f9f..a57317ee1 100644 --- a/app/components/containers/containersController.js +++ b/app/components/containers/containersController.js @@ -26,15 +26,41 @@ function($scope, Container, Settings, Messages, ViewSpinner) { }; angular.forEach(items, function(c) { if (c.Checked) { - counter = counter + 1; - action({id: c.Id, HostConfig: c.HostConfig}, function(d) { - Messages.send("Container " + msg, c.Id); - var index = $scope.containers.indexOf(c); - complete(); - }, function(e) { - Messages.error("Failure", e.data); - complete(); - }); + if(msg === "Started"){ + Container.get({id: c.Id}, function(d) { + c = d; + counter = counter + 1; + action({id: c.Id, HostConfig: c.HostConfig || {}}, function(d) { + Messages.send("Container " + msg, c.Id); + var index = $scope.containers.indexOf(c); + complete(); + }, function(e) { + Messages.error("Failure", e.data); + complete(); + }); + }, function(e) { + if (e.status === 404) { + $('.detail').hide(); + Messages.error("Not found", "Container not found."); + } else { + Messages.error("Failure", e.data); + } + complete(); + }); + } + else{ + counter = counter + 1; + action({id: c.Id}, function(d) { + Messages.send("Container " + msg, c.Id); + var index = $scope.containers.indexOf(c); + complete(); + }, function(e) { + Messages.error("Failure", e.data); + complete(); + }); + + } + } }); if (counter === 0) { diff --git a/dist/dockerui.js b/dist/dockerui.js index adb915903..27762939e 100644 --- a/dist/dockerui.js +++ b/dist/dockerui.js @@ -1,4 +1,4 @@ -/*! dockerui - v0.6.0 - 2015-02-01 +/*! dockerui - v0.6.0 - 2015-02-08 * https://github.com/crosbymichael/dockerui * Copyright (c) 2015 Michael Crosby & Kevan Ahlquist; * Licensed MIT @@ -211,15 +211,41 @@ function($scope, Container, Settings, Messages, ViewSpinner) { }; angular.forEach(items, function(c) { if (c.Checked) { - counter = counter + 1; - action({id: c.Id}, function(d) { - Messages.send("Container " + msg, c.Id); - var index = $scope.containers.indexOf(c); - complete(); - }, function(e) { - Messages.error("Failure", e.data); - complete(); - }); + if(msg === "Started"){ + Container.get({id: c.Id}, function(d) { + c = d; + counter = counter + 1; + action({id: c.Id, HostConfig: c.HostConfig || {}}, function(d) { + Messages.send("Container " + msg, c.Id); + var index = $scope.containers.indexOf(c); + complete(); + }, function(e) { + Messages.error("Failure", e.data); + complete(); + }); + }, function(e) { + if (e.status === 404) { + $('.detail').hide(); + Messages.error("Not found", "Container not found."); + } else { + Messages.error("Failure", e.data); + } + complete(); + }); + } + else{ + counter = counter + 1; + action({id: c.Id}, function(d) { + Messages.send("Container " + msg, c.Id); + var index = $scope.containers.indexOf(c); + complete(); + }, function(e) { + Messages.error("Failure", e.data); + complete(); + }); + + } + } }); if (counter === 0) { From 8abb445bd413d0d7a9ce4aa4f89196367ae2dfce Mon Sep 17 00:00:00 2001 From: Hendrik Hofstadt Date: Mon, 9 Feb 2015 20:06:28 +0100 Subject: [PATCH 03/11] nicer solution for checking the action --- app/components/containers/containersController.js | 2 +- dist/dockerui.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/containers/containersController.js b/app/components/containers/containersController.js index a57317ee1..08bd74def 100644 --- a/app/components/containers/containersController.js +++ b/app/components/containers/containersController.js @@ -26,7 +26,7 @@ function($scope, Container, Settings, Messages, ViewSpinner) { }; angular.forEach(items, function(c) { if (c.Checked) { - if(msg === "Started"){ + if(action === Container.start){ Container.get({id: c.Id}, function(d) { c = d; counter = counter + 1; diff --git a/dist/dockerui.js b/dist/dockerui.js index 27762939e..55d37182d 100644 --- a/dist/dockerui.js +++ b/dist/dockerui.js @@ -1,4 +1,4 @@ -/*! dockerui - v0.6.0 - 2015-02-08 +/*! dockerui - v0.6.0 - 2015-02-09 * https://github.com/crosbymichael/dockerui * Copyright (c) 2015 Michael Crosby & Kevan Ahlquist; * Licensed MIT @@ -211,7 +211,7 @@ function($scope, Container, Settings, Messages, ViewSpinner) { }; angular.forEach(items, function(c) { if (c.Checked) { - if(msg === "Started"){ + if(action === Container.start){ Container.get({id: c.Id}, function(d) { c = d; counter = counter + 1; From c7ebe9d88108cb2d08b4f7d6649e2ced1b3928b7 Mon Sep 17 00:00:00 2001 From: Kevan Ahlquist Date: Mon, 9 Feb 2015 23:00:34 -0600 Subject: [PATCH 04/11] Added timestamp option to stderr. --- app/components/containerLogs/containerLogsController.js | 2 +- dist/dockerui.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/containerLogs/containerLogsController.js b/app/components/containerLogs/containerLogsController.js index ddd614d79..70eff4dfc 100644 --- a/app/components/containerLogs/containerLogsController.js +++ b/app/components/containerLogs/containerLogsController.js @@ -23,7 +23,7 @@ function($scope, $routeParams, $location, $anchorScroll, ContainerLogs, Containe // Replace carriage returns twith newlines to clean up output $scope.stdout = data.replace(/[\r]/g, '\n'); }); - ContainerLogs.get($routeParams.id, {stdout: 0, stderr: 1}, function(data, status, headers, config) { + ContainerLogs.get($routeParams.id, {stdout: 0, stderr: 1, timestamps: $scope.showTimestamps}, function(data, status, headers, config) { $scope.stderr = data.replace(/[\r]/g, '\n'); }); } diff --git a/dist/dockerui.js b/dist/dockerui.js index 55d37182d..8452cb065 100644 --- a/dist/dockerui.js +++ b/dist/dockerui.js @@ -159,7 +159,7 @@ function($scope, $routeParams, $location, $anchorScroll, ContainerLogs, Containe // Replace carriage returns twith newlines to clean up output $scope.stdout = data.replace(/[\r]/g, '\n'); }); - ContainerLogs.get($routeParams.id, {stdout: 0, stderr: 1}, function(data, status, headers, config) { + ContainerLogs.get($routeParams.id, {stdout: 0, stderr: 1, timestamps: $scope.showTimestamps}, function(data, status, headers, config) { $scope.stderr = data.replace(/[\r]/g, '\n'); }); } From 0d4274fdebf7ea07d4c3f11f6b72018357a01225 Mon Sep 17 00:00:00 2001 From: Kevan Ahlquist Date: Mon, 9 Feb 2015 23:10:05 -0600 Subject: [PATCH 05/11] Added restart to container list actions. --- app/components/containers/containers.html | 1 + app/components/containers/containersController.js | 4 ++++ dist/dockerui.js | 5 +++++ dist/templates/app.js | 1 + 4 files changed, 11 insertions(+) diff --git a/app/components/containers/containers.html b/app/components/containers/containers.html index a4f159f61..1ae9b1ef7 100644 --- a/app/components/containers/containers.html +++ b/app/components/containers/containers.html @@ -8,6 +8,7 @@