Files
wx-win-agent/control-plane/web/dist/assets/OperationsViews-SiJaHFpg.js
T
rogee a977902b25
Build web service image / build (push) Successful in 1m29s
fix(web): isolate UI reads and improve mobile messages
2026-09-28 06:36:25 +08:00

11 lines
29 KiB
JavaScript

import{r as i,a3 as me,e as P,a4 as Ee,m as Ie,d as g,a5 as _e,a6 as he,a7 as Re,a8 as Xe,a9 as Ue,aa as ze,ab as Je,ac as Pe,ad as Qe,p as Ye,h as Ze,ae as be,af as ke,X as fe,_ as xe,E as n,U as ie,T as et,l as Te,P as q,I as E,Y as tt,n as Se,o as je,ag as $e,ah as at,H as B,L as nt,a1 as Me,J as Le,V as Z,ai as rt,a2 as Ce,aj as we,ak as Oe,Q as oe,S as ye,F as st,O as ve}from"./index-CSGym-Bq.js";import{A as le,b as re,P as ce,F as it}from"./Table-B79wm3oj.js";import"./index-Di2wY8BS.js";var ot=function(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s};const De=e=>{var{prefixCls:t,className:s,hoverable:a=!0}=e,r=ot(e,["prefixCls","className","hoverable"]);const{getPrefixCls:c}=i.useContext(me),o=c("card",t),l=P(`${o}-grid`,s,{[`${o}-grid-hoverable`]:a});return i.createElement("div",Object.assign({},r,{className:l}))},ct=e=>{const{antCls:t,componentCls:s,headerHeight:a,headerPadding:r,tabsMarginBottom:c}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:a,marginBottom:-1,padding:`0 ${g(r)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${g(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${g(e.borderRadiusLG)} ${g(e.borderRadiusLG)} 0 0`},he()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},Re),{[`
> ${s}-typography,
> ${s}-typography-edit-content
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:c,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${g(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})},lt=e=>{const{cardPaddingBase:t,colorBorderSecondary:s,cardShadow:a,lineWidth:r}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:`
${g(r)} 0 0 0 ${s},
0 ${g(r)} 0 0 ${s},
${g(r)} ${g(r)} 0 0 ${s},
${g(r)} 0 0 0 ${s} inset,
0 ${g(r)} 0 0 ${s} inset;
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:a}}},dt=e=>{const{componentCls:t,iconCls:s,actionsLiMargin:a,cardActionsIconSize:r,colorBorderSecondary:c,actionsBg:o}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:o,borderTop:`${g(e.lineWidth)} ${e.lineType} ${c}`,display:"flex",borderRadius:`0 0 ${g(e.borderRadiusLG)} ${g(e.borderRadiusLG)}`},he()),{"& > li":{margin:a,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${s}`]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:g(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${s}`]:{fontSize:r,lineHeight:g(e.calc(r).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${g(e.lineWidth)} ${e.lineType} ${c}`}}})},ut=e=>Object.assign(Object.assign({margin:`${g(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex"},he()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},Re),"&-description":{color:e.colorTextDescription}}),pt=e=>{const{componentCls:t,colorFillAlter:s,headerPadding:a,bodyPadding:r}=e;return{[`${t}-head`]:{padding:`0 ${g(a)}`,background:s,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${g(e.padding)} ${g(r)}`}}},gt=e=>{const{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}},mt=e=>{const{componentCls:t,cardShadow:s,cardHeadPadding:a,colorBorderSecondary:r,boxShadowTertiary:c,bodyPadding:o,extraColor:l}=e;return{[t]:Object.assign(Object.assign({},_e(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:c},[`${t}-head`]:ct(e),[`${t}-extra`]:{marginInlineStart:"auto",color:l,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:o,borderRadius:`0 0 ${g(e.borderRadiusLG)} ${g(e.borderRadiusLG)}`},[`${t}-grid`]:lt(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${g(e.borderRadiusLG)} ${g(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:dt(e),[`${t}-meta`]:ut(e)}),[`${t}-bordered`]:{border:`${g(e.lineWidth)} ${e.lineType} ${r}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:s}},[`${t}-contain-grid`]:{borderRadius:`${g(e.borderRadiusLG)} ${g(e.borderRadiusLG)} 0 0 `,[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:a}}},[`${t}-type-inner`]:pt(e),[`${t}-loading`]:gt(e),[`${t}-rtl`]:{direction:"rtl"}}},ht=e=>{const{componentCls:t,bodyPaddingSM:s,headerPaddingSM:a,headerHeightSM:r,headerFontSizeSM:c}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:r,padding:`0 ${g(a)}`,fontSize:c,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:s}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}},ft=e=>{var t,s;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,headerHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:(t=e.bodyPadding)!==null&&t!==void 0?t:e.paddingLG,headerPadding:(s=e.headerPadding)!==null&&s!==void 0?s:e.paddingLG}},xt=Ee("Card",e=>{const t=Ie(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[mt(t),ht(t)]},ft);var Ne=function(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s};const yt=e=>{const{actionClasses:t,actions:s=[],actionStyle:a}=e;return i.createElement("ul",{className:t,style:a},s.map((r,c)=>{const o=`action-${c}`;return i.createElement("li",{style:{width:`${100/s.length}%`},key:o},i.createElement("span",null,r))}))},vt=i.forwardRef((e,t)=>{const{prefixCls:s,className:a,rootClassName:r,style:c,extra:o,headStyle:l={},bodyStyle:p={},title:d,loading:u,bordered:h,variant:f,size:x,type:S,cover:j,actions:T,tabList:I,children:_,activeTabKey:M,defaultActiveTabKey:F,tabBarExtraContent:L,hoverable:k,tabProps:b={},classNames:O,styles:R}=e,D=Ne(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:V,direction:z,card:$}=i.useContext(me),[K]=Xe("card",f,h),ee=N=>{var v;(v=e.onTabChange)===null||v===void 0||v.call(e,N)},m=N=>{var v;return P((v=$==null?void 0:$.classNames)===null||v===void 0?void 0:v[N],O==null?void 0:O[N])},C=N=>{var v;return Object.assign(Object.assign({},(v=$==null?void 0:$.styles)===null||v===void 0?void 0:v[N]),R==null?void 0:R[N])},X=i.useMemo(()=>{let N=!1;return i.Children.forEach(_,v=>{(v==null?void 0:v.type)===De&&(N=!0)}),N},[_]),y=V("card",s),[de,ue,te]=xt(y),A=i.createElement(Pe,{loading:!0,active:!0,paragraph:{rows:4},title:!1},_),ae=M!==void 0,H=Object.assign(Object.assign({},b),{[ae?"activeKey":"defaultActiveKey"]:ae?M:F,tabBarExtraContent:L});let U;const G=Ue(x),J=!G||G==="default"?"large":G,Q=I?i.createElement(ze,Object.assign({size:J},H,{className:`${y}-head-tabs`,onChange:ee,items:I.map(N=>{var{tab:v}=N,ge=Ne(N,["tab"]);return Object.assign({label:v},ge)})})):null;if(d||o||Q){const N=P(`${y}-head`,m("header")),v=P(`${y}-head-title`,m("title")),ge=P(`${y}-extra`,m("extra")),Ke=Object.assign(Object.assign({},l),C("header"));U=i.createElement("div",{className:N,style:Ke},i.createElement("div",{className:`${y}-head-wrapper`},d&&i.createElement("div",{className:v,style:C("title")},d),o&&i.createElement("div",{className:ge,style:C("extra")},o)),Q)}const se=P(`${y}-cover`,m("cover")),ne=j?i.createElement("div",{className:se,style:C("cover")},j):null,pe=P(`${y}-body`,m("body")),Ae=Object.assign(Object.assign({},p),C("body")),He=i.createElement("div",{className:pe,style:Ae},u?A:_),Ge=P(`${y}-actions`,m("actions")),We=T!=null&&T.length?i.createElement(yt,{actionClasses:Ge,actionStyle:C("actions"),actions:T}):null,qe=Je(D,["onTabChange"]),Fe=P(y,$==null?void 0:$.className,{[`${y}-loading`]:u,[`${y}-bordered`]:K!=="borderless",[`${y}-hoverable`]:k,[`${y}-contain-grid`]:X,[`${y}-contain-tabs`]:I==null?void 0:I.length,[`${y}-${G}`]:G,[`${y}-type-${S}`]:!!S,[`${y}-rtl`]:z==="rtl"},a,r,ue,te),Ve=Object.assign(Object.assign({},$==null?void 0:$.style),c);return de(i.createElement("div",Object.assign({ref:t},qe,{className:Fe,style:Ve}),U,ne,He,We))});var bt=function(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s};const St=e=>{const{prefixCls:t,className:s,avatar:a,title:r,description:c}=e,o=bt(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:l}=i.useContext(me),p=l("card",t),d=P(`${p}-meta`,s),u=a?i.createElement("div",{className:`${p}-meta-avatar`},a):null,h=r?i.createElement("div",{className:`${p}-meta-title`},r):null,f=c?i.createElement("div",{className:`${p}-meta-description`},c):null,x=h||f?i.createElement("div",{className:`${p}-meta-detail`},h,f):null;return i.createElement("div",Object.assign({},o,{className:d}),u,x)},Y=vt;Y.Grid=De;Y.Meta=St;const jt=e=>{const{value:t,formatter:s,precision:a,decimalSeparator:r,groupSeparator:c="",prefixCls:o}=e;let l;if(typeof s=="function")l=s(t);else{const p=String(t),d=p.match(/^(-?)(\d*)(\.(\d+))?$/);if(!d||p==="-")l=p;else{const u=d[1];let h=d[2]||"0",f=d[4]||"";h=h.replace(/\B(?=(\d{3})+(?!\d))/g,c),typeof a=="number"&&(f=f.padEnd(a,"0").slice(0,a>0?a:0)),f&&(f=`${r}${f}`),l=[i.createElement("span",{key:"int",className:`${o}-content-value-int`},u,h),f&&i.createElement("span",{key:"decimal",className:`${o}-content-value-decimal`},f)]}}return i.createElement("span",{className:`${o}-content-value`},l)},$t=e=>{const{componentCls:t,marginXXS:s,padding:a,colorTextDescription:r,titleFontSize:c,colorTextHeading:o,contentFontSize:l,fontFamily:p}=e;return{[t]:Object.assign(Object.assign({},_e(e)),{[`${t}-title`]:{marginBottom:s,color:r,fontSize:c},[`${t}-skeleton`]:{paddingTop:a},[`${t}-content`]:{color:o,fontSize:l,fontFamily:p,[`${t}-content-value`]:{display:"inline-block",direction:"ltr"},[`${t}-content-prefix, ${t}-content-suffix`]:{display:"inline-block"},[`${t}-content-prefix`]:{marginInlineEnd:s},[`${t}-content-suffix`]:{marginInlineStart:s}}})}},Ct=e=>{const{fontSizeHeading3:t,fontSize:s}=e;return{titleFontSize:s,contentFontSize:t}},wt=Ee("Statistic",e=>{const t=Ie(e,{});return $t(t)},Ct);var Ot=function(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s};const W=i.forwardRef((e,t)=>{const{prefixCls:s,className:a,rootClassName:r,style:c,valueStyle:o,value:l=0,title:p,valueRender:d,prefix:u,suffix:h,loading:f=!1,formatter:x,precision:S,decimalSeparator:j=".",groupSeparator:T=",",onMouseEnter:I,onMouseLeave:_}=e,M=Ot(e,["prefixCls","className","rootClassName","style","valueStyle","value","title","valueRender","prefix","suffix","loading","formatter","precision","decimalSeparator","groupSeparator","onMouseEnter","onMouseLeave"]),{getPrefixCls:F,direction:L,className:k,style:b}=Qe("statistic"),O=F("statistic",s),[R,D,V]=wt(O),z=i.createElement(jt,{decimalSeparator:j,groupSeparator:T,prefixCls:O,formatter:x,precision:S,value:l}),$=P(O,{[`${O}-rtl`]:L==="rtl"},k,a,r,D,V),K=i.useRef(null);i.useImperativeHandle(t,()=>({nativeElement:K.current}));const ee=Ye(M,{aria:!0,data:!0});return R(i.createElement("div",Object.assign({},ee,{ref:K,className:$,style:Object.assign(Object.assign({},b),c),onMouseEnter:I,onMouseLeave:_}),p&&i.createElement("div",{className:`${O}-title`},p),i.createElement(Pe,{paragraph:!1,loading:f,className:`${O}-skeleton`,active:!0},i.createElement("div",{style:o,className:`${O}-content`},u&&i.createElement("span",{className:`${O}-content-prefix`},u),d?d(z):z,h&&i.createElement("span",{className:`${O}-content-suffix`},h)))))}),Nt=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]];function Et(e,t){let s=e;const a=/\[[^\]]*]/g,r=(t.match(a)||[]).map(p=>p.slice(1,-1)),c=t.replace(a,"[]"),o=Nt.reduce((p,[d,u])=>{if(p.includes(d)){const h=Math.floor(s/u);return s-=h*u,p.replace(new RegExp(`${d}+`,"g"),f=>{const x=f.length;return h.toString().padStart(x,"0")})}return p},c);let l=0;return o.replace(a,()=>{const p=r[l];return l+=1,p})}function It(e,t,s){const{format:a=""}=t,r=new Date(e).getTime(),c=Date.now(),o=Math.max(s?r-c:c-r,0);return Et(o,a)}var _t=function(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s};function Rt(e){return new Date(e).getTime()}const Be=e=>{const{value:t,format:s="HH:mm:ss",onChange:a,onFinish:r,type:c}=e,o=_t(e,["value","format","onChange","onFinish","type"]),l=c==="countdown",[p,d]=i.useState(null),u=Ze(()=>{const x=Date.now(),S=Rt(t);d({});const j=l?S-x:x-S;return a==null||a(j),l&&S<x?(r==null||r(),!1):!0});i.useEffect(()=>{let x;const S=()=>be.cancel(x),j=()=>{x=be(()=>{u()&&j()})};return j(),S},[t,l]),i.useEffect(()=>{d({})},[]);const h=(x,S)=>p?It(x,Object.assign(Object.assign({},S),{format:s}),l):"-",f=x=>ke(x,{title:void 0});return i.createElement(W,Object.assign({},o,{value:t,valueRender:f,formatter:h}))},zt=e=>i.createElement(Be,Object.assign({},e,{type:"countdown"})),Pt=i.memo(zt);W.Timer=Be;W.Countdown=Pt;var Tt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},Mt=function(t,s){return i.createElement(fe,xe({},t,{ref:s,icon:Tt}))},Lt=i.forwardRef(Mt),Dt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z"}}]},name:"safety-certificate",theme:"outlined"},Bt=function(t,s){return i.createElement(fe,xe({},t,{ref:s,icon:Dt}))},At=i.forwardRef(Bt),Ht={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},Gt=function(t,s){return i.createElement(fe,xe({},t,{ref:s,icon:Ht}))},Wt=i.forwardRef(Gt);const{Text:w,Title:qt}=et;function Xt({nodes:e,tasks:t,events:s,onNavigate:a,onRefresh:r,refreshing:c}){const o=e.filter(rt).length,l=t.filter(u=>["Pending","WaitingForClient","Accepted","Running"].includes(u.status)).length,p=t.filter(u=>["Failed","ResultUnconfirmed"].includes(u.status)).length,d=[...s].sort((u,h)=>new Date(h.received_at||0)-new Date(u.received_at||0)).slice(0,5);return n.jsxs("div",{className:"overview-stack",children:[n.jsxs("div",{className:"overview-welcome",children:[n.jsxs("div",{children:[n.jsx(qt,{level:3,children:"实时运行状态"}),n.jsx(w,{type:"secondary",children:"真实连接状态 · 按用户分配范围隔离 · 管理操作留有审计记录"})]}),n.jsx(E,{icon:n.jsx(Le,{}),loading:c,onClick:r,children:"刷新概览"})]}),n.jsxs("div",{className:"overview-metric-grid",children:[n.jsx(Y,{bordered:!0,children:n.jsx(W,{title:"可用 Desktop Agent",value:o,suffix:`/ ${e.length}`,prefix:n.jsx(Ce,{})})}),n.jsx(Y,{bordered:!0,children:n.jsx(W,{title:"当前待处理任务",value:l,prefix:n.jsx(we,{})})}),n.jsx(Y,{bordered:!0,children:n.jsx(W,{title:"待核对 / 失败",value:p,prefix:n.jsx(Wt,{}),valueStyle:{color:p?"#cf1322":void 0}})}),n.jsx(Y,{bordered:!0,children:n.jsx(W,{title:"近期授权事件(最多 200 条)",value:s.length,prefix:n.jsx(Oe,{})})})]}),n.jsxs("div",{className:"overview-primary-grid",children:[n.jsx(re,{title:"Desktop Agent 连接",className:"overview-agent-card",bordered:!0,extra:n.jsx(E,{type:"link",onClick:()=>a("agents"),children:"查看全部"}),children:e.length===0?n.jsx(B,{image:B.PRESENTED_IMAGE_SIMPLE,description:"没有可访问的 Desktop Agent / Node"}):n.jsx("div",{className:"overview-node-list",children:e.slice(0,6).map(u=>n.jsxs("div",{className:"overview-node-row",children:[n.jsx("span",{className:"node-mark",children:n.jsx(Ce,{})}),n.jsxs("span",{className:"overview-node-copy",children:[n.jsx(w,{strong:!0,children:u.node_id}),n.jsx(w,{type:"secondary",children:u.active_account_id||"尚未确认活动账号"})]}),n.jsx(q,{color:ye(u.status),children:oe(u.status)})]},u.node_id))})}),n.jsxs(re,{title:"快速入口",className:"overview-shortcuts-card",bordered:!0,children:[n.jsxs("div",{className:"quick-entry-grid",children:[n.jsx(E,{icon:n.jsx(Oe,{}),onClick:()=>a("messages"),children:"消息工作台"}),n.jsx(E,{icon:n.jsx(st,{}),onClick:()=>a("agents"),children:"Desktop Agent"}),n.jsx(E,{icon:n.jsx(we,{}),onClick:()=>a("tasks"),children:"任务中心"}),n.jsx(E,{icon:n.jsx(At,{}),onClick:()=>a("contacts"),children:"通讯录"})]}),n.jsx(le,{className:"overview-boundary",type:"info",showIcon:!0,message:"权限由服务端强制执行",description:"界面筛选只用于展示;节点列表、任务、事件和账号数据 API 都按用户分配范围校验。"})]})]}),n.jsx(re,{title:"最近授权事件",bordered:!0,extra:n.jsx(w,{type:"secondary",children:"最多展示 5 条"}),children:d.length?n.jsx("div",{className:"event-preview-list",children:d.map(u=>n.jsxs("div",{className:"event-preview-row",children:[n.jsx("span",{className:"event-dot"}),n.jsxs("div",{children:[n.jsx(w,{strong:!0,children:u.chat_id||u.event_type||"授权事件"}),n.jsxs(w,{type:"secondary",children:[u.node_id," · ",u.chat_type==="Group"?"群聊":"私聊"]})]}),n.jsx(w,{type:"secondary",children:Z(u.received_at)})]},u.event_id))}):n.jsx(B,{image:B.PRESENTED_IMAGE_SIMPLE,description:"暂无事件"})})]})}function Ut({token:e,client:t}){const{message:s}=tt.useApp(),a=(t==null?void 0:t.node_id)||"",r=Te(t),[c,o]=i.useState(!1),[l,p]=i.useState(""),[d,u]=i.useState({scope:"",query:"",items:[],hasMore:!1,syncInfo:null}),[h,f]=i.useState(!1),[x,S]=i.useState({scope:"",loading:!1,error:""}),j=i.useRef(0),T=i.useRef(d);T.current=d;const I=JSON.stringify([a,r,c]),_=JSON.stringify([I,l.trim()]),M=i.useRef(_);M.current=_;const F=i.useRef(null);F.current={clientId:a,accountId:r,groupsOnly:c,query:l,token:e,contextScope:I,requestScope:_};const L=d.scope===I?d:{query:"",items:[],hasMore:!1,syncInfo:null},k=L.items,b=L.syncInfo,O=L.query===l.trim()&&L.hasMore,R=x.scope===_?x:{loading:!1,error:""},D=JSON.stringify([a,r,c,e]),V=i.useRef(D),z=i.useCallback(async(m=!1)=>{const C=F.current;if(!(C!=null&&C.clientId)||!C.accountId)return;const{accountId:X,groupsOnly:y,query:de,token:ue,contextScope:te,requestScope:A}=C,ae=++j.current,H=de.trim();S({scope:A,loading:!0,error:""});const U=T.current,G=m&&U.scope===te&&U.query===H?U.items.length:0;try{const J=new URLSearchParams({limit:"200",offset:String(G),groups_only:String(y)});H&&J.set("contains",H);const Q=await Se(je(X,"contacts",`?${J.toString()}`),{token:ue});if(!$e(ae,j.current,A,M.current))return;const se=at(Q);u(ne=>{const pe=m&&ne.scope===te&&ne.query===H;return{scope:te,query:H,items:pe?[...ne.items,...se]:se,hasMore:!!Q.has_more,syncInfo:Q.sync||null}}),S({scope:A,loading:!1,error:""})}catch(J){$e(ae,j.current,A,M.current)&&S({scope:A,loading:!1,error:J.message})}},[]);i.useEffect(()=>{const m=V.current!==D;V.current=D,!(!m&&l.trim())&&(j.current+=1,a&&r&&z())},[D,l,a,r,z]);const $=async()=>{if(!(!a||!r||h)){f(!0);try{await Se(je(r,"refresh"),{token:e,method:"POST",body:{stream_key:"contacts"}}),s.success("通讯录同步任务已提交;完成后刷新缓存查看最新数据。")}catch(m){s.error(m.message)}finally{f(!1)}}},K=k.filter(m=>!l||`${m.title} ${m.id} ${m.detail}`.toLowerCase().includes(l.toLowerCase())),ee=[{title:"联系人 / 群聊",dataIndex:"title",render:(m,C)=>{var X;return n.jsxs(ie,{children:[n.jsx("span",{className:"contact-avatar",children:(X=C.title)==null?void 0:X.slice(0,1)}),n.jsxs("span",{children:[n.jsx(w,{strong:!0,children:C.title}),n.jsx("br",{}),n.jsx(w,{type:"secondary",children:C.type==="Group"?"群聊":"联系人"})]})]})}},{title:"会话 ID",dataIndex:"id",render:m=>n.jsx(w,{code:!0,children:ve(m,32)})},{title:"备注 / 账号",dataIndex:"detail",render:m=>m||"—"}];return t?n.jsx("div",{className:"page-stack",children:n.jsxs(re,{bordered:!0,title:"通讯录缓存",subTitle:`${a} · ${r||"未确认活动账号"}`,extra:n.jsx(q,{color:(b==null?void 0:b.state)==="complete"?"success":"default",children:(b==null?void 0:b.state)||"尚未同步"}),children:[n.jsxs("div",{className:"table-toolbar",children:[n.jsx(nt.Search,{allowClear:!0,value:l,onChange:m=>{j.current+=1,p(m.target.value)},onSearch:()=>void z(),placeholder:"搜索联系人或群聊",style:{maxWidth:360}}),n.jsxs(ie,{wrap:!0,children:[n.jsx(Me,{value:c,onChange:m=>{j.current+=1,o(m)},options:[{value:!1,label:"全部联系人"},{value:!0,label:"只看群聊"}],style:{width:145}}),n.jsx(E,{onClick:$,loading:h,children:"同步通讯录"}),n.jsx(E,{icon:n.jsx(Le,{}),onClick:()=>void z(),loading:R.loading,children:"刷新缓存"}),n.jsx(E,{disabled:!0,title:"写操作尚未通过 Windows 真机验收",children:"添加好友"})]})]}),R.error&&n.jsx(le,{type:"error",showIcon:!0,message:R.error,action:n.jsx(E,{type:"link",onClick:()=>void z(),children:"重试"})}),n.jsx(ce,{rowKey:"id",columns:ee,dataSource:K,loading:R.loading,search:!1,options:!1,scroll:{x:"max-content",y:"max(100px, calc(100dvh - 520px))"},pagination:!1,toolBarRender:!1}),n.jsxs("div",{className:"table-footer",children:[n.jsxs(w,{type:"secondary",children:["最近同步:",Z(b==null?void 0:b.last_success_at)," · ",(b==null?void 0:b.backlog_count)==null?"积压未知":`积压 ${b.backlog_count}`]}),n.jsx(E,{type:"link",disabled:!O||R.loading,onClick:()=>void z(!0),children:"加载更多"})]})]})}):n.jsx(B,{className:"page-empty",image:B.PRESENTED_IMAGE_SIMPLE,description:"当前没有可访问的 Desktop Agent / Node"})}function Jt({tasks:e,selectedNodeId:t}){const[s,a]=i.useState("all"),r=e.filter(o=>o.node_id===t&&(s==="all"||o.status===s)),c=[{title:"任务类型",dataIndex:"kind",width:170,render:o=>n.jsx(w,{strong:!0,children:o})},{title:"状态",dataIndex:"status",width:140,render:o=>n.jsx(q,{color:ye(o),children:oe(o)})},{title:"账号 / Node",dataIndex:"account_id",render:(o,l)=>n.jsxs("span",{children:[o||"—",n.jsx("br",{}),n.jsx(w,{type:"secondary",children:l.node_id})]})},{title:"任务 ID",dataIndex:"task_id",render:o=>n.jsx(w,{code:!0,children:ve(o,24)})},{title:"执行说明",dataIndex:"result",render:(o,l)=>l.status==="WaitingForClient"?"Client 离线后等待显式恢复;不会自动重放写操作。":(o==null?void 0:o.message)||(o==null?void 0:o.error_code)||"—"},{title:"更新时间",dataIndex:"updated_at",width:175,render:Z}];return t?n.jsx("div",{className:"page-stack table-view",children:n.jsx(ce,{rowKey:"task_id",headerTitle:`任务结果 · ${r.length}`,columns:c,dataSource:r,search:!1,options:!1,scroll:{x:"max-content",y:"max(100px, calc(100dvh - 480px))"},pagination:{pageSize:10},toolBarRender:()=>[n.jsx(Me,{value:s,onChange:a,style:{width:170},options:[{value:"all",label:"全部状态"},...["Pending","WaitingForClient","Accepted","Running","Succeeded","Failed","ResultUnconfirmed"].map(o=>({value:o,label:oe(o)}))]},"status")]})}):n.jsx(B,{className:"page-empty",image:B.PRESENTED_IMAGE_SIMPLE,description:"请先选择一个可访问的 Desktop Agent / Node"})}function Qt({client:e}){return n.jsxs("div",{className:"page-stack",children:[n.jsx(le,{type:"warning",showIcon:!0,message:"Web 群发尚未开放",description:"Desktop Agent 能力不等于 Web 写操作已验收。当前版本保留入口说明,不会创建或发送群发任务。"}),n.jsx(re,{title:"受控群发验收门槛",bordered:!0,children:n.jsxs(ie,{direction:"vertical",size:"middle",children:[n.jsxs(w,{children:["当前上下文:",(e==null?void 0:e.node_id)||"未选择 Node"," · ",Te(e)||"未确认活动账号"]}),n.jsx(w,{type:"secondary",children:"冻结获准对象名单 → 预览确认 → 串行执行 → 查看逐项结果。消息发送仍需在 Windows 已登录会话完成真机验收。"}),n.jsxs(ie,{wrap:!0,children:[n.jsx(q,{color:"success",icon:n.jsx(Lt,{}),children:"范围约束"}),n.jsx(q,{color:"processing",children:"任务 API 不自动重放"}),n.jsx(q,{color:"warning",children:"等待 Web 验收"})]}),n.jsx(E,{type:"primary",disabled:!0,children:"创建群发任务"})]})})]})}function Yt({nodes:e,events:t,audit:s,selectedNodeId:a,onSelectNode:r}){const c=t.filter(d=>!a||d.node_id===a),o=[{title:"时间",dataIndex:"received_at",width:180,render:Z},{title:"Node",dataIndex:"node_id",width:180},{title:"会话",dataIndex:"chat_id",render:d=>ve(d,28)},{title:"类型",dataIndex:"chat_type",width:100,render:d=>d==="Group"?"群聊":"私聊"},{title:"授权内容",dataIndex:"content",ellipsis:!0}],l=[{title:"时间",dataIndex:"at",width:180,render:Z},{title:"操作者",dataIndex:"principal",width:170},{title:"操作",dataIndex:"action",width:180},{title:"资源",dataIndex:"resource"},{title:"结果",dataIndex:"result",width:100}],p=[{title:"Node",dataIndex:"node_id"},{title:"状态",dataIndex:"status",render:d=>n.jsx(q,{color:ye(d),children:oe(d)})},{title:"活动账号",dataIndex:"active_account_id",render:d=>d||"—"},{title:"最后心跳",dataIndex:"last_heartbeat_at",render:Z}];return n.jsxs("div",{className:"page-stack diagnostics-stack",children:[n.jsx(le,{type:"info",showIcon:!0,message:"管理员诊断视图",description:"事件按可访问 Node 过滤;审计记录包含跨用户管理信息,仅对管理员开放。"}),n.jsx(ze,{className:"diagnostics-tabs",items:[{key:"nodes",label:`Node 状态 · ${e.length}`,children:n.jsx("div",{className:"diagnostics-table",children:n.jsx(it,{size:"small",rowKey:"node_id",pagination:!1,dataSource:e,columns:p,scroll:{x:"max-content",y:"max(100px, calc(100dvh - 460px))"}})})},{key:"events",label:`授权事件 · ${c.length}`,children:n.jsx("div",{className:"diagnostics-table",children:n.jsx(ce,{rowKey:"event_id",columns:o,dataSource:c,search:!1,options:!1,scroll:{x:"max-content",y:"max(100px, calc(100dvh - 460px))"},pagination:{pageSize:8},toolBarRender:!1})})},{key:"audit",label:`操作审计 · ${s.length}`,children:n.jsx("div",{className:"diagnostics-table",children:n.jsx(ce,{rowKey:"id",columns:l,dataSource:s,search:!1,options:!1,scroll:{x:"max-content",y:"max(100px, calc(100dvh - 460px))"},pagination:{pageSize:8},toolBarRender:!1})})}]})]})}export{Qt as BroadcastView,Ut as ContactsView,Yt as DiagnosticsView,Xt as OverviewView,Jt as TasksView};