Use simple input field for custom data dir instead of checkbox

This commit is contained in:
Johannes Zellner
2019-09-20 01:22:10 +02:00
parent 8fbfa86a7f
commit 09b09086ce
2 changed files with 9 additions and 15 deletions
+1 -6
View File
@@ -306,8 +306,6 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
memoryLimit: 0,
memoryTicks: [],
dataDir: null,
currentDataDirEnabled: false,
dataDirEnabled: false,
show: function () {
var app = $scope.app;
@@ -315,8 +313,6 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.resources.error = {};
$scope.resources.currentMemoryLimit = app.memoryLimit || app.manifest.memoryLimit || (256 * 1024 * 1024);
$scope.resources.memoryLimit = $scope.resources.currentMemoryLimit;
$scope.resources.dataDirEnabled = !!app.dataDir;
$scope.resources.currentDataDirEnabled = $scope.resources.dataDirEnabled
$scope.resources.dataDir = app.dataDir;
// create ticks starting from manifest memory limit. the memory limit here is currently split into ram+swap (and thus *2 below)
@@ -350,7 +346,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.resources.busyDataDir = true;
$scope.resources.error = {};
Client.configureApp($scope.app.id, 'data_dir', { dataDir: $scope.resources.dataDirEnabled ? $scope.resources.dataDir : null }, function (error) {
Client.configureApp($scope.app.id, 'data_dir', { dataDir: $scope.resources.dataDir || null }, function (error) {
if (error && error.statusCode === 400) {
$scope.resources.error.dataDir = error.message;
$scope.resources.busyDataDir = false;
@@ -358,7 +354,6 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
if (error) return Client.error(error);
$scope.resources.currentDataDirEnabled = $scope.resources.dataDirEnabled;
$scope.resourcesDataDirForm.$setPristine();
$scope.resources.busyDataDir = false;