refactor(frontend): P1-P2 架构统一 — utils/hooks/api 模块化

P1:
- utils/storage.ts、theme.ts、validate.ts + index 统一出口
- request/store/useTheme 接入 storage;清零 confirm/alert
- PipelineManager、TerminalAuditTab 拆分子模块(<700行红线)

P2:
- api/monitor、api/deploy 子目录化
- hooks/api 扩展:servers/pipelines/alerts/audit/sessionCommands
- PipelineManager、AuditOperationsTab 接入 TanStack Query
This commit is contained in:
Logan.Li committed 2026-06-26 00:18:14 +08:00
1 parent d19a03d427
commit f45e203e21
196 files changed
+3228 -2018

No files matched your search

+1
View File
@@ -0,0 +1 @@
import{r as n,j as a,aw as ot,ax as Pe,ao as nt,ak as Te,ay as rt,ah as st,ap as Ie,az as at,al as L,aA as lt,aj as j,am as E,aB as $,aC as ct,aD as Ne,aE as it,aF as dt,aG as ut,aH as pt,aI as ft,aJ as mt,aK as ht,aL as gt,aM as Ee,aN as vt,a0 as te,W as Re,O as xt}from"./index-HuRw9UhJ.js";import{u as St}from"./index-DwvHXNyF.js";import{C as wt}from"./chevron-up-GXrRy2ul.js";function Ct(t){const o=yt(t),e=n.forwardRef((s,r)=>{const{children:d,...l}=s,c=n.Children.toArray(d),i=c.find(bt);if(i){const p=i.props.children,g=c.map(x=>x===i?n.Children.count(p)>1?n.Children.only(null):n.isValidElement(p)?p.props.children:null:x);return a.jsx(o,{...l,ref:r,children:n.isValidElement(p)?n.cloneElement(p,void 0,g):null})}return a.jsx(o,{...l,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function yt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const l=Et(r),c=Tt(d,r.props);return r.type!==n.Fragment&&(c.ref=s?ot(s,l):l),n.cloneElement(r,c)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var It=Symbol("radix.slottable");function bt(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===It}function Tt(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...c)=>{const i=d(...c);return r(...c),i}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function Et(t){let o=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=Object.getOwnPropertyDescriptor(t,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var Pt=[" ","Enter","ArrowUp","ArrowDown"],Nt=[" ","Enter"],J="Select",[ie,de,Rt]=at(J),[oe]=st(J,[Rt,Pe]),ue=Pe(),[_t,G]=oe(J),[jt,Mt]=oe(J),_e=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:l,defaultValue:c,onValueChange:i,dir:p,name:g,autoComplete:x,disabled:P,required:b,form:y}=t,u=ue(o),[h,S]=n.useState(null),[m,v]=n.useState(null),[F,M]=n.useState(!1),ne=nt(p),[N,O]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:J}),[U,q]=Te({prop:l,defaultProp:c,onChange:i,caller:J}),k=n.useRef(null),V=h?y||!!h.closest("form"):!0,[z,B]=n.useState(new Set),H=Array.from(z).map(R=>R.props.value).join(";");return a.jsx(rt,{...u,children:a.jsxs(_t,{required:b,scope:o,trigger:h,onTriggerChange:S,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:q,open:N,onOpenChange:O,dir:ne,triggerPointerDownPosRef:k,disabled:P,children:[a.jsx(ie.Provider,{scope:o,children:a.jsx(jt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(R=>{B(D=>new Set(D).add(R))},[]),onNativeOptionRemove:n.useCallback(R=>{B(D=>{const W=new Set(D);return W.delete(R),W})},[]),children:e})}),V?a.jsxs(Je,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:x,value:U,onChange:R=>q(R.target.value),disabled:P,form:y,children:[U===void 0?a.jsx("option",{value:""}):null,Array.from(z)]},H):null]})})};_e.displayName=J;var je="SelectTrigger",Me=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),l=G(je,e),c=l.disabled||s,i=L(o,l.onTriggerChange),p=de(e),g=n.useRef("touch"),[x,P,b]=et(u=>{const h=p().filter(v=>!v.disabled),S=h.find(v=>v.value===l.value),m=tt(h,u,S);m!==void 0&&l.onValueChange(m.value)}),y=u=>{c||(l.onOpenChange(!0),b()),u&&(l.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return a.jsx(lt,{asChild:!0,...d,children:a.jsx(j.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Qe(l.value)?"":void 0,...r,ref:i,onClick:E(r.onClick,u=>{u.currentTarget.focus(),g.current!=="mouse"&&y(u)}),onPointerDown:E(r.onPointerDown,u=>{g.current=u.pointerType;const h=u.target;h.hasPointerCapture(u.pointerId)&&h.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(y(u),u.preventDefault())}),onKeyDown:E(r.onKeyDown,u=>{const h=x.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&P(u.key),!(h&&u.key===" ")&&Pt.includes(u.key)&&(y(),u.preventDefault())})})})});Me.displayName=je;var Ae="SelectValue",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:l="",...c}=t,i=G(Ae,e),{onValueNodeHasChildrenChange:p}=i,g=d!==void 0,x=L(o,i.onValueNodeChange);return $(()=>{p(g)},[p,g]),a.jsx(j.span,{...c,ref:x,style:{pointerEvents:"none"},children:Qe(i.value)?a.jsx(a.Fragment,{children:l}):d})});Oe.displayName=Ae;var At="SelectIcon",De=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return a.jsx(j.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});De.displayName=At;var Ot="SelectPortal",Le=t=>a.jsx(ct,{asChildLine truncated