From c7c510f1ce408f9d6ebcb130075f0bfec0a69980 Mon Sep 17 00:00:00 2001 From: Andreas Dinauer Date: Sun, 15 Feb 2026 10:48:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Change=20routes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/Api.ts | 2 +- app/app.vue | 14 +++- app/assets/base-style.css | 13 ++-- app/assets/style.css | 2 +- app/components/RatioComponent.vue | 36 ++++++++++ app/components/pings/PingComponent.vue | 73 +++++++++++++++++++++ app/components/targets/Target.ts | 31 +++++++-- app/components/ui/UiIcon.vue | 14 ++++ app/pages/healthchecks/[group]/[target].vue | 57 ++++++++++++++++ app/pages/index.vue | 41 ++++++------ app/utils/Optional.ts | 42 ++++++++++++ nuxt.config.ts | 12 +++- package-lock.json | 27 ++++++++ package.json | 4 ++ tsconfig.json | 7 +- 15 files changed, 340 insertions(+), 35 deletions(-) create mode 100644 app/components/RatioComponent.vue create mode 100644 app/components/pings/PingComponent.vue create mode 100644 app/components/ui/UiIcon.vue create mode 100644 app/pages/healthchecks/[group]/[target].vue create mode 100644 app/utils/Optional.ts diff --git a/app/api/Api.ts b/app/api/Api.ts index 9358062..3e695df 100644 --- a/app/api/Api.ts +++ b/app/api/Api.ts @@ -1,5 +1,5 @@ import axios, {type AxiosInstance} from "axios"; export const Api: AxiosInstance = axios.create({ - baseURL: 'http://localhost:8080' + baseURL: '/api' }); \ No newline at end of file diff --git a/app/app.vue b/app/app.vue index d32d311..ce4c94e 100644 --- a/app/app.vue +++ b/app/app.vue @@ -1,3 +1,15 @@ + + + + \ No newline at end of file diff --git a/app/assets/base-style.css b/app/assets/base-style.css index 35259d3..41d5bb4 100644 --- a/app/assets/base-style.css +++ b/app/assets/base-style.css @@ -119,8 +119,8 @@ } .narrow { - width: min(100%, 1340px); - padding: 0 0.5rem; + width: min(100%, 1140px); + padding: 2rem 0.5rem; } .narrow.s { width: min(100%, 320px); @@ -133,11 +133,14 @@ } .tile, *[class^='tile-'], *[class*=' tile-'] { - background-color: var(--tile-color); - border-radius: 0.25rem; + border-radius: 0.5rem; overflow: hidden; width: 100%; - border: 1px solid #cddaff; + border: 1px solid #555555; + background-color: #222222; + display: grid; + gap: 1.5rem; + padding: 1rem; } .tile-s { diff --git a/app/assets/style.css b/app/assets/style.css index 0f23ce1..6a21d01 100644 --- a/app/assets/style.css +++ b/app/assets/style.css @@ -1,5 +1,5 @@ @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap'); -@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap'); * { padding: 0; diff --git a/app/components/RatioComponent.vue b/app/components/RatioComponent.vue new file mode 100644 index 0000000..9c7fc92 --- /dev/null +++ b/app/components/RatioComponent.vue @@ -0,0 +1,36 @@ + + + + + \ No newline at end of file diff --git a/app/components/pings/PingComponent.vue b/app/components/pings/PingComponent.vue new file mode 100644 index 0000000..3dbb6ae --- /dev/null +++ b/app/components/pings/PingComponent.vue @@ -0,0 +1,73 @@ + + + + + \ No newline at end of file diff --git a/app/components/targets/Target.ts b/app/components/targets/Target.ts index cdafdd4..f0bb564 100644 --- a/app/components/targets/Target.ts +++ b/app/components/targets/Target.ts @@ -1,18 +1,36 @@ import {Api} from "~/api/Api"; +export class Group +{ + constructor ( + public key: string, + public displayName: string, + public targets: Target[], + ) {} + + static get(onSuccess: (groups: Group[]) => void) + { + Api.get("/groups") + .then((response) => { + onSuccess(response.data) + }); + } +} + export class Target { - constructor ( public key: string, - public display: string, + public displayName: string, public status: string, public pings: Ping[], + public last1Hour: number, + public last24Hour: number ) {} - static get(onSuccess: (targets: Target[]) => void) + static getByKey(key: string, onSuccess: (_target: Target) => void) { - Api.get("/targets") + Api.get("/healthchecks/" + key) .then((response) => { onSuccess(response.data) }); @@ -22,6 +40,9 @@ export class Target export class Ping { constructor ( - public result: string + public result: string, + public timestamp: Date, + public code: string, + public body: string ) {} } \ No newline at end of file diff --git a/app/components/ui/UiIcon.vue b/app/components/ui/UiIcon.vue new file mode 100644 index 0000000..b04ff23 --- /dev/null +++ b/app/components/ui/UiIcon.vue @@ -0,0 +1,14 @@ + + + diff --git a/app/pages/healthchecks/[group]/[target].vue b/app/pages/healthchecks/[group]/[target].vue new file mode 100644 index 0000000..64e6c05 --- /dev/null +++ b/app/pages/healthchecks/[group]/[target].vue @@ -0,0 +1,57 @@ + + + + + \ No newline at end of file diff --git a/app/pages/index.vue b/app/pages/index.vue index 8296914..ff07d48 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,9 +1,15 @@