Extraceted Service types from LinkList.tsx
This commit is contained in:
parent
f1d7b35912
commit
dbe55d76f5
3 changed files with 31 additions and 28 deletions
|
@ -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
28
interfaces/Services.ts
Normal 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"
|
||||
}
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue