Browse Source

Fix a couple of issues with the relays map (geoip, 'data unavailable')

 - Move to ipinfo.io for geoip, rather than Telize. Telize has been closed
   down. ipinfo.io has apparently got decent availability, and allows
   1,000 requests per day on the free tier. Since requests are made by the
   client, this should be more than enough (and the total across all clients
   should still be less than this).

 - Fix issue where one nonresponsive relay would cause 'data unavailable'
   to be shown for many relays. This was caused by the relay status
   promise not being correctly added to the list of things being waited
   for before the map was rendered. Any delayed relay status requests
   would therefore occur after the map was rendered, which was too late.
Antony Male 10 năm trước cách đây
mục cha
commit
6ee36fe361
2 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 1 1
      cmd/strelaypoolsrv/auto/gui.go
  2. 4 3
      cmd/strelaypoolsrv/gui/index.html

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
cmd/strelaypoolsrv/auto/gui.go


+ 4 - 3
cmd/strelaypoolsrv/gui/index.html

@@ -143,7 +143,7 @@
         $scope.uri[relay.url] = uri;
 
         initProgress("Resolving location for " + uri.hostname);
-        var resolveGeoIp = $http.get('http://www.telize.com/geoip/' + uri.hostname).then(function (response) {
+        var resolveGeoIp = $http.get('http://ipinfo.io/' + uri.hostname).then(function (response) {
           progressDone("Resolving location for " + uri.hostname);
 
           $scope.geoip[relay.url] = response.data;
@@ -173,7 +173,7 @@
           resolveStatus.resolve(response.data);
         });
 
-        promises.push(resolveStatus);
+        promises.push(resolveStatus.promise);
       });
 
       $q.all(promises).then(function() {
@@ -183,7 +183,8 @@
         angular.forEach($scope.relays, function(relay) {
           var scope = $rootScope.$new(true);
           var geoip = $scope.geoip[relay.url];
-          var position = new google.maps.LatLng(geoip.latitude, geoip.longitude);
+          var locParts = geoip.loc.split(',');
+          var position = new google.maps.LatLng(locParts[0], locParts[1]);
 
           scope.status = $scope.status[relay.url];
           scope.geoip = geoip;

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác