feat: Ansible 完整工作流页面(模板→主机→预览→执行→监控)
**新组件 AnsibleWorkflow.tsx(~670行):** - Step 1: 模板选择 — 卡片网格,按分类/标签搜索过滤 - Step 2: 主机匹配 — 正则/前缀/模糊搜索,checkable 表格,全选 - Step 3: 确认执行 — Playbook 摘要 + 主机列表 + YAML 预览 - Step 4: 执行监控 — 状态指示器 + 终端输出 + 耗时统计 - 执行记录 Tab — 历史列表 + 输出展开 **路由调整:** - /ansible → AnsibleWorkflow(主工作流) - /ansible/manage → AnsibleManager(模板 CRUD) **类型补全:** - ExecutionRecord 增加 triggered_by 字段
This commit is contained in:
1 parent
c9b6647831
commit
f05cf71121
5 files changed
+699
-6
No files matched your search
@@ -52,8 +52,6 @@ export function mapScript(raw: any): Script {
|
||||
export const scriptTypes = [
|
||||
{ value: 'shell', label: 'Shell', sample: '#!/bin/bash\n# 系统巡检脚本\necho "===== 系统信息 ====="\nuname -a\necho ""\necho "===== 磁盘使用 ====="\ndf -h\necho ""\necho "===== 内存使用 ====="\nfree -h\n' },
|
||||
{ value: 'python', label: 'Python', sample: '#!/usr/bin/env python3\n# 主机信息采集\nimport platform, socket\nprint("主机名:", socket.gethostname())\nprint("系统:", platform.platform())\nprint("Python:", platform.python_version())\n' },
|
||||
{ value: 'powershell', label: 'PowerShell', sample: '# Windows 系统检查\nWrite-Host "===== 系统信息 ====="\nGet-ComputerInfo | Select-Object CsName, WindowsVersion\nWrite-Host "===== 磁盘使用 ====="\nGet-PSDrive -PSProvider FileSystem | Format-Table\n' },
|
||||
{ value: 'yaml', label: 'YAML', sample: '# YAML 配置/任务定义\nname: example-task\nsteps:\n - name: step1\n action: echo\n message: hello\n' },
|
||||
];
|
||||
|
||||
const typeColors: Record<string, string> = {
|
||||
|
||||
Reference in new issue
Block a user