chore: 重新编译前端产物(补装CodeMirror依赖)
This commit is contained in:
1 parent
23e9e3da62
commit
4e384ca401
115 files changed
+147
-147
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import{j as t,r as i}from"./vendor-codemirror-B1SGo4xl.js";import{D as $,a as B,b as P,c as O,d as A,e as I,B as p,q as Z,f as Lt,t as l}from"./index-Dungj95X.js";import{I as D}from"./input-CXoUQQLm.js";import{S as tt,a as et,b as ot,c as st,d as z}from"./select-CiTqGGhE.js";import{T as _t,a as zt,b as G,c as K}from"./tabs-D87nAyJR.js";import{C as at}from"./checkbox-Bu55mX0G.js";import{s as j,t as $t}from"./automation-C9TdY9Jc.js";import{B as N}from"./badge-CGJlVD3L.js";import{a as Bt,y as ct,L as V,b as Pt,o as nt,aJ as rt,x as Ot,z as At,az as It,T as it,n as pt,r as Vt,S as qt,P as Rt}from"./vendor-icons-DmqcWdzX.js";import{L as v}from"./label-CMpUoC87.js";import{T as Ht}from"./textarea-BxfjmLq5.js";import{C as lt,b as Qt,c as Jt,d as Ut,a as mt}from"./card-BIfzBCEy.js";import"./index-5FEebgvX.js";function Xt(o){return{id:o.id,name:o.name,code:o.code||"",description:o.description||"",type:o.type||"shell",content:o.content||"",timeout:o.timeout||300,version:o.version||1,run_count:o.run_count||0,created_at:o.created_at,updated_at:o.updated_at}}const w=[{value:"shell",label:"Shell",sample:`#!/bin/bash
|
||||
# 系统巡检脚本
|
||||
echo "===== 系统信息 ====="
|
||||
uname -a
|
||||
echo ""
|
||||
echo "===== 磁盘使用 ====="
|
||||
df -h
|
||||
echo ""
|
||||
echo "===== 内存使用 ====="
|
||||
free -h
|
||||
`},{value:"python",label:"Python",sample:`#!/usr/bin/env python3
|
||||
# 主机信息采集
|
||||
import platform, socket
|
||||
print("主机名:", socket.gethostname())
|
||||
print("系统:", platform.platform())
|
||||
print("Python:", platform.python_version())
|
||||
`}],W={shell:"border-green-500/30 text-green-500 bg-green-500/10",bash:"border-green-500/30 text-green-500 bg-green-500/10",python:"border-blue-500/30 text-blue-500 bg-blue-500/10",powershell:"border-cyan-500/30 text-cyan-500 bg-cyan-500/10",yaml:"border-purple-500/30 text-purple-500 bg-purple-500/10"},dt=o=>t.jsx(N,{"code-path":"src/components/automation/script-helpers.tsx:67:3",variant:"outline",className:W[o]||W.shell,children:(o||"shell").toUpperCase()}),Y=()=>`sc-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`;function xt(o){switch(o){case"pending":return t.jsxs(N,{"code-path":"src/components/automation/script-helpers.tsx:79:14",variant:"outline",className:"gap-1",children:[t.jsx(Pt,{"code-path":"src/components/automation/script-helpers.tsx:79:57",className:"w-3 h-3"}),"等待中"]});case"running":return t.jsxs(N,{"code-path":"src/components/automation/script-helpers.tsx:81:14",variant:"default",className:"bg-blue-500 gap-1",children:[t.jsx(V,{"code-path":"src/components/automation/script-helpers.tsx:81:69",className:"w-3 h-3 animate-spin"}),"执行中"]});case"success":return t.jsxs(N,{"code-path":"src/components/automation/script-helpers.tsx:83:14",variant:"default",className:"bg-green-600 gap-1",children:[t.jsx(ct,{"code-path":"src/components/automation/script-helpers.tsx:83:70",className:"w-3 h-3"}),"成功"]});case"failed":return t.jsxs(N,{"code-path":"src/components/automation/script-helpers.tsx:85:14",variant:"destructive",className:"gap-1",children:[t.jsx(Bt,{"code-path":"src/components/automation/script-helpers.tsx:85:61",className:"w-3 h-3"}),"失败"]});default:return t.jsx(N,{"code-path":"src/components/automation/script-helpers.tsx:87:14",variant:"secondary",children:o||"未知"})}}const Gt=o=>{if(!o)return"-";const a=new Date(o);return Number.isNaN(a.getTime())?"-":a.toLocaleString("zh-CN",{hour12:!1})},Kt=({open:o,onOpenChange:a,editingId:s,editingCode:n,formData:m,setFormData:x,onTypeChange:f,onSave:y})=>t.jsx($,{"code-path":"src/components/automation/ScriptFormDialog.tsx:38:5",open:o,onOpenChange:a,children:t.jsxs(B,{"code-path":"src/components/automation/ScriptFormDialog.tsx:39:7",className:"max-w-4xl max-h-[90vh]",children:[t.jsxs(P,{"code-path":"src/components/automation/ScriptFormDialog.tsx:40:9",children:[t.jsx(O,{"code-path":"src/components/automation/ScriptFormDialog.tsx:41:11",children:s!==null?"编辑脚本":"新建脚本"}),t.jsx(A,{"code-path":"src/components/automation/ScriptFormDialog.tsx:42:11",children:"编写运维脚本,支持 Shell / Python / PowerShell"})]}),t.jsxs("div",{"code-path":"src/components/automation/ScriptFormDialog.tsx:44:9",className:"space-y-4 overflow-y-auto max-h-[60vh] pr-1",children:[t.jsxs("div",{"code-path":"src/components/automation/ScriptFormDialog.tsx:45:11",className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{"code-path":"src/components/automation/ScriptFormDialog.tsx:46:13",children:[t.jsx(v,{"code-path":"src/components/automation/ScriptFormDialog.tsx:47:15",children:"名称"}),t.jsx(D,{"code-path":"src/components/automation/ScriptFormDialog.tsx:48:15",value:m.name,onChange:r=>x({...m,name:r.target.value}),placeholder:"如:系统巡检脚本"})]}),t.jsxs("div",{"code-path":"src/components/automation/ScriptFormDialog.tsx:54:13",children:[t.jsx(v,{"code-path":"src/components/automation/ScriptFormDialog.tsx:55:15",children:"类型"}),t.jsxs(tt,{"code-path":"src/components/automation/ScriptFormDialog.tsx:56:15",value:m.type,onValueChange:f,children:[t.jsx(et,{"code-path":"src/components/automation/ScriptFormDialog.tsx:57:17",children:t.jsx(ot,{"code-path":"src/components/automation/ScriptFormDialog.tsx:57:32"})}),t.jsx(st,{"code-path":"src/components/automation/ScriptFormDialog.tsx:58:17",children:w.map(r=>t.jsx(z,{"code-path":"src/components/automation/ScriptFormDialog.tsx:60:21",value:r.value,children:r.label},r.value))})]})]})]}),t.jsxs("div",{"code-path":"src/components/automation/ScriptFormDialog.tsx:66:11",children:[t.jsx(v,{"code-path":"src/components/automation/ScriptFormDialog.tsx:67:13",children:"描述"}),t.jsx(D,{"code-path":"src/components/automation/ScriptFormDialog.tsx:68:13",value:m.description,onChange:r=>x({...m,description:r.target.value}),placeholder:"脚本用途说明"})]}),t.jsxs("div",{"code-path":"src/components/automation/ScriptFormDialog.tsx:74:11",className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{"code-path":"src/components/automation/ScriptFormDialog.tsx:75:13",children:[t.jsx(v,{"code-path":"src/components/automation/ScriptFormDialog.tsx:76:15",children:"超时(秒)"}),t.jsx(D,{"code-path":"src/components/automation/ScriptFormDialog.tsx:77:15",type:"number",value:m.timeout,onChange:r=>x({...m,timeout:Number(r.target.value)}),placeholder:"300"})]}),s!==null&&t.jsxs("div",{"code-path":"src/components/automation/ScriptFormDialog.tsx:85:15",children:[t.jsx(v,{"code-path":"src/components/automation/ScriptFormDialog.tsx:86:17",children:"编码"}),t.jsx(D,{"code-path":"src/compon
Line truncated
|
||||
Reference in new issue
Block a user