Comparing version 0.2.1 to 0.3.0
@@ -0,1 +1,7 @@ | ||
0.3.0 / 2015-01-02 | ||
================== | ||
* add: kill container | ||
* add: filter containers | ||
0.2.1 / 2014-12-31 | ||
@@ -2,0 +8,0 @@ ================== |
{ | ||
"name": "bluewhale", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Dockerboard Web Client", | ||
@@ -40,3 +40,3 @@ "main": "dist/index.html", | ||
"gulp-rev": "^2.0.1", | ||
"gulp-sass": "^1.2.4", | ||
"gulp-sass": "ajoslin/gulp-sass#master", | ||
"gulp-uglify": "^1.0.2", | ||
@@ -43,0 +43,0 @@ "gulp-usemin": "^0.3.8", |
@@ -34,3 +34,6 @@ (function () { | ||
$scope.queryParamsFilters = ''; | ||
$scope.fetch = function () { | ||
$scope.queryParams.filters = parseFilters($scope.queryParamsFilters); | ||
Containers.query($scope.queryParams, function (data) { | ||
@@ -60,2 +63,20 @@ $scope.containers = data; | ||
function parseFilters(text) { | ||
if (!text) return ''; | ||
var filters = {}; | ||
var arr = text.split(/\s+/g); | ||
for (var i = 0, l = arr.length; i < l; ++i) { | ||
var f = arr[i].split('='); | ||
if (f.length !== 2) { | ||
continue; | ||
} | ||
var name = f[0]; | ||
var value = f[1]; | ||
if (name && value) { | ||
filters[name] = filters[name] || []; | ||
filters[name].push(value); | ||
} | ||
} | ||
return JSON.stringify(filters); | ||
} | ||
} | ||
@@ -130,2 +151,14 @@ | ||
$scope.kill = function (ev) { | ||
$mdDialog.show({ | ||
controller: KillDialogController, | ||
templateUrl: '/js/modules/containers/views/container.kill.dialog.tpl.html', | ||
locals: { parentScope: $scope }, | ||
targetEvent: ev, | ||
}) | ||
.then(function (running) { | ||
$scope.container.State.Running = running; | ||
$scope.container.State.Pid = 0; | ||
}); | ||
}; | ||
} | ||
@@ -203,3 +236,5 @@ | ||
action: $scope.action | ||
}, $scope.params, function (data) { | ||
}, | ||
$scope.params, | ||
function (data) { | ||
var running = !$scope.container.State.Running; | ||
@@ -210,3 +245,4 @@ if ($scope.action == 'restart') { | ||
$mdDialog.hide(running); | ||
}, function (e) { | ||
}, | ||
function (e) { | ||
if (e.status === 304) { | ||
@@ -275,2 +311,33 @@ var running = !$scope.container.State.Running; | ||
KillDialogController.$inject = ['$scope', '$mdDialog', 'parentScope', 'ContainerActions']; | ||
function KillDialogController($scope, $mdDialog, parentScope, ContainerActions) { | ||
$scope.container = parentScope.container; | ||
$scope.containerShortId = parentScope.containerShortId; | ||
$scope.action = 'kill'; | ||
$scope.params = { | ||
signal: '' | ||
}; | ||
$scope.content = ''; | ||
$scope.cancel = function () { | ||
$mdDialog.cancel(); | ||
}; | ||
$scope.ok = function () { | ||
ContainerActions.update({ | ||
Id: $scope.containerShortId, | ||
action: $scope.action | ||
}, | ||
$scope.params, | ||
function (data) { | ||
$mdDialog.hide(false); | ||
}, | ||
function (e) { | ||
$scope.content = e.data; | ||
}); | ||
}; | ||
} | ||
})(); |
@@ -26,3 +26,4 @@ (function () { | ||
since: '', | ||
before: '' | ||
before: '', | ||
filters: '' | ||
}; | ||
@@ -29,0 +30,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5580848
95
3447