소스 검색

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 년 전
부모
커밋
6ee36fe361
2개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      cmd/strelaypoolsrv/auto/gui.go
  2. 4 3
      cmd/strelaypoolsrv/gui/index.html

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 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;

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.