Disable various views for non-operators

This commit is contained in:
Girish Ramakrishnan
2018-09-05 14:37:54 -07:00
parent 97b6e4c672
commit 02f04e2d33
10 changed files with 25 additions and 17 deletions

View File

@@ -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();