mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-02-04 12:40:08 +00:00
implement notification page (#8)
This commit is contained in:
4
src/types/alert-rule.tsx
Normal file
4
src/types/alert-rule.tsx
Normal file
@@ -0,0 +1,4 @@
|
||||
export const triggerModes: Record<number, string> = {
|
||||
0: "Always",
|
||||
1: "Once",
|
||||
}
|
||||
@@ -390,19 +390,22 @@ export interface ModelRule {
|
||||
/** 覆盖范围 RuleCoverAll/IgnoreAll */
|
||||
cover: number;
|
||||
/** 流量统计周期 */
|
||||
cycle_interval: number;
|
||||
cycle_interval?: number;
|
||||
/** 流量统计的开始时间 */
|
||||
cycle_start: string;
|
||||
/** 流量统计周期单位,默认hour,可选(hour, day, week, month, year) */
|
||||
cycle_unit: string;
|
||||
cycle_start?: string;
|
||||
/**
|
||||
* 流量统计周期单位,默认hour,可选(hour, day, week, month, year)
|
||||
* @default "hour"
|
||||
*/
|
||||
cycle_unit?: "hour" | "day" | "week" | "month" | "year";
|
||||
/** 持续时间 (秒) */
|
||||
duration: number;
|
||||
duration?: number;
|
||||
/** 覆盖范围的排除 */
|
||||
ignore: Record<string, boolean>;
|
||||
ignore?: Record<string, boolean>;
|
||||
/** 最大阈值 (百分比、字节 kb ÷ 1024) */
|
||||
max: number;
|
||||
max?: number;
|
||||
/** 最小阈值 (百分比、字节 kb ÷ 1024) */
|
||||
min: number;
|
||||
min?: number;
|
||||
/**
|
||||
* 指标类型,cpu、memory、swap、disk、net_in_speed、net_out_speed
|
||||
* net_all_speed、transfer_in、transfer_out、transfer_all、offline
|
||||
|
||||
@@ -6,3 +6,7 @@ export * from './ddns';
|
||||
export * from './serverStore';
|
||||
export * from './serverContext';
|
||||
export * from './cron';
|
||||
export * from './notification';
|
||||
export * from './alert-rule';
|
||||
export * from './notificationStore';
|
||||
export * from './notificationContext';
|
||||
|
||||
9
src/types/notification.ts
Normal file
9
src/types/notification.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export const nrequestMethods: Record<number, string> = {
|
||||
1: "GET",
|
||||
2: "POST",
|
||||
}
|
||||
|
||||
export const nrequestTypes: Record<number, string> = {
|
||||
1: "JSON",
|
||||
2: "Form",
|
||||
}
|
||||
6
src/types/notificationContext.ts
Normal file
6
src/types/notificationContext.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { ModelNotification, ModelNotificationGroupResponseItem } from "@/types";
|
||||
|
||||
export interface NotificationContextProps {
|
||||
notifiers?: ModelNotification[];
|
||||
notifierGroup?: ModelNotificationGroupResponseItem[];
|
||||
}
|
||||
8
src/types/notificationStore.ts
Normal file
8
src/types/notificationStore.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ModelNotification, ModelNotificationGroupResponseItem } from "@/types";
|
||||
|
||||
export interface NotificationStore {
|
||||
notifiers?: ModelNotification[];
|
||||
notifierGroup?: ModelNotificationGroupResponseItem[];
|
||||
setNotifier: (notifiers?: ModelNotification[]) => void;
|
||||
setNotifierGroup: (notifierGroup?: ModelNotificationGroupResponseItem[]) => void;
|
||||
}
|
||||
Reference in New Issue
Block a user