For each node, display the country's flag in addition to its name.
Flag images are sourced from here: https://flaglog.com/country-codes Placing the flags in a subdirectory of `./static` for good housekeeping requires a change to the location matching of the `nginx` configuration; otherwise they will not be found. Change: ``` location ~ /(?![^/]*\.(?:css|js|png|html)(?:$|\?)) { ``` to: ``` location ~ /(?!([^/]*|flags/[^/]*)\.(?:css|js|png|html)(?:$|\?)) { ```
|
@ -199,6 +199,7 @@ def get_sns(sns_future, info_future):
|
|||
sn['contribution_required'] = sn['staking_requirement'] - sn['total_contributed']
|
||||
sn['num_contributions'] = sum(len(x['locked_contributions']) for x in sn['contributors'] if 'locked_contributions' in x)
|
||||
sn['country'] = geoip.city(sn['public_ip']).country.names['en']
|
||||
sn['iso_code'] = geoip.city(sn['public_ip']).country.iso_code
|
||||
|
||||
if sn['active']:
|
||||
active_sns.append(sn)
|
||||
|
@ -593,6 +594,7 @@ def show_sn(pubkey, more_details=False):
|
|||
# Available open contribution spots:
|
||||
sn['num_open_spots'] = 0 if sn['total_reserved'] >= sn['staking_requirement'] else max(0, 4 - sn['num_contributions'] - sn['num_reserved_spots'])
|
||||
sn['country'] = geoip_c.city(sn['public_ip']).country.names['en']
|
||||
sn['iso_code'] = geoip_c.city(sn['public_ip']).country.iso_code
|
||||
city = geoip_c.city(sn['public_ip']).city
|
||||
if city.names:
|
||||
sn['city'] = city.names['en']
|
||||
|
|
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 601 B |
After Width: | Height: | Size: 140 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 760 B |
After Width: | Height: | Size: 511 B |
After Width: | Height: | Size: 994 B |
After Width: | Height: | Size: 530 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 528 B |
After Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 257 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 93 B |
After Width: | Height: | Size: 908 B |
After Width: | Height: | Size: 239 B |
After Width: | Height: | Size: 211 B |
After Width: | Height: | Size: 267 B |
After Width: | Height: | Size: 521 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 227 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 319 B |
After Width: | Height: | Size: 704 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 369 B |
After Width: | Height: | Size: 867 B |
After Width: | Height: | Size: 678 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 331 B |
After Width: | Height: | Size: 122 B |
After Width: | Height: | Size: 93 B |
After Width: | Height: | Size: 481 B |
After Width: | Height: | Size: 881 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 917 B |
After Width: | Height: | Size: 898 B |
After Width: | Height: | Size: 308 B |
After Width: | Height: | Size: 209 B |
After Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 958 B |
After Width: | Height: | Size: 195 B |
After Width: | Height: | Size: 193 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 122 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 112 B |
After Width: | Height: | Size: 457 B |
After Width: | Height: | Size: 634 B |
After Width: | Height: | Size: 237 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 635 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 114 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 619 B |
After Width: | Height: | Size: 155 B |
After Width: | Height: | Size: 554 B |
After Width: | Height: | Size: 286 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 280 B |
After Width: | Height: | Size: 650 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 302 B |
After Width: | Height: | Size: 383 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 473 B |
After Width: | Height: | Size: 719 B |
After Width: | Height: | Size: 309 B |
After Width: | Height: | Size: 154 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 181 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 790 B |
After Width: | Height: | Size: 894 B |
After Width: | Height: | Size: 321 B |
After Width: | Height: | Size: 450 B |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 703 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 125 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 848 B |
After Width: | Height: | Size: 305 B |
After Width: | Height: | Size: 549 B |