diff --git a/luciexpress/htdocs/plugins/internet/pages/internet.dns.html b/luciexpress/htdocs/plugins/internet/pages/internet.dns.html
index 5aa446e29..34b9f231d 100644
--- a/luciexpress/htdocs/plugins/internet/pages/internet.dns.html
+++ b/luciexpress/htdocs/plugins/internet/pages/internet.dns.html
@@ -34,6 +34,61 @@
+
diff --git a/luciexpress/htdocs/plugins/internet/pages/internet.dns.js b/luciexpress/htdocs/plugins/internet/pages/internet.dns.js
index 6246f4c40..2b550a5ff 100644
--- a/luciexpress/htdocs/plugins/internet/pages/internet.dns.js
+++ b/luciexpress/htdocs/plugins/internet/pages/internet.dns.js
@@ -1,18 +1,45 @@
$juci.module("internet")
- .controller("InternetDNSPageCtrl", function($scope, $uci){
+ .controller("InternetDNSPageCtrl", function($scope, $uci){
- $uci.sync("network").done( function(){
- console.log($uci.network.wan.peerdns); });
+ $scope.providers = ["dyndns.org"];
- $scope.onApply = function(){
- $scope.busy = 1;
- $uci.save().done(function(){
- console.log("Settings saved!");
- }).fail(function(){
- console.error("Could not save internet settings!");
- }).always(function(){
- $scope.$apply();
- $scope.busy = 0;
- });
- }
- });
+ $uci.sync("network").done( function(){
+ console.log($uci.network.wan.peerdns); });
+
+ $scope.onApply = function(){
+ $scope.busy = 1;
+ $uci.save().done(function(){
+ console.log("Settings saved!");
+ }).fail(function(){
+ console.error("Could not save internet settings!");
+ }).always(function(){
+ $scope.$apply();
+ $scope.busy = 0;
+ });
+ };
+
+ $scope.onChangeProvider = function(item){
+ $scope.selectedConfig = item;
+ $scope.error = "";
+ $scope.loading = 1;
+ $scope.subsections = {};
+
+
+ $rpc.uci.state({
+ config: item.id
+ }).done(function(data){
+ $scope.subsections = data.values;
+ Object.keys($scope.subsections).map(function(k){
+ $scope.subsections[k] = filterHiddenValues($scope.subsections[k]);
+ });
+ $scope.loading = 0;
+ $scope.$apply();
+ }).fail(function(err){
+ console.error("Could not retrieve data!", err);
+ $scope.error("Could not retrieve data!");
+ $scope.loading = 0;
+ $scope.$apply();
+ });
+ };
+
+ });