hunter-mate 0.1.30 → 0.1.32
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/assets/extension/build-info.json +1 -1
- package/dist/assets/extension/manifest.json +3 -3
- package/dist/assets/server/main.mjs +2820 -2077
- package/dist/index.js +1 -1
- package/dist/web/dist/404.html +1 -1
- package/dist/web/dist/_next/static/chunks/431-6c54d8d0cf2bf768.js +1 -0
- package/dist/web/dist/_next/static/chunks/587-a1defe5c7e3e1e1b.js +1 -0
- package/dist/web/dist/_next/static/chunks/{603-765c4fa1ed757ca5.js → 603-0878bd28159f4fe7.js} +1 -1
- package/dist/web/dist/_next/static/chunks/659-85c4e54826b8bd18.js +1 -0
- package/dist/web/dist/_next/static/chunks/686-332bfa3dbd6e0aac.js +1 -0
- package/dist/web/dist/_next/static/chunks/{935-12f1084f0e18c962.js → 935-0ec6bca7ef6e2dfc.js} +2 -2
- package/dist/web/dist/_next/static/chunks/987-d5135025f46d8a26.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/admin/data/page-efbbb1ea584df5a4.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/companies/page-e170ee131403d4d7.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/company/admin/page-940476e223ed5291.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/jobs/page-af06cb0c0686ebdd.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/layout-e93c294bf845144d.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/login/page-11dbf5148d19a037.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/page-04e5f88a00b6a762.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/page-fed47ed5c72523c4.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/page-29f956a9e7eb3954.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/parselog/page-d11c8ce5545a86af.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/recordings/page-4a11e105b956cd72.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/resource-usage/page-9591bf89800bebb6.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/shared/[token]/page-7189e27de66ecb09.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-c44bee385e0bca9a.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/talents/{page-4b00d69580f49f97.js → page-426470ca404838cb.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/team/insights/page-db663ad28356ff73.js +1 -0
- package/dist/web/dist/_next/static/chunks/{main-8a2c75d6c43385dd.js → main-8b470f167e9bfe73.js} +1 -1
- package/dist/web/dist/_next/static/chunks/{main-app-5e9b0602f99fef72.js → main-app-ee5c87be3671889b.js} +1 -1
- package/dist/web/dist/_next/static/chunks/pages/{_app-3fdd92eb97cdde60.js → _app-20aa9e4f679a6d47.js} +2 -2
- package/dist/web/dist/_next/static/css/ad396c8df7280fac.css +3 -0
- package/dist/web/dist/admin/data.html +1 -1
- package/dist/web/dist/admin/data.txt +4 -6
- package/dist/web/dist/auth/verify.html +1 -1
- package/dist/web/dist/auth/verify.txt +3 -5
- package/dist/web/dist/companies.html +1 -1
- package/dist/web/dist/companies.txt +4 -6
- package/dist/web/dist/company/admin.html +1 -1
- package/dist/web/dist/company/admin.txt +4 -6
- package/dist/web/dist/entity.html +1 -1
- package/dist/web/dist/entity.txt +3 -5
- package/dist/web/dist/index.html +1 -1
- package/dist/web/dist/index.txt +6 -8
- package/dist/web/dist/jobs.html +1 -1
- package/dist/web/dist/jobs.txt +4 -6
- package/dist/web/dist/login.html +35 -0
- package/dist/web/dist/login.txt +8 -0
- package/dist/web/dist/logs.html +1 -1
- package/dist/web/dist/logs.txt +3 -5
- package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -1
- package/dist/web/dist/matching/jobs/placeholder/talents.txt +4 -6
- package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -1
- package/dist/web/dist/matching/portraits/placeholder/jobs.txt +4 -6
- package/dist/web/dist/parselog.html +1 -1
- package/dist/web/dist/parselog.txt +4 -6
- package/dist/web/dist/recordings.html +1 -1
- package/dist/web/dist/recordings.txt +4 -6
- package/dist/web/dist/resource-usage.html +1 -1
- package/dist/web/dist/resource-usage.txt +4 -6
- package/dist/web/dist/shared/placeholder.html +1 -1
- package/dist/web/dist/shared/placeholder.txt +4 -6
- package/dist/web/dist/snapshots/placeholder/agent-prompt.html +1 -1
- package/dist/web/dist/snapshots/placeholder/agent-prompt.txt +4 -6
- package/dist/web/dist/talents.html +1 -1
- package/dist/web/dist/talents.txt +4 -6
- package/dist/web/dist/team/insights.html +1 -1
- package/dist/web/dist/team/insights.txt +4 -6
- package/package.json +1 -1
- package/dist/web/dist/_next/static/chunks/327-6b8f348b06e7977f.js +0 -1
- package/dist/web/dist/_next/static/chunks/587-e449469e56a2bfff.js +0 -1
- package/dist/web/dist/_next/static/chunks/659-3db6e9c90ee9d238.js +0 -1
- package/dist/web/dist/_next/static/chunks/686-9bdfefc40893173f.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/admin/data/page-666f99fbfee46cc9.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/companies/page-e1e730e2dc5ad84c.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/company/admin/page-02244f3f1a212c76.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/jobs/page-dff5282c65e66ef4.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/layout-1e492ed8c639edf5.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/page-73bca3864b8b9e44.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/page-477c66bee61225fa.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/page-8ea324b366e3d374.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/parselog/page-4f5c186442feb386.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/recordings/page-0fb8cafdd2f6762c.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/resource-usage/page-76be36ca978391a3.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/shared/[token]/page-47b5d836a9e10325.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-60ea46364a74b294.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/team/insights/page-5385dcd363f6e0cd.js +0 -1
- package/dist/web/dist/_next/static/css/8f3c454cab3414d0.css +0 -3
- /package/dist/assets/extension/background/{service-worker.20261025015540.js → service-worker.20261027115924.js} +0 -0
- /package/dist/web/dist/_next/static/{oL0Npvxb5lQa5gycVwoMf → MJuXtJSgMhtSDdWY9q8kk}/_buildManifest.js +0 -0
- /package/dist/web/dist/_next/static/{oL0Npvxb5lQa5gycVwoMf → MJuXtJSgMhtSDdWY9q8kk}/_ssgManifest.js +0 -0
package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/page-04e5f88a00b6a762.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="18b81c06-5083-4426-b57f-9034a076ce9f",e._sentryDebugIdIdentifier="sentry-dbid-18b81c06-5083-4426-b57f-9034a076ce9f")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[234],{30866:function(e,n,r){Promise.resolve().then(r.bind(r,84762))},27473:function(e,n,r){"use strict";var s=r(38321);r.o(s,"useParams")&&r.d(n,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(n,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(n,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(n,{useSearchParams:function(){return s.useSearchParams}}),r.o(s,"useServerInsertedHTML")&&r.d(n,{useServerInsertedHTML:function(){return s.useServerInsertedHTML}})},84762:function(e,n,r){"use strict";r.d(n,{default:function(){return d}});var s=r(72835),i=r(60635),t=r(27473),o=r(74431);function d(){let e=(0,t.useParams)().id,[n,r]=(0,i.useState)([]),[d,a]=(0,i.useState)(!1),[u,l]=(0,i.useState)(null);async function c(){a(!0),l(null);try{r(await (0,o.requestJson)("/matching/jobs/".concat(e,"/talents")))}catch(e){l(e.message)}finally{a(!1)}}return(0,s.jsxs)("div",{style:{padding:24,maxWidth:900,margin:"0 auto"},children:[(0,s.jsxs)("h1",{children:["职位 ",e," 的推荐人才"]}),(0,s.jsx)("button",{onClick:c,disabled:d,children:d?"计算中...":"刷新匹配"}),u&&(0,s.jsx)("div",{style:{color:"red",marginTop:12},children:u}),(0,s.jsx)("div",{style:{marginTop:16},children:n.map(e=>{var n,r,i,t,o,d,a;return(0,s.jsxs)("div",{style:{border:"1px solid #ddd",borderRadius:8,padding:16,marginBottom:12},children:[(0,s.jsxs)("div",{style:{fontWeight:"bold"},children:["人才 ID: ",e.portraitId.slice(0,8)," — 综合分 ",null===(n=e.scores)||void 0===n?void 0:n.overall]}),(0,s.jsxs)("div",{style:{fontSize:13,color:"#555",marginTop:4},children:["技能 ",null===(r=e.scores)||void 0===r?void 0:r.skill," | 经验 ",null===(i=e.scores)||void 0===i?void 0:i.experience," | 行业 ",null===(t=e.scores)||void 0===t?void 0:t.industry," | 地点 ",null===(o=e.scores)||void 0===o?void 0:o.location," | 薪酬 ",null===(d=e.scores)||void 0===d?void 0:d.salary]}),(null===(a=e.recommendation)||void 0===a?void 0:a.aiReason)&&(0,s.jsx)("pre",{style:{marginTop:8,background:"#f5f5f5",padding:12,borderRadius:4,whiteSpace:"pre-wrap"},children:e.recommendation.aiReason})]},e.id)})})]})}}},function(e){e.O(0,[431,400,935,744],function(){return e(e.s=30866)}),_N_E=e.O()}]);
|
package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/page-fed47ed5c72523c4.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="607d640a-3392-4567-928b-4792ffd1d772",e._sentryDebugIdIdentifier="sentry-dbid-607d640a-3392-4567-928b-4792ffd1d772")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[977],{48166:function(e,n,r){Promise.resolve().then(r.bind(r,91261))},27473:function(e,n,r){"use strict";var s=r(38321);r.o(s,"useParams")&&r.d(n,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(n,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(n,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(n,{useSearchParams:function(){return s.useSearchParams}}),r.o(s,"useServerInsertedHTML")&&r.d(n,{useServerInsertedHTML:function(){return s.useServerInsertedHTML}})},91261:function(e,n,r){"use strict";r.d(n,{default:function(){return t}});var s=r(72835),d=r(60635),i=r(27473),o=r(74431);function t(){let e=(0,i.useParams)().id,[n,r]=(0,d.useState)([]),[t,a]=(0,d.useState)(!1),[u,l]=(0,d.useState)(null);async function c(){a(!0),l(null);try{r(await (0,o.requestJson)("/matching/portraits/".concat(e,"/jobs")))}catch(e){l(e.message)}finally{a(!1)}}return(0,s.jsxs)("div",{style:{padding:24,maxWidth:900,margin:"0 auto"},children:[(0,s.jsxs)("h1",{children:["人才 ",e.slice(0,8)," 的推荐职位"]}),(0,s.jsx)("button",{onClick:c,disabled:t,children:t?"计算中...":"刷新匹配"}),u&&(0,s.jsx)("div",{style:{color:"red",marginTop:12},children:u}),(0,s.jsx)("div",{style:{marginTop:16},children:n.map(e=>{var n,r,d,i,o,t,a;return(0,s.jsxs)("div",{style:{border:"1px solid #ddd",borderRadius:8,padding:16,marginBottom:12},children:[(0,s.jsxs)("div",{style:{fontWeight:"bold"},children:["职位 ID: ",e.jobCaseId," — 综合分 ",null===(n=e.scores)||void 0===n?void 0:n.overall]}),(0,s.jsxs)("div",{style:{fontSize:13,color:"#555",marginTop:4},children:["技能 ",null===(r=e.scores)||void 0===r?void 0:r.skill," | 经验 ",null===(d=e.scores)||void 0===d?void 0:d.experience," | 行业 ",null===(i=e.scores)||void 0===i?void 0:i.industry," | 地点 ",null===(o=e.scores)||void 0===o?void 0:o.location," | 薪酬 ",null===(t=e.scores)||void 0===t?void 0:t.salary]}),(null===(a=e.recommendation)||void 0===a?void 0:a.aiReason)&&(0,s.jsx)("pre",{style:{marginTop:8,background:"#f5f5f5",padding:12,borderRadius:4,whiteSpace:"pre-wrap"},children:e.recommendation.aiReason})]},e.id)})})]})}}},function(e){e.O(0,[431,400,935,744],function(){return e(e.s=48166)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new n.Error).stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="22c10990-d866-4c9c-ad94-774a8d87e323",n._sentryDebugIdIdentifier="sentry-dbid-22c10990-d866-4c9c-ad94-774a8d87e323")}catch(n){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{34947:function(n,e,l){Promise.resolve().then(l.bind(l,19145))},19145:function(n,e,l){"use strict";l.r(e),l.d(e,{default:function(){return d}});var t=l(72835),r=l(60635),u=l(55589),o=l(74431),i=l(33447),s=l(8448),a=l(65777);function d(){var n;let[e,l]=(0,r.useState)({}),[d,c]=(0,r.useState)(0),[f,v]=(0,r.useState)(null),[h,m]=(0,r.useState)(""),{sync:g}=(0,a.nu)(),y=null!==(n=null==g?void 0:g.activeTenantId)&&void 0!==n?n:null,b=(0,r.useCallback)(async()=>{var n,e,t,r,u,a,d;let[f,h,g,y,b]=await Promise.all([(0,o.requestJson)("/entities?type=talent&limit=1").catch(()=>null),(0,o.requestJson)("/entities?type=job&limit=1").catch(()=>null),(0,o.requestJson)("/entities?type=company&limit=1").catch(()=>null),(0,i.K5)()?Promise.resolve(null):(0,o.requestJson)("/parse-log?limit=1").catch(()=>null),(0,i.K5)()?Promise.resolve(null):(0,o.requestJson)("/api/recordings?limit=1").catch(()=>null)]);v(!!(f||h||g||y||b)),l({talent:f?null!==(e=f.total)&&void 0!==e?e:0:null,job:h?null!==(t=h.total)&&void 0!==t?t:0:null,company:g?null!==(r=g.total)&&void 0!==r?r:0:null,parseLog:y?null!==(u=y.total)&&void 0!==u?u:0:null,recording:b?null!==(a=null===(n=b.sessions)||void 0===n?void 0:n.length)&&void 0!==a?a:0:null}),c(y&&null!==(d=y.abnormal)&&void 0!==d?d:0),m((0,s.d3)(new Date().toISOString()))},[]);(0,r.useEffect)(()=>{b()},[b,y]);let p=[{key:"talent",label:"人才",href:"/talents",count:e.talent},{key:"job",label:"职位",href:"/jobs",count:e.job},{key:"company",label:"公司",href:"/companies",count:e.company},{key:"parseLog",label:"解析日志",href:"/parselog",count:e.parseLog,abnormal:d},{key:"recording",label:"录制会话",href:"/recordings",count:e.recording}];return(0,t.jsxs)("div",{className:"h-full overflow-auto p-6",children:[(0,t.jsxs)("header",{className:"mb-6",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold",children:"HunterMate 仪表盘"}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-gray-500",children:[(0,i.K5)()?"云端服务":"本地服务"," ",(0,t.jsx)("span",{className:f?"text-green-600":"text-red-600",children:null===f?"检测中…":f?"在线":"离线"}),h?" \xb7 刷新于 ".concat(h):""]})]}),(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:p.map(n=>{var e;return(0,t.jsxs)(u.default,{href:n.href,className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm transition-shadow hover:shadow-md",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-gray-500",children:n.label}),(0,t.jsx)("span",{className:"text-2xl font-bold text-gray-900",children:null!==(e=n.count)&&void 0!==e?e:"—"})]}),n.abnormal?(0,t.jsxs)("div",{className:"mt-2 text-sm text-red-600",children:["异常 ",n.abnormal]}):null]},n.key)})})]})}},65777:function(n,e,l){"use strict";let t;l.d(e,{Cd:function(){return U},Xc:function(){return P},aG:function(){return _},cp:function(){return T},nu:function(){return S},tQ:function(){return q}});var r=l(60635),u=l(74431),o=l(67002),i=l(33447),s=l(21260),a=l(28431),d=l(60529);let c=null,f=null,v=null,h=new Set;function m(){h.forEach(n=>n())}function g(n){c=c?{...c,refreshing:n}:{...N,refreshing:n},m()}function y(n){if(void 0===t){t=n;return}if(n!==t){t=n;try{window.localStorage.removeItem("hm-view-mode")}catch(n){}}}async function b(){try{return await (0,u.requestJson)("/auth/session")}catch(n){return null}}async function p(n){let e=new Headers,l=(0,o.Xc)();l&&e.set("Authorization","UTOKEN ".concat(l));try{return await (0,u.requestJson)(n,{headers:e})}catch(n){return null}}async function I(){g(!0);try{var n,e,l,t,r,o,i,d,f;let v=(0,s.xq)();if(!v){(0,a.nZ)(),c={...N,session:{loggedIn:!1},refreshing:!1,authStatus:"out"},m();return}let h=await (0,u.requestJson)("/hunter-mate/sync/state?heads=0");(0,a.YZ)(null!==(n=h.activeTenantId)&&void 0!==n?n:null);let g=(0,s.OG)(v);y(null!==(l=null!==(e=h.hmUserId)&&void 0!==e?e:g.hmUserId)&&void 0!==l?l:null),c={session:{loggedIn:!0,email:null!==(t=g.email)&&void 0!==t?t:void 0,hmUserId:null!==(o=null!==(r=h.hmUserId)&&void 0!==r?r:g.hmUserId)&&void 0!==o?o:void 0,token:v},sync:{loggedIn:!0,enabled:!0,activeTenantId:(0,a.MA)(),serverSuggestedTenantId:null!==(i=h.activeTenantId)&&void 0!==i?i:null,memberships:null!==(d=h.memberships)&&void 0!==d?d:[],pendingCounts:null!==(f=h.pendingCounts)&&void 0!==f?f:[]},utoken:v,loadError:null,refreshing:!1,authStatus:"in",refresh:x},m()}catch(n){c=c?{...c,loadError:"云端无响应"}:{...N,loadError:"云端无响应"},m()}finally{(null==c?void 0:c.refreshing)&&g(!1)}}async function w(){if((0,i.K5)())return I();g(!0);try{var n;let[e,l]=await Promise.all([b(),p("/datasync/state")]),t=(null==e?void 0:e.loggedIn)&&e.token?e.token:null,r=null!=l?l:null;!r&&e&&t&&t!==(0,o.Xc)()?((0,o.GK)(t),r=await p("/datasync/state")):(0,o.GK)(t),y((null==e?void 0:e.loggedIn)&&null!==(n=e.hmUserId)&&void 0!==n?n:null);let u=!!((null==e?void 0:e.loggedIn)||(null==r?void 0:r.loggedIn));if(!e&&!r){c=c?{...c,loadError:"本地服务无响应"}:{...N,loadError:"本地服务无响应"},m();return}c={session:null!=e?e:{loggedIn:!1},sync:r,utoken:(0,o.Xc)(),loadError:null,refreshing:!1,authStatus:u?"in":"out",refresh:x},m()}finally{(null==c?void 0:c.refreshing)&&g(!1)}}function x(){return f||(f=w().finally(()=>{f=null}))}function E(n){return h.add(n),1===h.size&&(x(),v=setInterval(()=>void x(),6e4)),()=>{h.delete(n),0===h.size&&v&&(clearInterval(v),v=null)}}let N={session:null,sync:null,utoken:null,loadError:null,refreshing:!1,authStatus:"loading",refresh:x};function j(){return null!=c?c:N}function k(){return j()}function S(){return(0,r.useSyncExternalStore)(E,j,k)}function _(n){var e;return(null!==(e=null==n?void 0:n.memberships)&&void 0!==e?e:[]).filter(n=>!n.isPersonal&&!n.leftAt)}function T(n){var e,l;let t=null!==(e=null==n?void 0:n.activeTenantId)&&void 0!==e?e:null;if(null==t)return null;let r=(null!==(l=null==n?void 0:n.memberships)&&void 0!==l?l:[]).find(n=>n.tenantId===t&&!n.leftAt);return!r||r.isPersonal?null:t}function U(n,e){var l,t;if(!e)return null;let r=(null!==(l=null==n?void 0:n.memberships)&&void 0!==l?l:[]).find(n=>n.tenantId===e&&!n.leftAt&&!n.isPersonal);return null!==(t=null==r?void 0:r.role)&&void 0!==t?t:null}function q(){return d.env.NEXT_PUBLIC_HUNTER_MATE_SERVER_URL||""}function P(){return(0,o.Xc)()}},8448:function(n,e,l){"use strict";function t(n){return n?("string"==typeof n?new Date(n):n).toLocaleString("zh-CN",{hour12:!1}):""}l.d(e,{d3:function(){return t}})}},function(n){n.O(0,[589,431,400,935,744],function(){return n(n.s=34947)}),_N_E=n.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0d6a6307-e9f9-46a5-a0a7-0e44040492b5",e._sentryDebugIdIdentifier="sentry-dbid-0d6a6307-e9f9-46a5-a0a7-0e44040492b5")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[788],{10793:function(e,t,s){Promise.resolve().then(s.bind(s,4895))},27473:function(e,t,s){"use strict";var r=s(38321);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}}),s.o(r,"useServerInsertedHTML")&&s.d(t,{useServerInsertedHTML:function(){return r.useServerInsertedHTML}})},4895:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return N}});var r=s(72835),n=s(60635),l=s(27473),a=s(74431),o=s(37202),i=s(94518),c=s(63718),u=s(19036),d=s(55589),x=s(8448);let m={ok:"正常",empty:"关键字段为空","no-snapshot":"缺快照","no-rule":"无规则"},f={ok:"bg-green-50 text-green-700",empty:"bg-yellow-50 text-yellow-700","no-snapshot":"bg-red-50 text-red-700","no-rule":"bg-gray-100 text-gray-600"};function h(e){var t,s;let{item:n}=e;return(0,r.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,r.jsx)(d.default,{href:"/parselog",className:"text-sm text-blue-600 hover:underline",children:"← 返回解析日志列表"}),(0,r.jsxs)("header",{className:"mt-4 mb-6",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsxs)("h1",{className:"text-2xl font-bold text-gray-900",children:["解析记录 #",n.id]}),(0,r.jsx)("span",{className:"rounded px-2 py-0.5 text-xs ".concat(f[n.status]),children:null!==(s=m[n.status])&&void 0!==s?s:n.status}),n.hasSnapshot?(0,r.jsx)("span",{className:"rounded bg-green-50 px-2 py-0.5 text-xs text-green-700",children:"有录制快照"}):null]}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-gray-500",children:[n.domain," \xb7 ",n.pageClass," \xb7 ",(0,x.d3)(n.createdAt)]})]}),(0,r.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"来源"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"text-sm",children:[(0,r.jsx)("span",{className:"text-gray-500",children:"sessionId: "}),(0,r.jsx)("span",{className:"font-mono",children:n.sessionId})]}),(0,r.jsx)("a",{href:n.sourceUrl,target:"_blank",rel:"noreferrer",className:"break-all text-sm text-blue-600 hover:underline",children:n.sourceUrl}),n.entityId?(0,r.jsxs)("div",{className:"pt-2",children:[(0,r.jsx)("span",{className:"text-sm text-gray-500",children:"关联实体: "}),(0,r.jsxs)(d.default,{href:"/".concat(n.pageClass,"s?id=").concat(n.entityId),className:"text-sm text-blue-600 hover:underline",children:["#",n.entityId," (",n.pageClass,")"]})]}):null]})]}),n.extractedFields?(0,r.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"提取字段"}),(0,r.jsx)("pre",{className:"max-h-96 overflow-auto rounded bg-gray-50 p-3 text-xs text-gray-700",children:JSON.stringify(n.extractedFields,null,2)})]}):null,(null===(t=n.missingFields)||void 0===t?void 0:t.length)?(0,r.jsxs)("section",{className:"mt-4 rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,r.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"缺失字段(疑似站点改版)"}),(0,r.jsx)("ul",{className:"list-inside list-disc text-sm text-gray-700",children:n.missingFields.map(e=>(0,r.jsx)("li",{children:e},e))})]}):null]})}var g=s(12789),b=s(33447);let p=[{value:"ok",label:"正常"},{value:"empty",label:"关键字段为空"},{value:"no-snapshot",label:"缺快照"},{value:"no-rule",label:"无规则"}],v={ok:"bg-green-50 text-green-700",empty:"bg-yellow-50 text-yellow-700","no-snapshot":"bg-red-50 text-red-700","no-rule":"bg-gray-100 text-gray-600"};function y(e){let t=new URLSearchParams;Object.entries(e).forEach(e=>{let[s,r]=e;r&&t.set(s,r)});let s=t.toString();return s?"?".concat(s):""}function j(){let e=(0,l.useRouter)(),t=(0,l.usePathname)(),s=(0,l.useSearchParams)(),d=s.get("id")||"",m=(0,n.useMemo)(()=>({q:s.get("q")||"",status:s.get("status")||"",from:s.get("from")||"",to:s.get("to")||""}),[s]),[f,g]=(0,n.useState)(null),[b,j]=(0,n.useState)(!1),[N,w]=(0,n.useState)(null),[S,k]=(0,n.useState)(!0),[C,I]=(0,n.useState)(!1),[q,E]=(0,n.useState)(!1),[L,P]=(0,n.useState)(0),[M,R]=(0,n.useState)(0),_=(0,n.useCallback)(s=>{var r,n;let l=null!==(r=s.filters)&&void 0!==r?r:m,a=y({id:null!==(n=s.id)&&void 0!==n?n:d,q:l.q,status:l.status,from:l.from,to:l.to});e.replace("".concat(t).concat(a))},[m,d,t,e]),D=(0,n.useCallback)(()=>{R(e=>e+1)},[]),H=(0,n.useCallback)(()=>{let e=null==f?void 0:f.items[0];return null==e?void 0:e.createdAt},[f]);(0,n.useEffect)(()=>{k(!0),j(!1);let e=y({q:m.q,status:m.status,from:m.from,to:m.to});(0,a.requestJson)("/parse-log?limit=200".concat(e.replace("?","&"))).then(e=>{g(e)}).catch(()=>{j(!0)}).finally(()=>{k(!1)})},[m.q,m.status,m.from,m.to,M]),(0,n.useEffect)(()=>{if(!d){w(null),E(!1);return}I(!0),E(!1),(0,a.requestJson)("/parse-log/".concat(d)).then(e=>{w(e)}).catch(()=>{w(null),E(!0)}).finally(()=>{I(!1)})},[d,L]);let T=(0,n.useMemo)(()=>{var e;return(null!==(e=null==f?void 0:f.items)&&void 0!==e?e:[]).map(e=>({id:String(e.id),content:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs ".concat(v[e.status]),children:e.status}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:e.pageClass})]}),(0,r.jsx)("div",{className:"mt-0.5 text-sm font-medium text-gray-900",children:e.domain}),(0,r.jsx)("div",{className:"text-xs text-gray-400",children:(0,x.d3)(e.createdAt)})]})}))},[f]),O=d?C?(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):q?(0,r.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,r.jsx)("button",{type:"button",onClick:()=>P(e=>e+1),className:"text-blue-500 hover:underline",children:"重试"})]}):N?(0,r.jsx)(h,{item:N}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-red-500",children:"未找到该解析日志"}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"请在左侧选择一条解析日志查看详情"});return(0,r.jsx)(i.m,{filterBar:(0,r.jsxs)("div",{className:"border-b border-gray-200 bg-white",children:[(0,r.jsx)(o.f,{value:m,showStatus:!0,statusOptions:p,onChange:e=>_({filters:e})}),f?(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 pb-2 text-xs text-gray-500",children:[(0,r.jsxs)("span",{children:["共 ",f.total," 条"]}),f.abnormal>0?(0,r.jsxs)("span",{className:"rounded bg-red-50 px-1.5 py-0.5 text-red-700",children:["异常 ",f.abnormal]}):null]}):null,(0,r.jsx)(u.Y,{pollUrl:"/parse-log/count",getLatestTimestamp:H,onRefresh:D,label:"解析日志"})]}),listPanel:b?(0,r.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,r.jsx)("button",{type:"button",onClick:D,className:"text-blue-500 hover:underline",children:"重试"})]}):(0,r.jsx)(c.L,{items:T,selectedId:d,onSelect:e=>_({id:e}),loading:S,emptyText:"暂无解析日志"}),detailPanel:O})}function N(){return(0,b.K5)()?(0,r.jsx)(g.D,{feature:"解析日志",localPath:"/parselog"}):(0,r.jsx)(n.Suspense,{fallback:(0,r.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,r.jsx)(j,{})})}},37202:function(e,t,s){"use strict";s.d(t,{f:function(){return l}});var r=s(72835),n=s(60635);function l(e){let{value:t,showStatus:s,statusOptions:l,onChange:a}=e,[o,i]=(0,n.useState)(t);return(0,n.useEffect)(()=>{i(t)},[t.q,t.status,t.from,t.to]),(0,n.useEffect)(()=>{let e=setTimeout(()=>{(o.q!==t.q||o.status!==t.status||o.from!==t.from||o.to!==t.to)&&a(o)},300);return()=>clearTimeout(e)},[o.q,o.status,o.from,o.to]),(0,r.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)("input",{type:"text",value:o.q,onChange:e=>i(t=>({...t,q:e.target.value})),placeholder:"搜索关键词...",className:"w-full rounded border border-gray-300 px-2 py-1.5 pr-8 text-sm outline-none focus:border-blue-500"}),(0,r.jsx)("button",{type:"button",onClick:()=>a({q:"",status:"",from:"",to:""}),title:"重置筛选",className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 disabled:opacity-30",disabled:!o.q&&!o.status&&!o.from&&!o.to,children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),s?(0,r.jsxs)("select",{value:o.status,onChange:e=>i(t=>({...t,status:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500",children:[(0,r.jsx)("option",{value:"",children:"全部状态"}),(l||[]).map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))]}):null]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"date",value:o.from,onChange:e=>i(t=>({...t,from:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),(0,r.jsx)("span",{className:"text-sm text-gray-400",children:"-"}),(0,r.jsx)("input",{type:"date",value:o.to,onChange:e=>i(t=>({...t,to:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"})]})]})}},94518:function(e,t,s){"use strict";s.d(t,{m:function(){return n}});var r=s(72835);function n(e){let{filterBar:t,listPanel:s,detailPanel:n}=e;return(0,r.jsxs)("div",{className:"flex h-full",children:[(0,r.jsxs)("div",{className:"flex w-80 flex-col border-r border-gray-200 bg-white",children:[t,s]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto bg-gray-50 p-6",children:n})]})}},63718:function(e,t,s){"use strict";s.d(t,{L:function(){return l}});var r=s(72835),n=s(60635);function l(e){let{items:t,selectedId:s,onSelect:l,loading:a,emptyText:o="暂无数据",onLoadMore:i,loadingMore:c,exhausted:u}=e,d=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!i)return;let e=d.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&i()},{root:e.closest(".overflow-auto"),rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[i]),(0,r.jsxs)("div",{className:"flex-1 overflow-auto",children:[a?(0,r.jsx)("div",{className:"p-4 text-center text-sm text-gray-400",children:"加载中…"}):0===t.length?(0,r.jsx)("div",{className:"p-4 text-center text-sm text-gray-400",children:o}):(0,r.jsx)("ul",{className:"divide-y divide-gray-100",children:t.map(e=>(0,r.jsx)("li",{role:"button",tabIndex:0,onClick:()=>l(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&l(e.id)},className:"cursor-pointer px-3 py-2 text-sm transition-colors ".concat(s===e.id?"bg-blue-50":"hover:bg-gray-50"),children:e.content},e.id))}),i&&!a&&t.length>0&&(0,r.jsx)("div",{ref:d,className:"p-3 text-center text-xs text-gray-400",children:c?"加载更多…":u?"没有更多了":""})]})}},12789:function(e,t,s){"use strict";s.d(t,{D:function(){return i},X:function(){return o}});var r=s(72835),n=s(60635),l=s(33447);function a(){var e;return null!==(e=window.hmdDesktop)&&void 0!==e?e:null}function o(e){var t;let{feature:s,localPath:o,children:i}=e,[c,u]=(0,n.useState)(null),d=!!(null===(t=a())||void 0===t?void 0:t.probeLocalServer);return((0,n.useEffect)(()=>{var e,t;if(!(0,l.K5)()||!d)return;let s=!1;return null===(t=a())||void 0===t||null===(e=t.probeLocalServer)||void 0===e||e.call(t).then(e=>{s||u((null==e?void 0:e.online)===!0)}).catch(()=>{s||u(!1)}),()=>{s=!0}},[d]),(0,l.K5)())?(0,r.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-5 py-8 text-center",children:[(0,r.jsxs)("div",{className:"text-sm font-medium text-amber-900",children:[s,"需在本机 HunterMate 中使用"]}),(0,r.jsx)("p",{className:"mx-auto mt-2 max-w-md text-xs leading-5 text-amber-700",children:"这部分数据只保存在你的电脑上,云端工作台访问不到;数据互通不受影响。"}),d&&o?(0,r.jsx)("div",{className:"mt-4",children:!0===c?(0,r.jsx)("button",{onClick:()=>{var e,t;null===(t=a())||void 0===t||null===(e=t.openLocal)||void 0===e||e.call(t,o)},className:"rounded-lg bg-amber-600 px-4 py-2 text-sm text-white hover:bg-amber-700",children:"在本机 HunterMate 中打开"}):(0,r.jsx)("span",{className:"text-xs text-amber-600",children:"本机 HunterMate 未在运行,启动后即可跳转"})}):(0,r.jsx)("p",{className:"mt-4 text-xs text-amber-600",children:"请在本机打开 HunterMate 后使用此功能。"})]}):(0,r.jsx)(r.Fragment,{children:i})}function i(e){let{feature:t,localPath:s}=e;return(0,l.K5)()?(0,r.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,r.jsx)("div",{className:"w-full max-w-lg",children:(0,r.jsx)(o,{feature:t,localPath:s})})}):null}},19036:function(e,t,s){"use strict";s.d(t,{Y:function(){return a}});var r=s(72835),n=s(60635),l=s(74431);function a(e){let{pollUrl:t,intervalMs:s=5e3,onRefresh:a,getLatestTimestamp:o,label:i="新数据"}=e,[c,u]=(0,n.useState)(0),[d,x]=(0,n.useState)(!1),m=(0,n.useRef)(void 0);return((0,n.useEffect)(()=>{let e=()=>x(document.hidden);return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),(0,n.useEffect)(()=>{m.current=o(),u(0)},[o]),(0,n.useEffect)(()=>{if(d)return;let e=async()=>{let e=m.current;if(!e)return;let s=t.includes("?")?"&":"?",r=0;try{var n;let a=await (0,l.requestJson)("".concat(t).concat(s,"since=").concat(encodeURIComponent(e)));r=null!==(n=a.count)&&void 0!==n?n:0}catch(e){}u(e=>Math.max(e,r))};e();let r=setInterval(e,s);return()=>clearInterval(r)},[t,s,d]),c<=0)?null:(0,r.jsxs)("button",{type:"button",onClick:()=>{u(0),a()},className:"w-full bg-blue-50 px-3 py-2 text-center text-sm text-blue-700 hover:bg-blue-100 active:bg-blue-200",children:["有 ",c," 条",i,",点击刷新"]})}},8448:function(e,t,s){"use strict";function r(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("zh-CN",{hour12:!1}):""}s.d(t,{d3:function(){return r}})}},function(e){e.O(0,[589,431,400,935,744],function(){return e(e.s=10793)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4311eab8-9a62-4a8a-b4a5-ad4184a9995f",e._sentryDebugIdIdentifier="sentry-dbid-4311eab8-9a62-4a8a-b4a5-ad4184a9995f")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[370],{71428:function(e,t,r){Promise.resolve().then(r.bind(r,3402))},3402:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return O}});var s=r(72835),n=r(60635),l=r(27473),a=r(74431),o=r(37202),i=r(94518),d=r(14590);let c=null,u="";function x(){let e="".concat((0,a.Ox)(),"/api/recordings-view");return c&&u===e||(c=new d.kE(e),u=e),c}var m=r(8448);function v(e){let{sessionId:t,eventCount:r,sourceUrl:n,startedAt:l,lastEventAt:a,counts:o}=e,i=[{label:"页面轨迹",value:null==o?void 0:o.rrwebCount},{label:"网络请求",value:null==o?void 0:o.networkCount},{label:"控制台消息",value:null==o?void 0:o.consoleCount},{label:"简历提取",value:null==o?void 0:o.resumeCount},{label:"操作记录",value:null==o?void 0:o.actionCount}].filter(e=>{var t;return(null!==(t=e.value)&&void 0!==t?t:0)>0});return(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"事件数"}),(0,s.jsx)("div",{className:"text-lg font-semibold",children:r})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"来源页面"}),n?(0,s.jsx)("a",{href:n,target:"_blank",rel:"noreferrer",className:"break-all text-sm text-blue-600 hover:underline",children:n}):(0,s.jsx)("div",{className:"text-sm text-gray-400",children:"-"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"开始时间"}),(0,s.jsx)("div",{className:"text-sm",children:(0,m.d3)(l)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"最近事件"}),(0,s.jsx)("div",{className:"text-sm",children:(0,m.d3)(a)})]})]}),i.length>0?(0,s.jsx)("div",{className:"mt-3 flex flex-wrap gap-2 border-t border-gray-100 pt-3",children:i.map(e=>(0,s.jsxs)("span",{className:"rounded bg-gray-100 px-2 py-1 text-xs text-gray-700",children:[e.label,": ",e.value]},e.label))}):null,(0,s.jsx)("div",{className:"mt-3 border-t border-gray-100 pt-3",children:(0,s.jsx)("div",{className:"font-mono text-xs text-gray-400",children:t})})]})}let h={rrweb:"rrweb",network:"network",console:"console",resume:"简历",action:"操作"},b={rrweb:"bg-purple-100 text-purple-700",network:"bg-blue-100 text-blue-700",console:"bg-yellow-100 text-yellow-700",resume:"bg-green-100 text-green-700",action:"bg-gray-100 text-gray-700"};function g(e){var t,r;let{type:n}=e,l=null!==(t=h[n])&&void 0!==t?t:n,a=null!==(r=b[n])&&void 0!==r?r:"bg-gray-100 text-gray-600";return(0,s.jsx)("span",{className:"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium ".concat(a),children:l})}function f(e){let{data:t}=e;return(0,s.jsx)("pre",{className:"max-h-64 overflow-auto rounded bg-gray-50 p-3 text-xs text-gray-700",children:JSON.stringify(t,null,2)})}function p(e){var t;let{event:r}=e,n=r.payload;return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:null!==(t=null==n?void 0:n.title)&&void 0!==t?t:"简历提取事件"}),(null==n?void 0:n.source)?(0,s.jsxs)("div",{className:"text-xs text-gray-500",children:["来源:"," ",(0,s.jsx)("a",{href:n.source,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:n.source})]}):null,(null==n?void 0:n.fields)?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-gray-500",children:"提取到的字段"}),(0,s.jsx)(f,{data:n.fields})]}):(0,s.jsx)(f,{data:r.payload})]})}function y(e){var t;let{event:r}=e,n=r.payload;return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:null!==(t=null==n?void 0:n.action)&&void 0!==t?t:"操作事件"}),(0,s.jsx)(f,{data:r.payload})]})}function j(e){let{sessionId:t}=e,[r,l]=(0,n.useState)(null),[o,i]=(0,n.useState)(!1),[d,c]=(0,n.useState)(null),[u,x]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let e=!0;return l(null),i(!1),c(null),(0,a.requestJson)("/api/recordings-view/recordings/".concat(encodeURIComponent(t),"/business")).then(t=>{var r;e&&l(null!==(r=t.items)&&void 0!==r?r:[])}).catch(()=>{e&&i(!0)}),()=>{e=!1}},[t,u]),(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsx)("h2",{className:"mb-3 text-lg font-semibold",children:"本次操作与简历"}),o?(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-red-500",children:["加载失败",(0,s.jsx)("button",{type:"button",onClick:()=>x(e=>e+1),className:"text-blue-500 hover:underline",children:"重试"})]}):null===r?(0,s.jsx)("div",{className:"text-sm text-gray-400",children:"加载中…"}):0===r.length?(0,s.jsx)("div",{className:"text-sm text-gray-400",children:"本次录制没有捕捉到简历提取或操作记录"}):(0,s.jsx)("ul",{className:"space-y-1",children:r.map((e,t)=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>c(e=>e===t?null:t),className:"flex w-full items-start gap-3 rounded p-2 text-left text-sm hover:bg-gray-50",children:[(0,s.jsx)(g,{type:e.eventType}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"truncate text-gray-900",children:function(e){var t,r;if("resume"===e.eventType){let r=e.payload;return null!==(t=null==r?void 0:r.title)&&void 0!==t?t:"简历提取事件"}let s=e.payload;return null!==(r=null==s?void 0:s.action)&&void 0!==r?r:"操作事件"}(e)}),(0,s.jsx)("div",{className:"text-xs text-gray-400",children:(0,m.d3)(e.createdAt)})]}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:d===t?"收起":"展开"})]}),d===t?(0,s.jsx)("div",{className:"ml-2 mt-1 border-l-2 border-gray-100 pl-4 pb-2",children:"resume"===e.eventType?(0,s.jsx)(p,{event:e}):(0,s.jsx)(y,{event:e})}):null]},t))})]})}function N(e){let{sessionId:t}=e,[r,l]=(0,n.useState)("idle"),[o,i]=(0,n.useState)(null);async function d(){l("loading");try{let e=await (0,a.requestJson)("/api/recordings/".concat(encodeURIComponent(t),"/parse"),{method:"POST"});i(e),l("success")}catch(e){console.error("[recordings] 解析失败:",e),l("error")}}let c=o&&"object"==typeof o&&"entity"in o&&o.entity&&"object"==typeof o.entity&&"id"in o.entity&&"type"in o.entity?"/entity?type=".concat(encodeURIComponent(String(o.entity.type)),"&id=").concat(encodeURIComponent(String(o.entity.id))):null;return(0,s.jsxs)("section",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"解析"}),(0,s.jsx)("button",{type:"button",onClick:d,disabled:"loading"===r,className:"rounded bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:"loading"===r?"解析中,请稍候…":"开始解析"})]}),"success"===r?(0,s.jsxs)("div",{className:"mt-3 rounded border border-green-200 bg-green-50 p-3 text-sm text-green-700",children:[(0,s.jsx)("div",{children:"解析完成"}),c?(0,s.jsx)("a",{href:c,className:"mt-1 inline-block text-blue-600 hover:underline",children:"查看解析结果 →"}):null]}):null,"error"===r?(0,s.jsx)("div",{className:"mt-3 rounded border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:(0,s.jsx)("div",{children:"解析失败,请稍后重试"})}):null]})}function w(e){if(!e.sourceUrl)return"录制会话";try{return new URL(e.sourceUrl).hostname||"录制会话"}catch(t){return e.sourceUrl}}function I(e){var t;let{session:r,onCompare:n}=e;return(0,s.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,s.jsxs)("header",{className:"mb-6 flex items-center gap-3",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:w(r)}),n&&(0,s.jsx)("button",{type:"button",onClick:n,className:"rounded border border-gray-300 px-3 py-1 text-sm text-gray-600 hover:bg-gray-50 hover:text-gray-900",children:"与其他录制对比"})]}),(0,s.jsx)(v,{sessionId:r.sessionId,eventCount:r.eventCount,sourceUrl:null!==(t=r.sourceUrl)&&void 0!==t?t:null,startedAt:r.startedAt,lastEventAt:r.lastEventAt,counts:r.counts}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(d.$q,{api:x(),sessionId:r.sessionId,renderError:(e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-600",children:[(0,s.jsx)("span",{children:"回放加载失败"}),(0,s.jsx)("button",{type:"button",onClick:t,className:"rounded border border-red-300 px-3 py-1 hover:bg-red-100",children:"重试"})]})},r.sessionId)}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(j,{sessionId:r.sessionId})}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(N,{sessionId:r.sessionId})})]})}function C(e){if(e.urlKey)return e.urlKey;let t=e.sourceUrl;if(!t)return"";try{return new URL(t).hostname||""}catch(e){return t}}function k(e){let t=Date.parse(e.startedAt.replace(" ","T"));return Number.isFinite(t)?t:0}function E(e,t){let r=e.find(e=>e.sessionId===t),s=r?C(r):"";return e.filter(e=>e.sessionId!==t).sort((e,t)=>{let r=""!==s&&C(e)===s?0:1,n=""!==s&&C(t)===s?0:1;return r!==n?r-n:k(t)-k(e)})}function S(e){if("number"==typeof e.duration)return e.duration;let t=Date.parse(e.startedAt.replace(" ","T")),r=Date.parse(e.lastEventAt.replace(" ","T"));if(!Number.isFinite(t)||!Number.isFinite(r))return null;let s=r-t;return s>=0?s:null}function L(e){var t,r,s;let n=null!==(t=e.sourceUrl)&&void 0!==t?t:"",l="";if(n)try{l=new URL(n).hostname||""}catch(e){l=""}let a=Date.parse(e.lastEventAt.replace(" ","T"));return{sessionId:e.sessionId,title:n||e.sessionId,status:"completed",startTime:k(e),endTime:Number.isFinite(a)?a:null,duration:S(e),startUrl:n,domain:l,url:n,urlKey:null!==(r=e.urlKey)&&void 0!==r?r:"",tabId:null!==(s=e.tabId)&&void 0!==s?s:null,tags:[]}}let q={rrweb:[],network:[],console:[],exceptions:[]};function U(e,t){let[r,s]=(0,n.useState)({events:null,error:null,loading:!1});return(0,n.useEffect)(()=>{s({events:null,error:null,loading:!1})},[e]),(0,n.useEffect)(()=>{if(!e)return;let t=!1;return s(e=>({...e,error:null,loading:!0})),x().events(e).then(e=>{t||s({events:e,error:null,loading:!1})}).catch(()=>{t||s({events:null,error:"network_error",loading:!1})}),()=>{t=!0}},[e,t]),r}function A(e){var t,r,l,a;let{base:o,target:i,sessions:c,onSelectTarget:u,onSwap:x,onExit:m}=e,v=E(c,o.sessionId),[h,b]=(0,n.useState)(0),g=(0,n.useCallback)(()=>b(e=>e+1),[]);(0,n.useEffect)(()=>b(0),[o.sessionId,null==i?void 0:i.sessionId]);let f=U(o.sessionId,h),p=U(null!==(t=null==i?void 0:i.sessionId)&&void 0!==t?t:null,h),y=f.loading||!!i&&p.loading,j={meta:L(o),events:null!==(r=f.events)&&void 0!==r?r:q},N=i?{meta:L(i),events:null!==(l=p.events)&&void 0!==l?l:q}:null;return(0,s.jsxs)("div",{className:"mx-auto max-w-6xl",children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm",children:[(0,s.jsx)("span",{className:"text-gray-500",children:"基准:"}),(0,s.jsxs)("span",{title:"基准为当前选中会话,不可更改",className:"cursor-not-allowed select-none rounded border border-gray-200 bg-gray-50 px-2 py-1 text-gray-700",children:[w(o),(0,s.jsx)("span",{className:"ml-1 text-xs text-gray-400",children:"(本次)▾"})]}),(0,s.jsx)("button",{type:"button",onClick:x,disabled:!i,title:i?"互换基准与对照":"请先选择对照录制",className:"rounded border border-gray-300 px-2 py-1 text-gray-600 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-40",children:"⇄ 互换"}),(0,s.jsx)("span",{className:"text-gray-500",children:"对照:"}),0===v.length?(0,s.jsx)("span",{className:"text-gray-400",children:"还需要至少另一条录制才能对比"}):(0,s.jsxs)("select",{value:null!==(a=null==i?void 0:i.sessionId)&&void 0!==a?a:"",onChange:e=>u(e.target.value),"aria-label":"选择对照录制",className:"rounded border border-gray-300 bg-white px-2 py-1 text-gray-700",children:[(0,s.jsx)("option",{value:"",disabled:!0,children:"选择对照录制"}),v.map(e=>(0,s.jsx)("option",{value:e.sessionId,children:function(e){let t=e.startedAt.length>=16?e.startedAt.slice(5,16):e.startedAt;return"".concat(t," \xb7 ").concat(function(e){let t=S(e);if(null===t)return"—";let r=Math.floor(t/1e3);if(r<1)return"不足1秒";let s=Math.floor(r/60),n=r%60;return s>0?"".concat(s,"分").concat(n,"秒"):"".concat(n,"秒")}(e)," \xb7 ").concat(e.eventCount," 事件")}(e)},e.sessionId))]}),(0,s.jsx)("button",{type:"button",onClick:m,className:"ml-auto rounded border border-gray-300 px-3 py-1 text-gray-600 hover:bg-gray-50",children:"退出对比"})]}),i?y?(0,s.jsx)("div",{className:"flex h-64 items-center justify-center text-gray-400",children:"加载回放中…"}):(0,s.jsx)(d._f,{base:j,target:N,baseError:f.error,targetError:p.error,onRetryError:g,renderError:(e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-600",children:[(0,s.jsxs)("span",{children:["对比加载失败:",e]}),(0,s.jsx)("button",{type:"button",onClick:t,className:"rounded border border-red-300 px-3 py-1 hover:bg-red-100",children:"重试"})]})},"".concat(o.sessionId,":").concat(i.sessionId)):(0,s.jsx)("div",{className:"flex h-64 items-center justify-center text-gray-400",children:"从上方对照下拉选择另一条录制后开始对比"})]})}var T=r(63718);function _(e){let{session:t}=e;return(0,s.jsxs)("div",{children:[t.sourceUrl?(0,s.jsx)("div",{className:"truncate text-sm font-medium text-gray-900",children:t.sourceUrl}):(0,s.jsx)("div",{className:"text-sm font-medium text-gray-400",children:"无来源页面"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[(0,s.jsxs)("span",{children:[t.eventCount," 事件"]}),"number"==typeof t.tabId?(0,s.jsxs)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600",children:["tab #",t.tabId]}):null]}),(0,s.jsx)("div",{className:"text-xs text-gray-400",children:(0,m.d3)(t.lastEventAt)}),(0,s.jsx)("div",{className:"truncate font-mono text-[10px] text-gray-300",children:t.sessionId})]})}function D(e){let{sessions:t,selectedId:r,onSelect:n,loading:l}=e,a=t.map(e=>({id:e.sessionId,content:(0,s.jsx)(_,{session:e})}));return(0,s.jsx)(T.L,{items:a,selectedId:r,onSelect:n,loading:l,emptyText:"暂无录制会话"})}function R(e){let t=new URLSearchParams;Object.entries(e).forEach(e=>{let[r,s]=e;void 0!==s&&(s||"compare"===r)&&t.set(r,s)});let r=t.toString();return r?"?".concat(r):""}function M(){let e=(0,l.useRouter)(),t=(0,l.usePathname)(),r=(0,l.useSearchParams)(),d=r.get("sessionId")||"",c=r.get("compare"),u=r.has("compare"),x=(0,n.useMemo)(()=>({q:r.get("q")||"",status:"",from:r.get("from")||"",to:r.get("to")||""}),[r]),[m,v]=(0,n.useState)([]),[h,b]=(0,n.useState)(!1),[g,f]=(0,n.useState)(!1),[p,y]=(0,n.useState)(!0),j=(0,n.useCallback)(r=>{var s,n;let l=null!==(s=r.filters)&&void 0!==s?s:x,a=void 0===r.compare?null!=c?c:void 0:null===r.compare?void 0:r.compare,o=R({sessionId:null!==(n=r.sessionId)&&void 0!==n?n:d,q:l.q,from:l.from,to:l.to,compare:a});e.replace("".concat(t).concat(o))},[x,d,c,t,e]),N=(0,n.useCallback)(()=>{let e=E(m,d)[0];j({compare:e?e.sessionId:""})},[m,d,j]),w=(0,n.useCallback)(()=>j({compare:null}),[j]),C=(0,n.useCallback)(e=>j({compare:e}),[j]),k=(0,n.useCallback)(()=>{c&&j({sessionId:c,compare:d})},[c,d,j]),S=(0,n.useCallback)(e=>{(null==e?void 0:e.withLoading)&&y(!0);let t=R({q:x.q,from:x.from,to:x.to});(0,a.requestJson)("/api/recordings-view/recordings?limit=200".concat(t.replace("?","&"))).then(e=>{v(t=>{var r;return function(e,t){let r=new Map(e.map(e=>[e.sessionId,e]));return t.map(e=>{let t=r.get(e.sessionId);return t&&t.eventCount===e.eventCount&&t.lastEventAt===e.lastEventAt&&t.tabId===e.tabId?t:{...e}})}(t,null!==(r=e.recordings)&&void 0!==r?r:[])}),b(!1),f(!1)}).catch(()=>{(null==e?void 0:e.withLoading)?b(!0):f(!0)}).finally(()=>{(null==e?void 0:e.withLoading)&&y(!1)})},[x.q,x.from,x.to]);(0,n.useEffect)(()=>{S({withLoading:!0})},[S]),(0,n.useEffect)(()=>{let e=setInterval(()=>S({withLoading:!1}),1e4);return()=>clearInterval(e)},[S]);let L=h?(0,s.jsxs)("div",{className:"flex h-full items-center justify-center gap-2 text-red-500",children:["加载失败",(0,s.jsx)("button",{type:"button",onClick:()=>S({withLoading:!0}),className:"text-blue-500 hover:underline",children:"重试"})]}):(0,s.jsxs)(s.Fragment,{children:[g&&(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-amber-100 bg-amber-50 px-3 py-1.5 text-xs text-amber-600",children:[(0,s.jsx)("span",{children:"列表更新失败,显示上次数据"}),(0,s.jsx)("button",{type:"button",onClick:()=>S({withLoading:!1}),className:"text-blue-500 hover:underline",children:"重试"})]}),(0,s.jsx)(D,{sessions:m,selectedId:d,onSelect:e=>j({sessionId:e}),loading:p})]}),q=d?m.find(e=>e.sessionId===d):void 0,U=u&&d?m.find(e=>e.sessionId===d):void 0,T=u&&c?m.find(e=>e.sessionId===c):void 0,_=d?u?U?(0,s.jsx)(A,{base:U,target:null!=T?T:null,sessions:m,onSelectTarget:C,onSwap:k,onExit:w}):p?(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"加载中…"}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-red-500",children:"未找到该录制会话"}):q?(0,s.jsx)(I,{session:q,onCompare:N}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-red-500",children:"未找到该录制会话"}):(0,s.jsx)("div",{className:"flex h-full items-center justify-center text-gray-400",children:"请在左侧选择一个录制会话查看详情"});return(0,s.jsx)(i.m,{filterBar:(0,s.jsx)(o.f,{value:x,onChange:e=>j({filters:e})}),listPanel:L,detailPanel:_})}var K=r(12789),P=r(33447);function O(){return(0,P.K5)()?(0,s.jsx)(K.D,{feature:"录制回放",localPath:"/recordings"}):(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{className:"p-6 text-gray-500",children:"加载中…"}),children:(0,s.jsx)(M,{})})}},37202:function(e,t,r){"use strict";r.d(t,{f:function(){return l}});var s=r(72835),n=r(60635);function l(e){let{value:t,showStatus:r,statusOptions:l,onChange:a}=e,[o,i]=(0,n.useState)(t);return(0,n.useEffect)(()=>{i(t)},[t.q,t.status,t.from,t.to]),(0,n.useEffect)(()=>{let e=setTimeout(()=>{(o.q!==t.q||o.status!==t.status||o.from!==t.from||o.to!==t.to)&&a(o)},300);return()=>clearTimeout(e)},[o.q,o.status,o.from,o.to]),(0,s.jsxs)("div",{className:"space-y-2 border-b border-gray-200 bg-white p-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)("input",{type:"text",value:o.q,onChange:e=>i(t=>({...t,q:e.target.value})),placeholder:"搜索关键词...",className:"w-full rounded border border-gray-300 px-2 py-1.5 pr-8 text-sm outline-none focus:border-blue-500"}),(0,s.jsx)("button",{type:"button",onClick:()=>a({q:"",status:"",from:"",to:""}),title:"重置筛选",className:"absolute right-1 top-1/2 -translate-y-1/2 rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 disabled:opacity-30",disabled:!o.q&&!o.status&&!o.from&&!o.to,children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),r?(0,s.jsxs)("select",{value:o.status,onChange:e=>i(t=>({...t,status:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500",children:[(0,s.jsx)("option",{value:"",children:"全部状态"}),(l||[]).map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]}):null]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"date",value:o.from,onChange:e=>i(t=>({...t,from:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"}),(0,s.jsx)("span",{className:"text-sm text-gray-400",children:"-"}),(0,s.jsx)("input",{type:"date",value:o.to,onChange:e=>i(t=>({...t,to:e.target.value})),className:"rounded border border-gray-300 px-2 py-1.5 text-sm outline-none focus:border-blue-500"})]})]})}},94518:function(e,t,r){"use strict";r.d(t,{m:function(){return n}});var s=r(72835);function n(e){let{filterBar:t,listPanel:r,detailPanel:n}=e;return(0,s.jsxs)("div",{className:"flex h-full",children:[(0,s.jsxs)("div",{className:"flex w-80 flex-col border-r border-gray-200 bg-white",children:[t,r]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto bg-gray-50 p-6",children:n})]})}},63718:function(e,t,r){"use strict";r.d(t,{L:function(){return l}});var s=r(72835),n=r(60635);function l(e){let{items:t,selectedId:r,onSelect:l,loading:a,emptyText:o="暂无数据",onLoadMore:i,loadingMore:d,exhausted:c}=e,u=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!i)return;let e=u.current;if(!e)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&i()},{root:e.closest(".overflow-auto"),rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[i]),(0,s.jsxs)("div",{className:"flex-1 overflow-auto",children:[a?(0,s.jsx)("div",{className:"p-4 text-center text-sm text-gray-400",children:"加载中…"}):0===t.length?(0,s.jsx)("div",{className:"p-4 text-center text-sm text-gray-400",children:o}):(0,s.jsx)("ul",{className:"divide-y divide-gray-100",children:t.map(e=>(0,s.jsx)("li",{role:"button",tabIndex:0,onClick:()=>l(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&l(e.id)},className:"cursor-pointer px-3 py-2 text-sm transition-colors ".concat(r===e.id?"bg-blue-50":"hover:bg-gray-50"),children:e.content},e.id))}),i&&!a&&t.length>0&&(0,s.jsx)("div",{ref:u,className:"p-3 text-center text-xs text-gray-400",children:d?"加载更多…":c?"没有更多了":""})]})}},12789:function(e,t,r){"use strict";r.d(t,{D:function(){return i},X:function(){return o}});var s=r(72835),n=r(60635),l=r(33447);function a(){var e;return null!==(e=window.hmdDesktop)&&void 0!==e?e:null}function o(e){var t;let{feature:r,localPath:o,children:i}=e,[d,c]=(0,n.useState)(null),u=!!(null===(t=a())||void 0===t?void 0:t.probeLocalServer);return((0,n.useEffect)(()=>{var e,t;if(!(0,l.K5)()||!u)return;let r=!1;return null===(t=a())||void 0===t||null===(e=t.probeLocalServer)||void 0===e||e.call(t).then(e=>{r||c((null==e?void 0:e.online)===!0)}).catch(()=>{r||c(!1)}),()=>{r=!0}},[u]),(0,l.K5)())?(0,s.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-5 py-8 text-center",children:[(0,s.jsxs)("div",{className:"text-sm font-medium text-amber-900",children:[r,"需在本机 HunterMate 中使用"]}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-md text-xs leading-5 text-amber-700",children:"这部分数据只保存在你的电脑上,云端工作台访问不到;数据互通不受影响。"}),u&&o?(0,s.jsx)("div",{className:"mt-4",children:!0===d?(0,s.jsx)("button",{onClick:()=>{var e,t;null===(t=a())||void 0===t||null===(e=t.openLocal)||void 0===e||e.call(t,o)},className:"rounded-lg bg-amber-600 px-4 py-2 text-sm text-white hover:bg-amber-700",children:"在本机 HunterMate 中打开"}):(0,s.jsx)("span",{className:"text-xs text-amber-600",children:"本机 HunterMate 未在运行,启动后即可跳转"})}):(0,s.jsx)("p",{className:"mt-4 text-xs text-amber-600",children:"请在本机打开 HunterMate 后使用此功能。"})]}):(0,s.jsx)(s.Fragment,{children:i})}function i(e){let{feature:t,localPath:r}=e;return(0,l.K5)()?(0,s.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,s.jsx)("div",{className:"w-full max-w-lg",children:(0,s.jsx)(o,{feature:t,localPath:r})})}):null}},8448:function(e,t,r){"use strict";function s(e){return e?("string"==typeof e?new Date(e):e).toLocaleString("zh-CN",{hour12:!1}):""}r.d(t,{d3:function(){return s}})}},function(e){e.O(0,[896,431,400,935,744],function(){return e(e.s=71428)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="97827b7b-5569-43ef-98c3-3f3999411d67",e._sentryDebugIdIdentifier="sentry-dbid-97827b7b-5569-43ef-98c3-3f3999411d67")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[514],{19155:function(e,t,s){Promise.resolve().then(s.bind(s,80611))},80611:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return I}});var r=s(72835),a=s(60635),l=s(74431),n=s(51140),i=s(96049),c=s(85018),o=s(5200),d=s(85673),u=s(86583),m=s(74800),h=s(16308),x=s(8425),p=s(95090);let y=["#2563eb","#16a34a","#f59e0b","#dc2626","#7c3aed","#0891b2"],f={hm:"hunter-mate",hmh:"harness 工具链",extra:"其他"},g={hm:"#2563eb",hmh:"#16a34a",extra:"#94a3b8"};function j(e){if(!Number.isFinite(e)||e<0)return"-";let t=["B","KB","MB","GB","TB"],s=e,r=0;for(;s>=1024&&r<t.length-1;)s/=1024,r++;return"".concat(s>=100||0===r?Math.round(s):s.toFixed(1)," ").concat(t[r])}function b(e){let t=new Date(e);return"".concat(String(t.getMonth()+1).padStart(2,"0"),"-").concat(String(t.getDate()).padStart(2,"0")," ").concat(String(t.getHours()).padStart(2,"0"),":").concat(String(t.getMinutes()).padStart(2,"0"))}function v(e){let t=new Date(e);return"".concat(String(t.getHours()).padStart(2,"0"),":").concat(String(t.getMinutes()).padStart(2,"0"),":").concat(String(t.getSeconds()).padStart(2,"0"))}function N(e){return e.group?e.group:e.key.startsWith("hunter-mate-h")?"hmh":e.key.startsWith("hunter-mate-")?"hm":"extra"}function w(e){return e.group?e.group:/hunter-mate-harness|chromepilot|hmx/i.test(e.cmd)||/hmx|chromepilot/i.test(e.name)?"hmh":"hm"}function S(e){let{title:t,children:s}=e;return(0,r.jsxs)("section",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[(0,r.jsx)("h3",{className:"mb-3 text-sm font-medium text-gray-700",children:t}),s]})}let k=(0,a.memo)(function(e){let{items:t}=e,s=Array.from(new Set(t.flatMap(e=>e.paths.map(e=>e.key)))),a=t.map(e=>{let t={ts:b(e.ts)};for(let s of e.paths)t[s.key]=Number((s.totalBytes/1073741824).toFixed(3));return t});return(0,r.jsx)(S,{title:"磁盘占用趋势(按受监控路径,GB)",children:(0,r.jsx)(n.h,{width:"100%",height:260,children:(0,r.jsxs)(i.T,{data:a,margin:{top:4,right:12,bottom:0,left:0},children:[(0,r.jsx)(c.q,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),(0,r.jsx)(o.K,{dataKey:"ts",tick:{fontSize:11},minTickGap:40}),(0,r.jsx)(d.B,{tick:{fontSize:11},width:56}),(0,r.jsx)(u.u,{formatter:e=>["".concat(e," GB"),void 0]}),(0,r.jsx)(m.D,{}),s.map((e,t)=>(0,r.jsx)(h.uN,{type:"monotone",dataKey:e,stroke:y[t%y.length],fill:y[t%y.length],fillOpacity:.15,name:e,connectNulls:!0},e))]})})})}),B=(0,a.memo)(function(e){let{p:t,diskTotalBytes:s}=e,a=N(t),l=s>0?(t.totalBytes/s*100).toFixed(1):null;return(0,r.jsx)(S,{title:"路径构成:".concat(t.key,"(").concat(f[a],")(").concat(t.path,")— 共 ").concat(j(t.totalBytes)).concat(null!==l?" \xb7 占总磁盘 ".concat(l,"%"):""),children:(0,r.jsx)(n.h,{width:"100%",height:Math.max(120,26*t.topEntries.length+40),children:(0,r.jsxs)(x.v,{data:t.topEntries,layout:"vertical",margin:{top:0,right:16,bottom:0,left:8},children:[(0,r.jsx)(c.q,{strokeDasharray:"3 3",stroke:"#e5e7eb",horizontal:!1}),(0,r.jsx)(o.K,{type:"number",tick:{fontSize:11},tickFormatter:e=>j(e)}),(0,r.jsx)(d.B,{type:"category",dataKey:"name",tick:{fontSize:11},width:180}),(0,r.jsx)(u.u,{formatter:e=>j(Number(e))}),(0,r.jsx)(p.$Q,{dataKey:"bytes",name:"占用",fill:g[a],radius:[0,3,3,0]})]})})})}),M=(0,a.memo)(function(e){var t,s,a;let{items:l}=e,n=l[l.length-1];if(!n)return null;let i=new Map;for(let e of n.paths.filter(e=>e.exists)){let t=N(e);i.set(t,(null!==(s=i.get(t))&&void 0!==s?s:0)+e.totalBytes)}let c=Array.from(i.entries()).sort((e,t)=>t[1]-e[1]),o=null!==(a=null===(t=n.totals)||void 0===t?void 0:t.diskTotalBytes)&&void 0!==a?a:0;return(0,r.jsx)(S,{title:"磁盘分组概览(hm / harness 工具链,占总磁盘比例)",children:(0,r.jsxs)("table",{className:"w-full text-xs text-gray-600",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-gray-100 text-left",children:[(0,r.jsx)("th",{className:"py-1 pr-4 font-medium",children:"分组"}),(0,r.jsx)("th",{className:"py-1 pr-4 font-medium",children:"占用"}),(0,r.jsx)("th",{className:"py-1 pr-4 font-medium",children:"占总磁盘"}),(0,r.jsx)("th",{className:"py-1 font-medium",children:"占比条"})]})}),(0,r.jsxs)("tbody",{children:[c.map(e=>{let[t,s]=e,a=o>0?s/o*100:null;return(0,r.jsxs)("tr",{className:"border-b border-gray-50",children:[(0,r.jsx)("td",{className:"py-1 pr-4",children:f[t]}),(0,r.jsx)("td",{className:"py-1 pr-4",children:j(s)}),(0,r.jsx)("td",{className:"py-1 pr-4",children:null===a?"-":"".concat(a.toFixed(1),"%")}),(0,r.jsx)("td",{className:"py-1",children:null!==a&&(0,r.jsx)("div",{className:"h-2 w-full min-w-[120px] rounded bg-gray-100",children:(0,r.jsx)("div",{className:"h-2 rounded",style:{width:"".concat(Math.min(100,a),"%"),background:g[t]}})})})]},t)}),!c.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:4,className:"py-2 text-gray-400",children:"本帧无路径数据"})})]})]})})}),P=(0,a.memo)(function(e){let{items:t,liveSamples:s}=e,a=s.length>0,l=a?s[s.length-1]:null,x=t[t.length-1],p=a?s.map(e=>{var t,s,r,a;if(e.groups)return{ts:v(e.ts),rssMBHm:Number((e.groups.hm.rssBytes/1048576).toFixed(1)),rssMBHmh:Number((e.groups.hmh.rssBytes/1048576).toFixed(1)),cpuHm:Number((null!==(t=e.groups.hm.cpuPercent)&&void 0!==t?t:0).toFixed(1)),cpuHmh:Number((null!==(s=e.groups.hmh.cpuPercent)&&void 0!==s?s:0).toFixed(1))};let l=0,n=0,i=0,c=0;for(let t of e.processes)"hmh"===w(t)?(n+=t.rssBytes,c+=null!==(r=t.cpuPercent)&&void 0!==r?r:0):(l+=t.rssBytes,i+=null!==(a=t.cpuPercent)&&void 0!==a?a:0);return{ts:v(e.ts),rssMBHm:Number((l/1048576).toFixed(1)),rssMBHmh:Number((n/1048576).toFixed(1)),cpuHm:Number(i.toFixed(1)),cpuHmh:Number(c.toFixed(1))}}):t.map(e=>{let t=0,s=0,r=0,a=0;for(let l of e.processes)"hmh"===w(l)?(s+=l.rssBytes,a+=l.cpuPercent):(t+=l.rssBytes,r+=l.cpuPercent);return{ts:b(e.ts),rssMBHm:Number((t/1048576).toFixed(1)),rssMBHmh:Number((s/1048576).toFixed(1)),cpuHm:Number(r.toFixed(1)),cpuHmh:Number(a.toFixed(1))}}),y=l?l.processes:x.processes;return(0,r.jsxs)(S,{title:a?"相关进程占用趋势(准实时 5s \xb7 按 hm / 工具链分开 \xb7 内存 MB / CPU %)":"相关进程占用趋势(按 hm / harness 工具链分开 \xb7 内存 MB / CPU %)",children:[(0,r.jsx)(n.h,{width:"100%",height:240,children:(0,r.jsxs)(i.T,{data:p,margin:{top:4,right:12,bottom:0,left:0},children:[(0,r.jsx)(c.q,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),(0,r.jsx)(o.K,{dataKey:"ts",tick:{fontSize:11},minTickGap:40}),(0,r.jsx)(d.B,{yAxisId:"mb",tick:{fontSize:11},width:52}),(0,r.jsx)(d.B,{yAxisId:"pct",orientation:"right",tick:{fontSize:11},width:44}),(0,r.jsx)(u.u,{}),(0,r.jsx)(m.D,{}),(0,r.jsx)(h.uN,{yAxisId:"mb",type:"monotone",dataKey:"rssMBHm",name:"hm 内存(MB)",stroke:g.hm,fill:g.hm,fillOpacity:.15,isAnimationActive:!1}),(0,r.jsx)(h.uN,{yAxisId:"mb",type:"monotone",dataKey:"rssMBHmh",name:"工具链内存(MB)",stroke:g.hmh,fill:g.hmh,fillOpacity:.15,isAnimationActive:!1}),(0,r.jsx)(h.uN,{yAxisId:"pct",type:"monotone",dataKey:"cpuHm",name:"hm CPU(%)",stroke:"#dc2626",fill:"#dc2626",fillOpacity:.1,isAnimationActive:!1}),(0,r.jsx)(h.uN,{yAxisId:"pct",type:"monotone",dataKey:"cpuHmh",name:"工具链 CPU(%)",stroke:"#f59e0b",fill:"#f59e0b",fillOpacity:.1,isAnimationActive:!1})]})}),(0,r.jsx)("div",{className:"mt-3 overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-xs text-gray-600",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-gray-100 text-left",children:[(0,r.jsx)("th",{className:"py-1 pr-4 font-medium",children:"分组"}),(0,r.jsx)("th",{className:"py-1 pr-4 font-medium",children:"PID"}),(0,r.jsx)("th",{className:"py-1 pr-4 font-medium",children:"进程"}),(0,r.jsx)("th",{className:"py-1 pr-4 font-medium",children:"RSS"}),(0,r.jsx)("th",{className:"py-1 pr-4 font-medium",children:"CPU%"})]})}),(0,r.jsxs)("tbody",{children:[y.map(e=>(0,r.jsxs)("tr",{className:"border-b border-gray-50",children:[(0,r.jsx)("td",{className:"py-1 pr-4",children:"hmh"===w(e)?"工具链":"hm"}),(0,r.jsx)("td",{className:"py-1 pr-4",children:e.pid}),(0,r.jsx)("td",{className:"max-w-[360px] truncate py-1 pr-4",title:e.cmd,children:e.cmd||e.name}),(0,r.jsx)("td",{className:"py-1 pr-4",children:j(e.rssBytes)}),(0,r.jsx)("td",{className:"py-1 pr-4",children:null===e.cpuPercent?"—":"".concat(e.cpuPercent,"%")})]},e.pid)),!y.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:5,className:"py-2 text-gray-400",children:"本帧无匹配进程"})})]})]})})]})});function F(e){var t;let{items:s,liveSamples:a=[]}=e,l=s[s.length-1];if(!l)return null;let n=l.paths.filter(e=>e.exists),i=null!==(t=l.totals)&&void 0!==t?t:null;return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("section",{className:"rounded-xl border border-gray-200 bg-white p-4",children:[(0,r.jsx)("h3",{className:"mb-2 text-sm font-medium text-gray-700",children:"系统信息"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-x-6 gap-y-1 text-xs text-gray-600",children:[(0,r.jsxs)("span",{children:["主机:",l.system.hostname]}),(0,r.jsxs)("span",{children:["用户:",l.system.username]}),(0,r.jsxs)("span",{children:["系统:",l.system.platform," ",l.system.osRelease,"(",l.system.arch,")"]}),(0,r.jsxs)("span",{children:["CPU:",l.system.cpuModel," \xd7 ",l.system.cpuCores," 核"]}),(0,r.jsxs)("span",{children:["内存:",j(l.system.totalMemBytes)]}),(0,r.jsxs)("span",{children:["快照:",new Date(l.ts).toLocaleString()]})]}),i&&(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap gap-x-6 gap-y-1 border-t border-gray-100 pt-2 text-xs text-gray-600",children:[(0,r.jsxs)("span",{children:["整机 CPU:",i.cpuPercent,"%"]}),(0,r.jsxs)("span",{children:["整机内存:",j(i.memUsedBytes)," / ",j(i.memTotalBytes),"(",i.memUsedPercent,"%)"]}),(0,r.jsxs)("span",{children:["整机磁盘:",j(i.diskUsedBytes)," / ",j(i.diskTotalBytes),"(",i.diskUsedPercent,"%)"]})]})]}),(0,r.jsx)(M,{items:s}),(0,r.jsx)(k,{items:s}),(0,r.jsx)(P,{items:s,liveSamples:a}),n.map(e=>{var t;return(0,r.jsx)(B,{p:e,diskTotalBytes:null!==(t=null==i?void 0:i.diskTotalBytes)&&void 0!==t?t:0},e.key)})]})}var H=s(12789),C=s(33447);let D=[{value:24,label:"最近 1 天"},{value:72,label:"最近 3 天"},{value:168,label:"最近 7 天"}];function I(){if((0,C.K5)())return(0,r.jsx)(H.D,{feature:"资源监控",localPath:"/resource-usage"});let[e,t]=(0,a.useState)(72),[s,n]=(0,a.useState)([]),[i,c]=(0,a.useState)([]),[o,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!0),[h,x]=(0,a.useState)(!1),[p,y]=(0,a.useState)(""),f=(0,a.useRef)(e),g=(0,a.useRef)(null),j=(0,a.useRef)(null);(0,a.useEffect)(()=>{f.current=e},[e]);let b=(0,a.useCallback)(async e=>{m(!0);try{var t;let s=await (0,l.requestJson)("/resource-usage/history?hours=".concat(e)),r=null!==(t=null==s?void 0:s.items)&&void 0!==t?t:[];n(r);let a=r[r.length-1];a&&(g.current=a.ts)}catch(e){n([]),y("历史快照加载失败,请稍后重试")}finally{m(!1)}},[]);(0,a.useEffect)(()=>{b(e)},[e,b]),(0,a.useEffect)(()=>{let e,t=!1,s=e=>{if(!t){if(!e.sampleIntervalMs||e.sampleIntervalMs<=0){d(!1);return}if(d(!0),e.last&&e.last.ts!==j.current){j.current=e.last.ts;let t=e.last;c(e=>{let s=[...e,t];return s.length>720?s.slice(s.length-720):s})}e.lastFullSnapshotTs&&e.lastFullSnapshotTs!==g.current&&(g.current=e.lastFullSnapshotTs,b(f.current))}};return(async()=>{var r,a,n,i;try{let e=await (0,l.requestJson)("/resource-usage/samples");if(t)return;if(null==e?void 0:null===(r=e.samples)||void 0===r?void 0:r.length){let t=e.samples.slice(-720);c(t),j.current=null!==(n=null===(a=t[t.length-1])||void 0===a?void 0:a.ts)&&void 0!==n?n:null}}catch(e){}(0,l.requestJson)("/resource-usage/collect-now",{method:"POST",headers:{"Content-Type":"application/json"}}).catch(()=>{});let o=null;try{o=await (0,l.requestJson)("/resource-usage/live")}catch(e){}o&&s(o),t||(e=setInterval(()=>{(0,l.requestJson)("/resource-usage/live").then(s).catch(()=>{})},Math.max(null!==(i=null==o?void 0:o.sampleIntervalMs)&&void 0!==i?i:5e3,2e3)))})(),()=>{t=!0,e&&clearInterval(e)}},[b]);let v=async()=>{x(!0),y("");try{var e;let t=await (0,l.requestJson)("/resource-usage/collect-now",{method:"POST",headers:{"Content-Type":"application/json"}});y((null===(e=t.report)||void 0===e?void 0:e.reported)?"已采集并上报 ".concat(t.report.reported," 条"):"已采集(本地)"),b(f.current)}catch(e){y("采集失败(查看 server 日志)")}finally{x(!1)}};return(0,r.jsx)("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:(0,r.jsxs)("div",{className:"mx-auto max-w-5xl",children:[(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-lg font-semibold text-gray-900",children:"资源占用"}),(0,r.jsxs)("p",{className:"text-xs text-gray-500",children:["hunter-mate / hunter-mate-harness 磁盘占用、相关进程内存 CPU 与系统配置(默认保留 3 天)",o&&" \xb7 进程准实时 5s"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("select",{value:e,onChange:e=>t(Number(e.target.value)),className:"rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700",children:D.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,r.jsx)("button",{type:"button",onClick:v,disabled:h,className:"rounded-lg bg-blue-600 px-3 py-1.5 text-sm text-white transition-colors hover:bg-blue-700 disabled:opacity-50",children:h?"采集中…":"立即采集"})]})]}),p&&(0,r.jsx)("p",{className:"mb-3 text-xs text-gray-500",children:p}),u?(0,r.jsx)("div",{className:"py-20 text-center text-sm text-gray-400",children:"加载中…"}):0===s.length?(0,r.jsxs)("div",{className:"rounded-xl border border-dashed border-gray-300 bg-white py-20 text-center",children:[(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"窗口内暂无快照"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-400",children:"server 每 5 分钟自动采集一帧,也可点「立即采集」"})]}):(0,r.jsx)(F,{items:s,liveSamples:i})]})})}},12789:function(e,t,s){"use strict";s.d(t,{D:function(){return c},X:function(){return i}});var r=s(72835),a=s(60635),l=s(33447);function n(){var e;return null!==(e=window.hmdDesktop)&&void 0!==e?e:null}function i(e){var t;let{feature:s,localPath:i,children:c}=e,[o,d]=(0,a.useState)(null),u=!!(null===(t=n())||void 0===t?void 0:t.probeLocalServer);return((0,a.useEffect)(()=>{var e,t;if(!(0,l.K5)()||!u)return;let s=!1;return null===(t=n())||void 0===t||null===(e=t.probeLocalServer)||void 0===e||e.call(t).then(e=>{s||d((null==e?void 0:e.online)===!0)}).catch(()=>{s||d(!1)}),()=>{s=!0}},[u]),(0,l.K5)())?(0,r.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-5 py-8 text-center",children:[(0,r.jsxs)("div",{className:"text-sm font-medium text-amber-900",children:[s,"需在本机 HunterMate 中使用"]}),(0,r.jsx)("p",{className:"mx-auto mt-2 max-w-md text-xs leading-5 text-amber-700",children:"这部分数据只保存在你的电脑上,云端工作台访问不到;数据互通不受影响。"}),u&&i?(0,r.jsx)("div",{className:"mt-4",children:!0===o?(0,r.jsx)("button",{onClick:()=>{var e,t;null===(t=n())||void 0===t||null===(e=t.openLocal)||void 0===e||e.call(t,i)},className:"rounded-lg bg-amber-600 px-4 py-2 text-sm text-white hover:bg-amber-700",children:"在本机 HunterMate 中打开"}):(0,r.jsx)("span",{className:"text-xs text-amber-600",children:"本机 HunterMate 未在运行,启动后即可跳转"})}):(0,r.jsx)("p",{className:"mt-4 text-xs text-amber-600",children:"请在本机打开 HunterMate 后使用此功能。"})]}):(0,r.jsx)(r.Fragment,{children:c})}function c(e){let{feature:t,localPath:s}=e;return(0,l.K5)()?(0,r.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,r.jsx)("div",{className:"w-full max-w-lg",children:(0,r.jsx)(i,{feature:t,localPath:s})})}):null}}},function(e){e.O(0,[865,431,400,935,744],function(){return e(e.s=19155)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb8dd785-275b-4dd0-958a-8de4a06b1ec1",e._sentryDebugIdIdentifier="sentry-dbid-eb8dd785-275b-4dd0-958a-8de4a06b1ec1")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[245],{41689:function(e,t,n){Promise.resolve().then(n.bind(n,48517))},48517:function(e,t,n){"use strict";n.d(t,{default:function(){return m}});var l=n(72835),s=n(60635),d=n(74431),i=n(67002),o=n(33447),a=n(21260),r=n(21717);let c={not_found:"分享链接不存在、已失效,或你没有访问权限",expired:"分享链接已过期,请让分享者重新生成",revoked:"分享已被分享者撤销",out_of_scope:"你不在本次分享的范围内,请联系分享者"},u={recommended:"已推荐",pending_invite:"待邀请",invited:"已邀请",replied:"已回复",interview_scheduled:"已约面试",offer:"Offer",onboarding:"已入职",rejected:"已拒绝"};function m(){var e;let[t,n]=(0,s.useState)({kind:"loading"}),[r,u]=(0,s.useState)("");return(0,s.useEffect)(()=>{let e=window.location.pathname.match(/\/shared\/([^/]+)/);u((null==e?void 0:e[1])?decodeURIComponent(e[1]):"")},[]),(0,s.useEffect)(()=>{if(r)return e(),(0,o.K5)()?(0,a.RB)(()=>void e()):(0,i.Lc)(()=>void e());async function e(){let e=(0,o.K5)()?(0,a.xq)():(0,i.Xc)();if(!e){n({kind:"need-login"});return}let t=await fetch((0,o.K5)()?"".concat((0,o.XJ)(),"/hunter-mate/shares/").concat(encodeURIComponent(r),"/data"):"".concat((0,d.Ox)(),"/shared/").concat(encodeURIComponent(r),"/data"),{headers:{Authorization:"".concat((0,o.K5)()?"HMJWT":"UTOKEN"," ").concat(e)},cache:"no-store"});if(401===t.status){n({kind:"need-login"});return}let l=await t.json().catch(()=>({}));if(!t.ok){var s,c,u;n({kind:"error",code:null!==(c=null!==(s=null==l?void 0:l.errorCode)&&void 0!==s?s:null==l?void 0:l.code)&&void 0!==c?c:"not_found",message:null!==(u=null==l?void 0:l.message)&&void 0!==u?u:""});return}n({kind:"ok",data:l})}},[r]),(0,l.jsx)("div",{className:"h-full overflow-auto p-6",children:(0,l.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,l.jsx)("h1",{className:"mb-1 text-lg font-semibold",children:"同事分享的职位推荐"}),"loading"===t.kind?(0,l.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:"加载中…"}):null,"need-login"===t.kind?(0,l.jsx)("div",{className:"mt-4 rounded border border-amber-200 bg-amber-50 px-4 py-6 text-center text-sm text-amber-800",children:"请先登录本地 hm(左下角登录),登录后本页会自动加载分享内容。"}):null,"error"===t.kind?(0,l.jsxs)("div",{className:"mt-4 rounded border border-red-200 bg-red-50 px-4 py-6 text-center text-sm text-red-700",children:[null!==(e=c[t.code])&&void 0!==e?e:c.not_found,t.message?(0,l.jsx)("div",{className:"mt-1 text-xs text-red-400",children:t.message}):null]}):null,"ok"===t.kind?(0,l.jsx)(v,{data:t.data}):null]})})}function v(e){var t,n,d,i,o,a,c,m,v,x,h,f,b;let{data:p}=e,g=null!==(c=p.recommendations)&&void 0!==c?c:[],[j,y]=(0,s.useState)(null),N=null!==(m=p.jobCaseRef)&&void 0!==m?m:null,w=null===(t=p.jobCase)||void 0===t?void 0:t.id;return(0,l.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsxs)("div",{children:[null!=N||null!=w?(0,l.jsx)("a",{href:null!=N?"/jobs?job=".concat(encodeURIComponent(N)):"/jobs?id=".concat(w),title:"点击打开职位详情",className:"text-base font-medium text-blue-600 hover:underline",children:null!==(v=null===(n=p.jobCase)||void 0===n?void 0:n.title)&&void 0!==v?v:"职位 ".concat(null!=N?N:"#".concat(w))}):(0,l.jsx)("div",{className:"text-base font-medium",children:null!==(x=null===(d=p.jobCase)||void 0===d?void 0:d.title)&&void 0!==x?x:"职位"}),(0,l.jsxs)("div",{className:"mt-0.5 text-xs text-gray-500",children:["分享者:",(null===(i=p.fromUser)||void 0===i?void 0:i.email)||"#".concat(null===(o=p.fromUser)||void 0===o?void 0:o.hmUserId),p.expiresAt?" \xb7 有效期至 ".concat(new Date(p.expiresAt).toLocaleString()):""]})]}),(0,l.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:null!==(h=null===(a=p.jobCase)||void 0===a?void 0:a.status)&&void 0!==h?h:""})]}),p.note?(0,l.jsx)("div",{className:"mt-2 rounded bg-blue-50 px-3 py-2 text-sm text-blue-800",children:p.note}):null]}),(0,l.jsxs)("div",{className:"text-xs text-gray-500",children:["共 ",g.length," 位推荐人才(只读快照,实时数据以分享者本地为准)"]}),g.map(e=>{var t,n,s,d,i,o,a,r;let c=null!==(a=null!==(o=null===(t=e.snapshot)||void 0===t?void 0:t.name)&&void 0!==o?o:e.portraitName)&&void 0!==a?a:"推荐 #".concat(e.id.slice(0,8)),m=null!=e.entityId;return(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4".concat(m?" cursor-pointer transition-shadow hover:shadow-md":""),title:m?"点击查看人才详情":void 0,onClick:m?()=>y({entityId:e.entityId,name:c}):void 0,children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("div",{className:"font-medium".concat(m?" text-blue-600":""),children:c}),(0,l.jsx)("span",{className:"rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700",children:null!==(r=u[e.stage])&&void 0!==r?r:e.stage})]}),(null===(n=e.snapshot)||void 0===n?void 0:n.headline)?(0,l.jsx)("div",{className:"mt-1 text-xs text-gray-500",children:e.snapshot.headline}):null,"number"==typeof(null===(d=e.scores)||void 0===d?void 0:null===(s=d.dimensions)||void 0===s?void 0:s.overall)?(0,l.jsxs)("div",{className:"mt-1 text-xs text-gray-500",children:["综合匹配分:",e.scores.dimensions.overall]}):null,(null===(i=e.scores)||void 0===i?void 0:i.aiReason)?(0,l.jsx)("pre",{className:"mt-2 whitespace-pre-wrap rounded bg-gray-50 p-2 text-xs text-gray-600",children:e.scores.aiReason}):null]},e.id)}),g.length?null:(0,l.jsx)("div",{className:"py-8 text-center text-sm text-gray-400",children:"该职位暂无推荐人才"}),(0,l.jsx)(r.I,{entityId:null!==(f=null==j?void 0:j.entityId)&&void 0!==f?f:null,name:null!==(b=null==j?void 0:j.name)&&void 0!==b?b:"",open:null!=j,onClose:()=>y(null)})]})}},21717:function(e,t,n){"use strict";n.d(t,{I:function(){return u}});var l=n(72835),s=n(60635),d=n(95909),i=n(86892),o=n(87018),a=n(6443),r=n(74431),c=n(32587);function u(e){var t;let{entityId:n,name:u,open:m,onClose:v}=e,[x,h]=(0,s.useState)(null),[f,b]=(0,s.useState)([]),[p,g]=(0,s.useState)(null),[j,y]=(0,s.useState)(null),[N,w]=(0,s.useState)(!1),[k,I]=(0,s.useState)(!1),[_,C]=(0,s.useState)(0);return(0,s.useEffect)(()=>{if(!m||null==n)return;let e=!0;return w(!0),I(!1),h(null),b([]),g(null),y(null),Promise.all([(0,r.requestJson)("/entities/talent/".concat(n)),(0,r.requestJson)("/entities/talent/".concat(n,"/sources")).catch(()=>null),(0,r.requestJson)("/entities/talent/".concat(n,"/matches")).catch(()=>null)]).then(t=>{var n,l;let[s,d,i]=t;e&&(h(s.entity),b(d?d.items:[]),g(null!==(n=null==i?void 0:i.portraitId)&&void 0!==n?n:null),y(null!==(l=null==i?void 0:i.matches)&&void 0!==l?l:[]))}).catch(()=>{e&&I(!0)}).finally(()=>{e&&w(!1)}),()=>{e=!1}},[m,n,_]),(0,l.jsx)(d.Z,{title:null!==(t=null==x?void 0:x.name)&&void 0!==t?t:u,placement:"right",width:860,open:m,onClose:v,destroyOnHidden:!0,children:N?(0,l.jsx)(i.Z,{active:!0,paragraph:{rows:8}}):k?(0,l.jsx)(o.Z,{type:"error",message:"人才详情加载失败",description:(0,l.jsx)(a.ZP,{size:"small",onClick:()=>C(e=>e+1),children:"重试"})}):x?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.n,{entity:x}),(0,l.jsx)(c.z,{entity:x,portraitId:p,matches:j,sources:f})]}):null})}}},function(e){e.O(0,[603,882,431,587,400,935,744],function(){return e(e.s=41689)}),_N_E=e.O()}]);
|
package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-c44bee385e0bca9a.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="38c07d1b-8af7-4a11-bd03-df467e6ae5e4",e._sentryDebugIdIdentifier="sentry-dbid-38c07d1b-8af7-4a11-bd03-df467e6ae5e4")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[325],{71765:function(e,n,t){Promise.resolve().then(t.bind(t,24492))},27473:function(e,n,t){"use strict";var r=t(38321);t.o(r,"useParams")&&t.d(n,{useParams:function(){return r.useParams}}),t.o(r,"usePathname")&&t.d(n,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")&&t.d(n,{useRouter:function(){return r.useRouter}}),t.o(r,"useSearchParams")&&t.d(n,{useSearchParams:function(){return r.useSearchParams}}),t.o(r,"useServerInsertedHTML")&&t.d(n,{useServerInsertedHTML:function(){return r.useServerInsertedHTML}})},24492:function(e,n,t){"use strict";t.d(n,{default:function(){return o}});var r=t(72835),a=t(60635),s=t(27473),u=t(74431);function o(){let e=(0,s.useParams)().id,[n,t]=(0,a.useState)(null),[o,i]=(0,a.useState)(!1),[d,c]=(0,a.useState)(!1),[f,l]=(0,a.useState)(null);async function h(){i(!0),l(null);try{let n=await fetch("".concat((0,u.Ox)(),"/parsing/snapshots/").concat(e,"/agent-prompt"));if(!n.ok)throw Error("HTTP ".concat(n.status));let r=await n.json();t(r.prompt)}catch(e){l(e.message)}finally{i(!1)}}async function p(){n&&(await navigator.clipboard.writeText(n),c(!0),setTimeout(()=>c(!1),2e3))}return(0,r.jsxs)("div",{style:{padding:24,maxWidth:800,margin:"0 auto"},children:[(0,r.jsx)("h1",{children:"Agent 解析 Prompt"}),(0,r.jsxs)("p",{children:["Snapshot ID: ",e]}),(0,r.jsx)("button",{onClick:h,disabled:o,children:o?"加载中...":"生成 Prompt"}),f&&(0,r.jsx)("div",{style:{color:"red",marginTop:12},children:f}),n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:p,style:{marginLeft:12},children:d?"已复制 ✅":"复制到剪贴板"}),(0,r.jsx)("pre",{style:{marginTop:16,padding:16,background:"#f5f5f5",borderRadius:8,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:n})]})]})}}},function(e){e.O(0,[431,400,935,744],function(){return e(e.s=71765)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3ca6ac0c-cf97-405e-9eca-a52ea996d0d5",e._sentryDebugIdIdentifier="sentry-dbid-3ca6ac0c-cf97-405e-9eca-a52ea996d0d5")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[93],{85539:function(e,n,r){Promise.resolve().then(r.bind(r,59659))},27473:function(e,n,r){"use strict";var u=r(38321);r.o(u,"useParams")&&r.d(n,{useParams:function(){return u.useParams}}),r.o(u,"usePathname")&&r.d(n,{usePathname:function(){return u.usePathname}}),r.o(u,"useRouter")&&r.d(n,{useRouter:function(){return u.useRouter}}),r.o(u,"useSearchParams")&&r.d(n,{useSearchParams:function(){return u.useSearchParams}}),r.o(u,"useServerInsertedHTML")&&r.d(n,{useServerInsertedHTML:function(){return u.useServerInsertedHTML}})}},function(e){e.O(0,[431,587,987,659,400,935,744],function(){return e(e.s=85539)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9239b9ec-a19b-4c6a-bf4a-c22189f52872",e._sentryDebugIdIdentifier="sentry-dbid-9239b9ec-a19b-4c6a-bf4a-c22189f52872")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14],{80812:function(e,t,n){Promise.resolve().then(n.bind(n,21670))},21670:function(e,t,n){"use strict";n.d(t,{default:function(){return x}});var l=n(72835),r=n(60635),a=n(74431),s=n(67002),i=n(65777);let o=[{key:"today",label:"今天"},{key:"yesterday",label:"昨天"},{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"last7",label:"近 7 天"},{key:"custom",label:"自定义"}],d={recommended:"已推荐",pending_invite:"待邀请",invited:"已邀请",replied:"已回复",interview_scheduled:"已约面试",offer:"Offer",onboarding:"已入职",rejected:"已拒绝"},u={create:"建档",move:"阶段迁移",form:"保存表单",invite:"记录邀请",invite_approved:"批准邀请",note:"备注",delete:"移出流程"};function c(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function m(e){let{actorType:t}=e;return"agent"===t?(0,l.jsx)("span",{className:"rounded bg-purple-100 px-1.5 py-0.5 text-xs text-purple-700",children:"agent 代操作"}):"human"===t?(0,l.jsx)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-xs text-emerald-700",children:"本人操作"}):(0,l.jsx)("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-500",children:"来源不明"})}function x(){var e,t,n,x,h;let[y,p]=(0,r.useState)(null),[v,f]=(0,r.useState)(null),[b,j]=(0,r.useState)("last7"),[N,I]=(0,r.useState)(""),[S,w]=(0,r.useState)(""),[k,T]=(0,r.useState)(null),[D,E]=(0,r.useState)(!1),[O,U]=(0,r.useState)(null),{sync:_}=(0,i.nu)(),C=null!==(e=null==_?void 0:_.activeTenantId)&&void 0!==e?e:null,A=(0,r.useCallback)(()=>{(0,a.requestJson)("/team/members").then(e=>{let t=Array.isArray(null==e?void 0:e.items)?e.items:[];p(t),f(e=>{var n,l;return null!=e&&t.some(t=>t.hmUserId===e)?e:null!==(l=null===(n=t[0])||void 0===n?void 0:n.hmUserId)&&void 0!==l?l:null})}).catch(()=>{})},[C]);(0,r.useEffect)(()=>(A(),(0,s.Lc)(A)),[A]);let q=(0,r.useCallback)(async()=>{if(null==v)return;E(!0),U(null);let{from:e,to:t}=function(e,t,n){let l=c(new Date);switch(e){case"today":return{from:l.toISOString(),to:new Date(l.getTime()+864e5).toISOString()};case"yesterday":return{from:new Date(l.getTime()-864e5).toISOString(),to:l.toISOString()};case"week":{let e=(l.getDay()+6)%7;return{from:new Date(l.getTime()-864e5*e).toISOString(),to:new Date(l.getTime()+864e5).toISOString()}}case"month":return{from:new Date(l.getFullYear(),l.getMonth(),1).toISOString(),to:new Date(l.getTime()+864e5).toISOString()};case"custom":return{from:t?c(new Date("".concat(t,"T00:00:00"))).toISOString():l.toISOString(),to:n?new Date(c(new Date("".concat(n,"T00:00:00"))).getTime()+864e5).toISOString():new Date(l.getTime()+864e5).toISOString()};default:return{from:new Date(l.getTime()-5184e5).toISOString(),to:new Date(l.getTime()+864e5).toISOString()}}}(b,N,S);try{let n=await (0,a.requestJson)("/team/insights?hmUserId=".concat(v,"&from=").concat(encodeURIComponent(e),"&to=").concat(encodeURIComponent(t)));T(n)}catch(e){U("加载失败:未登录云端账号、与对方不在同一公司租户,或云服务不可达"),T(null)}finally{E(!1)}},[v,b,N,S,C]);(0,r.useEffect)(()=>(q(),(0,s.Lc)(()=>void q())),[q]);let P=null==k?void 0:k.summary,R=(0,r.useMemo)(()=>{var e;return Object.entries(null!==(e=null==P?void 0:P.terminal)&&void 0!==e?e:{})},[P]);return(0,l.jsx)("div",{className:"h-full overflow-auto p-6",children:(0,l.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,l.jsx)("h1",{className:"mb-4 text-lg font-semibold",children:"同事工作统计"}),(0,l.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-gray-200 bg-white p-3",children:[(0,l.jsxs)("label",{className:"text-sm text-gray-600",children:["同事:",(0,l.jsxs)("select",{value:null!=v?v:"",onChange:e=>f(Number(e.target.value)),className:"ml-2 rounded border border-gray-300 px-2 py-1 text-sm",children:[null===y?(0,l.jsx)("option",{children:"加载中…"}):null,(null!=y?y:[]).map(e=>(0,l.jsxs)("option",{value:e.hmUserId,children:[e.name,"(",e.email,")"]},e.hmUserId))]})]}),(0,l.jsx)("div",{className:"flex gap-1",children:o.map(e=>(0,l.jsx)("button",{onClick:()=>j(e.key),className:"rounded px-2.5 py-1 text-xs ".concat(b===e.key?"bg-blue-100 font-medium text-blue-800":"text-gray-500 hover:bg-gray-100"),children:e.label},e.key))}),"custom"===b?(0,l.jsxs)("span",{className:"flex items-center gap-1 text-sm",children:[(0,l.jsx)("input",{type:"date",value:N,onChange:e=>I(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm"}),"~",(0,l.jsx)("input",{type:"date",value:S,onChange:e=>w(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm"})]}):null]}),O?(0,l.jsx)("div",{className:"mb-4 rounded border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:O}):null,D?(0,l.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:"加载中…"}):null,!D&&k?(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[(0,l.jsx)(g,{label:"区间新建推荐",value:null!==(t=null==P?void 0:P.recsTotal)&&void 0!==t?t:0}),(0,l.jsx)(g,{label:"agent 代操作",value:null!==(n=null==P?void 0:P.recsByAgent)&&void 0!==n?n:0,tone:"purple"}),(0,l.jsx)(g,{label:"本人操作",value:null!==(x=null==P?void 0:P.recsByHuman)&&void 0!==x?x:0,tone:"green"}),(0,l.jsx)(g,{label:"来源不明(存量)",value:null!==(h=null==P?void 0:P.recsUnknown)&&void 0!==h?h:0,tone:"gray"})]}),R.length?(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-3 text-sm",children:[(0,l.jsx)("span",{className:"mr-2 text-xs text-gray-500",children:"终端阶段:"}),R.map(e=>{var t;let[n,r]=e;return(0,l.jsxs)("span",{className:"mr-3",children:[null!==(t=d[n])&&void 0!==t?t:n," ",(0,l.jsx)("b",{children:r})]},n)})]}):null,(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white",children:[(0,l.jsx)("div",{className:"border-b border-gray-100 px-4 py-2 text-sm font-medium",children:"分职位产出"}),k.jobs.length?(0,l.jsxs)("table",{className:"w-full text-sm",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"text-left text-xs text-gray-400",children:[(0,l.jsx)("th",{className:"px-4 py-2",children:"职位"}),(0,l.jsx)("th",{className:"px-2 py-2",children:"推荐数"}),(0,l.jsx)("th",{className:"px-2 py-2",children:"agent"}),(0,l.jsx)("th",{className:"px-2 py-2",children:"本人"}),(0,l.jsx)("th",{className:"px-2 py-2",children:"不明"}),(0,l.jsx)("th",{className:"px-4 py-2",children:"阶段分布"})]})}),(0,l.jsx)("tbody",{children:k.jobs.map(e=>(0,l.jsxs)("tr",{className:"border-t border-gray-50",children:[(0,l.jsxs)("td",{className:"px-4 py-2",children:[e.title,e.status?(0,l.jsxs)("span",{className:"ml-1 text-xs text-gray-400",children:["(",e.status,")"]}):null]}),(0,l.jsx)("td",{className:"px-2 py-2 font-medium",children:e.recsTotal}),(0,l.jsx)("td",{className:"px-2 py-2 text-purple-600",children:e.byAgent}),(0,l.jsx)("td",{className:"px-2 py-2 text-emerald-600",children:e.byHuman}),(0,l.jsx)("td",{className:"px-2 py-2 text-gray-400",children:e.byUnknown}),(0,l.jsx)("td",{className:"px-4 py-2 text-xs text-gray-500",children:Object.entries(e.stageDist).map(e=>{var t;let[n,l]=e;return"".concat(null!==(t=d[n])&&void 0!==t?t:n," ").concat(l)}).join(" / ")})]},e.jobCaseId))})]}):(0,l.jsx)("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:"该区间无推荐产出"})]}),(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white",children:[(0,l.jsxs)("div",{className:"border-b border-gray-100 px-4 py-2 text-sm font-medium",children:["操作时间线(区间内 ",k.timeline.length," 条)"]}),k.timeline.length?(0,l.jsx)("ul",{className:"divide-y divide-gray-50",children:k.timeline.map((e,t)=>{var n,r;return(0,l.jsxs)("li",{className:"flex items-center gap-3 px-4 py-2 text-sm",children:[(0,l.jsx)("span",{className:"w-32 shrink-0 text-xs text-gray-400",children:new Date(e.at).toLocaleString()}),(0,l.jsx)(m,{actorType:e.actorType}),(0,l.jsx)("span",{className:"font-medium",children:e.talentName||"—"}),(0,l.jsxs)("span",{className:"text-xs text-gray-500",children:[null!==(n=u[e.action])&&void 0!==n?n:e.action,e.toStage?" → ".concat(null!==(r=d[e.toStage])&&void 0!==r?r:e.toStage):""]}),(0,l.jsx)("span",{className:"ml-auto truncate text-xs text-gray-400",children:e.jobTitle})]},"".concat(e.at,"-").concat(t))})}):(0,l.jsx)("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:"该区间无操作记录"})]})]}):null,D||k||O?null:(0,l.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:y&&!y.length?"暂无公司租户同事(加入公司租户后可用)":"选择同事与时间段查看统计"})]})})}function g(e){let{label:t,value:n,tone:r}=e;return(0,l.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[(0,l.jsx)("div",{className:"text-xs text-gray-500",children:t}),(0,l.jsx)("div",{className:"mt-1 text-2xl font-semibold ".concat("purple"===r?"text-purple-700":"green"===r?"text-emerald-700":"gray"===r?"text-gray-500":"text-gray-900"),children:n})]})}},65777:function(e,t,n){"use strict";let l;n.d(t,{Cd:function(){return O},Xc:function(){return _},aG:function(){return D},cp:function(){return E},nu:function(){return T},tQ:function(){return U}});var r=n(60635),a=n(74431),s=n(67002),i=n(33447),o=n(21260),d=n(28431),u=n(60529);let c=null,m=null,x=null,g=new Set;function h(){g.forEach(e=>e())}function y(e){c=c?{...c,refreshing:e}:{...S,refreshing:e},h()}function p(e){if(void 0===l){l=e;return}if(e!==l){l=e;try{window.localStorage.removeItem("hm-view-mode")}catch(e){}}}async function v(){try{return await (0,a.requestJson)("/auth/session")}catch(e){return null}}async function f(e){let t=new Headers,n=(0,s.Xc)();n&&t.set("Authorization","UTOKEN ".concat(n));try{return await (0,a.requestJson)(e,{headers:t})}catch(e){return null}}async function b(){y(!0);try{var e,t,n,l,r,s,i,u,m;let x=(0,o.xq)();if(!x){(0,d.nZ)(),c={...S,session:{loggedIn:!1},refreshing:!1,authStatus:"out"},h();return}let g=await (0,a.requestJson)("/hunter-mate/sync/state?heads=0");(0,d.YZ)(null!==(e=g.activeTenantId)&&void 0!==e?e:null);let y=(0,o.OG)(x);p(null!==(n=null!==(t=g.hmUserId)&&void 0!==t?t:y.hmUserId)&&void 0!==n?n:null),c={session:{loggedIn:!0,email:null!==(l=y.email)&&void 0!==l?l:void 0,hmUserId:null!==(s=null!==(r=g.hmUserId)&&void 0!==r?r:y.hmUserId)&&void 0!==s?s:void 0,token:x},sync:{loggedIn:!0,enabled:!0,activeTenantId:(0,d.MA)(),serverSuggestedTenantId:null!==(i=g.activeTenantId)&&void 0!==i?i:null,memberships:null!==(u=g.memberships)&&void 0!==u?u:[],pendingCounts:null!==(m=g.pendingCounts)&&void 0!==m?m:[]},utoken:x,loadError:null,refreshing:!1,authStatus:"in",refresh:N},h()}catch(e){c=c?{...c,loadError:"云端无响应"}:{...S,loadError:"云端无响应"},h()}finally{(null==c?void 0:c.refreshing)&&y(!1)}}async function j(){if((0,i.K5)())return b();y(!0);try{var e;let[t,n]=await Promise.all([v(),f("/datasync/state")]),l=(null==t?void 0:t.loggedIn)&&t.token?t.token:null,r=null!=n?n:null;!r&&t&&l&&l!==(0,s.Xc)()?((0,s.GK)(l),r=await f("/datasync/state")):(0,s.GK)(l),p((null==t?void 0:t.loggedIn)&&null!==(e=t.hmUserId)&&void 0!==e?e:null);let a=!!((null==t?void 0:t.loggedIn)||(null==r?void 0:r.loggedIn));if(!t&&!r){c=c?{...c,loadError:"本地服务无响应"}:{...S,loadError:"本地服务无响应"},h();return}c={session:null!=t?t:{loggedIn:!1},sync:r,utoken:(0,s.Xc)(),loadError:null,refreshing:!1,authStatus:a?"in":"out",refresh:N},h()}finally{(null==c?void 0:c.refreshing)&&y(!1)}}function N(){return m||(m=j().finally(()=>{m=null}))}function I(e){return g.add(e),1===g.size&&(N(),x=setInterval(()=>void N(),6e4)),()=>{g.delete(e),0===g.size&&x&&(clearInterval(x),x=null)}}let S={session:null,sync:null,utoken:null,loadError:null,refreshing:!1,authStatus:"loading",refresh:N};function w(){return null!=c?c:S}function k(){return w()}function T(){return(0,r.useSyncExternalStore)(I,w,k)}function D(e){var t;return(null!==(t=null==e?void 0:e.memberships)&&void 0!==t?t:[]).filter(e=>!e.isPersonal&&!e.leftAt)}function E(e){var t,n;let l=null!==(t=null==e?void 0:e.activeTenantId)&&void 0!==t?t:null;if(null==l)return null;let r=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===l&&!e.leftAt);return!r||r.isPersonal?null:l}function O(e,t){var n,l;if(!t)return null;let r=(null!==(n=null==e?void 0:e.memberships)&&void 0!==n?n:[]).find(e=>e.tenantId===t&&!e.leftAt&&!e.isPersonal);return null!==(l=null==r?void 0:r.role)&&void 0!==l?l:null}function U(){return u.env.NEXT_PUBLIC_HUNTER_MATE_SERVER_URL||""}function _(){return(0,s.Xc)()}}},function(e){e.O(0,[431,400,935,744],function(){return e(e.s=80812)}),_N_E=e.O()}]);
|