hunter-mate 0.1.18 → 0.1.19
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/background/{service-worker.20261002143654.js → service-worker.20261008011501.js} +868 -142
- package/dist/assets/extension/background/service-worker.js +868 -142
- package/dist/assets/extension/build-info.json +1 -1
- package/dist/assets/extension/content/control-runtime.js +1028 -0
- package/dist/assets/extension/content/index.js +35 -0
- package/dist/assets/extension/manifest.json +4 -3
- package/dist/assets/extension/offscreen/offscreen.html +1 -1
- package/dist/assets/extension/offscreen/offscreen.js +2 -2
- package/dist/assets/extension/package.json +1 -1
- package/dist/assets/extension/sidepanel/index.css +1 -1
- package/dist/assets/extension/sidepanel/index.html +1 -1
- package/dist/assets/extension/sidepanel/index.js +23 -14
- package/dist/assets/server/main.mjs +10015 -4786
- package/dist/index.js +849 -318
- package/dist/web/dist/404.html +1 -1
- package/dist/web/dist/_next/static/{N_4Eb07x7RNgd3O5ubXrJ → 9Wm8FfXwBJyMk-wYf4l81}/_ssgManifest.js +1 -1
- package/dist/web/dist/_next/static/chunks/542-4a43545450151f1d.js +1 -0
- package/dist/web/dist/_next/static/chunks/670-750aa43678fb0d30.js +1 -0
- package/dist/web/dist/_next/static/chunks/852-5150a7ae95a599fb.js +1 -0
- package/dist/web/dist/_next/static/chunks/{935-bb4adb3868af4cd4.js → 935-4058f12c3d405b32.js} +4 -4
- package/dist/web/dist/_next/static/chunks/app/admin/data/page-a566c6b13c61f9d4.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/companies/page-058047767bc162f4.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/company/admin/page-a2088b59c3820800.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/jobs/page-4fb6a67d044b238d.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/layout-1feb99bf08beb3c8.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/page-c6714cec1ffd7c5e.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/page-658eca1ae5ca29dc.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/page-291cd145a56bd020.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/parselog/page-b1b7ae9483273ce0.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/recordings/page-c12948f01885099e.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/resource-usage/{page-3b8bd27536a7889a.js → page-8394e96892688180.js} +1 -1
- package/dist/web/dist/_next/static/chunks/app/shared/[token]/page-e859e87f2301b120.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-f519552be54e3bdf.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/talents/page-75af05473ea322d9.js +1 -0
- package/dist/web/dist/_next/static/chunks/app/team/insights/page-7b8769e35cd9987b.js +1 -0
- package/dist/web/dist/_next/static/chunks/{main-ead3ac50aa4bc931.js → main-8d45182e1c21cb95.js} +1 -1
- package/dist/web/dist/_next/static/chunks/{main-app-7e48cd6f6a954fec.js → main-app-70da092dee991648.js} +1 -1
- package/dist/web/dist/_next/static/chunks/pages/{_app-97da3522926feed4.js → _app-8438560f1c1a7980.js} +3 -3
- package/dist/web/dist/_next/static/css/9eaf0c9cc1c24641.css +3 -0
- package/dist/web/dist/admin/data.html +1 -1
- package/dist/web/dist/admin/data.txt +3 -3
- package/dist/web/dist/auth/verify.html +1 -1
- package/dist/web/dist/auth/verify.txt +2 -2
- package/dist/web/dist/companies.html +1 -1
- package/dist/web/dist/companies.txt +7 -6
- package/dist/web/dist/company/admin.html +1 -1
- package/dist/web/dist/company/admin.txt +3 -3
- package/dist/web/dist/entity.html +1 -1
- package/dist/web/dist/entity.txt +2 -2
- package/dist/web/dist/index.html +1 -1
- package/dist/web/dist/index.txt +3 -3
- package/dist/web/dist/jobs.html +1 -1
- package/dist/web/dist/jobs.txt +3 -3
- package/dist/web/dist/logs.html +1 -1
- package/dist/web/dist/logs.txt +2 -2
- package/dist/web/dist/matching/jobs/placeholder/talents.html +1 -1
- package/dist/web/dist/matching/jobs/placeholder/talents.txt +3 -3
- package/dist/web/dist/matching/portraits/placeholder/jobs.html +1 -1
- package/dist/web/dist/matching/portraits/placeholder/jobs.txt +3 -3
- package/dist/web/dist/parselog.html +1 -1
- package/dist/web/dist/parselog.txt +3 -3
- package/dist/web/dist/recordings.html +1 -1
- package/dist/web/dist/recordings.txt +3 -3
- package/dist/web/dist/resource-usage.html +1 -1
- package/dist/web/dist/resource-usage.txt +3 -3
- package/dist/web/dist/shared/placeholder.html +1 -0
- package/dist/web/dist/shared/placeholder.txt +8 -0
- package/dist/web/dist/snapshots/placeholder/agent-prompt.html +1 -1
- package/dist/web/dist/snapshots/placeholder/agent-prompt.txt +3 -3
- package/dist/web/dist/talents.html +1 -1
- package/dist/web/dist/talents.txt +3 -3
- package/dist/web/dist/team/insights.html +1 -0
- package/dist/web/dist/team/insights.txt +7 -0
- package/package.json +1 -1
- package/dist/web/dist/_next/static/chunks/170-b66b6f731381943e.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/admin/data/page-37e01dad70306bf3.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/companies/page-985002eea5b295d0.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/company/admin/page-8c7ecc92bef09e92.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/jobs/page-e39b3e25f0a81254.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/layout-d094dc654772bf32.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/matching/jobs/[id]/talents/page-936f6190c968d20b.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/matching/portraits/[id]/jobs/page-ea44a2236bd53cae.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/page-41d8e008a9411221.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/parselog/page-3f756bbd580f337e.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/recordings/page-ffd507b12e67f2db.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-c89b32aa2ef509f5.js +0 -1
- package/dist/web/dist/_next/static/chunks/app/talents/page-8e0b4072df138fa3.js +0 -1
- package/dist/web/dist/_next/static/css/1dd88e02ef1af7b9.css +0 -3
- /package/dist/web/dist/_next/static/{N_4Eb07x7RNgd3O5ubXrJ → 9Wm8FfXwBJyMk-wYf4l81}/_buildManifest.js +0 -0
|
@@ -1 +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]="9c0183a2-f19c-402d-8974-743906f5959b",e._sentryDebugIdIdentifier="sentry-dbid-9c0183a2-f19c-402d-8974-743906f5959b")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[514],{9155:function(e,t,s){Promise.resolve().then(s.bind(s,611))},611:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return A}});var r=s(2835),n=s(635),a=s(4431),l=s(470),i=s(8983),c=s(953),o=s(8532),d=s(2857),u=s(1970),m=s(3284),h=s(5963),x=s(7557),p=s(3551);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 k(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 S=(0,n.memo)(function(e){let{items:t}=e,s=Array.from(new Set(t.flatMap(e=>e.paths.map(e=>e.key)))),n=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)(k,{title:"磁盘占用趋势(按受监控路径,GB)",children:(0,r.jsx)(l.h,{width:"100%",height:260,children:(0,r.jsxs)(i.T,{data:n,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,n.memo)(function(e){let{p:t,diskTotalBytes:s}=e,n=N(t),a=s>0?(t.totalBytes/s*100).toFixed(1):null;return(0,r.jsx)(k,{title:"路径构成:".concat(t.key,"(").concat(f[n],")(").concat(t.path,")— 共 ").concat(j(t.totalBytes)).concat(null!==a?" \xb7 占总磁盘 ".concat(a,"%"):""),children:(0,r.jsx)(l.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[n],radius:[0,3,3,0]})]})})})}),M=(0,n.memo)(function(e){var t,s,n;let{items:a}=e,l=a[a.length-1];if(!l)return null;let i=new Map;for(let e of l.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!==(n=null===(t=l.totals)||void 0===t?void 0:t.diskTotalBytes)&&void 0!==n?n:0;return(0,r.jsx)(k,{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,n=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===n?"-":"".concat(n.toFixed(1),"%")}),(0,r.jsx)("td",{className:"py-1",children:null!==n&&(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,n),"%"),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,n.memo)(function(e){let{items:t,liveSamples:s}=e,n=s.length>0,a=n?s[s.length-1]:null,x=t[t.length-1],p=n?s.map(e=>{var t,s,r,n;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 a=0,l=0,i=0,c=0;for(let t of e.processes)"hmh"===w(t)?(l+=t.rssBytes,c+=null!==(r=t.cpuPercent)&&void 0!==r?r:0):(a+=t.rssBytes,i+=null!==(n=t.cpuPercent)&&void 0!==n?n:0);return{ts:v(e.ts),rssMBHm:Number((a/1048576).toFixed(1)),rssMBHmh:Number((l/1048576).toFixed(1)),cpuHm:Number(i.toFixed(1)),cpuHmh:Number(c.toFixed(1))}}):t.map(e=>{let t=0,s=0,r=0,n=0;for(let a of e.processes)"hmh"===w(a)?(s+=a.rssBytes,n+=a.cpuPercent):(t+=a.rssBytes,r+=a.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(n.toFixed(1))}}),y=a?a.processes:x.processes;return(0,r.jsxs)(k,{title:n?"相关进程占用趋势(准实时 5s \xb7 按 hm / 工具链分开 \xb7 内存 MB / CPU %)":"相关进程占用趋势(按 hm / harness 工具链分开 \xb7 内存 MB / CPU %)",children:[(0,r.jsx)(l.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:n=[]}=e,a=s[s.length-1];if(!a)return null;let l=a.paths.filter(e=>e.exists),i=null!==(t=a.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:["主机:",a.system.hostname]}),(0,r.jsxs)("span",{children:["用户:",a.system.username]}),(0,r.jsxs)("span",{children:["系统:",a.system.platform," ",a.system.osRelease,"(",a.system.arch,")"]}),(0,r.jsxs)("span",{children:["CPU:",a.system.cpuModel," \xd7 ",a.system.cpuCores," 核"]}),(0,r.jsxs)("span",{children:["内存:",j(a.system.totalMemBytes)]}),(0,r.jsxs)("span",{children:["快照:",new Date(a.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)(S,{items:s}),(0,r.jsx)(P,{items:s,liveSamples:n}),l.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)})]})}let H=[{value:24,label:"最近 1 天"},{value:72,label:"最近 3 天"},{value:168,label:"最近 7 天"}];function A(){let[e,t]=(0,n.useState)(72),[s,l]=(0,n.useState)([]),[i,c]=(0,n.useState)([]),[o,d]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!0),[h,x]=(0,n.useState)(!1),[p,y]=(0,n.useState)(""),f=(0,n.useRef)(e),g=(0,n.useRef)(null),j=(0,n.useRef)(null);(0,n.useEffect)(()=>{f.current=e},[e]);let b=(0,n.useCallback)(async e=>{var t;m(!0);let s=await (0,a.rd)("/resource-usage/history?hours=".concat(e)),r=null!==(t=null==s?void 0:s.items)&&void 0!==t?t:[];l(r);let n=r[r.length-1];n&&(g.current=n.ts),m(!1)},[]);(0,n.useEffect)(()=>{b(e)},[e,b]),(0,n.useEffect)(()=>{let e,t=!1,s=e=>{if(!t&&e){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,n,l,i;let o=await (0,a.rd)("/resource-usage/samples");if(t)return;if(null==o?void 0:null===(r=o.samples)||void 0===r?void 0:r.length){let e=o.samples.slice(-720);c(e),j.current=null!==(l=null===(n=e[e.length-1])||void 0===n?void 0:n.ts)&&void 0!==l?l:null}(0,a.uz)("/resource-usage/collect-now");let d=await (0,a.rd)("/resource-usage/live");s(d),t||(e=setInterval(()=>{(0,a.rd)("/resource-usage/live").then(s)},Math.max(null!==(i=null==d?void 0:d.sampleIntervalMs)&&void 0!==i?i:5e3,2e3)))})(),()=>{t=!0,e&&clearInterval(e)}},[b]);let v=async()=>{var e;x(!0),y("");let t=await (0,a.uz)("/resource-usage/collect-now");if(x(!1),!t){y("采集失败(查看 server 日志)");return}y((null===(e=t.report)||void 0===e?void 0:e.reported)?"已采集并上报 ".concat(t.report.reported," 条"):"已采集(本地)"),b(f.current)};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:H.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})]})})}},4431:function(e,t,s){"use strict";s.d(t,{Ox:function(){return n},rd:function(){return l},uz:function(){return i}});var r=s(529);function n(){return r.env.HUNTER_MATE_SERVER_URL||""}let a=n();async function l(e,t){try{let s=await fetch("".concat(a).concat(e),{cache:"no-store",...t});if(!s.ok)return null;return await s.json()}catch(e){return null}}async function i(e,t){try{let s=await fetch("".concat(a).concat(e),{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:null!=t?JSON.stringify(t):void 0});if(!s.ok)return null;return await s.json()}catch(e){return null}}}},function(e){e.O(0,[686,400,935,744],function(){return e(e.s=9155)}),_N_E=e.O()}]);
|
|
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]="407150c1-9162-4005-9013-32f6ac92ceaf",e._sentryDebugIdIdentifier="sentry-dbid-407150c1-9162-4005-9013-32f6ac92ceaf")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[514],{9155:function(e,t,s){Promise.resolve().then(s.bind(s,611))},611:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return A}});var r=s(2835),n=s(635),a=s(4431),l=s(470),i=s(8983),c=s(953),o=s(8532),d=s(2857),u=s(1970),m=s(3284),h=s(5963),x=s(7557),p=s(3551);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,n.memo)(function(e){let{items:t}=e,s=Array.from(new Set(t.flatMap(e=>e.paths.map(e=>e.key)))),n=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)(l.h,{width:"100%",height:260,children:(0,r.jsxs)(i.T,{data:n,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,n.memo)(function(e){let{p:t,diskTotalBytes:s}=e,n=N(t),a=s>0?(t.totalBytes/s*100).toFixed(1):null;return(0,r.jsx)(S,{title:"路径构成:".concat(t.key,"(").concat(f[n],")(").concat(t.path,")— 共 ").concat(j(t.totalBytes)).concat(null!==a?" \xb7 占总磁盘 ".concat(a,"%"):""),children:(0,r.jsx)(l.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[n],radius:[0,3,3,0]})]})})})}),M=(0,n.memo)(function(e){var t,s,n;let{items:a}=e,l=a[a.length-1];if(!l)return null;let i=new Map;for(let e of l.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!==(n=null===(t=l.totals)||void 0===t?void 0:t.diskTotalBytes)&&void 0!==n?n: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,n=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===n?"-":"".concat(n.toFixed(1),"%")}),(0,r.jsx)("td",{className:"py-1",children:null!==n&&(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,n),"%"),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,n.memo)(function(e){let{items:t,liveSamples:s}=e,n=s.length>0,a=n?s[s.length-1]:null,x=t[t.length-1],p=n?s.map(e=>{var t,s,r,n;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 a=0,l=0,i=0,c=0;for(let t of e.processes)"hmh"===w(t)?(l+=t.rssBytes,c+=null!==(r=t.cpuPercent)&&void 0!==r?r:0):(a+=t.rssBytes,i+=null!==(n=t.cpuPercent)&&void 0!==n?n:0);return{ts:v(e.ts),rssMBHm:Number((a/1048576).toFixed(1)),rssMBHmh:Number((l/1048576).toFixed(1)),cpuHm:Number(i.toFixed(1)),cpuHmh:Number(c.toFixed(1))}}):t.map(e=>{let t=0,s=0,r=0,n=0;for(let a of e.processes)"hmh"===w(a)?(s+=a.rssBytes,n+=a.cpuPercent):(t+=a.rssBytes,r+=a.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(n.toFixed(1))}}),y=a?a.processes:x.processes;return(0,r.jsxs)(S,{title:n?"相关进程占用趋势(准实时 5s \xb7 按 hm / 工具链分开 \xb7 内存 MB / CPU %)":"相关进程占用趋势(按 hm / harness 工具链分开 \xb7 内存 MB / CPU %)",children:[(0,r.jsx)(l.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:n=[]}=e,a=s[s.length-1];if(!a)return null;let l=a.paths.filter(e=>e.exists),i=null!==(t=a.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:["主机:",a.system.hostname]}),(0,r.jsxs)("span",{children:["用户:",a.system.username]}),(0,r.jsxs)("span",{children:["系统:",a.system.platform," ",a.system.osRelease,"(",a.system.arch,")"]}),(0,r.jsxs)("span",{children:["CPU:",a.system.cpuModel," \xd7 ",a.system.cpuCores," 核"]}),(0,r.jsxs)("span",{children:["内存:",j(a.system.totalMemBytes)]}),(0,r.jsxs)("span",{children:["快照:",new Date(a.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:n}),l.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)})]})}let H=[{value:24,label:"最近 1 天"},{value:72,label:"最近 3 天"},{value:168,label:"最近 7 天"}];function A(){let[e,t]=(0,n.useState)(72),[s,l]=(0,n.useState)([]),[i,c]=(0,n.useState)([]),[o,d]=(0,n.useState)(!1),[u,m]=(0,n.useState)(!0),[h,x]=(0,n.useState)(!1),[p,y]=(0,n.useState)(""),f=(0,n.useRef)(e),g=(0,n.useRef)(null),j=(0,n.useRef)(null);(0,n.useEffect)(()=>{f.current=e},[e]);let b=(0,n.useCallback)(async e=>{var t;m(!0);let s=await (0,a.rd)("/resource-usage/history?hours=".concat(e)),r=null!==(t=null==s?void 0:s.items)&&void 0!==t?t:[];l(r);let n=r[r.length-1];n&&(g.current=n.ts),m(!1)},[]);(0,n.useEffect)(()=>{b(e)},[e,b]),(0,n.useEffect)(()=>{let e,t=!1,s=e=>{if(!t&&e){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,n,l,i;let o=await (0,a.rd)("/resource-usage/samples");if(t)return;if(null==o?void 0:null===(r=o.samples)||void 0===r?void 0:r.length){let e=o.samples.slice(-720);c(e),j.current=null!==(l=null===(n=e[e.length-1])||void 0===n?void 0:n.ts)&&void 0!==l?l:null}(0,a.uz)("/resource-usage/collect-now");let d=await (0,a.rd)("/resource-usage/live");s(d),t||(e=setInterval(()=>{(0,a.rd)("/resource-usage/live").then(s)},Math.max(null!==(i=null==d?void 0:d.sampleIntervalMs)&&void 0!==i?i:5e3,2e3)))})(),()=>{t=!0,e&&clearInterval(e)}},[b]);let v=async()=>{var e;x(!0),y("");let t=await (0,a.uz)("/resource-usage/collect-now");if(x(!1),!t){y("采集失败(查看 server 日志)");return}y((null===(e=t.report)||void 0===e?void 0:e.reported)?"已采集并上报 ".concat(t.report.reported," 条"):"已采集(本地)"),b(f.current)};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:H.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})]})})}},4431:function(e,t,s){"use strict";s.d(t,{Ox:function(){return a},rd:function(){return c},uz:function(){return o}});var r=s(7002),n=s(529);function a(){return n.env.HUNTER_MATE_SERVER_URL||""}let l=a();function i(e){let t=(0,r.Xc)();if(!t)return e;let s=new Headers(null==e?void 0:e.headers);return s.has("Authorization")||s.set("Authorization","UTOKEN ".concat(t)),{...e,headers:s}}async function c(e,t){try{let s=await fetch("".concat(l).concat(e),{cache:"no-store",...i(t)});if(!s.ok)return null;return await s.json()}catch(e){return null}}async function o(e,t){try{let s=await fetch("".concat(l).concat(e),i({method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:null!=t?JSON.stringify(t):void 0}));if(!s.ok)return null;return await s.json()}catch(e){return null}}},7002:function(e,t,s){"use strict";s.d(t,{GK:function(){return l},Lc:function(){return i},Xc:function(){return a}});let r=null,n=new Set;function a(){return r}function l(e){e!==r&&(r=e,n.forEach(e=>e()))}function i(e){return n.add(e),()=>{n.delete(e)}}}},function(e){e.O(0,[686,400,935,744],function(){return e(e.s=9155)}),_N_E=e.O()}]);
|
|
@@ -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]="2fec831c-487c-453b-8494-51be95a0bcc2",e._sentryDebugIdIdentifier="sentry-dbid-2fec831c-487c-453b-8494-51be95a0bcc2")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[245],{1689:function(e,n,t){Promise.resolve().then(t.bind(t,8517))},8517:function(e,n,t){"use strict";t.d(n,{default:function(){return a}});var r=t(2835),s=t(635),i=t(4431),o=t(7002);let d={not_found:"分享链接不存在、已失效,或你没有访问权限",expired:"分享链接已过期,请让分享者重新生成",revoked:"分享已被分享者撤销",out_of_scope:"你不在本次分享的范围内,请联系分享者"},l={recommended:"已推荐",pending_invite:"待邀请",invited:"已邀请",replied:"已回复",interview_scheduled:"已约面试",offer:"Offer",onboarding:"已入职",rejected:"已拒绝"};function a(){var e;let[n,t]=(0,s.useState)({kind:"loading"}),[l,a]=(0,s.useState)("");return(0,s.useEffect)(()=>{let e=window.location.pathname.match(/^\/shared\/([^/]+)/);a((null==e?void 0:e[1])?decodeURIComponent(e[1]):"")},[]),(0,s.useEffect)(()=>{if(l)return e(),(0,o.Lc)(()=>void e());async function e(){let e=(0,o.Xc)();if(!e){t({kind:"need-login"});return}let n=await fetch("".concat((0,i.Ox)(),"/shared/").concat(encodeURIComponent(l),"/data"),{headers:{Authorization:"UTOKEN ".concat(e)},cache:"no-store"});if(401===n.status){t({kind:"need-login"});return}let r=await n.json().catch(()=>({}));if(!n.ok){var s,d,a;t({kind:"error",code:null!==(d=null!==(s=null==r?void 0:r.errorCode)&&void 0!==s?s:null==r?void 0:r.code)&&void 0!==d?d:"not_found",message:null!==(a=null==r?void 0:r.message)&&void 0!==a?a:""});return}t({kind:"ok",data:r})}},[l]),(0,r.jsx)("div",{className:"h-full overflow-auto p-6",children:(0,r.jsxs)("div",{className:"mx-auto max-w-3xl",children:[(0,r.jsx)("h1",{className:"mb-1 text-lg font-semibold",children:"同事分享的职位推荐"}),"loading"===n.kind?(0,r.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:"加载中…"}):null,"need-login"===n.kind?(0,r.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"===n.kind?(0,r.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=d[n.code])&&void 0!==e?e:d.not_found,n.message?(0,r.jsx)("div",{className:"mt-1 text-xs text-red-400",children:n.message}):null]}):null,"ok"===n.kind?(0,r.jsx)(c,{data:n.data}):null]})})}function c(e){var n,t,s,i,o,d,a,c,u;let{data:x}=e,m=null!==(d=x.recommendations)&&void 0!==d?d:[];return(0,r.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-base font-medium",children:null!==(c=null===(n=x.jobCase)||void 0===n?void 0:n.title)&&void 0!==c?c:"职位 #".concat(null!==(a=null===(t=x.jobCase)||void 0===t?void 0:t.id)&&void 0!==a?a:"")}),(0,r.jsxs)("div",{className:"mt-0.5 text-xs text-gray-500",children:["分享者:",(null===(s=x.fromUser)||void 0===s?void 0:s.email)||"#".concat(null===(i=x.fromUser)||void 0===i?void 0:i.hmUserId),x.expiresAt?" \xb7 有效期至 ".concat(new Date(x.expiresAt).toLocaleString()):""]})]}),(0,r.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:null!==(u=null===(o=x.jobCase)||void 0===o?void 0:o.status)&&void 0!==u?u:""})]}),x.note?(0,r.jsx)("div",{className:"mt-2 rounded bg-blue-50 px-3 py-2 text-sm text-blue-800",children:x.note}):null]}),(0,r.jsxs)("div",{className:"text-xs text-gray-500",children:["共 ",m.length," 位推荐人才(只读快照,实时数据以分享者本地为准)"]}),m.map(e=>{var n,t,s,i,o,d,a,c;return(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("div",{className:"font-medium",children:null!==(a=null!==(d=null===(n=e.snapshot)||void 0===n?void 0:n.name)&&void 0!==d?d:e.portraitName)&&void 0!==a?a:"推荐 #".concat(e.id.slice(0,8))}),(0,r.jsx)("span",{className:"rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700",children:null!==(c=l[e.stage])&&void 0!==c?c:e.stage})]}),(null===(t=e.snapshot)||void 0===t?void 0:t.headline)?(0,r.jsx)("div",{className:"mt-1 text-xs text-gray-500",children:e.snapshot.headline}):null,"number"==typeof(null===(i=e.scores)||void 0===i?void 0:null===(s=i.dimensions)||void 0===s?void 0:s.overall)?(0,r.jsxs)("div",{className:"mt-1 text-xs text-gray-500",children:["综合匹配分:",e.scores.dimensions.overall]}):null,(null===(o=e.scores)||void 0===o?void 0:o.aiReason)?(0,r.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)}),m.length?null:(0,r.jsx)("div",{className:"py-8 text-center text-sm text-gray-400",children:"该职位暂无推荐人才"})]})}},4431:function(e,n,t){"use strict";t.d(n,{Ox:function(){return i},rd:function(){return l},uz:function(){return a}});var r=t(7002),s=t(529);function i(){return s.env.HUNTER_MATE_SERVER_URL||""}let o=i();function d(e){let n=(0,r.Xc)();if(!n)return e;let t=new Headers(null==e?void 0:e.headers);return t.has("Authorization")||t.set("Authorization","UTOKEN ".concat(n)),{...e,headers:t}}async function l(e,n){try{let t=await fetch("".concat(o).concat(e),{cache:"no-store",...d(n)});if(!t.ok)return null;return await t.json()}catch(e){return null}}async function a(e,n){try{let t=await fetch("".concat(o).concat(e),d({method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:null!=n?JSON.stringify(n):void 0}));if(!t.ok)return null;return await t.json()}catch(e){return null}}},7002:function(e,n,t){"use strict";t.d(n,{GK:function(){return o},Lc:function(){return d},Xc:function(){return i}});let r=null,s=new Set;function i(){return r}function o(e){e!==r&&(r=e,s.forEach(e=>e()))}function d(e){return s.add(e),()=>{s.delete(e)}}}},function(e){e.O(0,[400,935,744],function(){return e(e.s=1689)}),_N_E=e.O()}]);
|
package/dist/web/dist/_next/static/chunks/app/snapshots/[id]/agent-prompt/page-f519552be54e3bdf.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){try{var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new n.Error).stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="dd66480f-d659-404c-9c66-d3ff2ae3ca54",n._sentryDebugIdIdentifier="sentry-dbid-dd66480f-d659-404c-9c66-d3ff2ae3ca54")}catch(n){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[325],{1765:function(n,t,e){Promise.resolve().then(e.bind(e,4492))},7473:function(n,t,e){"use strict";var r=e(8321);e.o(r,"useParams")&&e.d(t,{useParams:function(){return r.useParams}}),e.o(r,"usePathname")&&e.d(t,{usePathname:function(){return r.usePathname}}),e.o(r,"useRouter")&&e.d(t,{useRouter:function(){return r.useRouter}}),e.o(r,"useSearchParams")&&e.d(t,{useSearchParams:function(){return r.useSearchParams}})},4492:function(n,t,e){"use strict";e.d(t,{default:function(){return c}});var r=e(2835),a=e(635),u=e(7473),o=e(4431);function c(){let n=(0,u.useParams)().id,[t,e]=(0,a.useState)(null),[c,i]=(0,a.useState)(!1),[s,d]=(0,a.useState)(!1),[f,l]=(0,a.useState)(null);async function h(){i(!0),l(null);try{let t=await fetch("".concat((0,o.Ox)(),"/parsing/snapshots/").concat(n,"/agent-prompt"));if(!t.ok)throw Error("HTTP ".concat(t.status));let r=await t.json();e(r.prompt)}catch(n){l(n.message)}finally{i(!1)}}async function p(){t&&(await navigator.clipboard.writeText(t),d(!0),setTimeout(()=>d(!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: ",n]}),(0,r.jsx)("button",{onClick:h,disabled:c,children:c?"加载中...":"生成 Prompt"}),f&&(0,r.jsx)("div",{style:{color:"red",marginTop:12},children:f}),t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:p,style:{marginLeft:12},children:s?"已复制 ✅":"复制到剪贴板"}),(0,r.jsx)("pre",{style:{marginTop:16,padding:16,background:"#f5f5f5",borderRadius:8,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:t})]})]})}},4431:function(n,t,e){"use strict";e.d(t,{Ox:function(){return u},rd:function(){return i},uz:function(){return s}});var r=e(7002),a=e(529);function u(){return a.env.HUNTER_MATE_SERVER_URL||""}let o=u();function c(n){let t=(0,r.Xc)();if(!t)return n;let e=new Headers(null==n?void 0:n.headers);return e.has("Authorization")||e.set("Authorization","UTOKEN ".concat(t)),{...n,headers:e}}async function i(n,t){try{let e=await fetch("".concat(o).concat(n),{cache:"no-store",...c(t)});if(!e.ok)return null;return await e.json()}catch(n){return null}}async function s(n,t){try{let e=await fetch("".concat(o).concat(n),c({method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:null!=t?JSON.stringify(t):void 0}));if(!e.ok)return null;return await e.json()}catch(n){return null}}},7002:function(n,t,e){"use strict";e.d(t,{GK:function(){return o},Lc:function(){return c},Xc:function(){return u}});let r=null,a=new Set;function u(){return r}function o(n){n!==r&&(r=n,a.forEach(n=>n()))}function c(n){return a.add(n),()=>{a.delete(n)}}}},function(n){n.O(0,[400,935,744],function(){return n(n.s=1765)}),_N_E=n.O()}]);
|
|
@@ -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]="30482edc-a44f-4be4-9cfe-15630e9e56c7",e._sentryDebugIdIdentifier="sentry-dbid-30482edc-a44f-4be4-9cfe-15630e9e56c7")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[93],{5539:function(e,n,f){Promise.resolve().then(f.bind(f,852))}},function(e){e.O(0,[670,852,400,935,744],function(){return e(e.s=5539)}),_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]="21f7a839-9dc7-4fe2-a3f0-a4fd6a127358",e._sentryDebugIdIdentifier="sentry-dbid-21f7a839-9dc7-4fe2-a3f0-a4fd6a127358")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14],{812:function(e,t,n){Promise.resolve().then(n.bind(n,1670))},1670:function(e,t,n){"use strict";n.d(t,{default:function(){return x}});var r=n(2835),a=n(635),l=n(4431),s=n(7002);let c=[{key:"today",label:"今天"},{key:"yesterday",label:"昨天"},{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"last7",label:"近 7 天"},{key:"custom",label:"自定义"}],i={recommended:"已推荐",pending_invite:"待邀请",invited:"已邀请",replied:"已回复",interview_scheduled:"已约面试",offer:"Offer",onboarding:"已入职",rejected:"已拒绝"},d={create:"建档",move:"阶段迁移",form:"保存表单",invite:"记录邀请",invite_approved:"批准邀请",note:"备注",delete:"移出流程"};function o(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function u(e){let{actorType:t}=e;return"agent"===t?(0,r.jsx)("span",{className:"rounded bg-purple-100 px-1.5 py-0.5 text-xs text-purple-700",children:"agent 代操作"}):"human"===t?(0,r.jsx)("span",{className:"rounded bg-emerald-100 px-1.5 py-0.5 text-xs text-emerald-700",children:"本人操作"}):(0,r.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;let[g,p]=(0,a.useState)(null),[h,y]=(0,a.useState)(null),[f,b]=(0,a.useState)("last7"),[j,v]=(0,a.useState)(""),[N,w]=(0,a.useState)(""),[S,I]=(0,a.useState)(null),[k,O]=(0,a.useState)(!1),[D,T]=(0,a.useState)(null),_=(0,a.useCallback)(()=>{(0,l.rd)("/team/members").then(e=>{let t=Array.isArray(null==e?void 0:e.items)?e.items:[];p(t),y(e=>{var n,r;return null!==(r=null!=e?e:null===(n=t[0])||void 0===n?void 0:n.hmUserId)&&void 0!==r?r:null})})},[]);(0,a.useEffect)(()=>(_(),(0,s.Lc)(_)),[_]);let C=(0,a.useCallback)(async()=>{if(null==h)return;O(!0),T(null);let{from:e,to:t}=function(e,t,n){let r=o(new Date);switch(e){case"today":return{from:r.toISOString(),to:new Date(r.getTime()+864e5).toISOString()};case"yesterday":return{from:new Date(r.getTime()-864e5).toISOString(),to:r.toISOString()};case"week":{let e=(r.getDay()+6)%7;return{from:new Date(r.getTime()-864e5*e).toISOString(),to:new Date(r.getTime()+864e5).toISOString()}}case"month":return{from:new Date(r.getFullYear(),r.getMonth(),1).toISOString(),to:new Date(r.getTime()+864e5).toISOString()};case"custom":return{from:t?o(new Date("".concat(t,"T00:00:00"))).toISOString():r.toISOString(),to:n?new Date(o(new Date("".concat(n,"T00:00:00"))).getTime()+864e5).toISOString():new Date(r.getTime()+864e5).toISOString()};default:return{from:new Date(r.getTime()-5184e5).toISOString(),to:new Date(r.getTime()+864e5).toISOString()}}}(f,j,N),n=await (0,l.rd)("/team/insights?hmUserId=".concat(h,"&from=").concat(encodeURIComponent(e),"&to=").concat(encodeURIComponent(t)));if(O(!1),!n){T("加载失败:未登录云端账号、与对方不在同一公司租户,或云服务不可达"),I(null);return}I(n)},[h,f,j,N]);(0,a.useEffect)(()=>(C(),(0,s.Lc)(()=>void C())),[C]);let E=null==S?void 0:S.summary,U=(0,a.useMemo)(()=>{var e;return Object.entries(null!==(e=null==E?void 0:E.terminal)&&void 0!==e?e:{})},[E]);return(0,r.jsx)("div",{className:"h-full overflow-auto p-6",children:(0,r.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,r.jsx)("h1",{className:"mb-4 text-lg font-semibold",children:"同事工作统计"}),(0,r.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-3 rounded-lg border border-gray-200 bg-white p-3",children:[(0,r.jsxs)("label",{className:"text-sm text-gray-600",children:["同事:",(0,r.jsxs)("select",{value:null!=h?h:"",onChange:e=>y(Number(e.target.value)),className:"ml-2 rounded border border-gray-300 px-2 py-1 text-sm",children:[null===g?(0,r.jsx)("option",{children:"加载中…"}):null,(null!=g?g:[]).map(e=>(0,r.jsxs)("option",{value:e.hmUserId,children:[e.name,"(",e.email,")"]},e.hmUserId))]})]}),(0,r.jsx)("div",{className:"flex gap-1",children:c.map(e=>(0,r.jsx)("button",{onClick:()=>b(e.key),className:"rounded px-2.5 py-1 text-xs ".concat(f===e.key?"bg-blue-100 font-medium text-blue-800":"text-gray-500 hover:bg-gray-100"),children:e.label},e.key))}),"custom"===f?(0,r.jsxs)("span",{className:"flex items-center gap-1 text-sm",children:[(0,r.jsx)("input",{type:"date",value:j,onChange:e=>v(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm"}),"~",(0,r.jsx)("input",{type:"date",value:N,onChange:e=>w(e.target.value),className:"rounded border border-gray-300 px-2 py-1 text-sm"})]}):null]}),D?(0,r.jsx)("div",{className:"mb-4 rounded border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:D}):null,k?(0,r.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:"加载中…"}):null,!k&&S?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[(0,r.jsx)(m,{label:"区间新建推荐",value:null!==(e=null==E?void 0:E.recsTotal)&&void 0!==e?e:0}),(0,r.jsx)(m,{label:"agent 代操作",value:null!==(t=null==E?void 0:E.recsByAgent)&&void 0!==t?t:0,tone:"purple"}),(0,r.jsx)(m,{label:"本人操作",value:null!==(n=null==E?void 0:E.recsByHuman)&&void 0!==n?n:0,tone:"green"}),(0,r.jsx)(m,{label:"来源不明(存量)",value:null!==(x=null==E?void 0:E.recsUnknown)&&void 0!==x?x:0,tone:"gray"})]}),U.length?(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-3 text-sm",children:[(0,r.jsx)("span",{className:"mr-2 text-xs text-gray-500",children:"终端阶段:"}),U.map(e=>{var t;let[n,a]=e;return(0,r.jsxs)("span",{className:"mr-3",children:[null!==(t=i[n])&&void 0!==t?t:n," ",(0,r.jsx)("b",{children:a})]},n)})]}):null,(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white",children:[(0,r.jsx)("div",{className:"border-b border-gray-100 px-4 py-2 text-sm font-medium",children:"分职位产出"}),S.jobs.length?(0,r.jsxs)("table",{className:"w-full text-sm",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-left text-xs text-gray-400",children:[(0,r.jsx)("th",{className:"px-4 py-2",children:"职位"}),(0,r.jsx)("th",{className:"px-2 py-2",children:"推荐数"}),(0,r.jsx)("th",{className:"px-2 py-2",children:"agent"}),(0,r.jsx)("th",{className:"px-2 py-2",children:"本人"}),(0,r.jsx)("th",{className:"px-2 py-2",children:"不明"}),(0,r.jsx)("th",{className:"px-4 py-2",children:"阶段分布"})]})}),(0,r.jsx)("tbody",{children:S.jobs.map(e=>(0,r.jsxs)("tr",{className:"border-t border-gray-50",children:[(0,r.jsxs)("td",{className:"px-4 py-2",children:[e.title,e.status?(0,r.jsxs)("span",{className:"ml-1 text-xs text-gray-400",children:["(",e.status,")"]}):null]}),(0,r.jsx)("td",{className:"px-2 py-2 font-medium",children:e.recsTotal}),(0,r.jsx)("td",{className:"px-2 py-2 text-purple-600",children:e.byAgent}),(0,r.jsx)("td",{className:"px-2 py-2 text-emerald-600",children:e.byHuman}),(0,r.jsx)("td",{className:"px-2 py-2 text-gray-400",children:e.byUnknown}),(0,r.jsx)("td",{className:"px-4 py-2 text-xs text-gray-500",children:Object.entries(e.stageDist).map(e=>{var t;let[n,r]=e;return"".concat(null!==(t=i[n])&&void 0!==t?t:n," ").concat(r)}).join(" / ")})]},e.jobCaseId))})]}):(0,r.jsx)("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:"该区间无推荐产出"})]}),(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white",children:[(0,r.jsxs)("div",{className:"border-b border-gray-100 px-4 py-2 text-sm font-medium",children:["操作时间线(区间内 ",S.timeline.length," 条)"]}),S.timeline.length?(0,r.jsx)("ul",{className:"divide-y divide-gray-50",children:S.timeline.map((e,t)=>{var n,a;return(0,r.jsxs)("li",{className:"flex items-center gap-3 px-4 py-2 text-sm",children:[(0,r.jsx)("span",{className:"w-32 shrink-0 text-xs text-gray-400",children:new Date(e.at).toLocaleString()}),(0,r.jsx)(u,{actorType:e.actorType}),(0,r.jsx)("span",{className:"font-medium",children:e.talentName||"—"}),(0,r.jsxs)("span",{className:"text-xs text-gray-500",children:[null!==(n=d[e.action])&&void 0!==n?n:e.action,e.toStage?" → ".concat(null!==(a=i[e.toStage])&&void 0!==a?a:e.toStage):""]}),(0,r.jsx)("span",{className:"ml-auto truncate text-xs text-gray-400",children:e.jobTitle})]},"".concat(e.at,"-").concat(t))})}):(0,r.jsx)("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:"该区间无操作记录"})]})]}):null,k||S||D?null:(0,r.jsx)("div",{className:"py-10 text-center text-sm text-gray-400",children:g&&!g.length?"暂无公司租户同事(加入公司租户后可用)":"选择同事与时间段查看统计"})]})})}function m(e){let{label:t,value:n,tone:a}=e;return(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500",children:t}),(0,r.jsx)("div",{className:"mt-1 text-2xl font-semibold ".concat("purple"===a?"text-purple-700":"green"===a?"text-emerald-700":"gray"===a?"text-gray-500":"text-gray-900"),children:n})]})}},4431:function(e,t,n){"use strict";n.d(t,{Ox:function(){return l},rd:function(){return i},uz:function(){return d}});var r=n(7002),a=n(529);function l(){return a.env.HUNTER_MATE_SERVER_URL||""}let s=l();function c(e){let t=(0,r.Xc)();if(!t)return e;let n=new Headers(null==e?void 0:e.headers);return n.has("Authorization")||n.set("Authorization","UTOKEN ".concat(t)),{...e,headers:n}}async function i(e,t){try{let n=await fetch("".concat(s).concat(e),{cache:"no-store",...c(t)});if(!n.ok)return null;return await n.json()}catch(e){return null}}async function d(e,t){try{let n=await fetch("".concat(s).concat(e),c({method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:null!=t?JSON.stringify(t):void 0}));if(!n.ok)return null;return await n.json()}catch(e){return null}}},7002:function(e,t,n){"use strict";n.d(t,{GK:function(){return s},Lc:function(){return c},Xc:function(){return l}});let r=null,a=new Set;function l(){return r}function s(e){e!==r&&(r=e,a.forEach(e=>e()))}function c(e){return a.add(e),()=>{a.delete(e)}}}},function(e){e.O(0,[400,935,744],function(){return e(e.s=812)}),_N_E=e.O()}]);
|