Add dynamic dns settings

This commit is contained in:
Johannes Zellner
2018-10-31 16:03:09 +01:00
parent 97b24079f7
commit d6bf6eb0a0
3 changed files with 76 additions and 0 deletions

View File

@@ -287,6 +287,37 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
}
};
$scope.dyndnsConfigure = {
busy: false,
success: false,
error: '',
currentState: false,
enabled: false,
refresh: function () {
Client.getDynamicDnsConfig(function (error, enabled) {
if (error) return console.error(error);
$scope.dyndnsConfigure.currentState = enabled;
$scope.dyndnsConfigure.enabled = enabled;
});
},
submit: function () {
$scope.dyndnsConfigure.busy = true;
$scope.dyndnsConfigure.success = false;
$scope.dyndnsConfigure.error = '';
Client.setDynamicDnsConfig($scope.dyndnsConfigure.enabled, function (error) {
if (error) $scope.dyndnsConfigure.error = error.message;
else $scope.dyndnsConfigure.currentState = $scope.dyndnsConfigure.enabled;
$scope.dyndnsConfigure.busy = false;
$scope.dyndnsConfigure.success = true;
});
}
};
function getAutoupdatePattern() {
Client.getAppAutoupdatePattern(function (error, result) {
if (error) return console.error(error);
@@ -418,6 +449,8 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.currency = caasConfig.currency === 'eur' ? '€' : '$';
});
} else if (!$scope.config.managed) {
$scope.dyndnsConfigure.refresh();
Client.getAppstoreConfig(function (error, appstoreConfig) {
if (error) return console.error(error);
if (!appstoreConfig.token) return;