1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a10bf4-89c7-7f12-820c-7facba237d70")}catch(e){}}();import{dT as F,ge as T,iG as m,fz as e,ae as M,M as R,ce as O,a0 as h,a2 as g,aM as f,d6 as $,aj as z,dh as A,cR as j}from"./index-CAoWbJE9.js";import{A as P}from"./AdminLayout-DcqRrhX4.js";import{C as W}from"./chart-no-axes-column-Ow3qKsJr.js";import{C as q}from"./circle-x-KseYlWHv.js";import{T as E}from"./triangle-alert-BnXof3kk.js";import{G as Q}from"./globe-DL6tTD43.js";import"./DashboardLayout-ByxoMSZ9.js";import"./shield-rM-P6Qww.js";import"./menu-BqEnwCN8.js";import"./landmark-DtHVu_kw.js";import"./tv-CvI0r_e8.js";import"./lightbulb-fSK5_QIk.js";/** 2 * @license lucide-react v0.453.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 S=F("ServerCrash",[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2",key:"4b9dqc"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2",key:"22nnkd"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m13 6-4 6h6l-4 6",key:"14hqih"}]]),H=[6,12,24,48];function N({icon:a,label:p,value:r,sub:i,tone:o="default"}){const l={default:"bg-card border-border",warning:"bg-warning-muted/40 border-warning/30",danger:"bg-destructive/5 border-destructive/20",success:"bg-success-muted/30 border-success/20"},d={default:"text-muted-foreground",warning:"text-warning-foreground",danger:"text-destructive",success:"text-success"};return e.jsxs("div",{className:`rounded-xl border p-4 ${l[o]}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(a,{size:14,className:d[o]}),e.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:p})]}),e.jsx("p",{className:"text-2xl font-black text-foreground",children:r}),i&&e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i})]})}function v({title:a,count:p}){return e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("h2",{className:"text-sm font-bold text-foreground",children:a}),p!==void 0&&e.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-semibold text-muted-foreground",children:p})]})}function b({label:a}){return e.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:a})}function se(){const[a,p]=T.useState(24),r=m.monitoring.getSummary.useQuery({hours:a},{staleTime:3e4,refetchOnWindowFocus:!1}),i=m.monitoring.getErrors.useQuery({hours:a},{staleTime:3e4,refetchOnWindowFocus:!1}),o=m.monitoring.get404s.useQuery({hours:a},{staleTime:3e4,refetchOnWindowFocus:!1}),l=m.monitoring.getSlowPages.useQuery({threshold:3e3,hours:a},{staleTime:3e4,refetchOnWindowFocus:!1}),d=m.monitoring.getAPIFailures.useQuery({hours:a},{staleTime:3e4,refetchOnWindowFocus:!1}),x=m.monitoring.getZeroResultsSearches.useQuery({hours:168,limit:25},{staleTime:6e4,refetchOnWindowFocus:!1}),u=m.monitoring.healthCheck.useQuery(void 0,{staleTime:6e4,refetchOnWindowFocus:!1}),c=r.isLoading,t=r.data,w=t?.searchIndexing,k=w?.googleIndexing,C=k?.stats,y=typeof C?.successRate=="number"?Math.round(C.successRate*100):null,I=w?.cron?.lastRunAt?new Date(w.cron.lastRunAt).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}):"çå¾ å®æ¶ä»»å¡",L=()=>{r.refetch(),i.refetch(),o.refetch(),l.refetch(),d.refetch(),x.refetch(),u.refetch()};return e.jsxs(P,{title:"æ°æ®ä¸å¿",children:[e.jsxs("div",{className:"mb-4 flex min-h-11 flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{size:18,className:"text-primary"}),u.data&&e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-semibold ${u.data.ok?"bg-success/10 text-success":"bg-destructive/10 text-destructive"}`,children:[u.data.ok?e.jsx(M,{size:10}):e.jsx(q,{size:10}),u.data.ok?"çæ§å·²è¿æ¥":"çæ§å¼å¸¸"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"grid flex-1 grid-cols-4 roun
6ded-lg border border-border bg-muted/40 p-0.5 sm:flex-none",children:H.map(s=>e.jsxs(R,{variant:"ghost",onClick:()=>p(s),className:`rounded-md px-2.5 py-1 text-xs font-semibold ${a===s?"bg-background text-foreground ":"text-muted-foreground hover:text-foreground"}`,children:[s,"å°æ¶"]},s))}),e.jsxs(R,{variant:"outline",size:"sm",onClick:L,disabled:c,className:"min-h-11 gap-1.5",children:[e.jsx(O,{size:12,className:c?"animate-spin":""}),"å·æ°"]})]})]}),r.isError||u.isError?e.jsx(h,{className:"mb-6",children:e.jsx(g,{className:"p-4",children:e.jsx(f,{title:"çæ§æ¦è§å 载失败",description:"çæ§æ°æ®ææ¶ä¸å¯ç¨ï¼è¯·éè¯ã",onRetry:()=>{r.refetch(),u.refetch()}})})}):e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 mb-6",children:[e.jsx(N,{icon:E,label:"é误",value:c?"â¦":t?.errors.total??0,sub:`${t?.errors.uniqueIssues??0} 个é®é¢ · ${a} å°æ¶`,tone:t&&t.errors.total>10?"danger":t&&t.errors.total>0?"warning":"success"}),e.jsx(N,{icon:Q,label:"404 è·¯å¾",value:c?"â¦":t?.notFound.uniquePaths??0,sub:`${t?.notFound.total??0} 次请æ±`,tone:t&&t.notFound.uniquePaths>5?"warning":"default"}),e.jsx(N,{icon:$,label:"åå½±åç¨æ·",value:c?"â¦":t?.users.affected??0,sub:`${t?.users.totalErrors??0} 个é误`,tone:t&&t.users.affected>5?"warning":"default"}),e.jsx(N,{icon:z,label:"æ
¢å 载页é¢",value:c?"â¦":t?.performance.slowPages??0,sub:"è¶
è¿ 3 ç§",tone:t&&t.performance.slowPages>3?"warning":"default"}),e.jsx(N,{icon:S,label:"æ¥å£å¤±è´¥",value:c?"â¦":t?.api.failures??0,sub:`${t?.api.uniqueIssues??0} 个é®é¢ · ${a} å°æ¶`,tone:t&&t.api.failures>5?"danger":t&&t.api.failures>0?"warning":"success"}),e.jsx(N,{icon:A,label:"è°·æç´¢å¼",value:c?"â¦":y===null?k?.enabled?"å¾
éæ ·":"æªå¯ç¨":`${y}%`,sub:I,tone:k?.enabled?y===null?"default":y<90?"danger":"success":"warning"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(h,{children:e.jsxs(g,{className:"p-4",children:[e.jsx(v,{title:"æè¿é误",count:i.data?.length}),i.isLoading?e.jsx("div",{className:"space-y-2",children:[1,2,3].map(s=>e.jsx(j,{className:"h-10"},s))}):i.isError?e.jsx(f,{title:"é误记å½å 载失败",onRetry:()=>void i.refetch()}):i.data?.length?e.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:i.data.map((s,n)=>e.jsx("div",{className:"px-1 py-2",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(E,{size:11,className:"text-destructive mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:s.message||s.error||"æªç¥é误"}),(s.path||s.url)&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.path||s.url}),s.timestamp&&e.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(s.timestamp).toLocaleString("zh-CN")})]}),s.count&&e.jsxs("span",{className:"shrink-0 rounded-full bg-destructive/10 px-1.5 py-0.5 text-xs font-bold text-destructive",children:[s.count," 次"]})]})},n))}):e.jsx(b,{label:`è¿å» ${a} å°æ¶æ é误`})]})}),e.jsx(h,{children:e.jsxs(g,{className:"p-4",children:[e.jsx(v,{title:"404 è·¯å¾",count:o.data?.length}),o.isLoading?e.jsx("div",{className:"space-y-2",children:[1,2,3].map(s=>e.jsx(j,{className:"h-10"},s))}):o.isError?e.jsx(f,{title:"è·¯å¾è®°å½å 载失败",onRetry:()=>void o.refetch()}):o.data?.length?e.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:o.data.map((s,n)=>e.jsxs("div",{className:"flex items-center justify-between px-1 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Q,{size:11,className:"text-muted-foreground shrink-0"}),e.jsx("p",{className:"text-xs font-mono text-foreground truncate",children:s.path||s.url||"æªç¥è·¯å¾"})]}),e.jsxs("span",{className:"ml-2 shrink-0 rounded-full bg-warning/10 px-1.5 py-0.5 text-xs font-bold text-warning-foreground",children:[s.count," 次"]})]},n))}):e.jsx(b,{label:"æ 404 è®°å½"})]})}),e.jsx(h,{children:e.jsxs(g,{className:"p-4",children:[e.jsx(v,{title:"æ
¢å 载页é¢",count:l.data?.length}),l.isLoading?e.jsx("div",{className:"space-y-2",children:[1,2,3].map(s=>e.jsx(j,{className:"h-10"},s))}):l.isError?e.jsx(f,{title:"æ§è½æ°æ®å 载失败",onRetry:()=>void l.refetch()}):l.data?.length?e.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:l.data.map((s,n)=>e.jsxs("div",{className:"flex items-center justify-between px-1 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(z,{size:11,className:"text-warning-foreground shrink-0"}),e.jsx("p",{className:"text-xs font-mono text-foreground truncate",children:s.path||s.url||"æªç¥é¡µé¢"})]}),e.jsx("span",{className:"ml-2 shrink-0 rounded-full bg-warning/10 px-1.5 py-0.5 text-xs font-bold text-warning-foreground",children:s.avgDuration?`${Math.round(s.avgDuration)} 毫ç§`:s.duration?`${Math.round(s.duration)} 毫ç§`:"å è½½ç¼æ
¢"})]},n))}):e.jsx(b,{label:"æ æ
¢å 载页é¢"})]})}),e.jsx(h,{children:e.jsxs(g,{className:"p-4",children:[e.jsx(v,{title:"æ¥å£å¤±è´¥",count:d.data?.length}),d.isLoading?e.jsx("div",{className:"space-y-2",children:[1,2,3].map(s=>e.jsx(j,{className:"h-10"},s))}):d.isError?e.jsx(f,{title:"æ¥å£è®°å½å 载失败",onRetry:()=>void d.refetch()}):d.data?.length?e.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:d.data.map((s,n)=>e.jsx("div",{className:"px-1 py-2",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(S,{size:11,className:"text-destructive mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:s.endpoint||s.path||"æªç¥æ¥å£"}),s.error&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.error})]}),(s.count||s.statusCode)&&e.jsxs("span",{className:"shrink-0 rounded-full bg-destructive/10 px-1.5 py-0.5 text-xs font-bold text-destructive",children:[s.statusCode?`${s.statusCode}`:"",s.count?` Ã${s.count}`:""]})]})}
6,n))}):e.jsx(b,{label:"æ æ¥å£å¤±è´¥"})]})})]}),e.jsx(h,{className:"mt-6",children:e.jsxs(g,{className:"p-4",children:[e.jsx(v,{title:"é¶ç»ææç´¢è¯",count:x.data?.rows.length}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"è¿å»7å¤©ä¸æç´¢æ ç»æçå ³é®è¯ï¼å 容/å类缺å£ï¼"}),x.isLoading?e.jsx(j,{className:"h-12"}):x.isError?e.jsx(f,{title:"æç´¢è®°å½å 载失败",onRetry:()=>void x.refetch()}):x.data?.rows.length?e.jsx("div",{className:"flex flex-wrap gap-2 max-h-48 overflow-y-auto",children:x.data.rows.map((s,n)=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted/30 px-2 py-1 text-xs",children:[e.jsx("span",{className:"font-medium text-foreground",children:s.keyword}),e.jsx("span",{className:"rounded-full bg-warning/20 px-1 py-0.5 text-xs font-bold text-warning-foreground",children:s.count})]},n))}):e.jsx(b,{label:"ææ é¶ç»ææç´¢è®°å½"})]})}),e.jsx(h,{className:"mt-6",children:e.jsxs(g,{className:"p-4",children:[e.jsx(v,{title:"åå½±åç¨æ·",count:r.data?.users.affected}),r.isLoading?e.jsx(j,{className:"h-12"}):r.isError?e.jsx(f,{title:"ç¨æ·æ°æ®å 载失败",onRetry:()=>void r.refetch()}):r.data?.users.topUsers.length?e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:r.data.users.topUsers.map((s,n)=>e.jsxs("div",{className:"flex items-center justify-between px-1 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx($,{size:11,className:"text-muted-foreground shrink-0"}),e.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:s.userId||s.email||`ç¨æ· ${n+1}`})]}),e.jsxs("span",{className:"ml-2 shrink-0 rounded-full bg-warning/10 px-1.5 py-0.5 text-xs font-bold text-warning-foreground",children:[s.errorCount," é误"]})]},n))}):e.jsx(b,{label:"æ ç¨æ·é误"})]})})]})}export{se as default}; 7 8//# chunkId=01a10bf4-89c7-7f12-820c-7facba237d70
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.