diff --git a/src/js/client.js b/src/js/client.js index b17c23c30..86029d8ed 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -544,6 +544,22 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N }); }; + Client.prototype.setUnstableAppsConfig = function (enabled, callback) { + post('/api/v1/settings/unstable_apps', { enabled: enabled }, null, function (error, data, status) { + if (error) return callback(error); + if (status !== 200) return callback(new ClientError(status, data)); + callback(null); + }); + }; + + Client.prototype.getUnstableAppsConfig = function (callback) { + get('/api/v1/settings/unstable_apps', null, function (error, data, status) { + if (error) return callback(error); + if (status !== 200) return callback(new ClientError(status, data)); + callback(null, data.enabled); + }); + }; + Client.prototype.getUpdateInfo = function (callback) { get('/api/v1/cloudron/update', null, function (error, data, status) { if (error) return callback(error); diff --git a/src/views/settings.html b/src/views/settings.html index dc1acc89b..3be49bfae 100644 --- a/src/views/settings.html +++ b/src/views/settings.html @@ -250,4 +250,39 @@ + +
+

Unstable App Listing

+
+ +
+
+
+

+ Besides the officially supported and tested apps, Cloudron can also install apps, which are currently in testing phase or not officially supported. + There is no guarantee that those apps will be updated in the future. + If enabled, those apps will be listed in the App Store and marked accordingly. +

+ + Do not use those apps in any production environment. + +
+ +
+
+
+ +
+
+ Saved +
+ +
+ +
+
+
+ diff --git a/src/views/settings.js b/src/views/settings.js index fef303562..2e9c9b007 100644 --- a/src/views/settings.js +++ b/src/views/settings.js @@ -299,6 +299,14 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca }); } + function getUnstableAppsConfig() { + Client.getUnstableAppsConfig(function (error, result) { + if (error) return console.error(error); + + $scope.unstableApps.enabled = result; + }); + } + function getSubscription() { AppStore.getSubscription($scope.appstoreConfig, function (error, result) { if (error) return console.error(error); @@ -331,6 +339,31 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca fr.readAsDataURL(event.target.files[0]); }; + $scope.unstableApps = { + busy: false, + success: false, + + enabled: false, + + submit: function () { + $scope.unstableApps.busy = true; + + Client.setUnstableAppsConfig($scope.unstableApps.enabled, function (error) { + $scope.unstableApps.busy = false; + + if (error) { + console.error('Unable to change unstable app listing.', error); + return; + } + + $scope.unstableApps.success = true; + $timeout(function () { + $scope.unstableApps.success = false; + }, 5000); + }); + } + }; + $scope.cloudronNameChange = { busy: false, error: {}, @@ -380,6 +413,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca Client.onReady(function () { getAutoupdatePattern(); + getUnstableAppsConfig(); $scope.update.checkStatus();