ui: optional redis

fixes #810
This commit is contained in:
Girish Ramakrishnan
2023-07-14 09:03:23 +05:30
parent 866cf75012
commit e1ff5f1cae
5 changed files with 71 additions and 7 deletions

View File

@@ -590,12 +590,14 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
busy: false,
enableTurn: '1', // curse of radio buttons
enableRedis: '1',
show: function () {
var app = $scope.app;
$scope.services.error = {};
$scope.services.enableTurn = app.enableTurn ? '1' : '0';
$scope.services.enableRedis = app.enableRedis ? '1' : '0';
},
submitTurn: function () {
@@ -613,6 +615,22 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$timeout(function () { $scope.services.busy = false; }, 1000);
});
},
submitRedis: function () {
$scope.services.busy = true;
$scope.services.error = {};
Client.configureApp($scope.app.id, 'redis', { enable: $scope.services.enableRedis === '1' }, function (error) {
if (error && error.statusCode === 400) {
$scope.services.busy = false;
$scope.services.error.redis = true;
return;
}
if (error) return Client.error(error);
$timeout(function () { $scope.services.busy = false; }, 1000);
});
},
};
$scope.storage = {