zdashboard 2.8.3 → 2.8.4
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.
- package/dist/cli.js +3 -2
- package/dist/cli.js.map +1 -1
- package/dist/web/assets/BatchView-pClKtVa8.js +2 -0
- package/dist/web/assets/{CheckpointViewer-DJ9yKpMh.js → CheckpointViewer-CAbXbMti.js} +1 -1
- package/dist/web/assets/{CodeViewer-C_3Ms2Ri.js → CodeViewer-Cs0mG1h6.js} +1 -1
- package/dist/web/assets/{DependencyGraph-hsA8ZmBD.js → DependencyGraph-Czdg00AM.js} +1 -1
- package/dist/web/assets/{FileIcon-a612-H-j.js → FileIcon-1KBdrfw3.js} +1 -1
- package/dist/web/assets/{FilterPills-BVAToHeu.js → FilterPills-CCubROoX.js} +1 -1
- package/dist/web/assets/{ProgressBar-YEvCsTOC.js → ProgressBar-DVfldtzq.js} +1 -1
- package/dist/web/assets/{Sidebar-CmJ0RfM6.js → Sidebar-D4sJtPI_.js} +1 -1
- package/dist/web/assets/{Sidebar-CYYR-the.js → Sidebar-DE0UBp9b.js} +1 -1
- package/dist/web/assets/{SingleChangeView-CCpmUD7z.js → SingleChangeView-BYcaGOyR.js} +1 -1
- package/dist/web/assets/{ViewHeader-C_euf5UJ.js → ViewHeader-DPfbaJmK.js} +1 -1
- package/dist/web/assets/Workspace-B7MhdnwY.js +2 -0
- package/dist/web/assets/{Workspace-Coooyssr.js → Workspace-CAcrVL-m.js} +1 -1
- package/dist/web/assets/{Workspace-DT0JWcsX.js → Workspace-CvG5lIPT.js} +1 -1
- package/dist/web/assets/{Workspace-BLaqqsJU.js → Workspace-DWHHR42N.js} +1 -1
- package/dist/web/assets/{Workspace-C70CR7yx.js → Workspace-cXLWoMNL.js} +1 -1
- package/dist/web/assets/{index-C_16tmIU.js → index-Co7MWSFf.js} +2 -2
- package/dist/web/assets/{index-DvE_prho.js → index-D6EJRHBV.js} +1 -1
- package/dist/web/assets/{usePluginData-pzvMTyoN.js → usePluginData-IoRqReIJ.js} +1 -1
- package/dist/web/assets/{web-CF8JCQ-n.js → web-BZSTgldm.js} +2 -2
- package/dist/web/assets/{web-D-wmMJ1D.js → web-CX1FEFxC.js} +2 -2
- package/dist/web/assets/{web-qAmlbo_B.js → web-DLwxO4fO.js} +2 -2
- package/dist/web/assets/{web-DwYp5Vde.js → web-DOEmlI8d.js} +2 -2
- package/dist/web/assets/{web-BXIb25pa.js → web-DxbVzGf3.js} +2 -2
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/BatchView-D9TMypRX.js +0 -2
- package/dist/web/assets/Workspace-NqbDbmhC.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DependencyGraph-hsA8ZmBD.js","assets/index-C_16tmIU.js","assets/index-CwS-KyOV.css","assets/CheckpointViewer-DJ9yKpMh.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{b as $,a as C,r as o,j as e,C as V,E as B,_}from"./index-C_16tmIU.js";import{V as I,B as S}from"./ViewHeader-C_euf5UJ.js";import{u as f}from"./usePluginData-pzvMTyoN.js";import{M as A,t as R}from"./index-DvE_prho.js";const z=o.lazy(()=>_(()=>import("./DependencyGraph-hsA8ZmBD.js"),__vite__mapDeps([0,1,2]))),P=o.lazy(()=>_(()=>import("./CheckpointViewer-DJ9yKpMh.js"),__vite__mapDeps([3,1,2]))),T=["graph","checkpoint"],D={graph:"依赖图",checkpoint:"进度"},L={idle:"neutral",analyzing:"info","pending-approval":"warning",running:"info",paused:"warning",completed:"success",failed:"destructive"};function U(a){return a==="error"?"text-destructive":a==="warn"?"text-warning":"text-muted-foreground"}function O(a){const n=a?`?run=${encodeURIComponent(a)}`:"",i=f(`apply:/__apply/batch${n}`,()=>fetch(`/__apply/batch${n}`,{cache:"no-store"}).then(r=>r.json()),{subscribe:"files"}),x=f(`apply:/__apply/batch/graph${n}`,()=>fetch(`/__apply/batch/graph${n}`,{cache:"no-store"}).then(r=>r.json()),{subscribe:"files"}),g=f(`apply:/__apply/batch/logs${n}`,()=>fetch(`/__apply/batch/logs${n}`,{cache:"no-store"}).then(r=>r.json()),{subscribe:"files"}),c=f(`apply:/__apply/batch/plan${n}`,()=>fetch(`/__apply/batch/plan${n}`,{cache:"no-store"}).then(r=>r.ok?r.json().then(d=>d.plan):null).catch(()=>null),{subscribe:"files"});return{snapshot:i,graph:x,logs:g,plan:c}}function G({run:a,hasError:n}){return e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-6 gap-2",children:[e.jsx(B,{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 写入,本页只读)"]}),a!==null&&e.jsx("p",{children:"CURRENT 指向的 run 状态缺失或损坏(历史 run 只读)"}),n&&e.jsx("p",{children:"数据加载失败,请稍后重试或刷新页面"})]})]})}function F({onStatus:a}={}){var y,v;const{icon:n}=$(),i=C(),x=i.params.get("sel"),g=i.params.get("run"),[c,r]=o.useState("graph"),[d,N]=o.useState(!0),{snapshot:p,graph:w,logs:k,plan:b}=O(g),t=((y=p.data)==null?void 0:y.state)??null,u=((v=p.data)==null?void 0:v.run)??null,h=Array.isArray(t==null?void 0:t.changes)?t==null?void 0:t.changes:[],l={completed:h.filter(s=>s.status==="completed").length,failed:h.filter(s=>s.status==="failed").length,parked:h.filter(s=>s.status==="parked").length,running:h.filter(s=>s.status==="running").length},m=h.length;if(o.useEffect(()=>{a==null||a(m?{label:`${l.completed+l.failed}/${m}`,tone:l.failed?"warning":"info"}:void 0)},[m,l.completed,l.failed,a]),!t)return e.jsx("div",{"data-testid":"batch-view",className:"h-full flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:p.data===null&&!p.error?e.jsx("div",{className:"flex items-center justify-center h-full",children:"加载中..."}):e.jsx(G,{run:u,hasError:!!p.error})});const j=s=>i.navigate({sel:s});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(I,{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(S,{variant:L[t.status],children:t.status}),e.jsxs("span",{children:["第 ",t.currentBatchIndex+1,"/",t.batches.length," 批"]}),e.jsxs("span",{children:[l.completed,"/",m," 完成"]}),e.jsxs("span",{children:["并行度: ",t.parallelism]}),e.jsxs("span",{children:["🔄 ",l.running," 运行中"]}),e.jsxs("span",{children:["❌ ",l.failed," 失败"]}),e.jsxs("span",{children:["⏸️ ",l.parked," parked"]}),b.data&&e.jsx("button",{type:"button","aria-pressed":d,onClick:()=>N(s=>!s),className:`px-2 py-0.5 text-xs rounded-md border transition-colors ${d?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-accent"}`,children:"执行计划"}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 text-xs font-mono",children:[t.front&&e.jsx(V,{tone:"info",children:e.jsx("span",{className:"max-w-40 truncate",title:t.front,children:t.front})}),e.jsxs("span",{children:["run: ",(u==null?void 0:u.id)??"-"," · 只读"]})]})]}),e.jsx("div",{className:"flex-none px-4 py-1.5 border-b border-border flex items-center gap-2",children:T.map(s=>e.jsx("button",{type:"button",onClick:()=>r(s),className:`px-3 py-1 text-xs rounded-md ${c===s?"bg-primary text-primary-foreground":"border border-border hover:bg-accent"}`,children:D[s]},s))}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(o.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center h-full",children:"加载中..."}),children:e.jsxs("div",{"data-testid":`batch-subview-${c}`,className:"h-full",children:[c==="graph"&&e.jsx(z,{graph:w.data??{changes:[],batches:[],conflicts:[]},selectedChange:x,onSelectChange:j}),c==="checkpoint"&&e.jsx(P,{state:t,selectedChange:x,onSelectChange:j})]})})}),b.data&&d&&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:[n("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(A,{remarkPlugins:[R],children:b.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:(k.data??[]).slice(-20).reverse().map((s,E)=>e.jsxs("div",{className:U(s.level),children:[e.jsxs("span",{className:"text-muted-foreground/60",children:["[",new Date(s.timestamp).toLocaleTimeString(),"]"]}),s.changeName&&e.jsxs("span",{className:"text-info ml-2",children:["[",s.changeName,"]"]}),e.jsx("span",{className:"ml-2",children:s.message})]},E))})})]})}export{F as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SingleChangeView-CCpmUD7z.js","assets/index-C_16tmIU.js","assets/index-CwS-KyOV.css","assets/ViewHeader-C_euf5UJ.js","assets/ProgressBar-YEvCsTOC.js","assets/usePluginData-pzvMTyoN.js","assets/index-DvE_prho.js","assets/BatchView-D9TMypRX.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as g,a as h,r as t,j as e,P as _,S as f,_ as l}from"./index-C_16tmIU.js";import{m as r}from"./web-D-wmMJ1D.js";import"./client-Cw4K1Nx3.js";const b=t.lazy(()=>l(()=>import("./SingleChangeView-CCpmUD7z.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),j=t.lazy(()=>l(()=>import("./BatchView-D9TMypRX.js"),__vite__mapDeps([7,1,2,3,5,6]))),m=["single","batch"],S={single:"单 change",batch:"批量驾驶舱"};function w(n){return m.includes(n??"")?n:"single"}function y(n){const u=g(r.mode,"h-5 w-5"),o=h(),a=w(o.params.get("view")),i=o.params.get("change"),d=["插件",r.mode,...a==="single"&&i?[i]:[]],[x,p]=t.useState(void 0),c=t.useCallback(s=>p(s),[]);return e.jsx(_,{manifest:r,icon:u,breadcrumb:d,status:x,children:e.jsxs("div",{className:"h-full flex flex-col gap-3",children:[e.jsx("div",{className:"flex-none flex items-center gap-2",children:m.map(s=>e.jsx("button",{type:"button","aria-pressed":a===s,onClick:()=>o.navigate({view:s}),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${a===s?"bg-primary text-primary-foreground":"border border-border hover:bg-accent"}`,children:S[s]},s))}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(t.Suspense,{fallback:e.jsx(f,{rows:6,className:"mx-auto max-w-6xl"}),children:a==="single"?e.jsx(b,{onStatus:c}):e.jsx(j,{onStatus:c})})})]})})}export{y as default};
|