mirror of
https://github.com/tormachris/cf-workers-status-page.git
synced 2025-09-21 16:35:15 +02:00
Compare commits
5 Commits
dependabot
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
37924cc043 | |||
596d30389f | |||
1189e708da | |||
de0cfaf504 | |||
f0b27a8446 |
@ -22,7 +22,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^10.0.2",
|
||||
"node-fetch": "^2.6.1",
|
||||
"node-fetch": "^3.1.1",
|
||||
"postcss": "^8.2.10",
|
||||
"postcss-cli": "^8.3.0",
|
||||
"prettier": "^2.2.0",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { locations } from '../functions/helpers'
|
||||
import { locations } from '../functions/locations'
|
||||
|
||||
export default function MonitorDayAverage({ location, avg }) {
|
||||
return (
|
||||
|
@ -1,5 +1,5 @@
|
||||
import config from '../../config.yaml'
|
||||
import { locations } from '../functions/helpers'
|
||||
import { locations } from '../functions/locations'
|
||||
|
||||
const classes = {
|
||||
green:
|
||||
|
@ -141,8 +141,8 @@ export async function processCronTrigger(event) {
|
||||
// Save allOperational to false
|
||||
monitorsState.lastUpdate.allOperational = false
|
||||
|
||||
// Increment failed checks, only on status change (maybe call it .incidents instead?)
|
||||
if (monitorStatusChanged) {
|
||||
// Increment failed checks on status change or first fail of the day (maybe call it .incidents instead?)
|
||||
if (monitorStatusChanged || monitorsState.monitors[monitor.id].checks[checkDay].fails == 0) {
|
||||
monitorsState.monitors[monitor.id].checks[checkDay].fails++
|
||||
}
|
||||
}
|
||||
|
@ -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')
|
||||
@ -34,6 +27,7 @@ export async function notifySlack(monitor, operational) {
|
||||
const payload = {
|
||||
attachments: [
|
||||
{
|
||||
fallback: `Monitor ${monitor.name} changed status to ${getOperationalLabel(operational)}`,
|
||||
color: operational ? '#36a64f' : '#f2c744',
|
||||
blocks: [
|
||||
{
|
||||
|
226
src/functions/locations.js
Normal file
226
src/functions/locations.js
Normal file
@ -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',
|
||||
}
|
@ -3,6 +3,7 @@ workers_dev = true
|
||||
account_id = ""
|
||||
type = "webpack"
|
||||
webpack_config = "node_modules/flareact/webpack"
|
||||
compatibility_date = "2021-07-23"
|
||||
|
||||
[triggers]
|
||||
crons = ["* * * * *"]
|
||||
|
42
yarn.lock
42
yarn.lock
@ -2433,6 +2433,11 @@ cyclist@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
|
||||
integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=
|
||||
|
||||
data-uri-to-buffer@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b"
|
||||
integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==
|
||||
|
||||
date-fns@^2.0.1:
|
||||
version "2.16.1"
|
||||
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.16.1.tgz#05775792c3f3331da812af253e1a935851d3834b"
|
||||
@ -3029,6 +3034,14 @@ faye-websocket@~0.11.1:
|
||||
dependencies:
|
||||
websocket-driver ">=0.5.1"
|
||||
|
||||
fetch-blob@^3.1.2, fetch-blob@^3.1.3:
|
||||
version "3.1.4"
|
||||
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.4.tgz#e8c6567f80ad7fc22fd302e7dcb72bafde9c1717"
|
||||
integrity sha512-Eq5Xv5+VlSrYWEqKrusxY1C3Hm/hjeAsCGVG3ft7pZahlUAChpGZT/Ms1WmSLnEAisEXszjzu/s+ce6HZB2VHA==
|
||||
dependencies:
|
||||
node-domexception "^1.0.0"
|
||||
web-streams-polyfill "^3.0.3"
|
||||
|
||||
figgy-pudding@^3.5.1:
|
||||
version "3.5.2"
|
||||
resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e"
|
||||
@ -3173,6 +3186,13 @@ for-in@^1.0.2:
|
||||
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
|
||||
integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=
|
||||
|
||||
formdata-polyfill@^4.0.10:
|
||||
version "4.0.10"
|
||||
resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423"
|
||||
integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==
|
||||
dependencies:
|
||||
fetch-blob "^3.1.2"
|
||||
|
||||
forwarded@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84"
|
||||
@ -4652,6 +4672,11 @@ nice-try@^1.0.4:
|
||||
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
|
||||
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
|
||||
|
||||
node-domexception@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5"
|
||||
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==
|
||||
|
||||
node-emoji@^1.8.1:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.10.0.tgz#8886abd25d9c7bb61802a658523d1f8d2a89b2da"
|
||||
@ -4659,10 +4684,14 @@ node-emoji@^1.8.1:
|
||||
dependencies:
|
||||
lodash.toarray "^4.4.0"
|
||||
|
||||
node-fetch@^2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
|
||||
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
|
||||
node-fetch@^3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.1.1.tgz#d0d9607e455b3087e3092b821b5b1f1ebf4c2147"
|
||||
integrity sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==
|
||||
dependencies:
|
||||
data-uri-to-buffer "^4.0.0"
|
||||
fetch-blob "^3.1.3"
|
||||
formdata-polyfill "^4.0.10"
|
||||
|
||||
node-forge@^0.10.0:
|
||||
version "0.10.0"
|
||||
@ -7368,6 +7397,11 @@ wbuf@^1.1.0, wbuf@^1.7.3:
|
||||
dependencies:
|
||||
minimalistic-assert "^1.0.0"
|
||||
|
||||
web-streams-polyfill@^3.0.3:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz#a6b74026b38e4885869fb5c589e90b95ccfc7965"
|
||||
integrity sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA==
|
||||
|
||||
webpack-cli@^3.3.12:
|
||||
version "3.3.12"
|
||||
resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-3.3.12.tgz#94e9ada081453cd0aa609c99e500012fd3ad2d4a"
|
||||
|
Reference in New Issue
Block a user