From 4f1589324bef9840a997fb282e866a5c7de8a96e Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Fri, 14 Aug 2020 00:31:51 +0530 Subject: [PATCH] :construction: Create history page --- site/src/components/History.svelte | 80 +++++++++++++++++++++++++ site/src/components/LiveStatus.svelte | 6 +- site/src/routes/history/[number].svelte | 13 ++++ 3 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 site/src/components/History.svelte create mode 100644 site/src/routes/history/[number].svelte diff --git a/site/src/components/History.svelte b/site/src/components/History.svelte new file mode 100644 index 00000000..7d4ffcb8 --- /dev/null +++ b/site/src/components/History.svelte @@ -0,0 +1,80 @@ + + + + +
+ {#if loading} + + {:else if incidents.length} +

{config.i18n.pastIncidents}

+ {#each incidents as incident} + {#if incident.showHeading} +

{new Date(incident.created_at).toLocaleDateString()}

+ {/if} + + {/each} + {/if} +
diff --git a/site/src/components/LiveStatus.svelte b/site/src/components/LiveStatus.svelte index 9c729550..de531a5c 100644 --- a/site/src/components/LiveStatus.svelte +++ b/site/src/components/LiveStatus.svelte @@ -43,9 +43,11 @@ {:else if sites.length} {#each sites as site}
-

{site.name}

+

+ {site.name} +

{@html config.i18n.overallUptime.replace(/\$UPTIME/g, site.uptime)}
diff --git a/site/src/routes/history/[number].svelte b/site/src/routes/history/[number].svelte new file mode 100644 index 00000000..777d7c26 --- /dev/null +++ b/site/src/routes/history/[number].svelte @@ -0,0 +1,13 @@ + + + + +