diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2017-11-30 12:12:36 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2017-12-06 11:48:39 +0100 |
| commit | de56ce638d953a2eaf7769ac86df58e5c5839a52 (patch) | |
| tree | 94f082406dcb4913c93fbaaf3bcc17d5750c009a /app | |
| parent | d518c38f81f033a45c87bb6cf314fb328bb2eacf (diff) | |
| download | mullvadvpn-de56ce638d953a2eaf7769ac86df58e5c5839a52.tar.xz mullvadvpn-de56ce638d953a2eaf7769ac86df58e5c5839a52.zip | |
Flatten server list
Diffstat (limited to 'app')
| -rw-r--r-- | app/components/SelectLocation.js | 13 | ||||
| -rw-r--r-- | app/config.json | 117 |
2 files changed, 75 insertions, 55 deletions
diff --git a/app/components/SelectLocation.js b/app/components/SelectLocation.js index a416a768ea..e0f50a12d4 100644 --- a/app/components/SelectLocation.js +++ b/app/components/SelectLocation.js @@ -4,6 +4,7 @@ import { Layout, Container, Header } from './Layout'; import CustomScrollbars from './CustomScrollbars'; import { servers } from '../config'; +import type { ServerInfo } from '../lib/backend'; import type { SettingsReduxState } from '../redux/settings/reducers'; import type { RelayLocation } from '../lib/ipc-facade'; @@ -100,14 +101,14 @@ export default class SelectLocation extends Component { <div className="select-location__separator"></div> - { Object.keys(servers).map((key) => { - const { name, country_code, city_code } = servers[key]; - const location = { + { (servers: Array<ServerInfo>).map((server) => { + const { address, name, country_code, city_code } = server; + const relayLocation = { city: [ country_code, city_code ] }; - const selected = this._isSelected(location); - const clickHandler = () => this._onSelect(location); - return this.drawCell(key, name, selected, null, clickHandler); + const selected = this._isSelected(relayLocation); + const clickHandler = () => this._onSelect(relayLocation); + return this.drawCell(address, name, selected, null, clickHandler); }) } </div> diff --git a/app/config.json b/app/config.json index 7f50f93850..73eb310d3a 100644 --- a/app/config.json +++ b/app/config.json @@ -11,40 +11,44 @@ "supportEmail": "mailto:support@mullvad.net" }, "defaultServer": "193.138.218.135", - "servers": { - "168.1.6.5": { + "servers": [ + { "address": "168.1.6.5", "name": "Australia", "city": "Sydney", "country": "Australia", "country_code": "au", - "city_code": "syd" + "city_code": "syd", + "location": [0, 0] }, - "217.64.127.138": { + { "address": "217.64.127.138", "name": "Austria", "city": "Wien", "country": "Austria", "country_code": "at", - "city_code": "vie" + "city_code": "vie", + "location": [0, 0] }, - "185.104.186.202": { + { "address": "185.104.186.202", "name": "Belgium", "city": "Brussels", "country": "Belgium", "country_code": "be", - "city_code": "bru" + "city_code": "bru", + "location": [0, 0] }, - "185.94.192.42": { + { "address": "185.94.192.42", "name": "Bulgaria", "city": "Sofia", "country": "Bulgaria", "country_code": "bg", - "city_code": "sof" + "city_code": "sof", + "location": [0, 0] }, - "162.219.176.250": { + { "address": "162.219.176.250", "name": "Canada", "city": "Toronto", @@ -56,15 +60,16 @@ -75.697193 ] }, - "185.156.174.146": { + { "address": "185.156.174.146", "name": "Czech Republic", "city": "Prague", "country": "Czech Republic", "country_code": "cz", - "city_code": "prg" + "city_code": "prg", + "location": [0, 0] }, - "82.103.140.213": { + { "address": "82.103.140.213", "name": "Denmark", "city": "Copenhagen", @@ -76,23 +81,25 @@ 12.5683371 ] }, - "185.103.110.69": { + { "address": "185.103.110.69", "name": "Finland", "city": "Helsinki", "country": "Finland", "country_code": "fi", - "city_code": "hel" + "city_code": "hel", + "location": [0, 0] }, - "185.156.173.218": { + { "address": "185.156.173.218", "name": "France", "city": "Paris", "country": "France", "country_code": "fr", - "city_code": "par" + "city_code": "par", + "location": [0, 0] }, - "89.249.64.146": { + { "address": "89.249.64.146", "name": "Germany", "city": "Berlin", @@ -104,47 +111,52 @@ 10.45 ] }, - "161.202.48.245": { + { "address": "161.202.48.245", "name": "Hong Kong", "city": "Hong Kong", "country": "Hong Kong", "country_code": "hk", - "city_code": "hkg" + "city_code": "hkg", + "location": [0, 0] }, - "185.189.114.10": { + { "address": "185.189.114.10", "name": "Hungary", "city": "Budapest", "country": "Hungary", "country_code": "hu", - "city_code": "bud" + "city_code": "bud", + "location": [0, 0] }, - "213.184.122.34": { + { "address": "213.184.122.34", "name": "Israel", "city": "Petach-Tikva", "country": "Israel", "country_code": "il", - "city_code": "pet" + "city_code": "pet", + "location": [0, 0] }, - "217.64.113.180": { + { "address": "217.64.113.180", "name": "Italy", "city": "Milan", "country": "Italy", "country_code": "it", - "city_code": "mil" + "city_code": "mil", + "location": [0, 0] }, - "161.202.144.203": { + { "address": "161.202.144.203", "name": "Japan", "city": "Tokyo", "country": "Japan", "country_code": "jp", - "city_code": "tyo" + "city_code": "tyo", + "location": [0, 0] }, - "185.65.134.140": { + { "address": "185.65.134.140", "name": "Netherlands", "city": "Amsterdam", @@ -156,7 +168,7 @@ 4.895167900000001 ] }, - "31.169.51.154": { + { "address": "31.169.51.154", "name": "Norway", "city": "Oslo", @@ -168,15 +180,16 @@ 10.7522454 ] }, - "212.7.217.30": { + { "address": "212.7.217.30", "name": "Poland", "city": "Warsaw", "country": "Poland", "country_code": "pl", - "city_code": "waw" + "city_code": "waw", + "location": [0, 0] }, - "185.45.13.10": { + { "address": "185.45.13.10", "name": "Romania", "city": "Bucharest", @@ -188,7 +201,7 @@ 26.1025384 ] }, - "103.57.72.30": { + { "address": "103.57.72.30", "name": "Singapore", "city": "Singapore", @@ -200,7 +213,7 @@ 103.819836 ] }, - "89.238.178.34": { + { "address": "89.238.178.34", "name": "Spain", "city": "Madrid", @@ -212,39 +225,43 @@ -3.7037902 ] }, - "185.213.152.132": { + { "address": "185.213.152.132", "name": "Sweden - Helsingborg", "city": "Helsingborg", "country": "Sweden", "country_code": "se", - "city_code": "hel" + "city_code": "hel", + "location": [0, 0] }, - "193.138.218.135": { + { "address": "193.138.218.135", "name": "Sweden - Malmö", "city": "Malmö", "country": "Sweden", "country_code": "se", - "city_code": "mma" + "city_code": "mma", + "location": [0, 0] }, - "185.65.135.143": { + { "address": "185.65.135.143", "name": "Sweden - Stockholm", "city": "Stockholm", "country": "Sweden", "country_code": "se", - "city_code": "sto" + "city_code": "sto", + "location": [0, 0] }, - "179.43.128.170": { + { "address": "179.43.128.170", "name": "Switzerland", "city": "Zürich", "country": "Switzerland", "country_code": "ch", - "city_code": "zrh" + "city_code": "zrh", + "location": [0, 0] }, - "185.16.85.170": { + { "address": "185.16.85.170", "name": "United Kingdom", "city": "London", @@ -256,21 +273,23 @@ -0.1277583 ] }, - "173.199.80.130": { + { "address": "173.199.80.130", "name": "USA - Los Angeles", "city": "Los Angeles", "country": "USA", "country_code": "us", - "city_code": "lax" + "city_code": "lax", + "location": [0, 0] }, - "38.132.107.138": { + { "address": "38.132.107.138", "name": "USA - New York", "city": "New York", "country": "USA", "country_code": "us", - "city_code": "nyc" + "city_code": "nyc", + "location": [0, 0] } - } + ] } |
