Skip to content

Commit

Permalink
Add more data centre locations
Browse files Browse the repository at this point in the history
The full list of locations was generated from the [Cloudflare Status Page](https://www.cloudflarestatus.com/):

```bash
{
  echo 'export const locations = {';
  curl -ks https://www.cloudflarestatus.com/ | grep -- '- (' | while read line; do
    code=$(awk -F '[()]' '{print $2}' <<< "$line");
    city=$(awk -F '[,-]' '{print $1}' <<< "$line");
    echo "  $code: '${city//\'/’}',";
  done | sort;
  echo '}';
} > src/functions/locations.js
```
  • Loading branch information
cmbuckley authored and eidam committed Oct 11, 2021
1 parent a8cfe25 commit f0b27a8
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/monitorDayAverage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { locations } from '../functions/helpers'
import { locations } from '../functions/locations'

export default function MonitorDayAverage({ location, avg }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/monitorStatusHeader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import config from '../../config.yaml'
import { locations } from '../functions/helpers'
import { locations } from '../functions/locations'

const classes = {
green:
Expand Down
7 changes: 0 additions & 7 deletions src/functions/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import { useEffect, useState } from 'react'

const kvDataKey = 'monitors_data_v1_1'

export const locations = {
WAW: 'Warsaw',
SCL: 'Santiago de Chile',
MEL: 'Melbourne',
SIN: 'Singapore',
}

export async function getKVMonitors() {
// trying both to see performance difference
return KV_STATUS_PAGE.get(kvDataKey, 'json')
Expand Down
226 changes: 226 additions & 0 deletions src/functions/locations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
export const locations = {
ADL: 'Adelaide',
AKL: 'Auckland',
ALG: 'Algiers',
AMM: 'Amman',
AMS: 'Amsterdam',
ARI: 'Arica',
ARN: 'Stockholm',
ASU: 'Asunción',
ATH: 'Athens',
ATL: 'Atlanta',
BAH: 'Manama',
BCN: 'Barcelona',
BEG: 'Belgrade',
BEL: 'Belém',
BEY: 'Beirut',
BGW: 'Baghdad',
BKK: 'Bangkok',
BLR: 'Bangalore',
BNA: 'Nashville',
BNE: 'Brisbane',
BNU: 'Blumenau',
BOG: 'Bogotá',
BOM: 'Mumbai',
BOS: 'Boston',
BRU: 'Brussels',
BSB: 'Brasilia',
BUD: 'Budapest',
BUF: 'Buffalo',
BWN: 'Bandar Seri Begawan',
CAN: 'Guangzhou',
CBR: 'Canberra',
CCU: 'Kolkata',
CDG: 'Paris',
CEB: 'Cebu',
CFC: 'Caçador',
CGK: 'Jakarta',
CGO: 'Zhengzhou',
CGP: 'Chittagong',
CKG: 'Chongqing',
CLT: 'Charlotte',
CMB: 'Colombo',
CMH: 'Columbus',
CMN: 'Casablanca',
CNF: 'Belo Horizonte',
CPH: 'Copenhagen',
CPT: 'Cape Town',
CSX: 'Zhuzhou',
CTU: 'Chengdu',
CUR: 'Willemstad',
CWB: 'Curitiba',
DAC: 'Dhaka',
DAR: 'Dar Es Salaam',
DEL: 'New Delhi',
DEN: 'Denver',
DFW: 'Dallas',
DKR: 'Dakar',
DME: 'Moscow',
DMM: 'Dammam',
DOH: 'Doha',
DTW: 'Detroit',
DUB: 'Dublin',
DUR: 'Durban',
DUS: 'Düsseldorf',
DXB: 'Dubai',
EDI: 'Edinburgh',
EVN: 'Yerevan',
EWR: 'Newark',
EZE: 'Buenos Aires',
FCO: 'Rome',
FLN: 'Florianopolis',
FOR: 'Fortaleza',
FRA: 'Frankfurt',
GIG: 'Rio de Janeiro',
GND: 'St. George’s',
GOT: 'Gothenburg',
GRU: 'São Paulo',
GUA: 'Guatemala City',
GVA: 'Geneva',
GYD: 'Baku',
GYE: 'Guayaquil',
HAM: 'Hamburg',
HAN: 'Hanoi',
HEL: 'Helsinki',
HKG: 'Hong Kong ',
HNL: 'Honolulu',
HRE: 'Harare',
HYD: 'Hyderabad',
IAD: 'Ashburn',
IAH: 'Houston',
ICN: 'Seoul',
IND: 'Indianapolis',
ISB: 'Islamabad',
IST: 'Istanbul',
ITJ: 'Itajaí',
JAX: 'Jacksonville',
JIB: 'Djibouti City',
JNB: 'Johannesburg',
JSR: 'Jashore',
KBP: 'Kyiv',
KEF: 'Reykjavík',
KGL: 'Kigali',
KHI: 'Karachi',
KIV: 'Chișinău',
KIX: 'Osaka',
KJA: 'Krasnoyarsk',
KTM: 'Kathmandu',
KUL: 'Kuala Lumpur',
KWI: 'Kuwait City',
LAD: 'Luanda',
LAS: 'Las Vegas',
LAX: 'Los Angeles',
LCA: 'Nicosia',
LED: 'Saint Petersburg',
LHE: 'Lahore',
LHR: 'London',
LIM: 'Lima',
LIS: 'Lisbon',
LOS: 'Lagos',
LUX: 'Luxembourg City',
MAA: 'Chennai',
MAD: 'Madrid',
MAN: 'Manchester',
MBA: 'Mombasa',
MCI: 'Kansas City',
MCT: 'Muscat',
MDE: 'Medellín',
MEL: 'Melbourne',
MEM: 'Memphis',
MEX: 'Mexico City',
MFE: 'McAllen',
MFM: 'Macau ',
MGM: 'Montgomery',
MIA: 'Miami',
MLE: 'Malé',
MNL: 'Manila',
MPM: 'Maputo',
MRS: 'Marseille',
MRU: 'Port Louis',
MSP: 'Minneapolis',
MUC: 'Munich',
MXP: 'Milan',
NAG: 'Nagpur',
NBG: 'Ningbo',
NBO: 'Nairobi',
NOU: 'Noumea',
NRT: 'Tokyo',
OMA: 'Omaha',
ORD: 'Chicago',
ORF: 'Norfolk',
OSL: 'Oslo',
OTP: 'Bucharest',
PAP: 'Port',
PBH: 'Thimphu',
PBM: 'Paramaribo',
PDX: 'Portland',
PER: 'Perth',
PHL: 'Philadelphia',
PHX: 'Phoenix',
PIT: 'Pittsburgh',
PMO: 'Palermo',
PNH: 'Phnom Penh',
POA: 'Porto Alegre',
PRG: 'Prague',
PTY: 'Panama City',
QRO: 'Queretaro',
QWJ: 'Americana',
RAO: 'Ribeirao Preto',
RGN: 'Yangon',
RIC: 'Richmond',
RIX: 'Riga',
ROB: 'Monrovia',
RUH: 'Riyadh',
RUN: 'Réunion',
SAN: 'San Diego',
SCL: 'Santiago',
SEA: 'Seattle',
SGN: 'Ho Chi Minh City',
SHA: 'Shanghai',
SIN: 'Singapore',
SJC: 'San Jose',
SJO: 'San José',
SJP: 'São José do Rio Preto',
SKG: 'Thessaloniki',
SLC: 'Salt Lake City',
SMF: 'Sacramento',
SOD: 'Sorocaba',
SOF: 'Sofia',
SSA: 'Salvador',
STL: 'St. Louis',
SVX: 'Yekaterinburg',
SYD: 'Sydney',
SZV: 'Suzhou',
TBS: 'Tbilisi',
TGU: 'Tegucigalpa',
TLH: 'Tallahassee',
TLL: 'Tallinn',
TLV: 'Tel Aviv',
TNA: 'Jinan',
TNR: 'Antananarivo',
TPA: 'Tampa',
TPE: 'Taipei ',
TSN: 'Tianjin',
TUN: 'Tunis',
TXL: 'Berlin',
UIO: 'Quito',
ULN: 'Ulaanbaatar',
URT: 'Surat Thani',
VCP: 'Campinas',
VIE: 'Vienna',
VNO: 'Vilnius',
VTE: 'Vientiane',
WAW: 'Warsaw',
WUH: 'Wuhan',
WUX: 'Wuxi',
XIY: 'Xi’an',
YUL: 'Montréal',
YVR: 'Vancouver',
YWG: 'Winnipeg',
YXE: 'Saskatoon',
YYC: 'Calgary',
YYZ: 'Toronto',
ZAG: 'Zagreb',
ZDM: 'Ramallah ',
ZRH: 'Zürich',
}

0 comments on commit f0b27a8

Please sign in to comment.