diff --git a/src/index.html b/src/index.html index c2ade43cd..fe085e449 100644 --- a/src/index.html +++ b/src/index.html @@ -156,8 +156,8 @@
  • Email
  • Graphs
  • Settings
  • -
  • -
  • Support
  • +
  • +
  • Support
  • Logout
  • diff --git a/src/js/client.js b/src/js/client.js index efc71859c..8e40ceb45 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -233,7 +233,8 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N // derive feature flags from edition config.features = { spaces: config.edition === 'education', - hyphenatedSubdomains: config.edition === 'hostingprovider' + hyphenatedSubdomains: config.edition === 'hostingprovider', + operatorActions: config.edition !== 'hostingprovider' }; angular.copy(config, this._config); diff --git a/src/js/main.js b/src/js/main.js index c385ea7ec..6eb993701 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -182,7 +182,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route', $scope.initialized = true; - if ($scope.user.admin) { + if ($scope.user.admin && $scope.config.features.operatorActions) { runConfigurationChecks(); $scope.fetchAppstoreProfileAndSubscription(function (error) { diff --git a/src/views/apps.js b/src/views/apps.js index dcedd7c0e..1915d9ff3 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -608,7 +608,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location fetchUsers(); fetchGroups(); getDomains(); - if ($scope.user.admin) getBackupConfig(); // FIXME: detect disabled backups some other way + if ($scope.user.admin && $scope.config.features.operatorActions) getBackupConfig(); // FIXME: detect disabled backups some other way } var refreshAppsTimer = $interval(Client.refreshInstalledApps.bind(Client), 5000); diff --git a/src/views/appstore.js b/src/views/appstore.js index a8fbae006..d2bd45a7d 100644 --- a/src/views/appstore.js +++ b/src/views/appstore.js @@ -492,6 +492,11 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca return callback(); } + if ($scope.user.admin && !$scope.config.features.operatorActions) { + $scope.validAppstoreAccount = true; + return callback(); + } + Client.getAppstoreConfig(function (error, result) { if (error) return callback(error); diff --git a/src/views/backups.html b/src/views/backups.html index 997f0e0c5..8a1f449dd 100644 --- a/src/views/backups.html +++ b/src/views/backups.html @@ -160,7 +160,7 @@ {{ prettyProviderName(backupConfig.provider) }} -
    +
    Location
    @@ -171,7 +171,7 @@
    -
    +
    Storage Format
    @@ -227,7 +227,7 @@

    - +
    diff --git a/src/views/backups.js b/src/views/backups.js index ca73aa6c3..54b84b943 100644 --- a/src/views/backups.js +++ b/src/views/backups.js @@ -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(); diff --git a/src/views/settings.html b/src/views/settings.html index fcb147d08..b441ea42c 100644 --- a/src/views/settings.html +++ b/src/views/settings.html @@ -228,11 +228,11 @@ -
    +

    Cloudron.io Account

    -
    +
    A Cloudron subscription provides access to the Cloudron App Store. This ensures you are running the latest version and keeps your apps and server secure. diff --git a/src/views/settings.js b/src/views/settings.js index 99a931f4c..66aa52018 100644 --- a/src/views/settings.js +++ b/src/views/settings.js @@ -20,8 +20,8 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca $scope.prettyProviderName = function (provider) { switch (provider) { - case 'caas': return 'Managed Cloudron'; - default: return provider; + case 'caas': return 'Managed Cloudron'; + default: return provider; } }; @@ -417,7 +417,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca $scope.currentPlan = caasConfig.plan; $scope.currency = caasConfig.currency === 'eur' ? '€' : '$'; }); - } else { + } else if ($scope.config.features.operatorActions) { Client.getAppstoreConfig(function (error, appstoreConfig) { if (error) return console.error(error); if (!appstoreConfig.token) return; diff --git a/src/views/support.js b/src/views/support.js index 91e682b74..0a0794f03 100644 --- a/src/views/support.js +++ b/src/views/support.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('Application').controller('SupportController', ['$scope', '$location', 'Client', function ($scope, $location, Client) { - Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); + Client.onReady(function () { if (!Client.getConfig().operatorActions || !Client.getUserInfo().admin) $location.path('/'); }); $scope.config = Client.getConfig(); $scope.user = Client.getUserInfo();