implement docker host details page
This commit is contained in:
1 parent
a7ee90e1ee
commit
ca896fa22f
14 files changed
+366
-17
No files matched your search
@@ -127,6 +127,38 @@ export interface DockerContainerSummary {
|
||||
unhealthy: number;
|
||||
}
|
||||
|
||||
// Mirrors DockerContainerStates in server/src/types/network.ts.
|
||||
export const DockerContainerStates = [
|
||||
"created",
|
||||
"running",
|
||||
"paused",
|
||||
"restarting",
|
||||
"removing",
|
||||
"exited",
|
||||
"dead",
|
||||
] as const;
|
||||
export type DockerContainerState = (typeof DockerContainerStates)[number];
|
||||
|
||||
// Mirrors DockerHealthStatuses in server/src/types/network.ts.
|
||||
export const DockerHealthStatuses = ["healthy", "unhealthy", "starting", "none"] as const;
|
||||
export type DockerHealthStatus = (typeof DockerHealthStatuses)[number];
|
||||
|
||||
// Mirrors DockerContainerInfo in server/src/types/network.ts.
|
||||
export interface DockerContainerInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
image: string;
|
||||
state: DockerContainerState;
|
||||
status: string;
|
||||
health: DockerHealthStatus;
|
||||
cpuPct?: number; // fraction of one core; exceeds 1 when using multiple cores
|
||||
memoryUsedBytes?: number;
|
||||
memoryLimitBytes?: number;
|
||||
memoryPct?: number; // 0-1 fraction of the memory limit
|
||||
restartCount?: number;
|
||||
startedAt?: string;
|
||||
}
|
||||
|
||||
export interface Check {
|
||||
id: string;
|
||||
metadata: CheckMetadata;
|
||||
|
||||
@@ -3,6 +3,8 @@ import type {
|
||||
CheckSnapshot,
|
||||
GroupedUptimeCheck,
|
||||
DailyCheckBucket,
|
||||
DockerContainerInfo,
|
||||
DockerContainerSummary,
|
||||
} from "@/Types/Check";
|
||||
import type { PageSpeedGroupedCheck } from "@/Types/Check";
|
||||
import type { GeoContinent } from "@/Types/GeoCheck";
|
||||
@@ -268,6 +270,41 @@ export interface HardwareDetailsResponse {
|
||||
monitorStats: MonitorStats | null;
|
||||
}
|
||||
|
||||
// Mirrors DockerStatsBucket in server/src/domain/checks/check.type.ts.
|
||||
export interface DockerStatsBucket {
|
||||
_id: string;
|
||||
avgResponseTime: number | null;
|
||||
upCount: number;
|
||||
totalCount: number;
|
||||
avgRunning: number | null;
|
||||
avgTotal: number | null;
|
||||
avgUnhealthy: number | null;
|
||||
}
|
||||
|
||||
// Mirrors DockerStats in server/src/domain/checks/check.type.ts.
|
||||
export interface DockerStats {
|
||||
aggregateData: {
|
||||
totalChecks: number;
|
||||
};
|
||||
upChecks: {
|
||||
totalChecks: number;
|
||||
};
|
||||
aggregate: DockerStatsBucket[];
|
||||
latest: {
|
||||
containers: DockerContainerInfo[];
|
||||
summary?: DockerContainerSummary;
|
||||
checkedAt: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
// Response of GET /monitors/docker/details/{monitorId}; mirrors
|
||||
// dockerDetailsResponseSchema in server/src/api/validation/monitorValidation.ts.
|
||||
export interface DockerDetailsResponse {
|
||||
monitor: Monitor;
|
||||
stats: DockerStats;
|
||||
monitorStats: MonitorStats | null;
|
||||
}
|
||||
|
||||
export interface Game {
|
||||
name: string;
|
||||
options?: {
|
||||
|
||||
Reference in new issue
Block a user