diff --git a/src/index.html b/src/index.html index 11ddc9c1f..36ba2e568 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 79c1ade06..ad21dc24d 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -228,9 +228,10 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N var that = this; // derive feature flags from edition + config.isManaged = config.edition === 'hostingprovider' || config.provider === 'caas'; + config.features = { - spaces: config.edition === 'education', - operatorActions: config.edition !== 'hostingprovider' + spaces: config.edition === 'education' }; angular.copy(config, this._config); diff --git a/src/js/main.js b/src/js/main.js index 333903799..06bd46f52 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -175,7 +175,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route', $scope.initialized = true; - if ($scope.user.admin && $scope.config.features.operatorActions) { + if (!$scope.managed) { runConfigurationChecks(); $scope.fetchAppstoreProfileAndSubscription(function (error) { diff --git a/src/views/apps.js b/src/views/apps.js index 254131a34..6b37be341 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -614,7 +614,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location fetchUsers(); fetchGroups(); getDomains(); - if ($scope.user.admin && $scope.config.features.operatorActions) getBackupConfig(); // FIXME: detect disabled backups some other way + if ($scope.user.admin && !$scope.config.managed) 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 88a94a153..1d7752160 100644 --- a/src/views/appstore.js +++ b/src/views/appstore.js @@ -492,7 +492,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca return callback(); } - if ($scope.user.admin && !$scope.config.features.operatorActions) { + if ($scope.user.admin && $scope.config.managed) { $scope.validAppstoreAccount = true; return callback(); } diff --git a/src/views/backups.html b/src/views/backups.html index 353cc28fb..a7d768362 100644 --- a/src/views/backups.html +++ b/src/views/backups.html @@ -165,7 +165,7 @@ {{ prettyProviderName(backupConfig.provider) }} -
    +
    Location
    @@ -176,7 +176,7 @@
    -
    +
    Storage Format
    @@ -232,7 +232,7 @@

    - +
    diff --git a/src/views/backups.js b/src/views/backups.js index 830b68376..28f918112 100644 --- a/src/views/backups.js +++ b/src/views/backups.js @@ -73,7 +73,7 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat ]; $scope.prettyProviderName = function (provider) { - if (!$scope.config.features.operatorActions) return $scope.config.provider; + if ($scope.config.managed) return $scope.config.provider; switch (provider) { case 'caas': return 'Managed Cloudron'; @@ -355,7 +355,7 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat Client.onReady(function () { fetchBackups(); - if ($scope.config.features.operatorActions) getBackupConfig(); + if (!$scope.config.managed) getBackupConfig(); // show backup status $scope.createBackup.updateStatus(); diff --git a/src/views/settings.html b/src/views/settings.html index b441ea42c..ed7b6df3c 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 66aa52018..e1df8f90e 100644 --- a/src/views/settings.js +++ b/src/views/settings.js @@ -417,7 +417,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca $scope.currentPlan = caasConfig.plan; $scope.currency = caasConfig.currency === 'eur' ? '€' : '$'; }); - } else if ($scope.config.features.operatorActions) { + } else if (!$scope.config.managed) { 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 70094722a..91e682b74 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.getConfig().features.operatorActions || !Client.getUserInfo().admin) $location.path('/'); }); + Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); $scope.config = Client.getConfig(); $scope.user = Client.getUserInfo();