feat(opsserver): introduce OpsServer (TypedRequest API) and new lightweight web UI; replace legacy Angular UI and add typed interfaces
This commit is contained in:
82
ts_interfaces/data/service.ts
Normal file
82
ts_interfaces/data/service.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* Service-related data shapes for Onebox
|
||||
*/
|
||||
|
||||
import type { IPlatformRequirements } from './platform.ts';
|
||||
|
||||
export type TServiceStatus = 'stopped' | 'starting' | 'running' | 'stopping' | 'failed';
|
||||
|
||||
export interface IService {
|
||||
id?: number;
|
||||
name: string;
|
||||
image: string;
|
||||
registry?: string;
|
||||
envVars: Record<string, string>;
|
||||
port: number;
|
||||
domain?: string;
|
||||
containerID?: string;
|
||||
status: TServiceStatus;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
// Onebox Registry fields
|
||||
useOneboxRegistry?: boolean;
|
||||
registryRepository?: string;
|
||||
registryImageTag?: string;
|
||||
autoUpdateOnPush?: boolean;
|
||||
imageDigest?: string;
|
||||
// Platform service requirements
|
||||
platformRequirements?: IPlatformRequirements;
|
||||
// Backup settings
|
||||
includeImageInBackup?: boolean;
|
||||
}
|
||||
|
||||
export interface IServiceCreate {
|
||||
name: string;
|
||||
image: string;
|
||||
port: number;
|
||||
domain?: string;
|
||||
envVars?: Record<string, string>;
|
||||
useOneboxRegistry?: boolean;
|
||||
registryImageTag?: string;
|
||||
autoUpdateOnPush?: boolean;
|
||||
enableMongoDB?: boolean;
|
||||
enableS3?: boolean;
|
||||
enableClickHouse?: boolean;
|
||||
}
|
||||
|
||||
export interface IServiceUpdate {
|
||||
image?: string;
|
||||
registry?: string;
|
||||
port?: number;
|
||||
domain?: string;
|
||||
envVars?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface IContainerStats {
|
||||
cpuPercent: number;
|
||||
memoryUsed: number;
|
||||
memoryLimit: number;
|
||||
memoryPercent: number;
|
||||
networkRx: number;
|
||||
networkTx: number;
|
||||
}
|
||||
|
||||
export interface IMetric {
|
||||
id?: number;
|
||||
serviceId: number;
|
||||
timestamp: number;
|
||||
cpuPercent: number;
|
||||
memoryUsed: number;
|
||||
memoryLimit: number;
|
||||
networkRxBytes: number;
|
||||
networkTxBytes: number;
|
||||
}
|
||||
|
||||
export interface ILogEntry {
|
||||
id?: number;
|
||||
serviceId: number;
|
||||
timestamp: number;
|
||||
message: string;
|
||||
level: 'info' | 'warn' | 'error' | 'debug';
|
||||
source: 'stdout' | 'stderr';
|
||||
}
|
||||
Reference in New Issue
Block a user