Fetch backup config in settings view

This commit is contained in:
Johannes Zellner
2016-09-22 16:09:52 +02:00
parent 78367ea781
commit 5ebddf7df6

View File

@@ -6,7 +6,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.client = Client;
$scope.user = Client.getUserInfo();
$scope.config = Client.getConfig();
$scope.dnsConfig = {};
$scope.backupConfig = {};
$scope.appstoreConfig = {};
$scope.mailConfig = null;
@@ -129,6 +129,14 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
});
}
function getBackupConfig() {
Client.getBackupConfig(function (error, backupConfig) {
if (error) return console.error(error);
$scope.backupConfig = backupConfig;
});
}
$scope.toggleEmail = function () {
Client.setMailConfig({ enabled: !$scope.mailConfig.enabled }, function (error) {
if (error) return console.error(error);
@@ -374,6 +382,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
Client.onReady(function () {
fetchBackups();
getMailConfig();
getBackupConfig();
if ($scope.config.provider === 'caas') {
getPlans();