Files
dozzle/assets/types/notifications.ts
T
Amir Raminfar a79ffdaf50 feat: add metric-based alerts for container CPU/memory thresholds (#4454)
Co-authored-by: Dhaval Patel <dhavu262@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 20:55:35 +00:00

63 lines
1.1 KiB
TypeScript

export interface NotificationRule {
id: number;
name: string;
enabled: boolean;
containerExpression: string;
logExpression: string;
metricExpression?: string;
cooldown?: number;
triggerCount: number;
triggeredContainers: number;
lastTriggeredAt: string | null;
dispatcher: Dispatcher | null;
}
export interface Dispatcher {
id: number;
name: string;
type: string;
url?: string;
template?: string;
prefix?: string;
expiresAt?: string;
}
export interface NotificationRuleInput {
name: string;
enabled: boolean;
dispatcherId: number;
logExpression: string;
containerExpression: string;
metricExpression?: string;
cooldown?: number;
}
export interface PreviewResult {
containerError?: string;
logError?: string;
metricError?: string;
matchedContainers: {
id: string;
name: string;
image: string;
host: string;
}[];
matchedLogs: {
id: number;
t: string;
m: unknown;
rm: string;
ts: number;
l: string;
s: string;
}[];
totalLogs: number;
messageKeys?: string[];
}
export interface TestWebhookResult {
success: boolean;
statusCode?: number;
error?: string;
}