feat(ops): 集成运维监控设置对话框到仪表盘
- 在OpsDashboardHeader添加设置和警报规则按钮 - 在OpsDashboard集成OpsSettingsDialog组件 - 添加警报规则弹窗展示 - 添加高级设置API类型定义 - 支持从Header快速访问设置和规则管理 相关文件: - frontend/src/api/admin/ops.ts - frontend/src/views/admin/ops/types.ts - frontend/src/views/admin/ops/OpsDashboard.vue - frontend/src/views/admin/ops/components/OpsDashboardHeader.vue
This commit is contained in:
@@ -676,6 +676,23 @@ export interface OpsAlertRuntimeSettings {
|
||||
}
|
||||
}
|
||||
|
||||
export interface OpsAdvancedSettings {
|
||||
data_retention: OpsDataRetentionSettings
|
||||
aggregation: OpsAggregationSettings
|
||||
}
|
||||
|
||||
export interface OpsDataRetentionSettings {
|
||||
cleanup_enabled: boolean
|
||||
cleanup_schedule: string
|
||||
error_log_retention_days: number
|
||||
minute_metrics_retention_days: number
|
||||
hourly_metrics_retention_days: number
|
||||
}
|
||||
|
||||
export interface OpsAggregationSettings {
|
||||
aggregation_enabled: boolean
|
||||
}
|
||||
|
||||
export interface OpsErrorLog {
|
||||
id: number
|
||||
created_at: string
|
||||
@@ -894,6 +911,17 @@ export async function updateAlertRuntimeSettings(config: OpsAlertRuntimeSettings
|
||||
return data
|
||||
}
|
||||
|
||||
// Advanced settings (DB-backed)
|
||||
export async function getAdvancedSettings(): Promise<OpsAdvancedSettings> {
|
||||
const { data } = await apiClient.get<OpsAdvancedSettings>('/admin/ops/advanced-settings')
|
||||
return data
|
||||
}
|
||||
|
||||
export async function updateAdvancedSettings(config: OpsAdvancedSettings): Promise<OpsAdvancedSettings> {
|
||||
const { data } = await apiClient.put<OpsAdvancedSettings>('/admin/ops/advanced-settings', config)
|
||||
return data
|
||||
}
|
||||
|
||||
export const opsAPI = {
|
||||
getDashboardOverview,
|
||||
getThroughputTrend,
|
||||
@@ -915,7 +943,9 @@ export const opsAPI = {
|
||||
getEmailNotificationConfig,
|
||||
updateEmailNotificationConfig,
|
||||
getAlertRuntimeSettings,
|
||||
updateAlertRuntimeSettings
|
||||
updateAlertRuntimeSettings,
|
||||
getAdvancedSettings,
|
||||
updateAdvancedSettings
|
||||
}
|
||||
|
||||
export default opsAPI
|
||||
|
||||
Reference in New Issue
Block a user