Some code cleanup

This commit is contained in:
Johannes Zellner
2019-09-19 18:41:03 +02:00
parent 4a558a7f65
commit 4822984e34
2 changed files with 10 additions and 14 deletions

View File

@@ -52,18 +52,15 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.view = '';
$scope.app = null;
$scope.activeTask = null;
$scope.appIsRestarting = false;
$scope.ready = false;
$scope.HOST_PORT_MIN = 1024;
$scope.HOST_PORT_MAX = 65535;
$scope.config = Client.getConfig();
$scope.user = Client.getUserInfo();
$scope.domains = [];
$scope.groups = [];
$scope.users = [];
$scope.backupsEnabled = true;
$scope.disableIndexingTemplate = '# Disable search engine indexing\n\nUser-agent: *\nDisallow: /';
$scope.HOST_PORT_MIN = 1024;
$scope.HOST_PORT_MAX = 65535;
$scope.ROBOTS_DISABLE_INDEXING_TEMPLATE = '# Disable search engine indexing\n\nUser-agent: *\nDisallow: /';
$scope.setView = function (view) {
if ($scope.view === view) return;
@@ -599,6 +596,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.debug = {
show: function () {},
appIsRestarting: false,
stopAppTask: function (taskId) {
Client.stopTask(taskId, function (error) {
@@ -608,12 +606,12 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
},
restartApp: function () {
$scope.appIsRestarting = true;
$scope.debug.appIsRestarting = true;
Client.restartApp($scope.app.id, function (error) {
if (error) Client.error(error);
$scope.appIsRestarting = false;
$scope.debug.appIsRestarting = false;
});
}
};
@@ -778,9 +776,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.backups.show();
$scope.updates.show();
$scope.ready = true;
var refreshTimer = $interval(function () { refreshApp(); }, 5000); // call with inline function to avoid iteration argument passed see $interval docs
var refreshTimer = $interval(function () { refreshApp(); }, 3000); // call with inline function to avoid iteration argument passed see $interval docs
$scope.$on('$destroy', function () {
$interval.cancel(refreshTimer);
});