diff --git a/src/lib/components/itemBox.svelte b/src/lib/components/itemBox.svelte index 535f963..0de8495 100644 --- a/src/lib/components/itemBox.svelte +++ b/src/lib/components/itemBox.svelte @@ -1,28 +1,23 @@ - +
- +
- {detail.boxContent.name.toUpperCase()} - - - + {service.formattedName}
-

{detail.description}

-

Login with: {detail.loginMethod}

-

Current status: {detail.statusMessage || "Unknown"}

+

{service.description}

+

Login with: {service.loginMethod}

+
diff --git a/src/lib/scripts/serviceDetailMap.ts b/src/lib/scripts/serviceDetailMap.ts deleted file mode 100644 index 6b17ff7..0000000 --- a/src/lib/scripts/serviceDetailMap.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { ServiceDetail } from "$lib/types/serviceDetail" - -export const defaultVal: ServiceDetail = {description: "Unknown", loginMethod: "Unknown"} - -export const detailMap = new Map ([ - ["nextcloud", { - description: "Personal Cloud, Organisation and workspace", - loginMethod: "FJLA.net Credentials" - }], - ["gitea", { - description: "Git repositories & development tools", - loginMethod: "FJLA.net Credentials" - }], - ["jellyfin", { - description: "Music, Film and TV Services", - loginMethod: "FJLA.net Credentials" - }], - ["home assistant", { - description: "Smart & Connected Home", - loginMethod: "Home Assistant Credentials" - }], - ["traccar", { - description: "Device and Person Tracking", - loginMethod: "Traccar Credentials" - }], - ["owlboard", { - description: "Live train service data", - loginMethod: "No login required" - }], - ["webmail", { - description: "Mail services for FJLA.net, FJLA.uk, OwlBoard.info & fb-infra.uk", - loginMethod: "Email Credentials" - }], - ["account", { - description: "FJLA.net account settings", - loginMethod: "FJLA.net Credentials" - }] -]) \ No newline at end of file diff --git a/src/lib/scripts/serviceMap.ts b/src/lib/scripts/serviceMap.ts index c6b02fa..7ab5f0d 100644 --- a/src/lib/scripts/serviceMap.ts +++ b/src/lib/scripts/serviceMap.ts @@ -5,13 +5,15 @@ export const detailMap = new Map ([ url: "https://cloud.fjla.uk", checkString: "Login -", description: "Personal cloud, organiser and workspace", - imgPath: "nextcloud.svg" + imgPath: "nextcloud.svg", + loginMethod: "FJLA.net Credentials" }], ["gitea", { formattedName: "Gitea", url: "https://git.fjla.uk", checkString: "--??--", description: "Git Repository & Development tools", - imgPath: "" + imgPath: "", + loginMethod: "FJLA.net Credentials" }] ]) \ No newline at end of file diff --git a/src/lib/types/boxContent.ts b/src/lib/types/boxContent.ts deleted file mode 100644 index 4a2dc10..0000000 --- a/src/lib/types/boxContent.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface BoxContent { - name: string, - link: string, - img : string, -} \ No newline at end of file diff --git a/src/lib/types/serviceData.ts b/src/lib/types/serviceData.ts index 3479908..46c98ce 100644 --- a/src/lib/types/serviceData.ts +++ b/src/lib/types/serviceData.ts @@ -4,4 +4,5 @@ export interface ServiceData { checkString: string, imgPath: string, description: string, + loginMethod: string } \ No newline at end of file diff --git a/src/lib/types/serviceDetail.ts b/src/lib/types/serviceDetail.ts deleted file mode 100644 index 3919c37..0000000 --- a/src/lib/types/serviceDetail.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BoxContent } from "./boxContent"; - -export interface ServiceDetail { - boxContent?: BoxContent, - description: string, - loginMethod: string, - statusMessage?: string, -} \ No newline at end of file diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts deleted file mode 100644 index ac37a1e..0000000 --- a/src/routes/+page.server.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { BoxContent } from "$lib/types/boxContent"; -import type { ServiceDetail } from "$lib/types/serviceDetail"; - -import { check } from "$lib/scripts/statusChecks"; -import { detailMap, defaultVal } from "$lib/scripts/serviceDetailMap"; - -const boxes: BoxContent[] = [ - {name: "nextcloud", link: "https://cloud.fjla.uk", img: "auto"}, - {name: "home assistant", link: "https://ha.fjla.uk", img: "auto"}, - {name: "jellyfin", link: "https://jf.fjla.uk", img: "auto"}, - {name: "traccar", link:"https://traccar.fjla.uk", img: "auto"}, - {name: "owlboard", link:"https://owlboard.info", img:"auto"}, - {name: "webmail", link:"https://mx0123.fb-infra.uk/mail", img: "auto"}, - {name: "account", link:"https://ipa0922.fjla.net", img:"auto"} -] - -export async function load() { - const data: ServiceDetail[] = [] - for (const item of boxes) { - const svcDetail = detailMap.get(item.name.toLowerCase()) || defaultVal - svcDetail.statusMessage = await check(item.name.toLowerCase()) - svcDetail.boxContent = item - data.push(svcDetail) - } - return {data: data} -} \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0026c74..e6ad45d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,18 +1,16 @@
FJLA Gateway
- {#each data.data as detail} + {#each homeLinks as detail} {/each}