Files
wx-win-agent/control-plane/web/dist/assets/OperationsViews-CPuEGEMN.js
T
rogee 8760fa49f0
Build web service image / build (push) Successful in 2m7s
feat: add control-plane identity and management console
2026-09-27 20:27:31 +08:00

11 lines
28 KiB
JavaScript

import{r as i,C as te,c as I,g as xe,m as ve,l as p,a8 as ye,a9 as ae,aa as be,ab as qe,ac as Xe,ad as Se,o as Ue,ae as je,af as Ye,s as Qe,n as Ze,ag as de,ah as Je,I as ne,_ as re,O as n,$ as Y,T as ke,y as $e,X as B,B as N,a2 as et,z as ue,E as ge,ai as tt,S as R,q as at,a6 as Ce,U as we,a0 as W,aj as nt,a7 as me,ak as pe,al as he,Y as Q,Z as se,P as rt,W as ie}from"./index-B_02q8Ux.js";import{A as J,b as X,P as Z,F as st}from"./Table-ChBZjSv1.js";import"./ArrowUpOutlined-AK47BKBj.js";var it=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 Oe=e=>{var{prefixCls:t,className:s,hoverable:a=!0}=e,r=it(e,["prefixCls","className","hoverable"]);const{getPrefixCls:l}=i.useContext(te),o=l("card",t),c=I(`${o}-grid`,s,{[`${o}-grid-hoverable`]:a});return i.createElement("div",Object.assign({},r,{className:c}))},ot=e=>{const{antCls:t,componentCls:s,headerHeight:a,headerPadding:r,tabsMarginBottom:l}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:a,marginBottom:-1,padding:`0 ${p(r)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${p(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)} 0 0`},ae()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},be),{[`
> ${s}-typography,
> ${s}-typography-edit-content
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:"both",marginBottom:l,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${p(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:`
${p(r)} 0 0 0 ${s},
0 ${p(r)} 0 0 ${s},
${p(r)} ${p(r)} 0 0 ${s},
${p(r)} 0 0 0 ${s} inset,
0 ${p(r)} 0 0 ${s} inset;
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:a}}},ct=e=>{const{componentCls:t,iconCls:s,actionsLiMargin:a,cardActionsIconSize:r,colorBorderSecondary:l,actionsBg:o}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:o,borderTop:`${p(e.lineWidth)} ${e.lineType} ${l}`,display:"flex",borderRadius:`0 0 ${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)}`},ae()),{"& > 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:p(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${s}`]:{fontSize:r,lineHeight:p(e.calc(r).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${p(e.lineWidth)} ${e.lineType} ${l}`}}})},dt=e=>Object.assign(Object.assign({margin:`${p(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex"},ae()),{"&-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},be),"&-description":{color:e.colorTextDescription}}),ut=e=>{const{componentCls:t,colorFillAlter:s,headerPadding:a,bodyPadding:r}=e;return{[`${t}-head`]:{padding:`0 ${p(a)}`,background:s,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${p(e.padding)} ${p(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:l,bodyPadding:o,extraColor:c}=e;return{[t]:Object.assign(Object.assign({},ye(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:l},[`${t}-head`]:ot(e),[`${t}-extra`]:{marginInlineStart:"auto",color:c,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:o,borderRadius:`0 0 ${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)}`},[`${t}-grid`]:lt(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${p(e.borderRadiusLG)} ${p(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:ct(e),[`${t}-meta`]:dt(e)}),[`${t}-bordered`]:{border:`${p(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:`${p(e.borderRadiusLG)} ${p(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`]:ut(e),[`${t}-loading`]:gt(e),[`${t}-rtl`]:{direction:"rtl"}}},pt=e=>{const{componentCls:t,bodyPaddingSM:s,headerPaddingSM:a,headerHeightSM:r,headerFontSizeSM:l}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:r,padding:`0 ${p(a)}`,fontSize:l,[`> ${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"}}}}},ht=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}},ft=xe("Card",e=>{const t=ve(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[mt(t),pt(t)]},ht);var fe=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 xt=e=>{const{actionClasses:t,actions:s=[],actionStyle:a}=e;return i.createElement("ul",{className:t,style:a},s.map((r,l)=>{const o=`action-${l}`;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:l,extra:o,headStyle:c={},bodyStyle:g={},title:d,loading:u,bordered:m,variant:f,size:x,type:j,cover:O,actions:P,tabList:w,children:_,activeTabKey:D,defaultActiveTabKey:F,tabBarExtraContent:T,hoverable:V,tabProps:K={},classNames:$,styles:h}=e,E=fe(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:z,direction:M,card:b}=i.useContext(te),[U]=qe("card",f,m),k=C=>{var v;(v=e.onTabChange)===null||v===void 0||v.call(e,C)},A=C=>{var v;return I((v=b==null?void 0:b.classNames)===null||v===void 0?void 0:v[C],$==null?void 0:$[C])},H=C=>{var v;return Object.assign(Object.assign({},(v=b==null?void 0:b.styles)===null||v===void 0?void 0:v[C]),h==null?void 0:h[C])},Ne=i.useMemo(()=>{let C=!1;return i.Children.forEach(_,v=>{(v==null?void 0:v.type)===Oe&&(C=!0)}),C},[_]),y=z("card",s),[Ie,_e,ze]=ft(y),Pe=i.createElement(je,{loading:!0,active:!0,paragraph:{rows:4},title:!1},_),oe=D!==void 0,Te=Object.assign(Object.assign({},K),{[oe?"activeKey":"defaultActiveKey"]:oe?D:F,tabBarExtraContent:T});let le;const q=Xe(x),Re=!q||q==="default"?"large":q,ce=w?i.createElement(Se,Object.assign({size:Re},Te,{className:`${y}-head-tabs`,onChange:k,items:w.map(C=>{var{tab:v}=C,ee=fe(C,["tab"]);return Object.assign({label:v},ee)})})):null;if(d||o||ce){const C=I(`${y}-head`,A("header")),v=I(`${y}-head-title`,A("title")),ee=I(`${y}-extra`,A("extra")),Ke=Object.assign(Object.assign({},c),H("header"));le=i.createElement("div",{className:C,style:Ke},i.createElement("div",{className:`${y}-head-wrapper`},d&&i.createElement("div",{className:v,style:H("title")},d),o&&i.createElement("div",{className:ee,style:H("extra")},o)),ce)}const Me=I(`${y}-cover`,A("cover")),Le=O?i.createElement("div",{className:Me,style:H("cover")},O):null,Be=I(`${y}-body`,A("body")),De=Object.assign(Object.assign({},g),H("body")),Ae=i.createElement("div",{className:Be,style:De},u?Pe:_),He=I(`${y}-actions`,A("actions")),Ge=P!=null&&P.length?i.createElement(xt,{actionClasses:He,actionStyle:H("actions"),actions:P}):null,We=Ue(E,["onTabChange"]),Fe=I(y,b==null?void 0:b.className,{[`${y}-loading`]:u,[`${y}-bordered`]:U!=="borderless",[`${y}-hoverable`]:V,[`${y}-contain-grid`]:Ne,[`${y}-contain-tabs`]:w==null?void 0:w.length,[`${y}-${q}`]:q,[`${y}-type-${j}`]:!!j,[`${y}-rtl`]:M==="rtl"},a,r,_e,ze),Ve=Object.assign(Object.assign({},b==null?void 0:b.style),l);return Ie(i.createElement("div",Object.assign({ref:t},We,{className:Fe,style:Ve}),le,Le,Ae,Ge))});var yt=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 bt=e=>{const{prefixCls:t,className:s,avatar:a,title:r,description:l}=e,o=yt(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:c}=i.useContext(te),g=c("card",t),d=I(`${g}-meta`,s),u=a?i.createElement("div",{className:`${g}-meta-avatar`},a):null,m=r?i.createElement("div",{className:`${g}-meta-title`},r):null,f=l?i.createElement("div",{className:`${g}-meta-description`},l):null,x=m||f?i.createElement("div",{className:`${g}-meta-detail`},m,f):null;return i.createElement("div",Object.assign({},o,{className:d}),u,x)},G=vt;G.Grid=Oe;G.Meta=bt;const St=e=>{const{value:t,formatter:s,precision:a,decimalSeparator:r,groupSeparator:l="",prefixCls:o}=e;let c;if(typeof s=="function")c=s(t);else{const g=String(t),d=g.match(/^(-?)(\d*)(\.(\d+))?$/);if(!d||g==="-")c=g;else{const u=d[1];let m=d[2]||"0",f=d[4]||"";m=m.replace(/\B(?=(\d{3})+(?!\d))/g,l),typeof a=="number"&&(f=f.padEnd(a,"0").slice(0,a>0?a:0)),f&&(f=`${r}${f}`),c=[i.createElement("span",{key:"int",className:`${o}-content-value-int`},u,m),f&&i.createElement("span",{key:"decimal",className:`${o}-content-value-decimal`},f)]}}return i.createElement("span",{className:`${o}-content-value`},c)},jt=e=>{const{componentCls:t,marginXXS:s,padding:a,colorTextDescription:r,titleFontSize:l,colorTextHeading:o,contentFontSize:c,fontFamily:g}=e;return{[t]:Object.assign(Object.assign({},ye(e)),{[`${t}-title`]:{marginBottom:s,color:r,fontSize:l},[`${t}-skeleton`]:{paddingTop:a},[`${t}-content`]:{color:o,fontSize:c,fontFamily:g,[`${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}}})}},$t=e=>{const{fontSizeHeading3:t,fontSize:s}=e;return{titleFontSize:s,contentFontSize:t}},Ct=xe("Statistic",e=>{const t=ve(e,{});return jt(t)},$t);var wt=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 L=i.forwardRef((e,t)=>{const{prefixCls:s,className:a,rootClassName:r,style:l,valueStyle:o,value:c=0,title:g,valueRender:d,prefix:u,suffix:m,loading:f=!1,formatter:x,precision:j,decimalSeparator:O=".",groupSeparator:P=",",onMouseEnter:w,onMouseLeave:_}=e,D=wt(e,["prefixCls","className","rootClassName","style","valueStyle","value","title","valueRender","prefix","suffix","loading","formatter","precision","decimalSeparator","groupSeparator","onMouseEnter","onMouseLeave"]),{getPrefixCls:F,direction:T,className:V,style:K}=Ye("statistic"),$=F("statistic",s),[h,E,z]=Ct($),M=i.createElement(St,{decimalSeparator:O,groupSeparator:P,prefixCls:$,formatter:x,precision:j,value:c}),b=I($,{[`${$}-rtl`]:T==="rtl"},V,a,r,E,z),U=i.useRef(null);i.useImperativeHandle(t,()=>({nativeElement:U.current}));const k=Qe(D,{aria:!0,data:!0});return h(i.createElement("div",Object.assign({},k,{ref:U,className:b,style:Object.assign(Object.assign({},K),l),onMouseEnter:w,onMouseLeave:_}),g&&i.createElement("div",{className:`${$}-title`},g),i.createElement(je,{paragraph:!1,loading:f,className:`${$}-skeleton`,active:!0},i.createElement("div",{style:o,className:`${$}-content`},u&&i.createElement("span",{className:`${$}-content-prefix`},u),d?d(M):M,m&&i.createElement("span",{className:`${$}-content-suffix`},m)))))}),Ot=[["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(g=>g.slice(1,-1)),l=t.replace(a,"[]"),o=Ot.reduce((g,[d,u])=>{if(g.includes(d)){const m=Math.floor(s/u);return s-=m*u,g.replace(new RegExp(`${d}+`,"g"),f=>{const x=f.length;return m.toString().padStart(x,"0")})}return g},l);let c=0;return o.replace(a,()=>{const g=r[c];return c+=1,g})}function Nt(e,t,s){const{format:a=""}=t,r=new Date(e).getTime(),l=Date.now(),o=Math.max(s?r-l:l-r,0);return Et(o,a)}var It=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 _t(e){return new Date(e).getTime()}const Ee=e=>{const{value:t,format:s="HH:mm:ss",onChange:a,onFinish:r,type:l}=e,o=It(e,["value","format","onChange","onFinish","type"]),c=l==="countdown",[g,d]=i.useState(null),u=Ze(()=>{const x=Date.now(),j=_t(t);d({});const O=c?j-x:x-j;return a==null||a(O),c&&j<x?(r==null||r(),!1):!0});i.useEffect(()=>{let x;const j=()=>de.cancel(x),O=()=>{x=de(()=>{u()&&O()})};return O(),j},[t,c]),i.useEffect(()=>{d({})},[]);const m=(x,j)=>g?Nt(x,Object.assign(Object.assign({},j),{format:s}),c):"-",f=x=>Je(x,{title:void 0});return i.createElement(L,Object.assign({},o,{value:t,valueRender:f,formatter:m}))},zt=e=>i.createElement(Ee,Object.assign({},e,{type:"countdown"})),Pt=i.memo(zt);L.Timer=Ee;L.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"},Rt=function(t,s){return i.createElement(ne,re({},t,{ref:s,icon:Tt}))},Mt=i.forwardRef(Rt),Lt={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(ne,re({},t,{ref:s,icon:Lt}))},Dt=i.forwardRef(Bt),At={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"},Ht=function(t,s){return i.createElement(ne,re({},t,{ref:s,icon:At}))},Gt=i.forwardRef(Ht);const{Text:S,Title:Wt}=ke;function qt({nodes:e,tasks:t,events:s,onNavigate:a,onRefresh:r,refreshing:l}){const o=e.filter(nt).length,c=t.filter(u=>["Pending","WaitingForClient","Accepted","Running"].includes(u.status)).length,g=t.filter(u=>["Failed","ResultUnconfirmed"].includes(u.status)).length,d=[...s].sort((u,m)=>new Date(m.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(Wt,{level:3,children:"实时运行状态"}),n.jsx(S,{type:"secondary",children:"真实连接状态 · 按用户分配范围隔离 · 管理操作留有审计记录"})]}),n.jsx(N,{icon:n.jsx(we,{}),loading:l,onClick:r,children:"刷新概览"})]}),n.jsxs("div",{className:"overview-metric-grid",children:[n.jsx(G,{bordered:!0,children:n.jsx(L,{title:"可用 Desktop Agent",value:o,suffix:`/ ${e.length}`,prefix:n.jsx(me,{})})}),n.jsx(G,{bordered:!0,children:n.jsx(L,{title:"当前待处理任务",value:c,prefix:n.jsx(pe,{})})}),n.jsx(G,{bordered:!0,children:n.jsx(L,{title:"待核对 / 失败",value:g,prefix:n.jsx(Gt,{}),valueStyle:{color:g?"#cf1322":void 0}})}),n.jsx(G,{bordered:!0,children:n.jsx(L,{title:"近期授权事件",value:s.length,prefix:n.jsx(he,{})})})]}),n.jsxs("div",{className:"overview-primary-grid",children:[n.jsx(X,{title:"Desktop Agent 连接",className:"overview-agent-card",bordered:!0,extra:n.jsx(N,{type:"link",onClick:()=>a("agents"),children:"查看全部"}),children:e.length===0?n.jsx(R,{image:R.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(me,{})}),n.jsxs("span",{className:"overview-node-copy",children:[n.jsx(S,{strong:!0,children:u.node_id}),n.jsx(S,{type:"secondary",children:u.active_account_id||"尚未确认活动账号"})]}),n.jsx(B,{color:se(u.status),children:Q(u.status)})]},u.node_id))})}),n.jsxs(X,{title:"快速入口",className:"overview-shortcuts-card",bordered:!0,children:[n.jsxs("div",{className:"quick-entry-grid",children:[n.jsx(N,{icon:n.jsx(he,{}),onClick:()=>a("messages"),children:"消息工作台"}),n.jsx(N,{icon:n.jsx(rt,{}),onClick:()=>a("agents"),children:"Desktop Agent"}),n.jsx(N,{icon:n.jsx(pe,{}),onClick:()=>a("tasks"),children:"任务中心"}),n.jsx(N,{icon:n.jsx(Dt,{}),onClick:()=>a("contacts"),children:"通讯录"})]}),n.jsx(J,{className:"overview-boundary",type:"info",showIcon:!0,message:"权限由服务端强制执行",description:"界面筛选只用于展示;节点列表、任务、事件和账号数据 API 都按用户分配范围校验。"})]})]}),n.jsx(X,{title:"最近授权事件",bordered:!0,extra:n.jsx(S,{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(S,{strong:!0,children:u.chat_id||u.event_type||"授权事件"}),n.jsxs(S,{type:"secondary",children:[u.node_id," · ",u.chat_type==="Group"?"群聊":"私聊"]})]}),n.jsx(S,{type:"secondary",children:W(u.received_at)})]},u.event_id))}):n.jsx(R,{image:R.PRESENTED_IMAGE_SIMPLE,description:"暂无事件"})})]})}function Xt({token:e,client:t}){const{message:s}=et.useApp(),a=(t==null?void 0:t.node_id)||"",r=$e(t),[l,o]=i.useState(!1),[c,g]=i.useState(""),[d,u]=i.useState([]),[m,f]=i.useState(null),[x,j]=i.useState(!1),[O,P]=i.useState(!1),[w,_]=i.useState({loading:!1,error:""}),[D,F]=i.useState(0),T=i.useCallback(async(h=!1)=>{if(!(!a||!r)){_({loading:!0,error:""});try{const E=new URLSearchParams({limit:"200",offset:String(h?d.length:0),groups_only:String(l)});c.trim()&&E.set("contains",c.trim());const z=await ue(ge(r,"contacts",`?${E.toString()}`),{token:e}),M=tt(z);u(b=>h?[...b,...M]:M),j(!!z.has_more),f(z.sync||null),_({loading:!1,error:""})}catch(E){_({loading:!1,error:E.message})}}},[r,a,d.length,l,c,e]);i.useEffect(()=>{u([]),j(!1),f(null),a&&r&&T()},[a,r,l,D]);const V=async()=>{if(!(!a||!r||O)){P(!0);try{await ue(ge(r,"refresh"),{token:e,method:"POST",body:{stream_key:"contacts"}}),s.success("通讯录同步任务已提交;完成后刷新缓存查看最新数据。")}catch(h){s.error(h.message)}finally{P(!1)}}},K=d.filter(h=>!c||`${h.title} ${h.id} ${h.detail}`.toLowerCase().includes(c.toLowerCase())),$=[{title:"联系人 / 群聊",dataIndex:"title",render:(h,E)=>{var z;return n.jsxs(Y,{children:[n.jsx("span",{className:"contact-avatar",children:(z=E.title)==null?void 0:z.slice(0,1)}),n.jsxs("span",{children:[n.jsx(S,{strong:!0,children:E.title}),n.jsx("br",{}),n.jsx(S,{type:"secondary",children:E.type==="Group"?"群聊":"联系人"})]})]})}},{title:"会话 ID",dataIndex:"id",render:h=>n.jsx(S,{code:!0,children:ie(h,32)})},{title:"备注 / 账号",dataIndex:"detail",render:h=>h||"—"}];return t?n.jsx("div",{className:"page-stack",children:n.jsxs(X,{bordered:!0,title:"通讯录缓存",subTitle:`${a} · ${r||"未确认活动账号"}`,extra:n.jsx(B,{color:(m==null?void 0:m.state)==="complete"?"success":"default",children:(m==null?void 0:m.state)||"尚未同步"}),children:[n.jsxs("div",{className:"table-toolbar",children:[n.jsx(at.Search,{allowClear:!0,value:c,onChange:h=>g(h.target.value),onSearch:()=>void T(),placeholder:"搜索联系人或群聊",style:{maxWidth:360}}),n.jsxs(Y,{wrap:!0,children:[n.jsx(Ce,{value:l,onChange:o,options:[{value:!1,label:"全部联系人"},{value:!0,label:"只看群聊"}],style:{width:145}}),n.jsx(N,{onClick:V,loading:O,children:"同步通讯录"}),n.jsx(N,{icon:n.jsx(we,{}),onClick:()=>F(h=>h+1),loading:w.loading,children:"刷新缓存"}),n.jsx(N,{disabled:!0,title:"写操作尚未通过 Windows 真机验收",children:"添加好友"})]})]}),w.error&&n.jsx(J,{type:"error",showIcon:!0,message:w.error,action:n.jsx(N,{type:"link",onClick:()=>void T(),children:"重试"})}),n.jsx(Z,{rowKey:"id",columns:$,dataSource:K,loading:w.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(S,{type:"secondary",children:["最近同步:",W(m==null?void 0:m.last_success_at)," · ",(m==null?void 0:m.backlog_count)==null?"积压未知":`积压 ${m.backlog_count}`]}),n.jsx(N,{type:"link",disabled:!x||w.loading,onClick:()=>void T(!0),children:"加载更多"})]})]})}):n.jsx(R,{className:"page-empty",image:R.PRESENTED_IMAGE_SIMPLE,description:"当前没有可访问的 Desktop Agent / Node"})}function Ut({tasks:e,selectedNodeId:t}){const[s,a]=i.useState("all"),r=e.filter(o=>o.node_id===t&&(s==="all"||o.status===s)),l=[{title:"任务类型",dataIndex:"kind",width:170,render:o=>n.jsx(S,{strong:!0,children:o})},{title:"状态",dataIndex:"status",width:140,render:o=>n.jsx(B,{color:se(o),children:Q(o)})},{title:"账号 / Node",dataIndex:"account_id",render:(o,c)=>n.jsxs("span",{children:[o||"—",n.jsx("br",{}),n.jsx(S,{type:"secondary",children:c.node_id})]})},{title:"任务 ID",dataIndex:"task_id",render:o=>n.jsx(S,{code:!0,children:ie(o,24)})},{title:"执行说明",dataIndex:"result",render:(o,c)=>c.status==="WaitingForClient"?"Client 离线后等待显式恢复;不会自动重放写操作。":(o==null?void 0:o.message)||(o==null?void 0:o.error_code)||"—"},{title:"更新时间",dataIndex:"updated_at",width:175,render:W}];return t?n.jsx("div",{className:"page-stack table-view",children:n.jsx(Z,{rowKey:"task_id",headerTitle:`任务结果 · ${r.length}`,columns:l,dataSource:r,search:!1,options:!1,scroll:{x:"max-content",y:"max(100px, calc(100dvh - 480px))"},pagination:{pageSize:10},toolBarRender:()=>[n.jsx(Ce,{value:s,onChange:a,style:{width:170},options:[{value:"all",label:"全部状态"},...["Pending","WaitingForClient","Accepted","Running","Succeeded","Failed","ResultUnconfirmed"].map(o=>({value:o,label:Q(o)}))]},"status")]})}):n.jsx(R,{className:"page-empty",image:R.PRESENTED_IMAGE_SIMPLE,description:"请先选择一个可访问的 Desktop Agent / Node"})}function Yt({client:e}){return n.jsxs("div",{className:"page-stack",children:[n.jsx(J,{type:"warning",showIcon:!0,message:"Web 群发尚未开放",description:"Desktop Agent 能力不等于 Web 写操作已验收。当前版本保留入口说明,不会创建或发送群发任务。"}),n.jsx(X,{title:"受控群发验收门槛",bordered:!0,children:n.jsxs(Y,{direction:"vertical",size:"middle",children:[n.jsxs(S,{children:["当前上下文:",(e==null?void 0:e.node_id)||"未选择 Node"," · ",$e(e)||"未确认活动账号"]}),n.jsx(S,{type:"secondary",children:"冻结获准对象名单 → 预览确认 → 串行执行 → 查看逐项结果。消息发送仍需在 Windows 已登录会话完成真机验收。"}),n.jsxs(Y,{wrap:!0,children:[n.jsx(B,{color:"success",icon:n.jsx(Mt,{}),children:"范围约束"}),n.jsx(B,{color:"processing",children:"任务 API 不自动重放"}),n.jsx(B,{color:"warning",children:"等待 Web 验收"})]}),n.jsx(N,{type:"primary",disabled:!0,children:"创建群发任务"})]})})]})}function Qt({nodes:e,events:t,audit:s,selectedNodeId:a,onSelectNode:r}){const l=t.filter(d=>!a||d.node_id===a),o=[{title:"时间",dataIndex:"received_at",width:180,render:W},{title:"Node",dataIndex:"node_id",width:180},{title:"会话",dataIndex:"chat_id",render:d=>ie(d,28)},{title:"类型",dataIndex:"chat_type",width:100,render:d=>d==="Group"?"群聊":"私聊"},{title:"授权内容",dataIndex:"content",ellipsis:!0}],c=[{title:"时间",dataIndex:"at",width:180,render:W},{title:"操作者",dataIndex:"principal",width:170},{title:"操作",dataIndex:"action",width:180},{title:"资源",dataIndex:"resource"},{title:"结果",dataIndex:"result",width:100}],g=[{title:"Node",dataIndex:"node_id"},{title:"状态",dataIndex:"status",render:d=>n.jsx(B,{color:se(d),children:Q(d)})},{title:"活动账号",dataIndex:"active_account_id",render:d=>d||"—"},{title:"最后心跳",dataIndex:"last_heartbeat_at",render:W}];return n.jsxs("div",{className:"page-stack diagnostics-stack",children:[n.jsx(J,{type:"info",showIcon:!0,message:"管理员诊断视图",description:"事件按可访问 Node 过滤;审计记录包含跨用户管理信息,仅对管理员开放。"}),n.jsx(Se,{className:"diagnostics-tabs",items:[{key:"nodes",label:`Node 状态 · ${e.length}`,children:n.jsx("div",{className:"diagnostics-table",children:n.jsx(st,{size:"small",rowKey:"node_id",pagination:!1,dataSource:e,columns:g,scroll:{x:"max-content",y:"max(100px, calc(100dvh - 460px))"}})})},{key:"events",label:`授权事件 · ${l.length}`,children:n.jsx("div",{className:"diagnostics-table",children:n.jsx(Z,{rowKey:"event_id",columns:o,dataSource:l,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(Z,{rowKey:"id",columns:c,dataSource:s,search:!1,options:!1,scroll:{x:"max-content",y:"max(100px, calc(100dvh - 460px))"},pagination:{pageSize:8},toolBarRender:!1})})}]})]})}export{Yt as BroadcastView,Xt as ContactsView,Qt as DiagnosticsView,qt as OverviewView,Ut as TasksView};