zdashboard 2.0.0 → 2.1.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.
@@ -0,0 +1,31 @@
1
+ import{c as g,r as n,u as D,j as e,_ as I}from"./index-CcIhCGOi.js";import{r as P,a as L,b as U,c as F,d as V,e as W,f as X}from"./katex.min-BvZgSYSU.js";import{M as q,r as B}from"./index-RpDccu4v.js";/**
2
+ * @license lucide-react v0.460.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const _=g("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
7
+ * @license lucide-react v0.460.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const G=g("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
12
+ * @license lucide-react v0.460.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const H=g("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
17
+ * @license lucide-react v0.460.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const J=g("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
22
+ * @license lucide-react v0.460.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const K=g("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
27
+ * @license lucide-react v0.460.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const C=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Y={draft:"bg-zinc-500 text-white",reviewing:"bg-amber-500 text-white",passed:"bg-emerald-600 text-white",rejected:"bg-red-500 text-white"},Q={draft:"草案",reviewing:"评审中",passed:"已通过",rejected:"未通过"},Z=[{key:"all",label:"全部"},{key:"open",label:"待处理"},{key:"answered",label:"已答复"},{key:"accepted",label:"已采纳"},{key:"dismissed",label:"已驳回"}],T={high:"bg-red-500",medium:"bg-amber-500",low:"bg-sky-500"},ee={high:"高",medium:"中",low:"低"},E={open:"bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/30",answered:"bg-sky-500/15 text-sky-600 dark:text-sky-400 border-sky-500/30",accepted:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/30",dismissed:"bg-muted text-muted-foreground border-border"},M={open:"待处理",answered:"已答复",accepted:"已采纳",dismissed:"已驳回"};function te({children:t}){const d=n.useRef(null),[m,o]=n.useState(!1),i=async()=>{var r;const x=((r=d.current)==null?void 0:r.innerText)??"";try{await navigator.clipboard.writeText(x),o(!0),setTimeout(()=>o(!1),1500)}catch(c){console.error("[zdashboard] clipboard copy failed:",c)}};return e.jsxs("div",{className:"not-prose relative my-4 group",children:[e.jsx("button",{onClick:i,className:"absolute right-2 top-2 z-10 px-2 py-0.5 rounded border border-border bg-background/80 text-[11px] opacity-0 group-hover:opacity-100 transition-opacity",children:m?"已复制":"复制"}),e.jsx("pre",{ref:d,className:"overflow-auto rounded-md border bg-[#0d1117] p-3 text-xs leading-relaxed",children:t})]})}function se({path:t}){const[d,m]=n.useState(null);if(n.useEffect(()=>{let r=!0;return fetch("/"+encodeURI(t),{cache:"no-store"}).then(c=>c.text()).then(c=>{r&&m(c)}).catch(()=>{r&&m("")}),()=>{r=!1}},[t]),d===null)return e.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"加载中…"});const o=d.match(/^---\n([\s\S]*?)\n---\n?/),i=(o==null?void 0:o[1])??null,x=i?d.slice(o[0].length):d;return e.jsxs("div",{className:"prose dark:prose-invert mx-auto max-w-3xl p-8 prose-headings:scroll-mt-4 prose-pre:bg-transparent prose-pre:p-0 prose-pre:m-0",children:[i&&e.jsxs("details",{className:"not-prose mb-4 rounded border p-3 text-sm",children:[e.jsx("summary",{className:"cursor-pointer font-medium",children:"YAML frontmatter"}),e.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-xs",children:i})]}),e.jsx(q,{remarkPlugins:[B,W,X],rehypePlugins:[P,L,[U,{behavior:"wrap",properties:{className:["no-underline"]}}],[F,{detect:!0,ignoreMissing:!0}],[V,{strict:!1}]],components:{pre:({children:r})=>e.jsx(te,{children:r}),a:({href:r,children:c})=>{const h=r==null?void 0:r.startsWith("http");return e.jsx("a",{href:r,target:h?"_blank":void 0,rel:h?"noreferrer noopener":void 0,children:c})}},children:x})]})}function re({item:t,token:d,onUpdated:m}){const[o,i]=n.useState(t.answer??"");n.useEffect(()=>i(t.answer??""),[t.id,t.answer]);const x=async p=>{const b=await fetch("/__review/item",{method:"POST",headers:{"x-stop-token":d,"Content-Type":"application/json"},body:JSON.stringify({id:t.id,...p})});b.ok&&m(await b.json())},r=p=>p==="open"?{state:p,answer:o}:p==="answered"?{state:p,answer:o}:{state:p,answer:o||t.answer},c=t.state==="accepted"||t.state==="dismissed",h=c?t.state==="accepted"?"已采纳 — 可撤销后重新处理":"已驳回 — 可撤销后重新处理":t.state==="open"?"答复后可采纳或驳回,或直接采纳/驳回":"确认答复后采纳,或驳回 / 撤销";return e.jsxs("div",{className:"rounded-lg border bg-background shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 pt-2.5 text-[11px] text-muted-foreground",children:[t.severity&&e.jsx("span",{className:`h-2 w-2 rounded-full ${T[t.severity]??"bg-muted-foreground"}`}),e.jsx("span",{className:"font-medium",children:t.category??"通用"}),t.severity&&e.jsx("span",{children:ee[t.severity]??t.severity}),e.jsx("span",{className:`ml-auto px-1.5 py-0.5 rounded border text-[10px] font-medium ${E[t.state]??""}`,children:M[t.state]})]}),e.jsx("p",{className:"px-3 py-2 text-sm leading-relaxed",children:t.question}),e.jsxs("div",{className:"px-3 pb-3 flex flex-col gap-2",children:[e.jsx("textarea",{value:o,onChange:p=>i(p.target.value),placeholder:"答复 / 补充说明…",rows:2,className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs focus:outline-none focus:border-primary resize-y"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[t.state==="accepted"?e.jsxs("span",{className:"inline-flex items-center gap-1 h-7 px-2.5 rounded bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 text-xs font-medium",children:[e.jsx(_,{className:"h-3 w-3"}),"已采纳"]}):t.state==="dismissed"?e.jsxs("span",{className:"inline-flex items-center gap-1 h-7 px-2.5 rounded bg-muted text-muted-foreground text-xs font-medium",children:[e.jsx(C,{className:"h-3 w-3"}),"已驳回"]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>x(r("answered")),className:"inline-flex items-center gap-1 h-7 px-2.5 rounded bg-sky-600 hover:bg-sky-500 text-white text-xs",children:[e.jsx(K,{className:"h-3 w-3"}),t.state==="answered"?"更新答复":"答复"]}),e.jsxs("button",{onClick:()=>x(r("accepted")),className:"inline-flex items-center gap-1 h-7 px-2.5 rounded bg-emerald-600 hover:bg-emerald-500 text-white text-xs",children:[e.jsx(_,{className:"h-3 w-3"}),"采纳"]}),e.jsxs("button",{onClick:()=>x(r("dismissed")),className:"inline-flex items-center gap-1 h-7 px-2.5 rounded bg-muted hover:bg-muted/70 text-xs",children:[e.jsx(C,{className:"h-3 w-3"}),"驳回"]})]}),c&&e.jsxs("button",{onClick:()=>x(r("open")),className:"inline-flex items-center gap-1 h-7 px-2.5 rounded bg-muted hover:bg-muted/70 text-xs",children:[e.jsx(J,{className:"h-3 w-3"}),"撤销"]}),e.jsx("span",{className:"ml-auto text-[10px] text-muted-foreground",children:h})]})]})]})}function ae(){const[t,d]=n.useState(null),[m,o]=n.useState([]),[i,x]=n.useState(null),[r,c]=n.useState(null),[h,p]=n.useState(""),[b,R]=n.useState("all"),[j,y]=n.useState(!0),[v,k]=n.useState("");n.useRef(!1);const N=()=>{fetch("/__review",{cache:"no-store"}).then(s=>s.json()).then(d),fetch("/__docs",{cache:"no-store"}).then(s=>s.json()).then(s=>{o(s),x(a=>a&&s.includes(a)?a:s[0]??null)})};n.useEffect(()=>{N(),fetch("/__config").then(s=>s.json()).then(s=>p(s.stopToken??""))},[]),D(()=>{},N);const u={all:0,open:0,answered:0,accepted:0,dismissed:0};for(const s of(t==null?void 0:t.items)??[])u.all++,u[s.state]++;const S=n.useMemo(()=>{const s=new Map;for(const l of(t==null?void 0:t.items)??[]){if(b!=="all"&&l.state!==b)continue;const f=l.doc??null;s.has(f)||s.set(f,[]),s.get(f).push(l)}const a=l=>l??"(未关联文档)";return[...s.entries()].sort((l,f)=>a(l[0]).localeCompare(a(f[0]))).map(([l,f])=>({doc:l,label:a(l),items:f.sort((O,$)=>({high:0,medium:1,low:2})[O.severity??"medium"]-{high:0,medium:1,low:2}[$.severity??"medium"])}))},[t,b]),w=((t==null?void 0:t.items)??[]).find(s=>s.id===r)??null,z=s=>{c(s.id),x(s.doc??null)},A=async()=>{k("");const s=await fetch("/__review/status",{method:"POST",headers:{"x-stop-token":h,"Content-Type":"application/json"},body:'{"status":"passed"}'});s.ok?d(await s.json()):k((await s.json()).error??"failed")};return e.jsxs("div",{className:"mx-auto h-full max-w-6xl bg-background border rounded-lg shadow-sm overflow-hidden flex",children:[e.jsxs("aside",{className:"w-[240px] flex-none border-r bg-background overflow-auto",children:[e.jsx("div",{className:"px-3 pt-3 pb-2 border-b",children:(()=>{const s=u.all,a=s-u.open,l=s===0?0:Math.round(a/s*100);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between text-[11px] mb-1.5",children:[e.jsx("span",{className:"text-muted-foreground",children:"处理进度"}),e.jsxs("span",{className:"font-mono",children:[a,"/",s," · ",l,"%"]})]}),e.jsx("div",{className:`h-1.5 rounded-full bg-muted overflow-hidden ${u.open>0,""}`,children:e.jsx("div",{className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${l}%`}})})]})})()}),e.jsx("div",{className:"px-3 pt-2 pb-1.5 flex flex-wrap gap-1",children:Z.map(s=>e.jsxs("button",{onClick:()=>R(s.key),className:`px-1.5 py-0.5 rounded text-[11px] border ${b===s.key?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-muted text-muted-foreground"}`,children:[s.label," ",u[s.key]]},s.key))}),e.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"文档 · 评审项"}),S.length===0&&e.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"无评审项"}),S.map(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"px-3 py-1 text-[11px] font-medium text-muted-foreground flex items-center gap-1.5",children:[e.jsx("span",{className:"truncate",children:s.label}),e.jsx("span",{className:"ml-auto font-mono text-[10px]",children:s.items.length})]}),s.items.map(a=>e.jsxs("button",{onClick:()=>z(a),className:`w-full text-left px-3 py-1.5 text-xs border-l-2 flex items-center gap-1.5 hover:bg-muted ${r===a.id?"bg-muted font-medium border-primary":"border-transparent text-muted-foreground"}`,children:[a.severity&&e.jsx("span",{className:`h-1.5 w-1.5 rounded-full shrink-0 ${T[a.severity]??""}`}),e.jsx("span",{className:"truncate",children:a.question}),e.jsx("span",{className:`ml-auto shrink-0 text-[9px] px-1 rounded ${E[a.state]??""}`,children:M[a.state]})]},a.id))]},s.doc??"(none)"))]}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[e.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 border-b bg-background",children:[t&&e.jsx("span",{className:`px-2 py-0.5 rounded text-[11px] font-medium ${Y[t.status]??""}`,children:Q[t.status]??t.status}),u.open>0&&e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["还有 ",u.open," 项待处理"]}),e.jsx("button",{onClick:A,disabled:!t||t.status==="passed"||u.open>0,className:"ml-auto h-7 px-3 rounded bg-emerald-600 hover:bg-emerald-500 disabled:opacity-50 disabled:cursor-not-allowed text-white text-xs",children:"通过"})]}),v&&e.jsx("div",{className:"bg-red-500/10 text-red-600 dark:text-red-400 text-xs px-3.5 py-1.5 border-b border-red-500/20",children:v}),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[j&&e.jsxs("div",{className:"flex-1 min-h-0 overflow-auto border-b bg-background relative",children:[e.jsx("button",{onClick:()=>y(!1),title:"收起文档",className:"absolute right-2 top-2 z-10 h-6 px-2 rounded border border-border bg-background/80 text-xs hover:bg-muted",children:e.jsx(G,{className:"h-3.5 w-3.5"})}),i?e.jsx(se,{path:i}):e.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"在左侧选择评审项"})]}),e.jsxs("div",{className:j?"flex-none h-[42%] border-b overflow-auto p-3 flex flex-col gap-3":"flex-1 min-h-0 overflow-auto p-3 flex flex-col gap-3",style:j?void 0:{backgroundImage:"radial-gradient(circle at 1px 1px, hsl(var(--border)) 1px, transparent 0)",backgroundSize:"20px 20px"},children:[!j&&e.jsxs("button",{onClick:()=>y(!0),title:"展开文档",className:"self-start inline-flex items-center gap-1 h-6 px-2 rounded border border-border bg-background text-xs hover:bg-muted",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),"展开文档"]}),w?e.jsx(re,{item:w,token:h,onUpdated:d},w.id):e.jsx("p",{className:"text-xs text-muted-foreground text-center pt-6",children:"在左侧选择一个评审项"})]})]})]})]})}function ne(){return e.jsx(ae,{})}const oe=Object.freeze(Object.defineProperty({__proto__:null,default:ne},Symbol.toStringTag,{value:"Module"})),ie={mode:"review",label:"文档评审",icon:"✅",description:"评审项状态流转 · zreview",Workspace:n.lazy(()=>I(()=>Promise.resolve().then(()=>oe),void 0))};export{ne as ReviewWorkspace,ie as default};
@@ -1,4 +1,4 @@
1
- import{c as x,r as l,j as e,B as p,_ as h}from"./index-Deg587va.js";/**
1
+ import{c as x,r as l,j as e,B as p,_ as h}from"./index-CcIhCGOi.js";/**
2
2
  * @license lucide-react v0.460.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,4 +8,4 @@ import{c as x,r as l,j as e,B as p,_ as h}from"./index-Deg587va.js";/**
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const f=x("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),b=[{key:"mine",label:"我的"},{key:"all",label:"全部"},{key:"active",label:"active"},{key:"resolved",label:"resolved"},{key:"closed",label:"closed"}];function y({status:s}){const r=s==="active"?"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/30":s==="resolved"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30":"bg-muted text-muted-foreground border-border";return e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded border text-[10px] font-mono ${r}`,children:s})}function j({severity:s}){const r=Number(s),n=r<=1?"bg-red-500/10 text-red-600 dark:text-red-400":r===2?"bg-orange-500/10 text-orange-600 dark:text-orange-400":r===3?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-500":"bg-muted text-muted-foreground";return e.jsxs("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-mono font-medium ${n}`,children:["S",r]})}function k(){const[s,r]=l.useState(null),[n,d]=l.useState(!1),[a,u]=l.useState("mine"),o=l.useCallback(()=>{d(!0),fetch("/__bugs",{cache:"no-store"}).then(t=>t.json()).then(r).finally(()=>d(!1))},[]);l.useEffect(o,[o]);const m=t=>a==="all"?!0:a==="mine"?t.mine:t.status===a,c=s!=null&&s.ok?s.bugs.filter(m):[],i=s!=null&&s.ok?{mine:s.bugs.filter(t=>t.mine).length,all:s.bugs.length,active:s.bugs.filter(t=>t.status==="active").length,resolved:s.bugs.filter(t=>t.status==="resolved").length,closed:s.bugs.filter(t=>t.status==="closed").length}:null;return e.jsxs("div",{className:"mx-auto max-w-5xl h-full flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"flex-none flex items-center gap-2 px-3 py-2 border-b",children:[b.map(t=>e.jsxs("button",{onClick:()=>u(t.key),className:`px-2 py-1 rounded text-xs border transition-colors ${a===t.key?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:bg-muted"}`,children:[t.label,i&&e.jsx("span",{className:"ml-1 opacity-70",children:i[t.key]})]},t.key)),e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"禅道 · 只读"}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:o,title:"刷新",children:e.jsx(f,{className:`h-3.5 w-3.5 ${n?"animate-spin":""}`})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:s?s.ok?c.length?e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"sticky top-0 bg-background border-b",children:e.jsxs("tr",{className:"text-left text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 font-medium w-16",children:"#"}),e.jsx("th",{className:"px-3 py-2 font-medium",children:"标题"}),e.jsx("th",{className:"px-3 py-2 font-medium w-14",children:"严重度"}),e.jsx("th",{className:"px-3 py-2 font-medium w-20",children:"状态"}),e.jsx("th",{className:"px-3 py-2 font-medium w-20",children:"指派"})]})}),e.jsx("tbody",{children:c.map(t=>e.jsxs("tr",{className:"border-b last:border-0 hover:bg-muted/50",children:[e.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:t.id}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("button",{className:"text-left hover:text-primary hover:underline flex items-center gap-1",onClick:()=>window.open(`${s.url}/bug-view-${t.id}.html`,"_blank","noopener"),title:"在禅道打开",children:[e.jsx("span",{className:"truncate max-w-[420px]",children:t.title}),e.jsx(g,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{severity:t.severity})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(y,{status:t.status})}),e.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:t.assignedTo||"—"})]},t.id))})]}):e.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:a==="mine"?"没有指派给你的 bug 🎉":"无 bug 🎉(该状态下)"}):e.jsx("p",{className:"p-4 text-xs text-destructive",children:s.error}):e.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:"加载中…"})})]})}function v(){return e.jsx(k,{})}const N=Object.freeze(Object.defineProperty({__proto__:null,default:v},Symbol.toStringTag,{value:"Module"})),_={mode:"bugs",label:"禅道 Bugs",icon:"🎯",description:"只读 bug 列表 · zgoal",Workspace:l.lazy(()=>h(()=>Promise.resolve().then(()=>N),void 0))};export{v as BugWorkspace,_ as default};
11
+ */const f=x("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),b=[{key:"mine",label:"我的"},{key:"all",label:"全部"},{key:"active",label:"active"},{key:"resolved",label:"resolved"},{key:"closed",label:"closed"}];function y({status:s}){const r=s==="active"?"bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/30":s==="resolved"?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30":"bg-muted text-muted-foreground border-border";return e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded border text-[10px] font-mono ${r}`,children:s})}function j({severity:s}){const r=Number(s),n=r<=1?"bg-red-500/10 text-red-600 dark:text-red-400":r===2?"bg-orange-500/10 text-orange-600 dark:text-orange-400":r===3?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-500":"bg-muted text-muted-foreground";return e.jsxs("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-mono font-medium ${n}`,children:["S",r]})}function k(){const[s,r]=l.useState(null),[n,d]=l.useState(!1),[a,u]=l.useState("mine"),o=l.useCallback(()=>{d(!0),fetch("/__bugs",{cache:"no-store"}).then(t=>t.json()).then(r).finally(()=>d(!1))},[]);l.useEffect(o,[o]);const m=t=>a==="all"?!0:a==="mine"?t.mine:t.status===a,c=s!=null&&s.ok?s.bugs.filter(m):[],i=s!=null&&s.ok?{mine:s.bugs.filter(t=>t.mine).length,all:s.bugs.length,active:s.bugs.filter(t=>t.status==="active").length,resolved:s.bugs.filter(t=>t.status==="resolved").length,closed:s.bugs.filter(t=>t.status==="closed").length}:null;return e.jsxs("div",{className:"mx-auto h-full max-w-6xl flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"flex-none flex items-center gap-2 px-3 py-2 border-b",children:[b.map(t=>e.jsxs("button",{onClick:()=>u(t.key),className:`px-2 py-1 rounded text-xs border transition-colors ${a===t.key?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:bg-muted"}`,children:[t.label,i&&e.jsx("span",{className:"ml-1 opacity-70",children:i[t.key]})]},t.key)),e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"禅道 · 只读"}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:o,title:"刷新",children:e.jsx(f,{className:`h-3.5 w-3.5 ${n?"animate-spin":""}`})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:s?s.ok?c.length?e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"sticky top-0 bg-background border-b",children:e.jsxs("tr",{className:"text-left text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 font-medium w-16",children:"#"}),e.jsx("th",{className:"px-3 py-2 font-medium",children:"标题"}),e.jsx("th",{className:"px-3 py-2 font-medium w-14",children:"严重度"}),e.jsx("th",{className:"px-3 py-2 font-medium w-20",children:"状态"}),e.jsx("th",{className:"px-3 py-2 font-medium w-20",children:"指派"})]})}),e.jsx("tbody",{children:c.map(t=>e.jsxs("tr",{className:"border-b last:border-0 hover:bg-muted/50",children:[e.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:t.id}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("button",{className:"text-left hover:text-primary hover:underline flex items-center gap-1",onClick:()=>window.open(`${s.url}/bug-view-${t.id}.html`,"_blank","noopener"),title:"在禅道打开",children:[e.jsx("span",{className:"truncate max-w-[420px]",children:t.title}),e.jsx(g,{className:"h-3 w-3 shrink-0 text-muted-foreground"})]})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(j,{severity:t.severity})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(y,{status:t.status})}),e.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:t.assignedTo||"—"})]},t.id))})]}):e.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:a==="mine"?"没有指派给你的 bug 🎉":"无 bug 🎉(该状态下)"}):e.jsx("p",{className:"p-4 text-xs text-destructive",children:s.error}):e.jsx("p",{className:"p-4 text-xs text-muted-foreground",children:"加载中…"})})]})}function v(){return e.jsx(k,{})}const N=Object.freeze(Object.defineProperty({__proto__:null,default:v},Symbol.toStringTag,{value:"Module"})),_={mode:"bugs",label:"禅道 Bugs",icon:"🎯",description:"只读 bug 列表 · zgoal",Workspace:l.lazy(()=>h(()=>Promise.resolve().then(()=>N),void 0))};export{v as BugWorkspace,_ as default};
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <link rel="icon" href="/__app/favicon.svg" type="image/svg+xml" />
7
7
  <title>zdashboard · 项目洞察</title>
8
- <script type="module" crossorigin src="/assets/index-Deg587va.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-Dqj3ddhK.css">
8
+ <script type="module" crossorigin src="/assets/index-CcIhCGOi.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-CEza9SOJ.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zdashboard",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "ZCode skill dashboard platform — pluggable viewers for zdesign/zview/zreview/zgoal",
5
5
  "type": "module",
6
6
  "bin": {