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.
This commit is contained in:
Antony Male 2015-11-22 14:10:29 +00:00
parent b61d7c2428
commit 6ee36fe361
2 changed files with 6 additions and 5 deletions

View File

@ -5,12 +5,12 @@ import (
)
const (
AssetsBuildDate = "Thu, 29 Oct 2015 19:42:35 GMT"
AssetsBuildDate = "Sun, 22 Nov 2015 14:10:01 GMT"
)
func Assets() map[string][]byte {
var assets = make(map[string][]byte, 1)
assets["index.html"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/6Q6e3PbNvL/51MgbKakfpVIyanbjizpN47zuMw1rafJTXvn891AJCTBpgiGBC2rib777YIgCVB0JKd5SORiX9hd7C4ATZ6+/PXiwz8vX5GVXMezJ08m+E1imiynDksckiwHNE2nTr5NQrniyVKBQpHITMQxy6ZOxmK6fUklvaiBzuwJIZMVoxE+wOOaSUrCFc1yJqdOIReDnxxzaCVlOmAfC343df4Y/ON8cCHWKZV8HjOHoDCWAN3bV1MWLZlFmdA1mzp3nG1SkUkDecMjuZpG7I6HbKBe+oQnXHIaD/KQxmw68ocdrCKWhxlPJReJwa0DkRZyJTIbp0SSXMZs9hvaheSSynwSlKByOObJLVllbDF1gmBN78Mo8edCyFxmNMWXUKyDGhA895/7p0GY5w3MX3PAynOHgPHBN3Ibs3zFmKxVUKBSHiHfrGlKPukXQlaML1dyTH4YDtP7Mw3e6W8fvRsLemsQRDxPYS5jkoiE2QSToJY0CUqH4+NcRFsSxjTPp07FsDJhxO+qITQd5YkOGDW6GmnDXQoREwwr4HtSDyMxMORgu6dg2kyyyKm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qrNqWemXDnN2o3ftuK4kDXqsz14YZ1099axwox+pMzYKq251x02/1WxHc2iOYVmqnlVJdXx+y7Wp9pga8di6CNk3csDMRi2xM3G9evx7CH7ffifVbSkMuN7AF83/uxvhD3xAdtYcXPI73CUEcQ8Tz4zZCtw0JKa9uHrI8JBwa8QJ2jp5lQPvY/zsyGg7xOMZKzRZOD5COQXE75/bs/VfLifQdHzqdPhXwqr1Xr9SmB4FiLbReSOzmOpbxLYD/gHIg7jxLskEFbbM8K+V6Wn6vSwKNol94DsN4TLIWRc7ErToceSD520JA9cRTh8Ql1LbDoQILeai8MBY58x4rJYx5ePM5EfvCipA7Ze1yvmYfWCcRqxtsoIf2hH3i/G8e0+TG2VPOjdeyBPnsHqYZeXrilfs/VDxhsfwFl7o+lSwMXLSEVZiqOznonka2WZATONm/YZfsjZ6b8g6ro/XxhPreXqmv5vz5SXN4jT1deUEbVHHjqOsL88jCuCCubwPS2WSON6HW+my3k2A+sy9DdTIQ6uI+v3ShSbjlEYsG84175cyqVzLfkEmBHD9LoEQUs44LVeMCWi+8cYXSoZCy3AVfw+ze4yPUCjyuahSoEcgnvDVmY2fNIM+tnXKa2ax9MdQlxcqBT/FMVp+JO7P6fLAR+cBF6cHSdu9JbZHNkWEjs+tu9TECzTtWW9pZed3aEmbfyR4sSbsDBKGIYWnxRwgWZ2vcvxY88fAopfcFMi7dZSzmNB7gdS+4nD0rI0wfwWNGhs7sjQKpW2QS8zWXHRNoE+65iTxcA8gy3SoUiXpgUddFJ1iuMdljTJiybKCv5r/Ojh2MlDG1u+6zZgf5V5i0g1tp1y5tvtCwOz8NMX9XY+c1vHYBMfSW8pjO4/onDZP2Va2Z/SdB+Yuy/wMAAP//AQAA//9dRfhVYiYAAA==")
return assets
}

View File

@ -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;