diff --git a/frontend/src/api/admin/ops.ts b/frontend/src/api/admin/ops.ts index 3c39a32b..c0df4605 100644 --- a/frontend/src/api/admin/ops.ts +++ b/frontend/src/api/admin/ops.ts @@ -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 { + const { data } = await apiClient.get('/admin/ops/advanced-settings') + return data +} + +export async function updateAdvancedSettings(config: OpsAdvancedSettings): Promise { + const { data } = await apiClient.put('/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 diff --git a/frontend/src/views/admin/ops/OpsDashboard.vue b/frontend/src/views/admin/ops/OpsDashboard.vue index 212717fb..e8fedc5a 100644 --- a/frontend/src/views/admin/ops/OpsDashboard.vue +++ b/frontend/src/views/admin/ops/OpsDashboard.vue @@ -31,6 +31,8 @@ @refresh="fetchData" @open-request-details="handleOpenRequestDetails" @open-error-details="openErrorDetails" + @open-settings="showSettingsDialog = true" + @open-alert-rules="showAlertRulesCard = true" /> @@ -72,6 +74,14 @@ + + + + + + + + ({ sort: 'created_at_desc' }) +const showSettingsDialog = ref(false) +const showAlertRulesCard = ref(false) + function handleThroughputSelectPlatform(nextPlatform: string) { platform.value = nextPlatform || '' groupId.value = null diff --git a/frontend/src/views/admin/ops/components/OpsDashboardHeader.vue b/frontend/src/views/admin/ops/components/OpsDashboardHeader.vue index 312642c3..23609a06 100644 --- a/frontend/src/views/admin/ops/components/OpsDashboardHeader.vue +++ b/frontend/src/views/admin/ops/components/OpsDashboardHeader.vue @@ -34,6 +34,8 @@ interface Emits { (e: 'refresh'): void (e: 'openRequestDetails', preset?: OpsRequestDetailsPreset): void (e: 'openErrorDetails', kind: 'request' | 'upstream'): void + (e: 'openSettings'): void + (e: 'openAlertRules'): void } const props = defineProps() @@ -723,6 +725,33 @@ function openJobsDetails() { /> + + + + + + @@ -955,11 +984,11 @@ function openJobsDetails() {
- 请求数: + {{ t('admin.ops.requests') }}: {{ totalRequestsLabel }}
- Token: + {{ t('admin.ops.tokens') }}: {{ totalTokensLabel }}
diff --git a/frontend/src/views/admin/ops/types.ts b/frontend/src/views/admin/ops/types.ts index 08830542..45ba031f 100644 --- a/frontend/src/views/admin/ops/types.ts +++ b/frontend/src/views/admin/ops/types.ts @@ -13,5 +13,8 @@ export type { Operator, EmailNotificationConfig, OpsDistributedLockSettings, - OpsAlertRuntimeSettings + OpsAlertRuntimeSettings, + OpsAdvancedSettings, + OpsDataRetentionSettings, + OpsAggregationSettings } from '@/api/admin/ops'