mirror of
				https://github.com/tormachris/cf-workers-status-page.git
				synced 2025-11-04 04:46:24 +01:00 
			
		
		
		
	feat: show city also in header
This commit is contained in:
		@@ -1,9 +1,4 @@
 | 
				
			|||||||
const locations = {
 | 
					import { locations } from '../functions/helpers'
 | 
				
			||||||
  WAW: 'Warsaw',
 | 
					 | 
				
			||||||
  SCL: 'Santiago de Chile',
 | 
					 | 
				
			||||||
  MEL: 'Melbourne',
 | 
					 | 
				
			||||||
  SIN: 'Singapore',
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default function MonitorDayAverage({ location, avg }) {
 | 
					export default function MonitorDayAverage({ location, avg }) {
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
import config from '../../config.yaml'
 | 
					import config from '../../config.yaml'
 | 
				
			||||||
 | 
					import { locations } from '../functions/helpers'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const classes = {
 | 
					const classes = {
 | 
				
			||||||
  green:
 | 
					  green:
 | 
				
			||||||
@@ -24,7 +25,8 @@ export default function MonitorStatusHeader({ kvMonitorsLastUpdate }) {
 | 
				
			|||||||
          <div className="text-xs font-light">
 | 
					          <div className="text-xs font-light">
 | 
				
			||||||
            checked{' '}
 | 
					            checked{' '}
 | 
				
			||||||
            {Math.round((Date.now() - kvMonitorsLastUpdate.time) / 1000)} sec
 | 
					            {Math.round((Date.now() - kvMonitorsLastUpdate.time) / 1000)} sec
 | 
				
			||||||
            ago (from {kvMonitorsLastUpdate.loc})
 | 
					            ago (from{' '}
 | 
				
			||||||
 | 
					            {locations[kvMonitorsLastUpdate.loc] || kvMonitorsLastUpdate.loc})
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
        )}
 | 
					        )}
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,13 @@ import { useEffect, useState } from 'react'
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const kvDataKey = 'monitors_data_v1_1'
 | 
					const kvDataKey = 'monitors_data_v1_1'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const locations = {
 | 
				
			||||||
 | 
					  WAW: 'Warsaw',
 | 
				
			||||||
 | 
					  SCL: 'Santiago de Chile',
 | 
				
			||||||
 | 
					  MEL: 'Melbourne',
 | 
				
			||||||
 | 
					  SIN: 'Singapore',
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export async function getKVMonitors() {
 | 
					export async function getKVMonitors() {
 | 
				
			||||||
  // trying both to see performance difference
 | 
					  // trying both to see performance difference
 | 
				
			||||||
  return KV_STATUS_PAGE.get(kvDataKey, 'json')
 | 
					  return KV_STATUS_PAGE.get(kvDataKey, 'json')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user