provision: add route to detect ipv4 and ipv6

This commit is contained in:
Girish Ramakrishnan
2024-04-26 20:36:23 +02:00
parent 834a7d0f55
commit 8a987db177
6 changed files with 46 additions and 4 deletions
+8 -2
View File
@@ -310,9 +310,15 @@ app.controller('SetupDNSController', ['$scope', '$http', '$timeout', 'Client', f
$scope.instanceId = search.instanceId;
$scope.setupToken = search.setupToken;
$scope.provider = status.provider;
$scope.state = 'initialized';
setTimeout(function () { $("[autofocus]:first").focus(); }, 100);
Client.detectIp(function (error, ip) { // this is never supposed to error
if (!error) $scope.ipv4Config.provider = ip.ipv4 ? 'generic' : 'noop';
if (!error) $scope.ipv6Config.provider = ip.ipv6 ? 'generic' : 'noop';
$scope.state = 'initialized';
setTimeout(function () { $("[autofocus]:first").focus(); }, 100);
});
});
}