import React, {useEffect, useState} from 'react'; import NWSLogo from './static/images/NWS_Logo.png'; import './App.css'; import 'bootstrap/dist/css/bootstrap.min.css'; import {Incident, UptimeResponse} from "./nws-api/types"; import {getIncidents, getUptime} from "./nws-api/calls"; import ReactTooltip from 'react-tooltip'; function App() { const [uptime, setUptime] = useState({datacenters: [], services:[], lastUpdated: ""}); const [incidents, setIncidents] = useState([]); const severityText: string[] = [ "Low Severity means that this issue does not affect any services running on NWS.", "Medium Severity means that this issue may cause some slowdowns or outages on some services.", "High Severity means that this issue causes an outage on the entire NWS network or most of the services running on it." ]; const fetchUptime = async () => { let resp: UptimeResponse = await getUptime(); setUptime(resp); } const fetchIncidents = async () => { let resp: Incident[] = await getIncidents(); setIncidents(resp); } useEffect(() => { fetchUptime(); fetchIncidents(); }, []); // @ts-ignore return (
nws-logo

Nick Web Services

Nick Web Services is a hosting service based out of Austin, Texas. It is committed to achieving maximum uptime with better performance and a lower cost than any of the major cloud services.


NWS System Status

Last updated at {new Date(uptime.lastUpdated).toLocaleString()}

Service Status

{uptime.services.map((e) => { return (

{e.name}

{e.isUp ? 'Up' : (e.undergoingMaintenance ? 'Maintenance' : 'Down')}

{e.isUp ? 'Up' : (e.undergoingMaintenance ? 'Maintenance' : 'Down')}

Last Month Uptime: {e.uptimeMonth}%

All Time Uptime: {e.uptimeAllTime}%

); })}

Datacenter Status

{uptime.datacenters.map((e) => { return (

{e.name}

{e.isUp ? 'Up' : (e.undergoingMaintenance ? 'Maintenance' : 'Down')}

{e.isUp ? 'Up' : (e.undergoingMaintenance ? 'Maintenance' : 'Down')}

Last Month Uptime: {e.uptimeMonth}%

All Time Uptime: {e.uptimeAllTime}%

); })}

Service Alerts

{incidents.map((e) => { let severityClass: string = e.severity == 0 ? 'low' : (e.severity == 1 ? 'med' : 'high'); let severityString: string = e.severity == 0 ? 'Low' : (e.severity == 1 ? 'Medium' : 'High'); return (

{e.title}

{severityString} Severity ⓘ

{e.description}

); })} {incidents.length == 0 &&
No service alerts.
}
); } export default App;