feat: redesign service route (#2835)

* feat: redesign service route

* chore: more changes

* remove automated backups and fix interface addresses

* fix rpc methods and slightly better mocks

---------

Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
Alex Inkin
2025-02-25 19:33:35 +04:00
committed by GitHub
parent 1b006599cf
commit 7fff9579c0
70 changed files with 2437 additions and 2325 deletions

View File

@@ -1,8 +1,8 @@
import { BackupJob } from '../api/api.types'
import { T } from '@start9labs/start-sdk'
export type DataModel = {
export type DataModel = Omit<T.Public, 'serverInfo'> & {
ui: UIData
// @TODO 040
serverInfo: Omit<
T.Public['serverInfo'],
'wifi' | 'networkInterfaces' | 'host'
@@ -51,54 +51,24 @@ export type NetworkInfo = {
| null
}
}
start9To: {
subdomain: string
networkInterfaceId: string
} | null
domains: {
[key: string]: Domain
}
wanConfig: {
upnp: boolean
forwards: PortForward[]
}
outboundProxy: string | null
}
export type DomainInfo = {
domain: string
subdomain: string | null
}
export type PortForward = {
assigned: number
override: number | null
target: number
error: string | null
}
export type Domain = {
provider: string
networkInterfaceId: string
}
export interface ServerStatusInfo {
currentBackup: null | {
job: BackupJob
backupProgress: Record<string, boolean>
}
updated: boolean
updateProgress: { size: number | null; downloaded: number } | null
restarting: boolean
shuttingDown: boolean
// @TODO 041
// start9To: {
// subdomain: string
// networkInterfaceId: string
// } | null
// domains: {
// [key: string]: Domain
// }
// wanConfig: {
// upnp: boolean
// forwards: PortForward[]
// }
// outboundProxy: string | null
}
export type PackageDataEntry<T extends StateInfo = StateInfo> =
T.PackageDataEntry & {
stateInfo: T
installedAt: string
outboundProxy: string | null
nextBackup: string | null
}
export type AllPackageData = NonNullable<
@@ -129,3 +99,11 @@ export type InstallingInfo = {
progress: T.FullProgress
newManifest: T.Manifest
}
// @TODO 041
// export type ServerStatusInfo = Omit<T.ServerStatus, 'backupProgress'> & {
// currentBackup: null | {
// job: BackupJob
// backupProgress: Record<string, boolean>
// }
// }