Files
aiops/frontend
attacker ae6af93360 feat: Ansible Playbook 全栈 CRUD + 真实执行 — 替换mock为后端持久化
后端:
- models/automation.go: Playbook 模型新增 Category/Tags 字段; 新增 CreatePlaybookRequest
- handlers/automation.go: 新增 runPlaybookLocal(写临时YML+ansible-playbook --connection=local执行)
  + randomCode(crypto/rand生成唯一code) + List/Get/Create/Update/Delete/Execute Playbook 完整CRUD
  Execute 创建TaskExecution(task_type=playbook)记录,采集stdout/stderr/退出码/耗时
- routes/routes.go: 注册 /playbooks 路由组(7个端点)

前端:
- services/api.ts: ansibleApi 从mock改为真实 /playbooks 后端调用
- AnsibleManager.tsx 完全重写:
  - Playbook管理: 真实数据卡片列表(id/name/category/tags/run_count/timeout) + 搜索/分类筛选
  - 新建/编辑对话框复用(编辑模式预填数据) — 新增编辑入口(原无编辑功能)
  - 查看内容: 终端风格YAML查看器 + 快捷编辑按钮
  - 执行: ConfirmProvider确认 + ansible-playbook本地执行 + toast结果反馈
  - 执行记录tab: 真实TaskExecution记录(任务名/状态/开始时间/耗时/日志查看)
  - 统计卡片: 总数/执行中/今日成功/今日失败(基于真实执行记录)
  - 移除原inventory占位tab(无后端支持,避免非功能按钮)
  - tags JSON数组与前端string[]互转映射
2026-06-14 23:14:16 +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...
    },
  },
])