Move the dyndns setting to the domains view

This commit is contained in:
Girish Ramakrishnan
2018-11-09 10:37:50 -08:00
parent 50bf193fd1
commit 2b6423d3b7
4 changed files with 64 additions and 63 deletions
+35
View File
@@ -441,12 +441,47 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
}
};
$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;
});
}
};
Client.onReady(function () {
getDomains(function (error, result) {
if (error) return console.error(error);
$scope.domains = result;
$scope.ready = true;
if (!$scope.config.managed) {
$scope.dyndnsConfigure.refresh();
}
});
});