Extraceted Service types from LinkList.tsx

This commit is contained in:
Neshura 2022-12-11 18:38:43 +01:00
parent f1d7b35912
commit dbe55d76f5
No known key found for this signature in database
GPG key ID: ACDF5B6EBECF6B0A
3 changed files with 31 additions and 28 deletions

View file

@ -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"
}

28
interfaces/Services.ts Normal file
View file

@ -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"
}

View file

@ -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 {