backend implementation
This commit is contained in:
1 parent
a250bf38aa
commit
378a40ce84
16 files changed
+777
-728
No files matched your search
@@ -137,11 +137,35 @@ export interface ICheck extends Document {
|
||||
system?: ISystemInfo;
|
||||
capture?: ICaptureInfo;
|
||||
lighthouse?: ICheckLighthouseFields;
|
||||
dockerContainers?: IDockerContainerSummary[];
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
expiry: Date;
|
||||
}
|
||||
|
||||
export interface IDockerContainerHealth {
|
||||
healthy: boolean;
|
||||
source?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface IDockerExposedPort {
|
||||
port: string;
|
||||
protocol: string;
|
||||
}
|
||||
|
||||
export interface IDockerContainerSummary {
|
||||
container_id: string;
|
||||
container_name: string;
|
||||
status: string;
|
||||
health?: IDockerContainerHealth;
|
||||
running: boolean;
|
||||
base_image?: string;
|
||||
exposed_ports?: IDockerExposedPort[];
|
||||
started_at?: number;
|
||||
finished_at?: number;
|
||||
}
|
||||
|
||||
const CheckSchema = new Schema<ICheck>(
|
||||
{
|
||||
metadata: {
|
||||
@@ -293,6 +317,29 @@ const CheckSchema = new Schema<ICheck>(
|
||||
required: false,
|
||||
},
|
||||
|
||||
dockerContainers: [
|
||||
{
|
||||
container_id: { type: String },
|
||||
container_name: { type: String },
|
||||
status: { type: String },
|
||||
health: {
|
||||
healthy: { type: Boolean },
|
||||
source: { type: String },
|
||||
message: { type: String },
|
||||
},
|
||||
running: { type: Boolean },
|
||||
base_image: { type: String },
|
||||
exposed_ports: [
|
||||
{
|
||||
port: { type: String },
|
||||
protocol: { type: String },
|
||||
},
|
||||
],
|
||||
started_at: { type: Number },
|
||||
finished_at: { type: Number },
|
||||
},
|
||||
],
|
||||
|
||||
errorMessage: { type: String, trim: true },
|
||||
ackAt: { type: Date },
|
||||
ackBy: { type: Schema.Types.ObjectId, ref: "User" },
|
||||
|
||||
@@ -4,6 +4,7 @@ export type {
|
||||
ISystemInfo,
|
||||
ICaptureInfo,
|
||||
ILighthouseResult,
|
||||
IDockerContainerSummary,
|
||||
} from "./checks/Check.js";
|
||||
|
||||
export { Monitor, MonitorStatuses, MonitorTypes } from "./monitors/Monitor.js";
|
||||
|
||||
@@ -14,6 +14,7 @@ export const MonitorTypes = [
|
||||
"ping",
|
||||
"infrastructure",
|
||||
"pagespeed",
|
||||
"docker",
|
||||
] as const;
|
||||
export type MonitorType = (typeof MonitorTypes)[number];
|
||||
|
||||
|
||||
Reference in new issue
Block a user