Files
opsxsql/frontend
logan 00db0e5bca feat: 日志自动清理 — 系统设置+定时任务+手动操作
1. 系统设置新增 cleanup 分组(6项配置):
   - 启用自动清理(开关)
   - 清理执行时间(默认凌晨3点)
   - 工单保留天数(默认90天)
   - 审计日志保留天数(默认180天)
   - 查询历史保留天数(默认30天)
   - 定时任务日志保留天数(默认30天)

2. log_cleanup.py: 自动清理服务
   - 只清理已完成/已拒绝的工单
   - 按保留天数过滤
   - 0天=不清理

3. APScheduler cron job: 每天03:00自动清理

4. API endpoints:
   - POST /settings/cleanup/run — 手动触发清理
   - GET /settings/cleanup/preview — 预览待清理数量

5. 前端 PlatformConfigPage:
   - GROUP_META 新增 cleanup 分组
   - CleanupActions 子组件: 预览+手动清理按钮

6. 清空所有历史工单数据(tickets/ticket_approvals/audit_logs/query_histories)
2026-05-25 00:19:38 +08:00
..

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])