From dbe55d76f5f3956f29260f4ae6c2e92009e64bd6 Mon Sep 17 00:00:00 2001 From: Neshura Date: Sun, 11 Dec 2022 18:38:43 +0100 Subject: [PATCH] Extraceted Service types from LinkList.tsx --- interfaces/LinkTypes.ts | 29 ++--------------------------- interfaces/Services.ts | 28 ++++++++++++++++++++++++++++ pages/api/services.tsx | 2 +- 3 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 interfaces/Services.ts diff --git a/interfaces/LinkTypes.ts b/interfaces/LinkTypes.ts index 9aabf4a..be23ed4 100644 --- a/interfaces/LinkTypes.ts +++ b/interfaces/LinkTypes.ts @@ -1,3 +1,5 @@ +import { Service } from "./Services" + export interface EntryList { services: Service[], games: CustomLink[] @@ -13,30 +15,3 @@ export interface CustomLink { docker_container_name: string } -export interface Service { - name: string, - href: string, - desc: string, - warn: string, - type: ServiceType, - docker_container_name: string, - location: ServiceLocation, - status: ServiceStatus -} - -export enum ServiceStatus { - online = "Online", - offline = "Offline", - loading = "Loading", - error = "ERROR" -} - -export enum ServiceLocation { - brr7_4800u = "brr7-4800u", - other = "" -} - -export enum ServiceType { - docker = "docker", - app = "app" -} \ No newline at end of file diff --git a/interfaces/Services.ts b/interfaces/Services.ts new file mode 100644 index 0000000..29178b4 --- /dev/null +++ b/interfaces/Services.ts @@ -0,0 +1,28 @@ +export interface Service { + name: string, + icon: string, + href: string, + desc: string, + warn: string, + type: ServiceType, + docker_container_name: string, + location: ServiceLocation, + status: ServiceStatus +} + +export enum ServiceStatus { + online = "Online", + offline = "Offline", + loading = "Loading", + error = "ERROR" +} + +export enum ServiceLocation { + brr7_4800u = "brr7-4800u", + other = "" +} + +export enum ServiceType { + docker = "docker", + app = "app" +} \ No newline at end of file diff --git a/pages/api/services.tsx b/pages/api/services.tsx index a416716..0adf0a8 100644 --- a/pages/api/services.tsx +++ b/pages/api/services.tsx @@ -1,6 +1,6 @@ import fsPromises from 'fs/promises' import path from 'path' -import { Service, ServiceStatus } from '../../interfaces/LinkTypes'; +import { Service, ServiceStatus } from '../../interfaces/Services'; export default async function ServicesAPI(req: any, res: any) { try {