Disable various views for non-operators
This commit is contained in:
@@ -4,6 +4,8 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); });
|
||||
|
||||
$scope.config = Client.getConfig();
|
||||
$scope.user = Client.getUserInfo();
|
||||
|
||||
$scope.backupConfig = {};
|
||||
$scope.lastBackup = null;
|
||||
$scope.backups = [];
|
||||
@@ -64,6 +66,8 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
];
|
||||
|
||||
$scope.prettyProviderName = function (provider) {
|
||||
if (!$scope.config.features.operatorActions) return $scope.config.provider;
|
||||
|
||||
switch (provider) {
|
||||
case 'caas': return 'Managed Cloudron';
|
||||
default: return provider;
|
||||
@@ -316,8 +320,6 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
// $scope.configureBackup.reset();
|
||||
$('#configureBackupModal').modal('hide');
|
||||
|
||||
// now refresh the ui
|
||||
Client.refreshConfig();
|
||||
getBackupConfig();
|
||||
});
|
||||
}
|
||||
@@ -347,7 +349,7 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat
|
||||
|
||||
Client.onReady(function () {
|
||||
fetchBackups();
|
||||
getBackupConfig();
|
||||
if ($scope.config.features.operatorActions) getBackupConfig();
|
||||
|
||||
// show backup status
|
||||
$scope.createBackup.updateStatus();
|
||||
|
||||
Reference in New Issue
Block a user