feat: 监控告警体系统一重构 + 自动化任务调度引擎 + 监控大屏拆分

告警中心
- 新增统一告警(alert_unified)、监控告警规则(monitor_alert_rule)、指标目录(alert_metric_catalog)
- 通知策略与消息分发(alert_notify_policy/dispatch/message)、静默规则
- 告警引擎按阈值/SNMP 拆分(alert_engine_monitor/snmp)

监控采集
- SNMP 常量/模板与历史指标(snmp templates/constants、snmp_metrics_history、snmp_collect)
- 中间件监控 Redis 采集与种子(middleware_monitor_redis/seed)
- 站点探测 pkg(siteprobe) + 站点视图(site_view)

自动化任务
- cron 调度器(cronscheduler)、脚本运行器(scriptrunner)、系统任务(systask)及运行记录(cron_job_run、system_task)

审计与凭证
- 审计设置(audit_setting) + 历史清理(auditcleaner)

前端
- 监控页面(host/middleware/site/snmp)拆分为子模块并大屏化
- 告警中心多 Tab(规则/指标目录/通知策略/静默)、任务管理组件重构、Agent CLI Markdown 渲染
- 移除旧脚本卡片/详情/日志组件,统一为 ScriptTable/ScriptCodeEditor/TerminalOutput

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
LoganandClaude committed 2026-07-01 23:44:45 +08:00
1 parent 092d0e4b9e
commit 471353e3d7
190 files changed
+16640 -3484

No files matched your search

@@ -1,6 +1,7 @@
// 终端审计 — 在线会话子面板 // Logan.Li
import { useState, useEffect } from 'react';
import { cn } from '@/lib/utils';
import { useTranslation } from 'react-i18next';
import { Card, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
@@ -108,7 +109,7 @@ export function ActiveSessionsPanel({ userToggledOff, onUserToggledOff }: Active
const { t } = useTranslation();
const confirm = useConfirm();
const { killMutation } = useTerminalSessionMutations();
const { data, isLoading, refetch } = useTerminalSessions({
const { data, isLoading, isFetching, refetch } = useTerminalSessions({
page: 1,
page_size: 100,
status: 'active',
@@ -177,8 +178,9 @@ export function ActiveSessionsPanel({ userToggledOff, onUserToggledOff }: Active
variant="outline"
className="dg-btn-secondary"
onClick={() => refetch()}
disabled={isFetching}
>
<RefreshCw className="h-4 w-4 mr-2" />
<RefreshCw className={cn('h-4 w-4 mr-2', isFetching && 'animate-spin')} />
{t('common.refresh')}
</Button>
<Button
@@ -1,6 +1,7 @@
// 终端审计 — 历史会话子面板(筛选 / 分页 / 回放 / 导出,只读无删除) // Logan.Li
import { useState, useMemo } from 'react';
import { cn } from '@/lib/utils';
import { useTranslation } from 'react-i18next';
import { Card, CardContent } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
@@ -46,7 +47,7 @@ export function HistorySessionsPanel() {
...(applied.hasRecordOnly ? { has_record: '1' } : {}),
}), [page, applied]);
const { data, isLoading, refetch } = useTerminalSessions(queryParams);
const { data, isLoading, isFetching, refetch } = useTerminalSessions(queryParams);
const sessions = data?.list ?? [];
const total = data?.total ?? 0;
const totalPages = Math.max(1, Math.ceil(total / PAGE_SIZE));
@@ -127,8 +128,8 @@ export function HistorySessionsPanel() {
{t('audit.terminal.hasRecordOnly')}
</label>
<Button size="sm" className="h-9" onClick={applyFilters}>{t('audit.terminal.applyFilter')}</Button>
<Button variant="outline" size="sm" className="dg-btn-secondary h-9" onClick={() => refetch()}>
<RefreshCw className="h-4 w-4 mr-1" />{t('common.refresh')}
<Button variant="outline" size="sm" className="dg-btn-secondary h-9" onClick={() => refetch()} disabled={isFetching}>
<RefreshCw className={cn('h-4 w-4 mr-1', isFetching && 'animate-spin')} />{t('common.refresh')}
</Button>
</div>
</div>
@@ -47,7 +47,7 @@ export function SessionCommandsPanel() {
...(applied.endDate ? { end_date: applied.endDate } : {}),
}), [applied]);
const { data, isLoading, refetch } = useSessionCommands(queryParams);
const { data, isLoading, isFetching, refetch } = useSessionCommands(queryParams);
const commands = data?.list ?? [];
const total = data?.total ?? 0;
@@ -153,8 +153,9 @@ export function SessionCommandsPanel() {
variant="outline"
className="dg-btn-secondary h-9"
onClick={() => refetch()}
disabled={isFetching}
>
<RefreshCw className="h-4 w-4 mr-2" />
<RefreshCw className={cn('h-4 w-4 mr-2', isFetching && 'animate-spin')} />
{t('common.refresh')}
</Button>
<Button