chore: 重新编译前端产物(补装CodeMirror依赖)

This commit is contained in:
attacker committed 2026-06-26 23:29:08 +08:00
1 parent 23e9e3da62
commit 4e384ca401
115 files changed
+147 -147

No files matched your search

@@ -0,0 +1,2 @@
import{j as t,r as n}from"./vendor-codemirror-B1SGo4xl.js";import{C as lt,a as dt}from"./card-BIfzBCEy.js";import{S as mt}from"./stat-strip-BSQFwFzG.js";import{D as X,a as G,b as K,c as U,d as W,e as xt,B as p,t as l,f as pt}from"./index-Dungj95X.js";import{I as P}from"./input-CXoUQQLm.js";import{B as C}from"./badge-CGJlVD3L.js";import{C as I}from"./checkbox-Bu55mX0G.js";import{s as $,c as y,t as ht}from"./automation-C9TdY9Jc.js";import{L as k,a as gt,y as ut,aw as Y,r as Z,R as bt,P as vt,S as yt,T as z,aH as Ct,b as jt,o as Jt,z as B,aI as Nt,aJ as ft}from"./vendor-icons-DmqcWdzX.js";import{S as O,a as R,b as A,c as V,d as J}from"./select-CiTqGGhE.js";import{T as Q}from"./textarea-BxfjmLq5.js";import{L as N}from"./label-CMpUoC87.js";import{T as Dt,a as Ft,b as L,c as w,d as Mt,e as f}from"./table-B2F10oba.js";import"./index-5FEebgvX.js";function tt(i){switch(i){case"success":return t.jsxs(C,{"code-path":"src/components/automation/cronJobHelpers.tsx:9:9",variant:"outline",className:"border-emerald-500/30 text-emerald-400 bg-emerald-500/10",children:[t.jsx(ut,{"code-path":"src/components/automation/cronJobHelpers.tsx:10:11",className:"h-3 w-3 mr-1"}),"成功"]});case"failed":return t.jsxs(C,{"code-path":"src/components/automation/cronJobHelpers.tsx:16:9",variant:"outline",className:"border-red-500/30 text-red-400 bg-red-500/10",children:[t.jsx(gt,{"code-path":"src/components/automation/cronJobHelpers.tsx:17:11",className:"h-3 w-3 mr-1"}),"失败"]});case"running":return t.jsxs(C,{"code-path":"src/components/automation/cronJobHelpers.tsx:23:9",variant:"outline",className:"border-blue-500/30 text-blue-400 bg-blue-500/10 animate-pulse",children:[t.jsx(k,{"code-path":"src/components/automation/cronJobHelpers.tsx:24:11",className:"h-3 w-3 mr-1 animate-spin"}),"执行中"]});default:return t.jsx(C,{"code-path":"src/components/automation/cronJobHelpers.tsx:30:9",variant:"outline",className:"border-[var(--dg-border)] text-[var(--dg-text-muted)]",children:"从未执行"})}}function wt(i){return{"0 2 * * *":"每天 02:00","0 3 * * 0":"每周日 03:00","*/5 * * * *":"每 5 分钟","0 * * * *":"每小时","0 9 * * 1":"每周一 09:00"}[i]||i}const q=[{value:"shell",label:"Shell 脚本",desc:"关联脚本库中的 Shell 脚本"},{value:"python",label:"Python 脚本",desc:"关联脚本库中的 Python 脚本"},{value:"command",label:"自定义命令",desc:"手动输入命令或脚本路径"}];function St({open:i,onOpenChange:g,editJob:s,onSuccess:D}){const[a,d]=n.useState({name:"",description:"",cron_expr:"",type:"shell",content:"",script_id:null}),[h,v]=n.useState([]),[r,m]=n.useState(null),[S,F]=n.useState(!1);n.useEffect(()=>{i&&($.getScripts({page_size:200}).then(e=>{v(e?.list||[])}).catch(()=>v([])),s?(d({name:s.name||"",description:s.description||"",cron_expr:s.cron_expr||"",type:s.type||"shell",content:s.content||"",script_id:s.script_id||null}),s.script_id?$.getScript(s.script_id).then(e=>{m(e)}).catch(()=>m(null)):m(null)):(d({name:"",description:"",cron_expr:"",type:"shell",content:"",script_id:null}),m(null)))},[i,s]);const M=a.type==="shell"||a.type==="python"?h.filter(e=>e.type===a.type):[],E=e=>{const x=h.find(j=>String(j.id)===e);x&&(m(x),d(j=>({...j,script_id:x.id,content:x.content})))},T=e=>{d(x=>({...x,type:e,script_id:null,content:e==="command"?x.content:""})),m(null)},H=async()=>{if(!a.name||!a.cron_expr){l.error("请填写任务名称和 Cron 表达式");return}if((a.type==="shell"||a.type==="python")&&!a.script_id){l.error("请选择关联的脚本");return}try{F(!0);const e={name:a.name,description:a.description,cron_expr:a.cron_expr,type:a.type,content:a.content,script_id:a.script_id};s?(await y.updateJob(s.id,e),l.success("任务更新成功")):(await y.createJob(e),l.success("任务创建成功")),g(!1),D()}catch(e){console.error("Failed to save cron job:",e),l.error(s?"更新失败":"创建失败")}finally{F(!1)}};return t.jsx(X,{"code-path":"src/components/automation/CronJobFormDialog.tsx:150:5",open:i,onOpenChange:g,children:t.jsxs(G,{"code-path":"src/components/automation/CronJobFormDialog.tsx:151:7",className:"max-w-2xl bg-[var(--dg-bg-primary)] border-[var(--dg-border)] text-[var(--dg-text-primary)]",children:[t.jsxs(K,{"code-path":"src/components/automation/CronJobFormDialog.tsx:152:9",children:[t.jsx(U,{"code-path":"src/components/automation/CronJobFormDialog.tsx:153:11",children:s?"编辑定时任务":"新建定时任务"}),t.jsx(W,{"code-path":"src/components/automation/CronJobFormDialog.tsx:154:11",className:"text-[var(--dg-text-secondary)]",children:"配置 Cron 定时任务"})]}),t.jsxs("div",{"code-path":"src/components/automation/CronJobFormDialog.tsx:156:9",className:"space-y-4 py-4 max-h-[60vh] overflow-y-auto pr-1",children:[t.jsxs("div",{"code-path":"src/components/automation/CronJobFormDialog.tsx:158:11",children:[t.jsx(N,{"code-path":"src/components/automation/CronJobFormDialog.tsx:159:13",className:"text-[var(--dg-text-primary)]",children:"任务名称"}),t.jsx(P,{"code-paLine truncated
`).length," 行"]})]}),t.jsx("pre",{"code-path":"src/components/automation/CronJobFormDialog.tsx:276:19",className:"max-h-48 overflow-auto rounded-md bg-[var(--dg-bg-tertiary)] border border-[var(--dg-border)] p-3 text-xs font-mono text-[var(--dg-text-secondary)] whitespace-pre-wrap break-all",children:r.content||"(空脚本)"})]})]}):t.jsxs("div",{"code-path":"src/components/automation/CronJobFormDialog.tsx:283:13",children:[t.jsx(N,{"code-path":"src/components/automation/CronJobFormDialog.tsx:284:15",className:"text-[var(--dg-text-primary)]",children:"执行命令"}),t.jsx(Q,{"code-path":"src/components/automation/CronJobFormDialog.tsx:285:15",value:a.content,onChange:e=>d({...a,content:e.target.value}),placeholder:"/scripts/backup.sh arg1 arg2",rows:4,className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] text-[var(--dg-text-primary)] mt-1 font-mono"})]})]}),t.jsxs(xt,{"code-path":"src/components/automation/CronJobFormDialog.tsx:295:9",children:[t.jsx(p,{"code-path":"src/components/automation/CronJobFormDialog.tsx:296:11",variant:"outline",onClick:()=>g(!1),className:"border-[var(--dg-border)] text-[var(--dg-text-secondary)]",children:"取消"}),t.jsx(p,{"code-path":"src/components/automation/CronJobFormDialog.tsx:299:11",className:"bg-blue-600 hover:bg-blue-700",onClick:H,disabled:S,children:S?"保存中...":s?"保存修改":"创建任务"})]})]})})}function Et({open:i,onOpenChange:g}){const[s,D]=n.useState([]),[a,d]=n.useState(!1),[h,v]=n.useState(null);return n.useEffect(()=>{if(!i)return;(async()=>{try{d(!0);const m=await ht.getExecutions({task_type:"cron",page_size:50});D(m.list||[])}catch(m){console.error("Failed to load executions:",m)}finally{d(!1)}})()},[i]),t.jsx(X,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:52:5",open:i,onOpenChange:g,children:t.jsxs(G,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:53:7",className:"max-w-4xl bg-[var(--dg-bg-primary)] border-[var(--dg-border)] text-[var(--dg-text-primary)] max-h-[85vh] overflow-y-auto",children:[t.jsxs(K,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:54:9",children:[t.jsx(U,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:55:11",children:"执行历史"}),t.jsx(W,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:56:11",className:"text-[var(--dg-text-secondary)]",children:"定时任务执行记录与输出日志"})]}),t.jsx("div",{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:58:9",className:"mt-4",children:a?t.jsx("div",{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:60:13",className:"flex items-center justify-center py-8",children:t.jsx(k,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:61:15",className:"h-6 w-6 text-[var(--dg-text-secondary)] animate-spin"})}):s.length===0?t.jsxs("div",{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:64:13",className:"flex flex-col items-center justify-center py-12 text-[var(--dg-text-secondary)]",children:[t.jsx(Y,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:65:15",className:"h-10 w-10 mb-3 opacity-40"}),t.jsx("p",{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:66:15",className:"text-sm",children:"暂无执行记录"})]}):t.jsxs(Dt,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:69:13",children:[t.jsx(Ft,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:70:15",children:t.jsxs(L,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:71:17",className:"border-[var(--dg-border)]",children:[t.jsx(w,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:72:19",className:"text-[var(--dg-text-secondary)]",children:"任务"}),t.jsx(w,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:73:19",className:"text-[var(--dg-text-secondary)]",children:"状态"}),t.jsx(w,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:74:19",className:"text-[var(--dg-text-secondary)]",children:"耗时"}),t.jsx(w,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:75:19",className:"text-[var(--dg-text-secondary)]",children:"执行时间"}),t.jsx(w,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:76:19",className:"text-[var(--dg-text-secondary)]",children:"输出"})]})}),t.jsx(Mt,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:79:15",children:s.map(r=>t.jsxs(n.Fragment,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:81:19",children:[t.jsxs(L,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:82:21",className:"border-[var(--dg-border)] cursor-pointer hover:bg-[var(--dg-bg-hover)]/50",onClick:()=>v(h===r.id?null:r.id),children:[t.jsx(f,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:83:23",className:"text-[var(--dg-text-primary)]",children:r.task_name}),t.jsx(f,{"code-path":"src/components/automation/ExecutionHistoryDialog.tsx:84: Line truncated