PingWatch 网络设备离线监控系统
- FastAPI 后端 + Vue 3 前端 - Docker Compose 一键部署 - Casdoor OAuth 认证集成 - LogHive 集中式日志 - 设备批量 CSV 导入/导出 - WebSocket 实时状态推送 - 企业微信告警通知 - fping 高性能并发 Ping 检测 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class AlertEventOut(BaseModel):
|
||||
id: int
|
||||
device_id: int
|
||||
device_name: str = ""
|
||||
device_ip: str = ""
|
||||
device_type: str = ""
|
||||
location: str = ""
|
||||
project_name: str = ""
|
||||
alert_type: str
|
||||
message: str
|
||||
start_at: datetime
|
||||
end_at: Optional[datetime] = None
|
||||
duration_minutes: Optional[int] = None
|
||||
is_resolved: bool
|
||||
notification_sent: bool
|
||||
created_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class AlertEventQuery(BaseModel):
|
||||
page: int = 1
|
||||
page_size: int = 20
|
||||
device_id: Optional[int] = None
|
||||
alert_type: Optional[str] = None
|
||||
is_resolved: Optional[bool] = None
|
||||
start_time: Optional[datetime] = None
|
||||
end_time: Optional[datetime] = None
|
||||
Reference in New Issue
Block a user