services: add recoveryMode checkbox
This commit is contained in:
@@ -20,7 +20,7 @@ angular.module('Application').controller('ServicesController', ['$scope', '$loca
|
||||
if (error) return console.log('Error getting status of ' + serviceName + ':' + error.message);
|
||||
|
||||
var service = $scope.services.find(function (s) { return s.name === serviceName; });
|
||||
if (!service) $scope.services.find(function (s) { return s.name === serviceName; });
|
||||
if (!service) $scope.services[serviceName] = service;
|
||||
|
||||
service.status = result.status;
|
||||
service.config = result.config;
|
||||
@@ -69,13 +69,15 @@ angular.module('Application').controller('ServicesController', ['$scope', '$loca
|
||||
memoryLimit: 0,
|
||||
memoryTicks: [],
|
||||
|
||||
recoveryMode: false,
|
||||
|
||||
show: function (service) {
|
||||
$scope.serviceConfigure.reset();
|
||||
|
||||
$scope.serviceConfigure.service = service;
|
||||
$scope.serviceConfigure.memoryLimit = service.config.memoryLimit;
|
||||
$scope.serviceConfigure.recoveryMode = !!service.config.recoveryMode;
|
||||
|
||||
// TODO improve those
|
||||
$scope.serviceConfigure.memoryTicks = [];
|
||||
|
||||
// create ticks starting from manifest memory limit. the memory limit here is currently split into ram+swap (and thus *2 below)
|
||||
@@ -89,11 +91,14 @@ angular.module('Application').controller('ServicesController', ['$scope', '$loca
|
||||
$('#serviceConfigureModal').modal('show');
|
||||
},
|
||||
|
||||
submit: function (memoryLimit) {
|
||||
submit: function () {
|
||||
$scope.serviceConfigure.busy = true;
|
||||
$scope.serviceConfigure.error = null;
|
||||
|
||||
var data = { memoryLimit: memoryLimit };
|
||||
var data = {
|
||||
memoryLimit: $scope.serviceConfigure.memoryLimit,
|
||||
recoveryMode: $scope.serviceConfigure.recoveryMode
|
||||
};
|
||||
|
||||
Client.configureService($scope.serviceConfigure.service.name, data, function (error) {
|
||||
$scope.serviceConfigure.busy = false;
|
||||
|
||||
Reference in New Issue
Block a user