PageSourceSearch

https://oulang.ai/assets/AdminDataHubPage-DPygawJY.js

js oulang.ai collected 2026-10-05 12:24:19 UTC 12,400 bytes, 8 lines download raw bytes

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.