PageSourceSearch

https://convertos.ai/_next/static/chunks/592.028992ef379ab268.js

js convertos.ai collected 2026-10-05 11:56:53 UTC 18,001 bytes, 1 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:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="c7220816-c9f3-4176-a87b-017ca1395fa6",e._sentryDebugIdIdentifier="sentry-dbid-c7220816-c9f3-4176-a87b-017ca1395fa6")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[592],{50592:function(e,s,t){t.r(s),t.d(s,{AuditHistoryEnhanced:function(){return x}});var r=t(57437),a=t(2265),n=t(27648),i=t(99376),o=t(93375),l=t(46239),d=t(28105);let c=async e=>{let s=await fetch(e);if(!s.ok){if(401===s.status)return[];throw Error("Failed to fetch running audit jobs")}return(await s.json()).data||[]};var u=t(78760),m=t(82374);function x(e){let{userId:s}=e,t=(0,i.useRouter)(),{isZh:x}=(0,o.Z)(),{openLoginModal:h}=(0,u.N)(),{audits:f,isPaidUser:p,limit:g,isLoading:b,mutate:v}=(0,l.H)(s),{jobs:j}=function(e){let{data:s,error:t,isLoading:r,mutate:a}=(0,d.ZP)(e?"/api/audit/jobs?includeActiveOnly=true":null,c,{dedupingInterval:2e3,revalidateOnFocus:!1,revalidateOnReconnect:!1,errorRetryCount:2,errorRetryInterval:5e3,keepPreviousData:!0,refreshInterval:3e3,revalidateIfStale:!0});return{jobs:s||[],isLoading:r&&!s,error:t,mutate:async()=>await a()}}(s),[N,w]=(0,a.useState)(""),[k,y]=(0,a.useState)("all"),[C,L]=(0,a.useState)("all"),[U,P]=(0,a.useState)("date"),[A,R]=(0,a.useState)("desc"),S=(0,a.useMemo)(()=>{let e=[...f];if(N.trim()){let s=N.toLowerCase().trim();e=e.filter(e=>{var t;let r=e.targetUrl.toLowerCase(),a=(null===(t=e.finalUrl)||void 0===t?void 0:t.toLowerCase())||"",n=new URL(e.targetUrl).hostname.toLowerCase();return r.includes(s)||a.includes(s)||n.includes(s)})}return"all"!==k&&(e=e.filter(e=>e.mode===k)),"all"!==C&&(e=e.filter(e=>"p0"===C?e.p0Count>0:"p1"===C?e.p1Count>0:"p2"!==C||e.p2Count>0)),e.sort((e,s)=>{let t=0;switch(U){case"date":t=new Date(e.createdAt).getTime()-new Date(s.createdAt).getTime();break;case"issues":t=e.p0Count+e.p1Count+e.p2Count-(s.p0Count+s.p1Count+s.p2Count);break;case"url":t=e.targetUrl.localeCompare(s.targetUrl)}return"asc"===A?t:-t}),e},[f,N,k,C,U,A]),D=e=>{t.push("/audit?url=".concat(encodeURIComponent(e)))},M=async e=>{let s="".concat(window.location.origin,"/reports/").concat(e);try{await navigator.clipboard.writeText(s),alert(x?"链接已复制到剪贴板":"Link copied to clipboard")}catch(e){console.error("Failed to copy link:",e)}},B=async e=>{if(confirm(x?"确定要删除此审核记录吗?此操作不可撤销。":"Are you sure you want to delete this audit? This action cannot be undone."))try{alert(x?"删除功能暂未实现。请联系管理员。":"Delete feature not yet implemented. Please contact administrator.")}catch(e){console.error("Failed to delete audit:",e),alert(x?"删除失败,请稍后重试":"Failed to delete. Please try again.")}},H=e=>{t.push("/audit/".concat(e,"?export=true"))};return s?b?(0,r.jsx)("div",{className:"border border-line rounded-xl p-6 bg-surface-panel",children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("div",{className:"h-6 w-32 bg-surface-raised rounded animate-pulse"}),(0,r.jsx)("div",{className:"h-4 w-20 bg-surface-raised rounded animate-pulse"})]}),(0,r.jsx)("div",{className:"h-10 w-full bg-surface-raised rounded-lg animate-pulse"}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)("div",{className:"h-9 w-24 bg-surface-raised rounded-lg animate-pulse"}),(0,r.jsx)("div",{className:"h-9 w-28 bg-surface-raised rounded-lg animate-pulse"}),(0,r.jsx)("div",{className:"h-9 w-20 bg-surface-raised rounded-lg animate-pulse"})]}),(0,r.jsx)("div",{className:"space-y-3",children:[1,2,3].map(e=>(0,r.jsx)("div",{className:"border border-line rounded-lg p-4 bg-surface-canvas",children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,r.jsx)("div",{className:"h-4 w-3/4 bg-surface-raised rounded animate-pulse"}),(0,r.jsx)("div",{className:"h-3 w-1/2 bg-surface-raised rounded animate-pulse"}),(0,r.jsxs)("div",{className:"flex gap-4 mt-2",children:[(0,r.jsx)("div",{className:"h-3 w-20 bg-surface-raised rounded animate-pulse"}),(0,r.jsx)("div",{className:"h-3 w-32 bg-surface-raised rounded animate-pulse"})]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("div",{className:"h-6 w-12 bg-surface-raised rounded animate-pulse"}),(0,r.jsx)("div",{className:"h-6 w-12 bg-surface-raised rounded animate-pulse"})]})]})},e))})]})}):(0,r.jsxs)("div",{className:"border border-line rounded-xl p-6 bg-surface-panel",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-xl font-semibold text-white mb-1",children:x?"审核历史":"Audit History"}),(0,r.jsx)("p",{className:"text-sm text-ink-muted",children:x?"共 ".concat(S.length," 条记录").concat(f.length!==S.length?"(已筛选 ".concat(f.length," 条)"):""):"".concat(S.length," records").concat(f.length!==S.length?" (filtered from ".concat(f.length,")"):"")})]}),(0,r.jsx)("div",{className:"text-sm text-ink-muted",children:p?(0,r.jsx)("span",{className:"text-green-400 font-medium",children:x?"无限记录":"Unlimited"}):(0,r.jsx)("span",{children:x?"已保存 ".concat(f.length," / ").concat(g," 次"):"Saved ".concat(f.length," / ").concat(g)})})]}),(0,r.jsxs)("div",{className:"mb-6 space-y-4",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",value:N,onChange:e=>w(e.target.value),placeholder:x?"搜索 URL 或域名...":"Search U
1RL or domain...",className:"w-full px-4 py-2 pl-10 border border-line rounded-lg bg-surface-canvas text-white placeholder-ink-muted focus:outline-none focus:ring-2 focus:ring-brand focus:border-transparent transition-colors"}),(0,r.jsx)("svg",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-ink-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,r.jsxs)("select",{value:k,onChange:e=>y(e.target.value),className:"px-3 py-2 border border-line rounded-lg bg-surface-canvas text-white text-sm focus:outline-none focus:ring-2 focus:ring-brand focus:border-transparent transition-colors cursor-pointer",children:[(0,r.jsx)("option",{value:"all",children:x?"所有模式":"All Modes"}),(0,r.jsx)("option",{value:"full",children:x?"完整审核":"Full Audit"})]}),(0,r.jsxs)("select",{value:C,onChange:e=>L(e.target.value),className:"px-3 py-2 border border-line rounded-lg bg-surface-canvas text-white text-sm focus:outline-none focus:ring-2 focus:ring-brand focus:border-transparent transition-colors cursor-pointer",children:[(0,r.jsx)("option",{value:"all",children:x?"所有严重性":"All Severities"}),(0,r.jsxs)("option",{value:"p0",children:["P0 - ",x?"严重":"Critical"]}),(0,r.jsxs)("option",{value:"p1",children:["P1 - ",x?"重要":"Important"]}),(0,r.jsxs)("option",{value:"p2",children:["P2 - ",x?"建议":"Suggestion"]})]}),(0,r.jsxs)("select",{value:U,onChange:e=>P(e.target.value),className:"px-3 py-2 border border-line rounded-lg bg-surface-canvas text-white text-sm focus:outline-none focus:ring-2 focus:ring-brand focus:border-transparent transition-colors cursor-pointer",children:[(0,r.jsx)("option",{value:"date",children:x?"按日期":"By Date"}),(0,r.jsx)("option",{value:"issues",children:x?"按问题数":"By Issues"}),(0,r.jsx)("option",{value:"url",children:x?"按 URL":"By URL"})]}),(0,r.jsx)("button",{onClick:()=>R("asc"===A?"desc":"asc"),className:"px-3 py-2 border border-line rounded-lg bg-surface-canvas text-white text-sm hover:bg-surface-raised focus:outline-none focus:ring-2 focus:ring-brand focus:border-transparent transition-colors cursor-pointer","aria-label":x?"切换排序顺序":"Toggle sort order",children:"asc"===A?"↑":"↓"})]})]}),0===S.length&&0===j.length?(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-sm text-ink-muted",children:N||"all"!==k||"all"!==C?x?"没有找到匹配的审核记录":"No matching audit records found":x?"暂无审核记录":"No audit records yet"})}):(0,r.jsxs)("div",{className:"space-y-3",children:[j.map(e=>{let s=Math.min(Math.max(e.progress||0,0),100),t=e.progressHint||e.step||(x?"处理中...":"Processing...");return(0,r.jsx)("div",{className:"border border-brand/50 rounded-lg p-4 bg-brand/10 hover:bg-brand-hover/15 transition-all group",children:(0,r.jsx)("div",{className:"flex items-start justify-between gap-4",children:(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)("svg",{className:"w-4 h-4 text-brand animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,r.jsx)("span",{className:"text-xs font-medium text-brand",children:x?"分析中":"Analyzing"})]}),(0,r.jsx)("p",{className:"text-sm font-medium text-white truncate mb-1",children:e.targetUrl}),(0,r.jsx)("p",{className:"text-xs text-ink-muted mb-3",children:t}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,r.jsx)("span",{className:"text-ink-muted",children:x?"进度":"Progress"}),(0,r.jsxs)("span",{className:"text-brand font-medium",children:[s,"%"]})]}),(0,r.jsx)("div",{className:"relative h-2 bg-surface-raised rounded-full overflow-hidden",children:(0,r.jsx)("div",{className:"absolute top-0 left-0 h-full bg-gradient-to-r from-[#00d7d9] to-[#35edef] transition-all duration-300 ease-out rounded-full",style:{width:"".concat(s,"%")},children:(0,r.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-progress-s
1himmer"})})})]})]})})},e.id)}),S.map(e=>{let s="running"===e.status;return(0,r.jsxs)("div",{className:"border rounded-lg p-4 transition-all group ".concat(s?"border-brand/50 bg-brand/10 hover:bg-brand-hover/15":"border-line hover:bg-surface-raised hover:border-brand/30"),children:[(0,r.jsx)("div",{className:"flex items-start justify-between gap-4",children:(0,r.jsx)("div",{className:"flex-1 min-w-0",children:s?(0,r.jsxs)("div",{className:"block",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)("svg",{className:"w-4 h-4 text-brand animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,r.jsx)("span",{className:"text-xs font-medium text-brand",children:x?"分析中":"Analyzing"})]}),(0,r.jsx)("p",{className:"text-sm font-medium text-white truncate mb-1",children:e.targetUrl}),e.finalUrl&&e.finalUrl!==e.targetUrl&&(0,r.jsxs)("p",{className:"text-xs text-ink-muted truncate mb-2",children:[x?"最终 URL":"Final URL",": ",e.finalUrl]}),(0,r.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-xs text-ink-muted",children:[(0,r.jsx)("span",{className:"inline-flex items-center gap-1",children:"quick"===e.mode?x?"快速预览":"Quick Preview":x?"完整审核":"Full Audit"}),(0,r.jsx)("span",{children:new Date(e.createdAt).toLocaleString(x?"zh-CN":"en-US")})]})]}):(0,r.jsxs)(n.default,{href:"/audit/".concat(e.id),className:"block focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2 focus:ring-offset-surface-canvas rounded",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white truncate mb-1",children:e.targetUrl}),e.finalUrl&&e.finalUrl!==e.targetUrl&&(0,r.jsxs)("p",{className:"text-xs text-ink-muted truncate mb-2",children:[x?"最终 URL":"Final URL",": ",e.finalUrl]}),(0,r.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-xs text-ink-muted",children:[(0,r.jsx)("span",{className:"inline-flex items-center gap-1",children:"quick"===e.mode?x?"快速预览":"Quick Preview":x?"完整审核":"Full Audit"}),(0,r.jsx)("span",{children:new Date(e.createdAt).toLocaleString(x?"zh-CN":"en-US")})]})]})})}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[!s&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[e.p0Count>0&&(0,r.jsxs)("span",{className:"px-2 py-1 text-xs font-semibold bg-red-900/30 text-red-300 border border-red-500/30 rounded",children:["P0: ",e.p0Count]}),e.p1Count>0&&(0,r.jsxs)("span",{className:"px-2 py-1 text-xs font-semibold bg-orange-900/30 text-orange-300 border border-orange-500/30 rounded",children:["P1: ",e.p1Count]}),e.p2Count>0&&(0,r.jsxs)("span",{className:"px-2 py-1 text-xs font-semibold bg-blue-900/30 text-blue-300 border border-blue-500/30 rounded",children:["P2: ",e.p2Count]})]}),!s&&(0,r.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,r.jsx)("button",{onClick:s=>{s.stopPropagation(),D(e.targetUrl)},className:"p-2 text-ink-muted hover:text-brand hover:bg-surface-raised rounded transition-colors focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2 focus:ring-offset-surface-canvas cursor-pointer","aria-label":x?"重新审核":"Re-audit",title:x?"重新审核":"Re-audit",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),(0,r.jsx)("button",{onClick:s=>{s.stopPropagation(),M(e.id)},className:"p-2 text-ink-muted hover:text-brand hover:bg-surface-raised rounded transition-colors focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2 focus:ring-offset-surface-canvas cursor-pointer","aria-label":x?"分享":"Share",title:x?"分享链接":"Share link",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.3
116m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})})}),(0,r.jsx)("button",{onClick:s=>{s.stopPropagation(),H(e.id)},className:"p-2 text-ink-muted hover:text-brand hover:bg-surface-raised rounded transition-colors focus:outline-none focus:ring-2 focus:ring-brand focus:ring-offset-2 focus:ring-offset-surface-canvas cursor-pointer","aria-label":x?"导出":"Export",title:x?"导出报告":"Export report",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,r.jsx)("button",{onClick:s=>{s.stopPropagation(),B(e.id)},className:"p-2 text-ink-muted hover:text-red-400 hover:bg-surface-raised rounded transition-colors focus:outline-none focus:ring-2 focus:ring-red-400 focus:ring-offset-2 focus:ring-offset-surface-canvas cursor-pointer","aria-label":x?"删除":"Delete",title:x?"删除记录":"Delete record",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})]},e.id)})]}),!p&&"number"==typeof g&&f.length>=g&&(0,r.jsx)("div",{className:"mt-6 border border-yellow-500/30 rounded-xl p-4 bg-yellow-900/20",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-yellow-400 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm text-yellow-300 mb-2",children:x?"您已达到入门用户限制(".concat(g," 次)。升级到付费计划可享受无限审核历史记录。"):"You've reached the current account limit (".concat(g,"). Buy credits or contact support for higher volume.")}),(0,r.jsxs)(n.default,{href:(0,m.ey)(),className:"text-sm text-yellow-400 font-medium hover:text-yellow-300 transition-colors inline-flex items-center gap-1 focus:outline-none focus:ring-2 focus:ring-yellow-400 focus:ring-offset-2 focus:ring-offset-transparent rounded cursor-pointer",children:[m.EX?x?"查看定价":"View Pricing":x?"联系我们":"Contact us"," →"]})]})]})})]}):(0,r.jsx)("div",{className:"border border-line rounded-xl p-6 bg-surface-panel",children:(0,r.jsx)("p",{className:"text-sm text-ink-muted text-center",children:(0,r.jsx)("button",{type:"button",onClick:()=>h(),className:"underline underline-offset-2 hover:text-white transition-colors cursor-pointer rounded-sm focus-ring-brand",children:x?"请登录以查看审核历史记录":"Please log in to view audit history"})})})}}}]);

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.