Add settings UI to enable unstable apps listing
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user