add ui to enable/disable ipv6

This commit is contained in:
Girish Ramakrishnan
2022-01-06 21:50:23 -08:00
parent ccc5f5f004
commit 346dc4f861
4 changed files with 82 additions and 1 deletions

View File

@@ -56,6 +56,37 @@ angular.module('Application').controller('NetworkController', ['$scope', '$locat
}
};
$scope.ipv6Configure = {
busy: false,
success: false,
error: '',
currentState: false,
enabled: false,
refresh: function () {
Client.getIPv6Config(function (error, enabled) {
if (error) return console.error(error);
$scope.ipv6Configure.currentState = enabled;
$scope.ipv6Configure.enabled = enabled;
});
},
submit: function () {
$scope.ipv6Configure.busy = true;
$scope.ipv6Configure.success = false;
$scope.ipv6Configure.error = '';
Client.setIPv6Config($scope.ipv6Configure.enabled, function (error) {
if (error) $scope.ipv6Configure.error = error.message;
else $scope.ipv6Configure.currentState = $scope.ipv6Configure.enabled;
$scope.ipv6Configure.busy = false;
$scope.ipv6Configure.success = true;
});
}
};
$scope.blocklist = {
busy: false,
error: {},
@@ -191,6 +222,7 @@ angular.module('Application').controller('NetworkController', ['$scope', '$locat
$scope.sysinfo.refresh();
$scope.dyndnsConfigure.refresh();
$scope.ipv6Configure.refresh();
if ($scope.user.isAtLeastOwner) $scope.blocklist.refresh();
});