zdashboard 2.1.1 → 2.2.0
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 +96 -74
- package/dist/cli.js.map +1 -1
- package/dist/web/assets/{MdViewer-CgSHNqC3.js → MdViewer-qvXbO8IA.js} +1 -1
- package/dist/web/assets/Workspace-D96dCoOA.js +1 -0
- package/dist/web/assets/git-branch-DJLd5kDE.js +11 -0
- package/dist/web/assets/{index-CcIhCGOi.js → index-15cLfCw4.js} +9 -9
- package/dist/web/assets/{index-RpDccu4v.js → index-6FGn10zY.js} +1 -1
- package/dist/web/assets/index-CYqm3unP.css +1 -0
- package/dist/web/assets/{katex.min-BvZgSYSU.js → katex.min-D_D1u30F.js} +1 -1
- package/dist/web/assets/web-BUNysAkV.js +7 -0
- package/dist/web/assets/{web-BH8k8F-d.js → web-BeuJXCg2.js} +1 -1
- package/dist/web/assets/{web-CUFkwTcN.js → web-BnZ_68eg.js} +11 -11
- package/dist/web/assets/{web-D6ODdMUf.js → web-C-O8qmKu.js} +1 -1
- package/dist/web/assets/{web-DiGxrTCi.js → web-CJq1r_vk.js} +1 -1
- package/dist/web/assets/web-DP_CBpB2.js +2 -0
- package/dist/web/assets/{web-CTWlKjBz.js → web-Xpqif6fn.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/Workspace-BjAcIoe8.js +0 -1
- package/dist/web/assets/file-text-B46O-IoU.js +0 -6
- package/dist/web/assets/index-CEza9SOJ.css +0 -1
- package/dist/web/assets/web-BG3uPf-s.js +0 -12
- package/dist/web/assets/web-CB5F-y_R.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,j as r}from"./index-
|
|
1
|
+
import{r as c,j as r}from"./index-15cLfCw4.js";import{r as d,a as u,b as m,c as x,d as h,e as g,f}from"./katex.min-D_D1u30F.js";import{M as b,r as y}from"./index-6FGn10zY.js";function j({children:n}){const t=c.useRef(null),[i,s]=c.useState(!1),a=async()=>{var e;const p=((e=t.current)==null?void 0:e.innerText)??"";try{await navigator.clipboard.writeText(p),s(!0),setTimeout(()=>s(!1),1500)}catch(o){console.error("[zdashboard] clipboard copy failed:",o)}};return r.jsxs("div",{className:"not-prose relative my-4 group",children:[r.jsx("button",{onClick:a,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:i?"已复制":"复制"}),r.jsx("pre",{ref:t,className:"overflow-auto rounded-md border bg-[#0d1117] p-3 text-xs leading-relaxed",children:n})]})}function N({path:n}){const[t,i]=c.useState(null);if(c.useEffect(()=>{let e=!0;return fetch("/"+encodeURI(n),{cache:"no-store"}).then(o=>o.text()).then(o=>{e&&i(o)}).catch(()=>{e&&i("")}),()=>{e=!1}},[n]),t===null)return r.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"加载中…"});const s=t.match(/^---\n([\s\S]*?)\n---\n?/),a=(s==null?void 0:s[1])??null,p=a?t.slice(s[0].length):t;return r.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:[a&&r.jsxs("details",{className:"not-prose mb-4 rounded border p-3 text-sm",children:[r.jsx("summary",{className:"cursor-pointer font-medium",children:"YAML frontmatter"}),r.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-xs",children:a})]}),r.jsx(b,{remarkPlugins:[y,g,f],rehypePlugins:[d,u,[m,{behavior:"wrap",properties:{className:["no-underline"]}}],[x,{detect:!0,ignoreMissing:!0}],[h,{strict:!1}]],components:{pre:({children:e})=>r.jsx(j,{children:e}),a:({href:e,children:o})=>{const l=e==null?void 0:e.startsWith("http");return r.jsx("a",{href:e,target:l?"_blank":void 0,rel:l?"noreferrer noopener":void 0,children:o})}},children:p})]})}export{N as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,j as t}from"./index-15cLfCw4.js";function f(m){const[s,o]=l.useState(null),[r,d]=l.useState(null);if(l.useEffect(()=>{fetch("/__stats/data",{cache:"no-store"}).then(e=>e.json()).then(o).catch(e=>d(e.message))},[]),r)return t.jsx("div",{className:"flex h-full items-center justify-center text-destructive",children:t.jsxs("p",{children:["加载失败: ",r]})});if(!s)return t.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:t.jsx("p",{children:"加载中…"})});const n=(s.totalSize/1024/1024).toFixed(2),i=Math.max(...s.byExt.map(e=>e.count),1),c=[{label:"文件",value:s.files,mode:null,filter:null},{label:"目录",value:s.dirs,mode:null,filter:null},{label:"总大小",value:`${n} MB`,mode:null,filter:null},{label:"Markdown",value:s.markdown,mode:"view",filter:".md"},{label:"变更 进行/归档",value:`${s.openspec.active}/${s.openspec.archived}`,mode:"apply",filter:null}],u=(e,a)=>{e&&window.dispatchEvent(new CustomEvent("zd-dashboard-nav",{detail:{mode:e,...a?{filter:a}:{}}}))};return t.jsxs("div",{className:"mx-auto h-full max-w-6xl overflow-auto rounded-lg border bg-background p-6 shadow-sm",children:[t.jsx("h1",{className:"text-lg font-semibold mb-1",children:"📊 项目统计"}),t.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:"后端 fs 扫描 + 前端渲染 · 改文件即时刷新 · 点击卡片跳转"}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 mb-6",children:c.map(e=>t.jsxs("button",{type:"button",onClick:()=>u(e.mode,e.filter),disabled:!e.mode,title:e.mode?`点击跳转至 ${e.label}`:void 0,className:`rounded-lg border bg-background p-4 text-left transition-colors ${e.mode?"hover:bg-muted/70 cursor-pointer":"cursor-default opacity-80"}`,children:[t.jsx("div",{className:"text-xl font-bold",children:e.value}),t.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:e.label})]},e.label))}),t.jsx("h2",{className:"text-xs font-medium text-muted-foreground mb-3",children:"文件类型 Top 10"}),t.jsx("div",{className:"space-y-2",children:s.byExt.map(e=>t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsx("span",{className:"w-16 font-mono text-foreground truncate",children:e.ext}),t.jsx("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${(e.count/i*100).toFixed(1)}%`}})}),t.jsx("span",{className:"w-8 text-right font-mono text-muted-foreground",children:e.count})]},e.ext))}),t.jsxs("div",{className:"mt-5 flex items-center gap-2 text-xs",children:[t.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded border ${s.hasJust?"text-emerald-600 border-emerald-500/30 bg-emerald-500/10":"text-muted-foreground border-border"}`,children:["justfile ",s.hasJust?"✓":"✗"]}),t.jsxs("span",{className:"text-muted-foreground",children:["root: ",s.root]})]})]})}export{f as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as e}from"./index-15cLfCw4.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 c=e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
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 t=e("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);export{c as F,t as G};
|