zdashboard 2.7.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +1 -0
  2. package/dist/cli.js +571 -1018
  3. package/dist/cli.js.map +1 -1
  4. package/dist/web/assets/BatchView-BcYVTq5m.js +2 -0
  5. package/dist/web/assets/{CheckpointViewer-DBmTkC_E.js → CheckpointViewer-aVIaKKvz.js} +1 -1
  6. package/dist/web/assets/{FileIcon-tDB2mYGC.js → CodeViewer-DFzMfmdB.js} +31 -31
  7. package/dist/web/assets/DependencyGraph-NqqCB6Vt.js +1 -0
  8. package/dist/web/assets/FileIcon-Bk6QVgj6.js +1 -0
  9. package/dist/web/assets/{FilterPills-CvO0pz85.js → FilterPills-CiDfp_8h.js} +1 -1
  10. package/dist/web/assets/{ProgressBar-DIoIeYBA.js → ProgressBar-DIVNOeTV.js} +1 -1
  11. package/dist/web/assets/Sidebar-DbPvTOr4.js +1 -0
  12. package/dist/web/assets/Sidebar-prXqMrLa.js +1 -0
  13. package/dist/web/assets/SingleChangeView-e7LU1eVP.js +1 -0
  14. package/dist/web/assets/ViewHeader-1hW25T7x.js +1 -0
  15. package/dist/web/assets/Workspace-BgZLrrMa.js +1 -0
  16. package/dist/web/assets/Workspace-BjE2HRuu.js +1 -0
  17. package/dist/web/assets/Workspace-CCD9dE4r.js +2 -0
  18. package/dist/web/assets/Workspace-CthIPSy_.js +1 -0
  19. package/dist/web/assets/Workspace-DHQUpHN1.js +5 -0
  20. package/dist/web/assets/client-Cw4K1Nx3.js +1 -0
  21. package/dist/web/assets/{index-yx7txO50.js → index-Cq5UOBJN.js} +509 -509
  22. package/dist/web/assets/index-DcspTMh9.css +1 -0
  23. package/dist/web/assets/{index-CtlFZEcM.js → index-PcP6ebRP.js} +2 -2
  24. package/dist/web/assets/usePluginData-Cpm5C7LU.js +1 -0
  25. package/dist/web/assets/web-BnL7vuwB.js +2 -0
  26. package/dist/web/assets/web-CdCGfZIi.js +2 -0
  27. package/dist/web/assets/web-Ch8IK7pu.js +2 -0
  28. package/dist/web/assets/web-CjjS2dbX.js +2 -0
  29. package/dist/web/assets/web-Jaf9aZCx.js +2 -0
  30. package/dist/web/index.html +3 -3
  31. package/package.json +6 -1
  32. package/dist/web/assets/ApprovalPanel-CXQRioSw.js +0 -1
  33. package/dist/web/assets/BatchDashboard-BigPUG8g.js +0 -2
  34. package/dist/web/assets/ConfigField-BqjVlteZ.js +0 -1
  35. package/dist/web/assets/DependencyGraph-DPVneSQh.js +0 -1
  36. package/dist/web/assets/Workspace-B2nKQnQf.js +0 -1
  37. package/dist/web/assets/badge-CmIMTBDj.js +0 -1
  38. package/dist/web/assets/index-BHL7sr_b.css +0 -1
  39. package/dist/web/assets/web-BBv8hkwo.js +0 -1
  40. package/dist/web/assets/web-BNjs9lCy.js +0 -139
  41. package/dist/web/assets/web-BX2cajm6.js +0 -5
  42. package/dist/web/assets/web-BpBEbcYZ.js +0 -1
  43. package/dist/web/assets/web-CGbbhItO.js +0 -2
  44. package/dist/web/assets/web-CcDed_yx.js +0 -1
  45. package/dist/web/assets/web-DsIjKVnn.js +0 -2
  46. package/dist/web/assets/web-Eo4S0U_k.js +0 -2
  47. /package/dist/web/assets/{FileIcon-BTcE7LSd.css → CodeViewer-BTcE7LSd.css} +0 -0
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DependencyGraph-NqqCB6Vt.js","assets/index-Cq5UOBJN.js","assets/index-DcspTMh9.css","assets/CheckpointViewer-aVIaKKvz.js"])))=>i.map(i=>d[i]);
2
+ import{b as k,a as E,r as l,j as e,E as V,_ as y}from"./index-Cq5UOBJN.js";import{V as C,B}from"./ViewHeader-1hW25T7x.js";import{u as x}from"./usePluginData-Cpm5C7LU.js";import{M as S,t as z}from"./index-PcP6ebRP.js";const I=l.lazy(()=>y(()=>import("./DependencyGraph-NqqCB6Vt.js"),__vite__mapDeps([0,1,2]))),R=l.lazy(()=>y(()=>import("./CheckpointViewer-aVIaKKvz.js"),__vite__mapDeps([3,1,2]))),T=["graph","checkpoint"],A={graph:"依赖图",checkpoint:"进度"},D={idle:"neutral",analyzing:"info","pending-approval":"warning",running:"info",paused:"warning",completed:"success",failed:"destructive"};function L(r){return r==="error"?"text-destructive":r==="warn"?"text-warning":"text-muted-foreground"}function P(){const r=x("apply:/__apply/batch",()=>fetch("/__apply/batch",{cache:"no-store"}).then(t=>t.json()),{subscribe:"files"}),c=x("apply:/__apply/batch/graph",()=>fetch("/__apply/batch/graph",{cache:"no-store"}).then(t=>t.json()),{subscribe:"files"}),d=x("apply:/__apply/batch/logs",()=>fetch("/__apply/batch/logs",{cache:"no-store"}).then(t=>t.json()),{subscribe:"files"}),i=x("apply:/__apply/batch/plan",()=>fetch("/__apply/batch/plan",{cache:"no-store"}).then(t=>t.ok?t.json().then(u=>u.plan):null).catch(()=>null),{subscribe:"files"});return{snapshot:r,graph:c,logs:d,plan:i}}function $({run:r,hasError:c}){return e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-6 gap-2",children:[e.jsx(V,{title:"暂无批量执行数据",hint:"在 zapply batch 中启动批量执行后,状态会出现在这里"}),e.jsxs("div",{className:"text-center text-xs text-muted-foreground space-y-1",children:[e.jsxs("p",{children:["状态文件:",e.jsx("code",{className:"font-mono",children:".zdev/apply/runs/<runId>/state.json"}),"(由 zapply 写入,本页只读)"]}),e.jsx("p",{children:"旧 .zapply/batch-state.json 历史数据不迁移,仅留档"}),r!==null&&e.jsx("p",{children:"CURRENT 指向的 run 状态缺失或损坏(历史 run 只读)"}),c&&e.jsx("p",{children:"数据加载失败,请稍后重试或刷新页面"})]})]})}function W({onStatus:r}={}){var g,j;const{icon:c}=k(),d=E(),i=d.params.get("sel"),[t,u]=l.useState("graph"),[m,v]=l.useState(!0),{snapshot:o,graph:_,logs:N,plan:f}=P(),s=((g=o.data)==null?void 0:g.state)??null,p=((j=o.data)==null?void 0:j.run)??null,n={completed:(s==null?void 0:s.changes.filter(a=>a.status==="completed").length)??0,failed:(s==null?void 0:s.changes.filter(a=>a.status==="failed").length)??0,parked:(s==null?void 0:s.changes.filter(a=>a.status==="parked").length)??0,running:(s==null?void 0:s.changes.filter(a=>a.status==="running").length)??0},h=(s==null?void 0:s.changes.length)??0;if(l.useEffect(()=>{r==null||r(h?{label:`${n.completed+n.failed}/${h}`,tone:n.failed?"warning":"info"}:void 0)},[h,n.completed,n.failed,r]),!s)return e.jsx("div",{"data-testid":"batch-view",className:"h-full flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:o.data===null&&!o.error?e.jsx("div",{className:"flex items-center justify-center h-full",children:"加载中..."}):e.jsx($,{run:p,hasError:!!o.error})});const b=a=>d.navigate({sel:a});return e.jsxs("div",{"data-testid":"batch-view",className:"h-full flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:[e.jsx(C,{title:"zapply batch"}),e.jsxs("div",{"data-testid":"batch-overview",className:"flex-none px-4 py-2 border-b border-border flex items-center gap-3 text-sm text-muted-foreground flex-wrap",children:[e.jsx(B,{variant:D[s.status],children:s.status}),e.jsxs("span",{children:["第 ",s.currentBatchIndex+1,"/",s.batches.length," 批"]}),e.jsxs("span",{children:[n.completed,"/",h," 完成"]}),e.jsxs("span",{children:["并行度: ",s.parallelism]}),e.jsxs("span",{children:["🔄 ",n.running," 运行中"]}),e.jsxs("span",{children:["❌ ",n.failed," 失败"]}),e.jsxs("span",{children:["⏸️ ",n.parked," parked"]}),f.data&&e.jsx("button",{type:"button","aria-pressed":m,onClick:()=>v(a=>!a),className:`px-2 py-0.5 text-xs rounded-md border transition-colors ${m?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-accent"}`,children:"执行计划"}),e.jsxs("span",{className:"ml-auto text-xs font-mono",children:["run: ",(p==null?void 0:p.id)??"-"," · 只读"]})]}),e.jsx("div",{className:"flex-none px-4 py-1.5 border-b border-border flex items-center gap-2",children:T.map(a=>e.jsx("button",{type:"button",onClick:()=>u(a),className:`px-3 py-1 text-xs rounded-md ${t===a?"bg-primary text-primary-foreground":"border border-border hover:bg-accent"}`,children:A[a]},a))}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(l.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full",children:"加载中..."}),children:e.jsxs("div",{"data-testid":`batch-subview-${t}`,className:"h-full",children:[t==="graph"&&e.jsx(I,{graph:_.data??{changes:[],batches:[],conflicts:[]},selectedChange:i,onSelectChange:b}),t==="checkpoint"&&e.jsx(R,{state:s,selectedChange:i,onSelectChange:b})]})})}),f.data&&m&&e.jsxs("div",{className:"flex-none border-t border-border px-6 py-3 max-h-48 overflow-y-auto",children:[e.jsxs("h4",{className:"text-xs font-medium text-muted-foreground mb-2 flex items-center gap-1",children:[c("file-text","h-3 w-3")," 执行计划 plan.md(只读)"]}),e.jsx("div",{className:"prose dark:prose-invert max-w-none text-xs bg-card border rounded-lg p-3",children:e.jsx(S,{remarkPlugins:[z],children:f.data})})]}),e.jsx("footer",{"data-testid":"batch-logs",className:"h-48 shrink-0 overflow-auto border-t border-border px-6 py-2",children:e.jsx("div",{className:"text-xs font-mono space-y-1",children:(N.data??[]).slice(-20).reverse().map((a,w)=>e.jsxs("div",{className:L(a.level),children:[e.jsxs("span",{className:"text-muted-foreground/60",children:["[",new Date(a.timestamp).toLocaleTimeString(),"]"]}),a.changeName&&e.jsxs("span",{className:"text-info ml-2",children:["[",a.changeName,"]"]}),e.jsx("span",{className:"ml-2",children:a.message})]},w))})})]})}export{W as default};
@@ -1 +1 @@
1
- import{j as e}from"./index-yx7txO50.js";function x({state:c,selectedChange:r,onSelectChange:a}){const t=c.changes.filter(s=>s.checkpoint&&s.status==="running");return e.jsxs("div",{className:"flex h-full",children:[e.jsxs("aside",{className:"w-80 border-r border-border overflow-y-auto p-4",children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:"执行中的变更"}),e.jsxs("div",{className:"space-y-2",children:[t.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无执行中的变更"}),t.map(s=>e.jsxs("div",{onClick:()=>a(r===s.name?null:s.name),className:`p-3 rounded-lg border cursor-pointer transition-colors ${r===s.name?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[e.jsx("div",{className:"font-medium text-sm",children:s.name}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[s.checkpoint.completedTasks,"/",s.checkpoint.totalTasks," 任务"]})]},s.name))]})]}),e.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:r&&t.find(s=>s.name===r)?e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:r}),e.jsx("div",{className:"space-y-3",children:Array.from({length:t.find(s=>s.name===r).checkpoint.totalTasks}).map((s,n)=>{const d=t.find(l=>l.name===r),i=n<d.checkpoint.completedTasks,o=n===d.checkpoint.currentTaskIndex;return e.jsx("div",{className:`p-4 rounded-lg border ${i?"border-success/30 bg-success/5":o?"border-info/30 bg-info/5":"border-border bg-card"}`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-xs ${i?"bg-success text-success-foreground":o?"bg-info text-info-foreground":"bg-muted text-muted-foreground"}`,children:i?"✓":o?"↻":n+1}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:`text-sm ${i?"line-through text-muted-foreground":"font-medium"}`,children:o?d.checkpoint.currentTask:`任务 #${n+1}`}),o&&e.jsx("div",{className:"text-xs text-info mt-1",children:"执行中..."})]})]})},n)})})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"选择一个变更查看任务进度"})})]})}export{x as default};
1
+ import{j as e}from"./index-Cq5UOBJN.js";function x({state:c,selectedChange:r,onSelectChange:a}){const t=c.changes.filter(s=>s.checkpoint&&s.status==="running");return e.jsxs("div",{className:"flex h-full",children:[e.jsxs("aside",{className:"w-80 border-r border-border overflow-y-auto p-4",children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:"执行中的变更"}),e.jsxs("div",{className:"space-y-2",children:[t.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无执行中的变更"}),t.map(s=>e.jsxs("div",{onClick:()=>a(r===s.name?null:s.name),className:`p-3 rounded-lg border cursor-pointer transition-colors ${r===s.name?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[e.jsx("div",{className:"font-medium text-sm",children:s.name}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[s.checkpoint.completedTasks,"/",s.checkpoint.totalTasks," 任务"]})]},s.name))]})]}),e.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:r&&t.find(s=>s.name===r)?e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:r}),e.jsx("div",{className:"space-y-3",children:Array.from({length:t.find(s=>s.name===r).checkpoint.totalTasks}).map((s,n)=>{const d=t.find(l=>l.name===r),i=n<d.checkpoint.completedTasks,o=n===d.checkpoint.currentTaskIndex;return e.jsx("div",{className:`p-4 rounded-lg border ${i?"border-success/30 bg-success/5":o?"border-info/30 bg-info/5":"border-border bg-card"}`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-xs ${i?"bg-success text-success-foreground":o?"bg-info text-info-foreground":"bg-muted text-muted-foreground"}`,children:i?"✓":o?"↻":n+1}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:`text-sm ${i?"line-through text-muted-foreground":"font-medium"}`,children:o?d.checkpoint.currentTask:`任务 #${n+1}`}),o&&e.jsx("div",{className:"text-xs text-info mt-1",children:"执行中..."})]})]})},n)})})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"选择一个变更查看任务进度"})})]})}export{x as default};