Add dynamic dns settings
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user