@fudanda/admin-antd 1.20261015.1-beta.1 → 2.20261024.1-beta.1
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/LICENSE +21 -21
- package/README.md +58 -42
- package/THIRD_PARTY_NOTICES.md +55 -55
- package/dist/automation.js +3 -3
- package/dist/chunks/App-DNjXLysb.js +79 -0
- package/dist/chunks/{AppModal-B_xvSaeq.js → AppModal-DJzQA6FR.js} +1 -1
- package/dist/chunks/ArcBaseAdmin-BZrHGq2f.js +1 -0
- package/dist/chunks/ConfigurableTable-DzmZDd8F.js +55 -0
- package/dist/chunks/{DashboardPage-BTLufKzi.js → DashboardPage-BohGodSl.js} +1 -1
- package/dist/chunks/DataScopePanel-B2-x8Jcz.js +1 -0
- package/dist/chunks/{DateTimeText-rk9NeYgA.js → DateTimeText-CIt0Qy45.js} +1 -1
- package/dist/chunks/DepartmentsPage-DMWY__Y_.js +1 -0
- package/dist/chunks/DictTag-2-adKbYg.js +1 -0
- package/dist/chunks/DictsPage-DILDyHi-.js +15 -0
- package/dist/chunks/EditFormModal-DNHOZHxM.js +1 -0
- package/dist/chunks/EntityContextRuntime-DMklAv-k.js +1 -0
- package/dist/chunks/{EntityContextRuntime-BrAz-aCV.js → EntityContextRuntime-sslBZqYD.js} +1 -1
- package/dist/chunks/{EntityRelationButton-C8Cl8wyh.js → EntityRelationButton-DWn1rC2J.js} +2 -2
- package/dist/chunks/{ExportButton-D4IvZKHy.js → ExportButton-AzH4D0oW.js} +1 -1
- package/dist/chunks/FileNameCell-DPyi64Rv.js +1 -0
- package/dist/chunks/FileStorageConfigsPage-CzuOgeK0.js +15 -0
- package/dist/chunks/FileTypeIcon-DIih3XQG.js +1 -0
- package/dist/chunks/{FileViewerPreviewPanel-wbXzgqxc.js → FileViewerPreviewPanel-CMqVtGCr.js} +2 -2
- package/dist/chunks/FilesPage-BaEBCOCs.js +43 -0
- package/dist/chunks/IdentitySecurityPage-BO7nY8id.js +1 -0
- package/dist/chunks/{JsonPreviewPanel-D8YpZD1A.js → JsonPreviewPanel-Dhbza-Uu.js} +1 -1
- package/dist/chunks/LogStatsScaffold-CLycj3da.js +1 -0
- package/dist/chunks/LoginLogsPage-DTmHi8u0.js +1 -0
- package/dist/chunks/LoginLogsTable-DVmHnC6V.js +1 -0
- package/dist/chunks/{MasterDetailLayout-DDVFodpX.js → MasterDetailLayout-sjPWw8BI.js} +2 -2
- package/dist/chunks/{MemberAssignmentSheet-NWm5vThg.js → MemberAssignmentSheet-Czbt6_zv.js} +1 -1
- package/dist/chunks/MenuCommandPalette-BCOzf-Kq.js +8 -0
- package/dist/chunks/MenusPage-DN8DTGB1.js +1 -0
- package/dist/chunks/{ModalFooter-vXDpmYTM.js → ModalFooter-RMlvqrO9.js} +1 -1
- package/dist/chunks/NavListPanel-vjIOIqK0.js +1 -0
- package/dist/chunks/OnlineSessionsPage-FoHYZKlR.js +1 -0
- package/dist/chunks/OperationLogsPage-BeRnGcBJ.js +1 -0
- package/dist/chunks/OperationLogsTable-COI-Lp-y.js +1 -0
- package/dist/chunks/PDFPreviewPanel-BIQuBnZZ.js +37 -0
- package/dist/chunks/PasswordInput-DGEJO9yx.js +1 -0
- package/dist/chunks/PositionsPage-DohI0luX.js +1 -0
- package/dist/chunks/PreferencesSheetBody-B9niQABW.js +43 -0
- package/dist/chunks/ProfilePage-CVTRv7xb.js +15 -0
- package/dist/chunks/RelationPanel-B1X6AVaM.js +36 -0
- package/dist/chunks/RolesPage-CtUw93L8.js +1 -0
- package/dist/chunks/{SearchToolbar-BAh56OAa.js → SearchToolbar-CvgYKUjr.js} +1 -1
- package/dist/chunks/{SessionClientTag-DafwXf-o.js → SessionClientTag-DIwnYodW.js} +2 -2
- package/dist/chunks/SessionConflictModal-BLNuDsN_.js +1 -0
- package/dist/chunks/SettingRow-DVNmTJWC.js +1 -0
- package/dist/chunks/SettingsPage-BRnCxYQm.js +26 -0
- package/dist/chunks/StatCard-Czjfs0fa.js +4 -0
- package/dist/chunks/{UserDisplay-BYhcfa84.js → UserDisplay-J0Re8z-7.js} +1 -1
- package/dist/chunks/UserGroupsPage-CNwbejx-.js +1 -0
- package/dist/chunks/{UserLogsPanels-3ZlKQsCu.js → UserLogsPanels-BHeSxWrk.js} +2 -2
- package/dist/chunks/UserTransferSelect-CAeyxdor.js +22 -0
- package/dist/chunks/UsersPage-BXt9fOru.js +36 -0
- package/dist/chunks/{archive-D0BSMQmn.js → archive-B_IKvysI.js} +4 -4
- package/dist/chunks/chart-data-DImT_Mzn.js +5 -0
- package/dist/chunks/{chart-renderer-BWLqOvLF.js → chart-renderer-k-Rd8vdL.js} +1 -1
- package/dist/chunks/{user-cC0uCe3d.js → chevron-right-EBApfX6q.js} +2 -2
- package/dist/chunks/{clipboard-BKPNFY58.js → clipboard-ERcMSMRH.js} +1 -1
- package/dist/chunks/{confirm-CC2F8XXe.js → confirm-BtBBEqk8.js} +1 -1
- package/dist/chunks/{data-DPCozzrG.js → data-B05HzECj.js} +1 -1
- package/dist/chunks/{deleteAction-NGTDhZud.js → deleteAction-CCocr5uV.js} +1 -1
- package/dist/chunks/{diagram-vBbcsoK2.js → diagram-D9cwc7QH.js} +3 -3
- package/dist/chunks/dist-Bauqz5on.js +1 -0
- package/dist/chunks/{drawing-CUAfa3D5.js → drawing-D2Qrun-P.js} +2 -2
- package/dist/chunks/{email-U025DuXM.js → email-ByshRsFv.js} +2 -2
- package/dist/chunks/{export-CCaKk9VN.js → export-DlTz5dc2.js} +5 -5
- package/dist/chunks/{eye-DNBTmA6c.js → eye-off-BtJoIT5n.js} +1 -8
- package/dist/chunks/feedback-BnjMKZpz.js +1 -0
- package/dist/chunks/file-utils-DyvnVEoH.js +1 -0
- package/dist/chunks/fit-CsnhEncA.js +1 -0
- package/dist/chunks/{form-DhQiOMvp.js → form-CQutQFiD.js} +1 -1
- package/dist/chunks/geo-DR0fL7r2.js +38 -0
- package/dist/chunks/{image-C52XMTxg.js → image-ez9hvzKT.js} +1 -1
- package/dist/chunks/{lib-DZsU27Fn.js → lib-BlRm3nk1.js} +4 -4
- package/dist/chunks/line-BV7qVRkM.js +1 -0
- package/dist/chunks/{msg-DNXH9mKo.js → msg-BzZbudMm.js} +1 -1
- package/dist/chunks/{ofd-B0_-rey2.js → ofd-C7DKqJ6Z.js} +1 -1
- package/dist/chunks/{openDocument-DW7w0HpR.js → openDocument-DGzqlyJg.js} +1 -1
- package/dist/chunks/parse-6ZQGx714.js +1 -0
- package/dist/chunks/{parser-BFNqF7wU.js → parser-DC3PvpL4.js} +1 -1
- package/dist/chunks/ppt-B0WY5Gks.js +30 -0
- package/dist/chunks/pptx-DX5KDFZ7.js +109 -0
- package/dist/chunks/{print-mask-DTiml6Ox.js → print-mask-Dguzv0rv.js} +2 -2
- package/dist/chunks/{psd-yU36O76Y.js → psd-hjeNFQZ-.js} +1 -1
- package/dist/chunks/{search-filters-BoRMIesR.js → search-filters-CRIhZ0gL.js} +1 -1
- package/dist/chunks/spreadsheet-BzbBEhmY.js +1 -0
- package/dist/chunks/{spreadsheet-DiZ31XlH.js → spreadsheet-LR3SOG-x.js} +3 -3
- package/dist/chunks/toolbar-controls-CThS0xuP.js +15 -0
- package/dist/chunks/ui-BFsHoY7a.js +1 -0
- package/dist/chunks/{useCrudOperationColumn-PObQMk2y.js → useCrudOperationColumn-D935tixd.js} +1 -1
- package/dist/chunks/useListPage-CbcOQG4m.js +1 -0
- package/dist/chunks/{useStatusToggle-B7KSIN75.js → useStatusToggle-B2qZaoc-.js} +1 -1
- package/dist/chunks/wordDoc-BZY3ZnxN.js +152 -0
- package/dist/chunks/wordDocx-Bt2mlB3C.js +77 -0
- package/dist/chunks/{xmind-B9BtGBNI.js → xmind-CF9YwkOD.js} +2 -2
- package/dist/file-viewer/flyfish-viewer-assets.json +5 -5
- package/dist/file-viewer/vendor/docx/jszip.min.js +0 -0
- package/dist/file-viewer/wasm/data/sql-wasm.wasm +0 -0
- package/dist/index.js +1 -1
- package/dist/{src-DVwjbBTf.js → src-LbWcrSWe.js} +1 -1
- package/dist/styles.css +1 -1
- package/package.json +7 -7
- package/dist/chunks/App-DX7JOOmP.js +0 -79
- package/dist/chunks/ArcBaseAdmin-CdB_roNY.js +0 -1
- package/dist/chunks/ConfigurableTable-CyfZLgG0.js +0 -55
- package/dist/chunks/DataScopePanel-CubtBhTT.js +0 -1
- package/dist/chunks/DepartmentsPage-ECexbzsK.js +0 -1
- package/dist/chunks/DictTag-BerYvaUM.js +0 -1
- package/dist/chunks/DictsPage-65kAxYFd.js +0 -15
- package/dist/chunks/DirectoryLoginModal-rRXvoqV7.js +0 -1
- package/dist/chunks/EditFormModal-D68dOnaj.js +0 -1
- package/dist/chunks/EntityContextRuntime-D9mWi5xC.js +0 -1
- package/dist/chunks/FileNameCell-C_V1k0q-.js +0 -1
- package/dist/chunks/FilePreviewModal-D7v5seXB.js +0 -1
- package/dist/chunks/FileStorageConfigsPage-D2UYESb5.js +0 -15
- package/dist/chunks/FileTypeIcon-C77EVWXZ.js +0 -1
- package/dist/chunks/FilesPage-By81A2i7.js +0 -43
- package/dist/chunks/ForgotPasswordModal-DTlunJpM.js +0 -1
- package/dist/chunks/IdentitySecurityPage-Dp5EP7aT.js +0 -1
- package/dist/chunks/LogStatsScaffold-BFwbN_MU.js +0 -1
- package/dist/chunks/LoginField-Bu4C0-Mk.js +0 -1
- package/dist/chunks/LoginLogsPage-BuMJ6U8I.js +0 -1
- package/dist/chunks/LoginLogsTable-DfAlWPZb.js +0 -1
- package/dist/chunks/MenuCommandPalette-BvW2kEU4.js +0 -8
- package/dist/chunks/MenusPage-DT3kxAfi.js +0 -1
- package/dist/chunks/NavListPanel-agMt2kc6.js +0 -1
- package/dist/chunks/OnlineSessionsPage-BJJAB2pV.js +0 -1
- package/dist/chunks/OperationLogsPage-CP-wUt_N.js +0 -1
- package/dist/chunks/OperationLogsTable-BX0vV3fT.js +0 -1
- package/dist/chunks/PDFPreviewPanel-D8-74Zqs.js +0 -30
- package/dist/chunks/PasswordInput--G8GKd5g.js +0 -1
- package/dist/chunks/PositionsPage-Cs7xq89s.js +0 -1
- package/dist/chunks/PreferencesSheetBody-CdA4Ig_g.js +0 -43
- package/dist/chunks/ProfilePage-Bt3yP6D-.js +0 -15
- package/dist/chunks/RelationPanel-B-KAfl9B.js +0 -36
- package/dist/chunks/RolesPage-DDNGkGAq.js +0 -1
- package/dist/chunks/SessionConflictModal-DgFNCU3j.js +0 -1
- package/dist/chunks/SettingRow-BIb1ruW2.js +0 -1
- package/dist/chunks/SettingsPage-rhqkPOJ9.js +0 -16
- package/dist/chunks/StatCard-BwhGDWpE.js +0 -4
- package/dist/chunks/UserGroupsPage-D3_aji58.js +0 -1
- package/dist/chunks/UserTransferSelect-S-GUw2Y9.js +0 -1
- package/dist/chunks/UsersPage-CLRJX-V9.js +0 -29
- package/dist/chunks/WorkflowPrintButton-BVa-xw-8.js +0 -1
- package/dist/chunks/chart-data-DOMSCLwj.js +0 -5
- package/dist/chunks/chevron-left-DnDEG_PI.js +0 -8
- package/dist/chunks/chevron-right-CzizTV5i.js +0 -8
- package/dist/chunks/dist-BqNhxPp5.js +0 -1
- package/dist/chunks/feedback-D4BIfDNd.js +0 -1
- package/dist/chunks/file-utils-DJ9ksj-g.js +0 -1
- package/dist/chunks/geo-Bf8ymo43.js +0 -38
- package/dist/chunks/line-DSFA8EqT.js +0 -1
- package/dist/chunks/mail-Cduf1OFr.js +0 -8
- package/dist/chunks/mono-icons-CxCoktev.js +0 -1
- package/dist/chunks/plus-Bvdn6bx1.js +0 -8
- package/dist/chunks/ppt-C9RgrmNU.js +0 -30
- package/dist/chunks/pptx-_T8ZPVQn.js +0 -109
- package/dist/chunks/printer-DL8WQci4.js +0 -8
- package/dist/chunks/shield-check-DZGK8n9u.js +0 -8
- package/dist/chunks/spreadsheet-CHFSQY8j.js +0 -1
- package/dist/chunks/table-columns-XaoxVUJN.js +0 -1
- package/dist/chunks/toolbar-controls-BFOuV86W.js +0 -8
- package/dist/chunks/ui-DoIHGuTR.js +0 -1
- package/dist/chunks/useDebouncedValue-DFoJN77o.js +0 -22
- package/dist/chunks/useListPage-1Upr_ala.js +0 -1
- package/dist/chunks/wordDoc-CtetBfzo.js +0 -152
- package/dist/chunks/wordDocx-8ak39HcF.js +0 -77
- package/dist/chunks/zoom-8Eo2fTNd.js +0 -1
- package/dist/public/monaco/vs/editor/editor.worker.js +0 -1
- package/dist/public/monaco/vs/language/css/css.worker.js +0 -66
- package/dist/public/monaco/vs/language/html/html.worker.js +0 -443
- package/dist/public/monaco/vs/language/json/json.worker.js +0 -17
- package/dist/public/monaco/vs/language/typescript/ts.worker.js +0 -67693
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{i as t,o as n,s as r}from"./controls-C5dPckUT.js";import{t as i}from"./typography-DKK_iHcj.js";import{i as a,o,r as ee,s}from"./feedback-D4BIfDNd.js";import{c,l,n as u,r as d,t as te}from"./ConfigurableTable-CyfZLgG0.js";import{n as f,t as p}from"./createLucideIcon-BtwfYE6A.js";import{r as ne,s as m}from"./toolbar-controls-BFOuV86W.js";import{n as h,t as re}from"./chevron-left-DnDEG_PI.js";import{n as g,t as ie}from"./chevron-right-CzizTV5i.js";import{n as _,t as v}from"./layout-grid-Bp9bwiQZ.js";import{n as y,t as ae}from"./list-DCcWnjUg.js";import{t as b}from"./form-DhQiOMvp.js";import{C as oe,_ as x,a as S,b as C,g as w,i as T,o as E,v as se,w as D}from"./ui-DoIHGuTR.js";import{n as ce,t as O}from"./useStatusToggle-B7KSIN75.js";import{n as k,t as le}from"./ResponsiveTableActions-y54aSdhs.js";import{n as A,t as j}from"./useCrudOperationColumn-PObQMk2y.js";import{n as ue,t as de}from"./useListPage-1Upr_ala.js";import{n as M,t as fe}from"./DateTimeText-rk9NeYgA.js";import{i as N,r as P,s as F,t as I}from"./table-columns-XaoxVUJN.js";import{a as L,i as R,n as z,r as pe}from"./EditFormModal-D68dOnaj.js";import{n as me,r as he}from"./clipboard-BKPNFY58.js";import{a as ge,r as _e,t as ve}from"./file-utils-DJ9ksj-g.js";import{r as ye,t as B}from"./PasswordInput--G8GKd5g.js";import{n as be,t as xe}from"./ExportButton-D4IvZKHy.js";import{c as Se,d as Ce,f as we,i as Te,l as Ee,n as De,o as Oe,p as ke,r as Ae,s as je,t as Me,u as Ne}from"./FileNameCell-C_V1k0q-.js";import{useEffect as Pe,useState as V}from"react";import{Fragment as H,jsx as U,jsxs as W}from"react/jsx-runtime";import{abortSubmit as Fe}from"@fudanda/react-core/lib/abort-submit";import{formatBytes as Ie}from"@fudanda/shared/core";import{usePermission as Le}from"@fudanda/react-core/hooks/usePermission";import{usePagination as Re}from"@fudanda/react-core/hooks/usePagination";import{IS_GO_FOUNDATION as G}from"@fudanda/react-core/lib/foundation-mode";import{FILE_OBJECT_ACL_LABELS as ze,FILE_OBJECT_ACL_SUPPORT as Be,FILE_STORAGE_PROVIDER_LABELS as Ve,FILE_STORAGE_PROVIDER_OPTIONS as He,FILE_URL_STRATEGY_LABELS as Ue,FILE_URL_STRATEGY_OPTIONS as We,PRESIGNED_EXPIRY_DEFAULT_SECONDS as K,PRESIGNED_EXPIRY_MAX_SECONDS as Ge,PRESIGNED_EXPIRY_MIN_SECONDS as Ke,fileStorageConfigContract as qe}from"@fudanda/shared/platform";import{useDeleteFiles as Je,useFileDetail as Ye}from"@fudanda/react-core/hooks/queries/files";import{useDeleteFileStorageConfigs as Xe,useFileStorageConfigDetail as Ze,useFileStorageConfigList as Qe,useSaveFileStorageConfig as $e,useSetDefaultFileStorageConfig as et,useStorageBrowse as tt,useTestFileStorageConfig as nt}from"@fudanda/react-core/hooks/queries/file-storage-configs";var q,J;function rt(){return(rt=e((()=>{
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v1.53.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
f(),q={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]},q.node,J=p(q)})))()}var Y,it;function at(){return(at=e((()=>{
|
|
9
|
-
/**
|
|
10
|
-
* @license lucide-react v1.53.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
|
-
f(),Y={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]},Y.node,it=p(Y)})))()}function ot({config:e,onClose:t}){let{hasPermission:n}=Le(),[r,i]=V(`list`),[o,s]=V(``),{page:c,setPage:l}=Re(),u=tt(e?.id,o,!!e),f=u.data??null,p=u.isFetching,ne=Je(),[m,h]=V([``]),[g,_]=V(0),y=g>0,b=g<m.length-1,C=je(()=>f?.files??[]),[w,E]=V(null),D=Ye(w?.id,!!w),ce=D.data??w,O=D.isFetching;Pe(()=>{e&&(s(``),i(`list`),l(1),h([``]),_(0),E(null),C.resetPreview())},[e,l]);let k=(e,t=!0)=>{s(e),l(1),t&&(h(t=>{let n=t.slice(0,g+1);return n.push(e),n}),_(e=>e+1))},A=e=>k(e.path),j=e=>k(e),ue=()=>{let e=g-1,t=m[e]??``;_(e),s(t),l(1)},de=()=>{let e=g+1,t=m[e]??``;_(e),s(t),l(1)},M=o?o.split(`/`):[],N=async e=>{await ne.mutateAsync([e.id]),a.success(`文件已删除`),u.refetch()},P=e=>{E(e)},F=async e=>{await me(_e(e.url),{success:`链接已复制`,error:`复制失败,请手动复制`})},I=[{title:`名称`,key:`name`,ellipsis:{showTitle:!1},render:(e,t)=>{if(!(`id`in t))return/* @__PURE__ */ U(Me,{name:t.name,icon:/* @__PURE__ */ U(J,{size:15,className:`storage-browser__folder-icon`}),onClick:()=>A(t)});let n=ve(t.mimeType,t.originalName);return/* @__PURE__ */ U(Me,{name:t.originalName,mimeType:t.mimeType,onClick:n?()=>void C.handlePreview(t):void 0})}},{title:`大小`,key:`size`,width:110,align:`right`,render:(e,t)=>`id`in t?Ie(t.size):/* @__PURE__ */ U(`span`,{className:`table-cell-placeholder`,children:`—`})},{title:`上传时间`,key:`createdAt`,width:180,render:(e,t)=>`id`in t?/* @__PURE__ */ U(fe,{value:t.createdAt}):/* @__PURE__ */ U(`span`,{className:`table-cell-placeholder`,children:`—`})},le({width:180,desktopInlineKeys:[`open`,`preview`,`download`],actions:e=>`id`in e?we(e,{preview:C,onDetail:e=>{P(e)},onCopyUrl:F,onDelete:N,canDelete:n(`system:file:delete`)}):[{key:`open`,label:`打开`,onClick:()=>A(e)}]})],L=[...f?.folders??[],...f?.files??[]],R=L.length,z=L.slice((c-1)*50,c*50);return/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ W(ee,{title:e?`文件浏览 · ${e.name}`:`文件浏览`,visible:!!e,onCancel:t,size:`large`,bodyStyle:{padding:0,display:`flex`,flexDirection:`column`},headerStyle:{borderBottom:`1px solid var(--arc-antd-color-border)`},children:[/* @__PURE__ */ W(`div`,{className:`storage-browser__toolbar`,children:[/* @__PURE__ */ W(x,{spacing:4,style:{flexShrink:0},children:[/* @__PURE__ */ U(S,{size:`small`,theme:`borderless`,type:`tertiary`,icon:/* @__PURE__ */ U(re,{size:15}),disabled:!y,onClick:ue}),/* @__PURE__ */ U(S,{size:`small`,theme:`borderless`,type:`tertiary`,icon:/* @__PURE__ */ U(ie,{size:15}),disabled:!b,onClick:de})]}),/* @__PURE__ */ W(T,{className:`storage-browser__breadcrumb`,children:[/* @__PURE__ */ U(T.Item,{onClick:()=>j(``),style:{cursor:o?`pointer`:`default`,color:o?`var(--arc-antd-color-primary)`:void 0},children:`根目录`}),M.map((e,t)=>{let n=M.slice(0,t+1).join(`/`),r=t===M.length-1;return/* @__PURE__ */ U(T.Item,{onClick:r?void 0:()=>j(n),style:{cursor:r?`default`:`pointer`,color:r?void 0:`var(--arc-antd-color-primary)`},children:e},n)})]}),/* @__PURE__ */ W(x,{spacing:0,children:[/* @__PURE__ */ U(S,{size:`small`,theme:r===`list`?`solid`:`light`,type:r===`list`?`primary`:`tertiary`,icon:/* @__PURE__ */ U(ae,{size:14}),style:{borderRadius:`4px 0 0 4px`},onClick:()=>i(`list`)}),/* @__PURE__ */ U(S,{size:`small`,theme:r===`grid`?`solid`:`light`,type:r===`grid`?`primary`:`tertiary`,icon:/* @__PURE__ */ U(v,{size:14}),style:{borderRadius:`0 4px 4px 0`},onClick:()=>i(`grid`)})]})]}),/* @__PURE__ */ U(`div`,{className:`storage-browser__content`,children:/* @__PURE__ */ W(se,{spinning:p,size:`large`,wrapperClassName:`storage-browser__spin`,children:[!p&&R===0&&/* @__PURE__ */ U(`div`,{className:`storage-browser__empty`,children:`当前目录为空`}),r===`list`&&R>0&&/* @__PURE__ */ U(te,{bordered:!0,columns:I,dataSource:z,rowKey:e=>e?`id`in e?`file-${e.id}`:`folder-${e.path}`:``,loading:!1,onRefresh:()=>void u.refetch(),refreshLoading:p,size:`small`,pagination:!1,onRow:e=>e&&!(`id`in e)?{onClick:()=>A(e),style:{cursor:`pointer`}}:{}}),r===`grid`&&R>0&&(()=>{let e=z.filter(e=>!(`id`in e)),t=z.filter(e=>`id`in e);return/* @__PURE__ */ W(`div`,{className:`storage-browser__grid-wrap`,children:[e.length>0&&/* @__PURE__ */ W(`div`,{className:`storage-browser__grid-section`,children:[/* @__PURE__ */ U(`div`,{className:`storage-browser__grid-section-label`,children:`文件夹`}),/* @__PURE__ */ U(`div`,{className:`storage-browser__folder-grid`,children:e.map(e=>/* @__PURE__ */ W(`button`,{type:`button`,className:`storage-browser__folder-card`,onClick:()=>A(e),children:[/* @__PURE__ */ U(J,{size:32,className:`storage-browser__folder-card-icon`}),/* @__PURE__ */ U(oe,{content:e.name,position:`top`,children:/* @__PURE__ */ U(`span`,{className:`storage-browser__folder-card-name`,children:e.name})})]},e.path))})]}),t.length>0&&/* @__PURE__ */ W(`div`,{className:`storage-browser__grid-section`,children:[e.length>0&&/* @__PURE__ */ U(`div`,{className:`storage-browser__grid-section-label`,children:`文件`}),/* @__PURE__ */ U(`div`,{className:`storage-browser__file-grid`,children:t.map(e=>/* @__PURE__ */ U(Ae,{file:e,selected:!1,canSelect:!1,onSelect:()=>{},onPreview:C.handlePreview,onDownload:C.handleDownload,onDelete:N,onDetail:P,onCopyUrl:F,canDelete:n(`system:file:delete`),previewLoading:C.previewLoadingId===e.id},e.id))})]})]})})()]})}),/* @__PURE__ */ W(`div`,{className:`storage-browser__footer`,children:[/* @__PURE__ */ W(st,{type:`secondary`,size:`small`,children:[(f?.folders.length??0)>0&&`${f.folders.length} 个文件夹`,(f?.folders.length??0)>0&&(f?.files.length??0)>0&&`,`,(f?.files.length??0)>0&&`${f.files.length} 个文件`,R===0&&!p&&`空目录`]}),R>0&&/* @__PURE__ */ U(d,{currentPage:c,pageSize:50,total:R,onPageChange:l,size:`small`,hoverShowPageSelect:!0})]})]}),/* @__PURE__ */ U(Ne,{preview:C}),/* @__PURE__ */ U(Se,{visible:!!w,file:ce,loading:O,resolveUrl:e=>_e(e.url),onCopyUrl:e=>void F(e),onClose:()=>E(null)})]})}var st;function X(){return(X=e((()=>{D(),rt(),h(),g(),_(),y(),M(),ge(),ke(),he(),Ce(),Ee(),Oe(),u(),k(),Te(),De(),{Text:st}=i})))()}function Z(e){return e?.trim()??``}function Q(e,t){return{name:e.name?.trim()??``,status:e.status??`enabled`,isDefault:t,basePath:Z(e.basePath),urlStrategy:e.urlStrategy??`proxy`,publicBaseUrl:Z(e.publicBaseUrl),presignedExpirySeconds:e.presignedExpirySeconds??K}}function ct(e,t,n){return e===`local`?{...Q(n,t),provider:e,objectAcl:`default`,localRootPath:Z(n.localRootPath),remark:Z(n.remark)}:e===`oss`?{...Q(n,t),provider:e,objectAcl:n.objectAcl??`default`,ossRegion:Z(n.ossRegion),ossEndpoint:Z(n.ossEndpoint),ossBucket:Z(n.ossBucket),ossAccessKeyId:Z(n.ossAccessKeyId),ossAccessKeySecret:Z(n.ossAccessKeySecret),remark:Z(n.remark)}:e===`s3`?{...Q(n,t),provider:e,objectAcl:n.objectAcl??`default`,s3Region:Z(n.s3Region),s3Endpoint:Z(n.s3Endpoint),s3Bucket:Z(n.s3Bucket),s3AccessKeyId:Z(n.s3AccessKeyId),s3SecretAccessKey:Z(n.s3SecretAccessKey),s3ForcePathStyle:n.s3ForcePathStyle??!1,remark:Z(n.remark)}:e===`cos`?{...Q(n,t),provider:e,objectAcl:n.objectAcl??`default`,cosRegion:Z(n.cosRegion),cosBucket:Z(n.cosBucket),cosSecretId:Z(n.cosSecretId),cosSecretKey:Z(n.cosSecretKey),remark:Z(n.remark)}:e===`obs`?{...Q(n,t),provider:e,objectAcl:n.objectAcl??`default`,obsEndpoint:Z(n.obsEndpoint),obsBucket:Z(n.obsBucket),obsAccessKeyId:Z(n.obsAccessKeyId),obsSecretAccessKey:Z(n.obsSecretAccessKey),remark:Z(n.remark)}:e===`kodo`?{...Q(n,t),provider:e,objectAcl:`default`,kodoAccessKey:Z(n.kodoAccessKey),kodoSecretKey:Z(n.kodoSecretKey),kodoBucket:Z(n.kodoBucket),kodoRegion:Z(n.kodoRegion),kodoEndpoint:Z(n.kodoEndpoint),remark:Z(n.remark)}:e===`bos`?{...Q(n,t),provider:e,objectAcl:n.objectAcl??`default`,bosEndpoint:Z(n.bosEndpoint),bosBucket:Z(n.bosBucket),bosAccessKeyId:Z(n.bosAccessKeyId),bosSecretAccessKey:Z(n.bosSecretAccessKey),remark:Z(n.remark)}:e===`azure`?{...Q(n,t),provider:e,objectAcl:`default`,azureAccountName:Z(n.azureAccountName),azureAccountKey:Z(n.azureAccountKey),azureContainerName:Z(n.azureContainerName),azureEndpoint:Z(n.azureEndpoint),remark:Z(n.remark)}:{...Q(n,t),provider:e,objectAcl:`default`,sftpHost:Z(n.sftpHost),sftpPort:n.sftpPort,sftpUsername:Z(n.sftpUsername),sftpPassword:Z(n.sftpPassword),sftpPrivateKey:n.sftpPrivateKey,sftpRootPath:Z(n.sftpRootPath),sftpBaseUrl:Z(n.sftpBaseUrl),remark:Z(n.remark)}}function lt(e){return e.provider===`local`?e.localRootPath||I:e.provider===`oss`?[e.ossBucket,e.ossRegion].filter(Boolean).join(` / `)||I:e.provider===`s3`?[e.s3Bucket,e.s3Region].filter(Boolean).join(` / `)||I:e.provider===`cos`?[e.cosBucket,e.cosRegion].filter(Boolean).join(` / `)||I:e.provider===`obs`?[e.obsBucket,e.obsEndpoint].filter(Boolean).join(` / `)||I:e.provider===`kodo`?[e.kodoBucket,e.kodoRegion].filter(Boolean).join(` / `)||I:e.provider===`bos`?[e.bosBucket,e.bosEndpoint].filter(Boolean).join(` / `)||I:e.provider===`azure`?[e.azureContainerName,e.azureAccountName].filter(Boolean).join(` / `)||I:e.provider===`sftp`&&[e.sftpHost,e.sftpRootPath].filter(Boolean).join(`:`)||I}function ut(){let{hasPermission:e}=Le(),i=ue({contract:qe,useList:Qe}),{tableProps:o,filterQuery:ee}=i,[l,u]=V(`local`),[d,f]=V(!1),[p,m]=V(null),h=$e(),re=$e(),g=L({entityName:`文件配置`,save:h,useDetail:Ze,defaults:{name:``,provider:`local`,status:`enabled`,isDefault:!1,basePath:``,objectAcl:`default`,urlStrategy:`proxy`,publicBaseUrl:``,presignedExpirySeconds:K,localRootPath:`storage/local`,remark:``},toValues:e=>({...e,basePath:e.basePath??``,objectAcl:e.objectAcl??`default`,urlStrategy:e.urlStrategy??`proxy`,publicBaseUrl:e.publicBaseUrl??``,presignedExpirySeconds:e.presignedExpirySeconds??K,localRootPath:e.localRootPath??``,ossRegion:e.ossRegion??``,ossEndpoint:e.ossEndpoint??``,ossBucket:e.ossBucket??``,ossAccessKeyId:e.ossAccessKeyId??``,ossAccessKeySecret:``,s3Region:e.s3Region??``,s3Endpoint:e.s3Endpoint??``,s3Bucket:e.s3Bucket??``,s3AccessKeyId:e.s3AccessKeyId??``,s3SecretAccessKey:``,s3ForcePathStyle:e.s3ForcePathStyle??!1,cosRegion:e.cosRegion??``,cosBucket:e.cosBucket??``,cosSecretId:e.cosSecretId??``,cosSecretKey:``,obsEndpoint:e.obsEndpoint??``,obsBucket:e.obsBucket??``,obsAccessKeyId:e.obsAccessKeyId??``,obsSecretAccessKey:``,kodoAccessKey:e.kodoAccessKey??``,kodoSecretKey:``,kodoBucket:e.kodoBucket??``,kodoRegion:e.kodoRegion??``,kodoEndpoint:e.kodoEndpoint??``,bosEndpoint:e.bosEndpoint??``,bosBucket:e.bosBucket??``,bosAccessKeyId:e.bosAccessKeyId??``,bosSecretAccessKey:``,azureAccountName:e.azureAccountName??``,azureAccountKey:``,azureContainerName:e.azureContainerName??``,azureEndpoint:e.azureEndpoint??``,sftpHost:e.sftpHost??``,sftpPort:e.sftpPort??22,sftpUsername:e.sftpUsername??``,sftpPassword:``,sftpPrivateKey:``,sftpRootPath:e.sftpRootPath??``,sftpBaseUrl:e.sftpBaseUrl??``,remark:e.remark??``}),beforeSave:e=>ct(l,d,e),successMessage:({isEdit:e})=>e?`文件服务配置已更新`:`文件服务配置已创建`,labelWidth:150}),ie=Xe(),_=et(),v=nt(),y=v.isPending&&!v.variables?.id,ae=v.isPending?v.variables?.id??null:null;Pe(()=>{g.editing&&(u(g.editing.provider),f(g.editing.isDefault))},[g.editing]);let oe=()=>{u(`local`),f(!1),g.openCreate()},x=e=>{u(e.provider),f(e.isDefault),g.openEdit(e)},T=async()=>{let e;try{e=await g.formApi.current.validate()}catch{return}if(!e)return;let t=ct(l,d,e);await v.mutateAsync(g.editing?{id:g.editing.id,values:t}:{values:t}),a.success(`存储连接测试通过`)},se=async e=>{await _.mutateAsync({params:{id:e.id}}),a.success(`默认文件服务已更新`)},D=async e=>{await v.mutateAsync({id:e.id,values:{}}),a.success(`存储连接测试通过`)},O=ce({toggle:async(e,t)=>{!t&&e.isDefault&&(a.warning(`默认配置不能禁用,请先将其他配置设为默认`),Fe(`default-config-cannot-be-disabled`)),await re.mutateAsync({id:e.id,values:{status:t?`enabled`:`disabled`}})},confirmDisable:e=>e.isDefault?null:{danger:!0,title:`确认禁用「${e.name}」?`,okText:`确认禁用`},disabled:!e(`system:file:config:update`),messages:{disabled:`已禁用`}}),k=A({permission:`system:file:config`,edit:x,remove:ie,title:`确认删除此文件服务配置?`,content:`若已绑定文件记录,后端会阻止删除。`,successMessage:`文件服务配置已删除`,disabled:{remove:e=>e.isDefault},extra:t=>[{key:`browse`,label:`浏览`,hidden:!e(`system:file:list`),onClick:()=>m(t)},{key:`default`,label:`设为默认`,hidden:!e(`system:file:config:default`),disabled:t.isDefault||t.status!==`enabled`,onClick:()=>se(t)}],extraBetween:t=>[{key:`test`,label:`测试连接`,loading:ae===t.id,hidden:!e(`system:file:config`),onClick:()=>{D(t)}}],width:180,desktopInlineKeys:[`browse`,`edit`]}),le=[{title:`配置名称`,dataIndex:`name`,minWidth:180,render:F},{title:`存储类型`,dataIndex:`provider`,width:120,render:e=>/* @__PURE__ */ U(C,{color:{local:`blue`,oss:`orange`,s3:`purple`,cos:`teal`,obs:`red`,kodo:`cyan`,bos:`indigo`,azure:`violet`,sftp:`green`}[e],size:`small`,children:Ve[e]})},{title:`默认服务`,dataIndex:`isDefault`,width:110,align:`center`,render:e=>e?/* @__PURE__ */ U(C,{color:`green`,size:`small`,children:`默认`}):/* @__PURE__ */ U(`span`,{className:`table-cell-placeholder`,children:`—`})},{title:`存储信息`,key:`storageSummary`,dataIndex:`storageSummary`,width:180,render:(e,t)=>{let n={local:`目录`,oss:`Bucket`,s3:`Bucket`,cos:`Bucket`,obs:`Bucket`,kodo:`Bucket`,bos:`Bucket`,azure:`Container`,sftp:`主机`}[t.provider]??`Bucket`,r=lt(t);return F(`${n}: ${r}`)}},{title:`基础路径`,dataIndex:`basePath`,width:160,render:e=>F(e)},{title:`读写权限`,dataIndex:`objectAcl`,width:120,align:`center`,render:(e,t)=>{if(!$.includes(t.provider))return/* @__PURE__ */ U(`span`,{className:`table-cell-placeholder`,children:`—`});let n={default:`grey`,private:`blue`,"public-read":`orange`,"public-read-write":`red`},r=e??`default`;return/* @__PURE__ */ U(C,{color:n[r],size:`small`,children:ze[r]})}},{title:`访问策略`,dataIndex:`urlStrategy`,width:120,align:`center`,render:e=>{let t=e??`proxy`;return/* @__PURE__ */ U(C,{color:{proxy:`grey`,public:`green`,presigned:`purple`}[t],size:`small`,children:Ue[t]})}},P(`更新时间`,`updatedAt`),O.column(),k];return/* @__PURE__ */ W(`div`,{className:`page-container`,children:[/* @__PURE__ */ U(`div`,{className:`storage-configs-tip`,style:{marginBottom:0,marginTop:-4},children:/* @__PURE__ */ U(dt,{type:`secondary`,children:`当前支持多文件服务配置,但上传时会优先走"默认文件服务"。切换默认服务不会影响历史文件记录。`})}),/* @__PURE__ */ U(te,{searchConfig:c({page:i,filters:[`status`,[`startTime`,`endTime`]],create:/* @__PURE__ */ U(ne,{permission:`system:file:config:create`,onClick:oe}),actions:/* @__PURE__ */ U(xe,{entity:`system.file-storage-configs`,query:ee}),filterTitle:`文件配置筛选`,actionTitle:`文件配置操作`}),columns:le,...o}),/* @__PURE__ */ W(z,{modal:g,width:780,footer:/* @__PURE__ */ W(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:8},children:[` `,/* @__PURE__ */ U(S,{icon:/* @__PURE__ */ U(it,{size:14}),loading:y,disabled:g.detailLoading,onClick:()=>void T(),children:` 测试连接 `}),` `,/* @__PURE__ */ W(`div`,{style:{display:`flex`,gap:8},children:[` `,/* @__PURE__ */ U(S,{type:`tertiary`,onClick:g.close,children:`取消`}),` `,/* @__PURE__ */ U(S,{type:`primary`,theme:`solid`,loading:g.modalProps.okButtonProps.loading,disabled:g.modalProps.okButtonProps.disabled,onClick:()=>void s(g.modalProps.onOk),children:` 保存 `}),` `]}),` `]}),children:[/* @__PURE__ */ W(b.Section,{text:`基础信息`,children:[/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`name`,label:`配置名称`,placeholder:`请输入配置名称`,rules:[{required:!0,message:`请输入配置名称`}]})}),/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Select,{field:`provider`,label:`存储类型`,style:{width:`100%`},optionList:He.filter(e=>[`local`,`s3`].includes(e.value)),onChange:e=>{let t=e;u(t);let n=g.formApi.current?.getValue(`objectAcl`);n&&!(Be[t]??[]).includes(n)&&g.formApi.current?.setValue(`objectAcl`,`default`)},placeholder:`请选择存储类型`})})]}),/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ W(b.Select,{field:`status`,label:`状态`,style:{width:`100%`},placeholder:`请选择状态`,children:[/* @__PURE__ */ U(n.Option,{value:`enabled`,children:`启用`}),/* @__PURE__ */ U(n.Option,{value:`disabled`,children:`禁用`})]})}),l===`s3`&&/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`basePath`,label:`基础路径`,placeholder:`例如 uploads / images`})})]}),/* @__PURE__ */ U(b.Slot,{label:`设为默认服务`,children:/* @__PURE__ */ U(r,{checked:d,onChange:f})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`remark`,label:`备注`,placeholder:`选填,说明该文件服务的用途`})})})]}),/* @__PURE__ */ W(b.Section,{text:`${Ve[l]} 连接配置`,children:[l===`local`&&/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`localRootPath`,label:`存储目录`,placeholder:`例如 storage/local 或 D:/uploads`,rules:[{required:!0,message:`请输入本地磁盘存储目录`}]})})}),l===`oss`&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`ossRegion`,label:`Region`,placeholder:`请输入 OSS Region`,rules:[{required:!0,message:`请输入 OSS Region`}]})}),/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`ossBucket`,label:`Bucket`,placeholder:`请输入 OSS Bucket`,rules:[{required:!0,message:`请输入 OSS Bucket`}]})})]}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`ossEndpoint`,label:`Endpoint`,placeholder:`请输入 OSS Endpoint`,rules:[{required:!0,message:`请输入 OSS Endpoint`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`ossAccessKeyId`,label:`AccessKey ID`,placeholder:`请输入 AccessKey ID`,rules:[{required:!0,message:`请输入 AccessKey ID`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(B,{field:`ossAccessKeySecret`,label:`AccessKey Secret`,placeholder:g.isEdit?`留空表示不修改`:`请输入 AccessKey Secret`,rules:g.isEdit?[]:[{required:!0,message:`请输入 AccessKey Secret`}]})})})]}),l===`s3`&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`s3Region`,label:`Region`,placeholder:`请输入 S3 Region`,rules:[{required:!0,message:`请输入 S3 Region`}]})}),/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`s3Bucket`,label:`Bucket`,placeholder:`请输入 S3 Bucket`,rules:[{required:!0,message:`请输入 S3 Bucket`}]})})]}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`s3Endpoint`,label:`Endpoint`,placeholder:`可选,兼容 S3 自定义存储`})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`s3AccessKeyId`,label:`Access Key ID`,placeholder:`请输入 Access Key ID`,rules:[{required:!0,message:`请输入 Access Key ID`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(B,{field:`s3SecretAccessKey`,label:`Secret Access Key`,placeholder:g.isEdit?`留空表示不修改`:`请输入 Secret Access Key`,rules:g.isEdit?[]:[{required:!0,message:`请输入 Secret Access Key`}]})})}),/* @__PURE__ */ U(b.Checkbox,{field:`s3ForcePathStyle`,noLabel:!0,children:`强制路径样式(MinIO / Ceph 等兼容当需开启)`})]}),l===`cos`&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`cosRegion`,label:`Region`,placeholder:`例如 ap-guangzhou`,rules:[{required:!0,message:`请输入 COS Region`}]})}),/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`cosBucket`,label:`Bucket`,placeholder:`例如 my-bucket-1250000000`,rules:[{required:!0,message:`请输入 COS Bucket`}]})})]}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`cosSecretId`,label:`SecretId`,placeholder:`请输入 SecretId`,rules:[{required:!0,message:`请输入 SecretId`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(B,{field:`cosSecretKey`,label:`SecretKey`,placeholder:g.isEdit?`留空表示不修改`:`请输入 SecretKey`,rules:g.isEdit?[]:[{required:!0,message:`请输入 SecretKey`}]})})})]}),l===`obs`&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`obsEndpoint`,label:`Endpoint`,placeholder:`例如 obs.cn-north-4.myhuaweicloud.com`,rules:[{required:!0,message:`请输入 OBS Endpoint`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`obsBucket`,label:`Bucket`,placeholder:`请输入 OBS Bucket 名称`,rules:[{required:!0,message:`请输入 Bucket`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`obsAccessKeyId`,label:`Access Key ID`,placeholder:`请输入 Access Key ID`,rules:[{required:!0,message:`请输入 Access Key ID`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(B,{field:`obsSecretAccessKey`,label:`Secret Access Key`,placeholder:g.isEdit?`留空表示不修改`:`请输入 Secret Access Key`,rules:g.isEdit?[]:[{required:!0,message:`请输入 Secret Access Key`}]})})})]}),l===`kodo`&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`kodoBucket`,label:`Bucket`,placeholder:`请输入 Kodo Bucket`,rules:[{required:!0,message:`请输入 Bucket`}]})}),/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`kodoRegion`,label:`Region`,placeholder:`例如 z0(华东)、z1(华北)`})})]}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`kodoEndpoint`,label:`访问域名`,placeholder:`用于下载文件的公开域名,例如 cdn.example.com`})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`kodoAccessKey`,label:`Access Key`,placeholder:`请输入 Access Key`,rules:[{required:!0,message:`请输入 Access Key`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(B,{field:`kodoSecretKey`,label:`Secret Key`,placeholder:g.isEdit?`留空表示不修改`:`请输入 Secret Key`,rules:g.isEdit?[]:[{required:!0,message:`请输入 Secret Key`}]})})})]}),l===`bos`&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`bosEndpoint`,label:`Endpoint`,placeholder:`例如 https://bj.bcebos.com`,rules:[{required:!0,message:`请输入 BOS Endpoint`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`bosBucket`,label:`Bucket`,placeholder:`请输入 BOS Bucket 名称`,rules:[{required:!0,message:`请输入 Bucket`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`bosAccessKeyId`,label:`Access Key ID`,placeholder:`请输入 Access Key`,rules:[{required:!0,message:`请输入 Access Key ID`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(B,{field:`bosSecretAccessKey`,label:`Secret Access Key`,placeholder:g.isEdit?`留空表示不修改`:`请输入 Secret Key`,rules:g.isEdit?[]:[{required:!0,message:`请输入 Secret Access Key`}]})})})]}),l===`azure`&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`azureAccountName`,label:`Account Name`,placeholder:`存储账户名称`,rules:[{required:!0,message:`请输入 Account Name`}]})}),/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`azureContainerName`,label:`Container`,placeholder:`Blob 容器名称`,rules:[{required:!0,message:`请输入 Container Name`}]})})]}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(B,{field:`azureAccountKey`,label:`Account Key`,placeholder:g.isEdit?`留空表示不修改`:`存储账户密钥`,rules:g.isEdit?[]:[{required:!0,message:`请输入 Account Key`}]})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`azureEndpoint`,label:`Endpoint(可选)`,placeholder:`自定义端点,默认 Azure 全球端点`})})})]}),l===`sftp`&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:16,children:/* @__PURE__ */ U(b.Input,{field:`sftpHost`,label:`主机地址`,placeholder:`IP 或域名`,rules:[{required:!0,message:`请输入主机地址`}]})}),/* @__PURE__ */ U(E,{span:8,children:/* @__PURE__ */ U(b.InputNumber,{field:`sftpPort`,label:`端口`,placeholder:`22`,min:1,max:65535})})]}),/* @__PURE__ */ W(w,{gutter:16,children:[/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(b.Input,{field:`sftpUsername`,label:`用户名`,placeholder:`登录用户名`,rules:[{required:!0,message:`请输入用户名`}]})}),/* @__PURE__ */ U(E,{span:12,children:/* @__PURE__ */ U(B,{field:`sftpPassword`,label:`密码`,placeholder:g.isEdit?`留空表示不修改`:`密码或私钥二选一`})})]}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`sftpRootPath`,label:`远端根目录`,placeholder:`例如 /data/uploads`})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`sftpBaseUrl`,label:`访问 Base URL`,placeholder:`文件公开 URL 前缀,例如 https://static.example.com`})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.TextArea,{field:`sftpPrivateKey`,label:`SSH 私钥(可选)`,placeholder:g.isEdit?`留空表示不修改`:`如果使用私钥登录,请将 PEM 内容粘贴至此`,rows:4})})})]})]}),/* @__PURE__ */ W(b.Section,{text:`访问与权限`,children:[$.includes(l)&&/* @__PURE__ */ U(b.RadioGroup,{field:`objectAcl`,label:`读写权限`,type:`button`,extraText:l===`s3`?`上传文件将按此权限设置对象 ACL。注意:AWS S3 新建桶默认禁用 ACL(Bucket owner enforced),启用前请先在桶设置中开启;MinIO / Cloudflare R2 不支持对象 ACL,请保持「继承 Bucket」。`:`上传文件将按此权限设置对象 ACL;「继承 Bucket」表示不单独指定、跟随 Bucket 权限。公共读 / 公共读写存在数据泄露风险,请谨慎选择。`,children:[`default`].map(e=>/* @__PURE__ */ U(t,{value:e,children:ze[e]},e))}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Select,{field:`urlStrategy`,disabled:G,label:`访问策略`,style:{width:`100%`},extraText:`代理:文件流量经过服务端(兜底);公开直链:返回永久直连地址,要求对象可公开读;临时签名:按需签发限时直连地址,适合私有文件(本地磁盘 / SFTP 不支持)`,children:We.filter(e=>e.value===`proxy`).map(e=>/* @__PURE__ */ U(n.Option,{value:e.value,children:e.label},e.value))})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.InputNumber,{field:`presignedExpirySeconds`,disabled:G,label:`签名有效期(秒)`,style:{width:`100%`},min:Ke,max:Ge,extraText:`仅临时签名策略生效;修改只影响新签发的链接`})})}),/* @__PURE__ */ U(w,{gutter:16,children:/* @__PURE__ */ U(E,{span:24,children:/* @__PURE__ */ U(b.Input,{field:`publicBaseUrl`,disabled:G,label:`访问域名(CDN)`,placeholder:`可选,例如 https://cdn.example.com,公开直链优先使用该域名`})})})]})]}),/* @__PURE__ */ U(ot,{config:p,onClose:()=>m(null)})]})}var dt,$;function ft(){return(ft=e((()=>{ye(),D(),at(),R(),be(),N(),u(),l(),O(),j(),o(),X(),m(),de(),pe(),{Text:dt}=i,$=Object.keys(Be)})))()}ft();export{ut as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{i as t,n,r,t as i}from"./mono-icons-CxCoktev.js";import{jsx as a}from"react/jsx-runtime";function o({icon:e,size:t=16,className:n,style:o}){if(e in i)return/* @__PURE__ */ a(r,{icon:i[e],size:t,className:n,style:o});let l=s[e]??s[c];return l?/* @__PURE__ */ a(`img`,{src:l,width:t,height:t,alt:``,"aria-hidden":`true`,draggable:!1,loading:`lazy`,decoding:`async`,className:n,style:{flexShrink:0,display:`inline-block`,verticalAlign:`middle`,...o}}):null}var s,c;function l(){return(l=e((()=>{n(),t(),s=Object.fromEntries(Object.entries(/* #__PURE__ */ Object.assign({})).map(([e,t])=>[`vscode-icons:${e.slice(e.lastIndexOf(`/`)+1,-4)}`,t])),c=`vscode-icons:default-file`})))()}export{l as n,o as t};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{t}from"./controls-C5dPckUT.js";import{t as n}from"./typography-DKK_iHcj.js";import{i as r}from"./feedback-D4BIfDNd.js";import{n as i,t as a}from"./tabs-BobA_IcO.js";import{c as o,l as s,n as c,r as l,s as u,t as ee}from"./ConfigurableTable-CyfZLgG0.js";import{n as d,o as f,r as te,t as ne}from"./search-filters-BoRMIesR.js";import{n as p,t as m}from"./createLucideIcon-BtwfYE6A.js";import{s as re,t as ie}from"./toolbar-controls-BFOuV86W.js";import{n as ae,t as oe}from"./circle-check-RKAno__V.js";import{n as se,t as ce}from"./circle-x-BB5x-D-8.js";import{n as h,t as le}from"./layout-grid-Bp9bwiQZ.js";import{n as g,t as ue}from"./list-DCcWnjUg.js";import{n as de,t as fe}from"./plus-Bvdn6bx1.js";import{n as _,t as pe}from"./x-Ak9hw1R9.js";import{n as me}from"./list-0CbyOlT9.js";import{C as he,_ as v,a as y,h as ge,v as b,w as x}from"./ui-DoIHGuTR.js";import{n as S,t as _e}from"./ResponsiveTableActions-y54aSdhs.js";import{r as ve,t as ye}from"./deleteAction-NGTDhZud.js";import{n as be}from"./listTableProps-DDynsnLF.js";import{i as C,r as xe,s as Se,t as w}from"./table-columns-XaoxVUJN.js";import{n as Ce,r as we}from"./clipboard-BKPNFY58.js";import{Hn as Te}from"./chart-data-DOMSCLwj.js";import{a as T,i as Ee,n as E,r as De,t as Oe}from"./file-utils-DJ9ksj-g.js";import{n as D,t as ke}from"./AppModal-B_xvSaeq.js";import{c as Ae,d as je,f as Me,i as O,l as k,n as Ne,o as Pe,p as A,r as Fe,s as Ie,t as Le,u as Re}from"./FileNameCell-C_V1k0q-.js";import{Ar as ze,At as j,C as M,Ct as N,D as P,Dt as Be,E as F,Et as I,I as L,It as Ve,L as He,Lt as Ue,Mt as We,Nt as R,Ot as Ge,S as z,St as Ke,T as qe,Tt as Je,_ as Ye,_t as Xe,b as Ze,bt as Qe,c as $e,fi as et,gt as tt,ht as B,i as nt,ir as rt,jr as it,jt as at,kt as ot,m as V,n as st,ni as ct,o as lt,pi as ut,r as dt,ri as ft,rr as pt,t as H,vt as mt,w as ht,wt as gt,x as _t,xt as vt,yt}from"./StatCard-BwhGDWpE.js";import{n as bt,t as xt}from"./line-DSFA8EqT.js";import{useEffect as St,useMemo as U,useRef as Ct,useState as W}from"react";import{usePreferences as wt}from"@fudanda/react-core/hooks/usePreferences";import{Fragment as Tt,jsx as G,jsxs as K}from"react/jsx-runtime";import{enumValueOf as Et,formatBytes as q}from"@fudanda/shared/core";import{urlOf as Dt}from"@fudanda/react-core/lib/contract-query";import{usePermission as Ot}from"@fudanda/react-core/hooks/usePermission";import{useFilterQuery as kt}from"@fudanda/react-core/hooks/useFilterQuery";import{useListSearch as At}from"@fudanda/react-core/hooks/useListSearch";import{formatDateTimeRangeForApi as jt}from"@fudanda/react-core/utils/date";import{usePagination as Mt}from"@fudanda/react-core/hooks/usePagination";import{useQueryClient as Nt}from"@tanstack/react-query";import{downloadBlob as Pt}from"@fudanda/react-core/utils/download";import{FILE_STORAGE_PROVIDERS as Ft,FILE_STORAGE_PROVIDER_LABELS as It,FILE_STORAGE_PROVIDER_OPTIONS as Lt,FILE_TYPE_FILTERS as Rt,FILE_TYPE_FILTER_OPTIONS as zt,fileContract as Bt}from"@fudanda/shared/platform";import{request as Vt}from"@fudanda/react-core/utils/request";import{useUrlTabState as Ht}from"@fudanda/react-core/hooks/useUrlTabState";import{fileKeys as Ut,invalidateAfterFilesAdded as Wt,useChunkUploadThreshold as Gt,useDeleteFiles as Kt,useFileDetail as qt,useFileList as Jt,useFileStats as Yt,useUploadFile as Xt}from"@fudanda/react-core/hooks/queries/files";import{useDefaultFileStorageConfig as Zt}from"@fudanda/react-core/hooks/queries/file-storage-configs";import{CHUNKED_UPLOAD_CANCELLED as Qt,chunkedUpload as $t}from"@fudanda/react-core/utils/chunked-upload";var en,tn;function nn(){return(nn=e((()=>{
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v1.53.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
p(),en={name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]},en.node,tn=m(en)})))()}var rn,an;function on(){return(on=e((()=>{
|
|
9
|
-
/**
|
|
10
|
-
* @license lucide-react v1.53.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
|
-
p(),rn={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]},rn.node,an=m(rn)})))()}var sn,cn;function ln(){return(ln=e((()=>{
|
|
16
|
-
/**
|
|
17
|
-
* @license lucide-react v1.53.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/
|
|
22
|
-
p(),sn={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]},sn.node,cn=m(sn)})))()}var un,dn;function fn(){return(fn=e((()=>{
|
|
23
|
-
/**
|
|
24
|
-
* @license lucide-react v1.53.0 - ISC
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the ISC license.
|
|
27
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/
|
|
29
|
-
p(),un={name:`folder-down`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m15 13-3 3-3-3`,key:`6j2sf0`}]]},un.node,dn=m(un)})))()}var pn,mn;function hn(){return(hn=e((()=>{
|
|
30
|
-
/**
|
|
31
|
-
* @license lucide-react v1.53.0 - ISC
|
|
32
|
-
*
|
|
33
|
-
* This source code is licensed under the ISC license.
|
|
34
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/
|
|
36
|
-
p(),pn={name:`music`,size:24,node:[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]},pn.node,mn=m(pn)})))()}var gn,_n;function vn(){return(vn=e((()=>{
|
|
37
|
-
/**
|
|
38
|
-
* @license lucide-react v1.53.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/
|
|
43
|
-
p(),gn={name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]},gn.node,_n=m(gn)})))()}var yn;function bn(){return(bn=e((()=>{R(),ze(),yn=class extends We{_getDefaultSeriesSpec(e){let t=super._getDefaultSeriesSpec(e,[`point`,`line`,`activePoint`,`sampling`,`samplingFactor`,`pointDis`,`pointDisMul`,`markOverlap`,`lineLabel`]);return t.seriesMark=e.seriesMark??`line`,t}transformSpec(e){super.transformSpec(e),it(e)}}})))()}var J,xn;function Sn(){return(Sn=e((()=>{ut(),xt(),ft(),bn(),Ue(),at(),Ge(),I(),Je(),Ke(),yt(),Xe(),B(),J=class extends Ve{constructor(){super(...arguments),this.transformerConstructor=yn,this.type=`line`,this.seriesType=et.line}_setModelOption(){this._modelOption.getDimensionInfo=N,this._modelOption.getDimensionInfoByValue=gt,this._modelOption.getRectByDimensionData=vt}},J.type=`line`,J.seriesType=et.line,J.transformerConstructor=yn,Te(J,j),xn=()=>{Qe(),mt(),tt(),Be(),ot(),bt(),ct.registerChart(J.type,J)}})))()}var Cn;function wn(){return(wn=e((()=>{rt(),Sn(),L(),P(),ht(),Cn=F(`LineChart`,{type:`line`,vchartConstructor:pt},[xn,He,...qe])})))()}function Tn({value:e,max:t,minPercent:n=0,color:r,fillOpacity:i,track:a,height:o=8,radius:s,title:c,className:l,style:u}){let ee=Number.isFinite(e)&&Number.isFinite(t)&&t>0?e/t:0,d=Math.min(100,Math.max(e>0?n:0,ee*100)),f=[`zx-data-bar`,l].filter(Boolean).join(` `),te={"--zx-bar-height":`${o}px`,"--zx-bar-scale":d/100,...r?{"--zx-bar-stroke":r}:{},...i===void 0?{}:{"--zx-bar-opacity":i},...a?{"--zx-bar-track":a}:{},...s===void 0?{}:{"--zx-bar-radius":typeof s==`number`?`${s}px`:s},...u};return/* @__PURE__ */ G(`div`,{className:f,style:te,title:c,"aria-hidden":`true`,children:/* @__PURE__ */ G(`span`,{className:`zx-data-bar__fill`})})}function En(){return(En=e((()=>{})))()}function Dn(){let e=_t(),t=Yt(),n=t.data??null,r=n?.summary,i=r?.totalFiles??0,a=U(()=>(n?.providerStats??[]).map((e,t)=>({...e,providerLabel:On[e.provider]??e.provider,fill:kn[t%kn.length]})),[n]),o=U(()=>(n?.uploaderStats??[]).map(e=>({...e,sizeLabel:q(e.size)})),[n]),s=U(()=>lt({data:a,xField:`providerLabel`,series:[{field:`count`,name:`文件数`,color:`#3b82f6`}],palette:e,horizontal:!0,categoryAxisWidth:80,colorByDatum:e=>String(e?.fill),tooltip:{value:e=>`${e} 个文件`}}),[e,a]),c=U(()=>$e({data:n?.monthlyStats??[],xField:`month`,series:[{field:`count`,name:`新增文件`,color:`#3b82f6`}],palette:e,point:!0,tooltip:{value:e=>`${e} 个`}}),[e,n]),l=U(()=>lt({data:n?.sizeRangeStats??[],xField:`range`,series:[{field:`count`,name:`文件数`,color:`#10b981`}],palette:e,tooltip:{value:e=>`${e} 个`}}),[e,n]),u=U(()=>lt({data:o,xField:`username`,series:[{field:`count`,name:`文件数`,color:`#8b5cf6`}],palette:e,horizontal:!0,categoryAxisWidth:80,tooltip:{value:e=>`${e} 个文件`}}),[e,o]);return/* @__PURE__ */ G(b,{spinning:t.isFetching,children:/* @__PURE__ */ K(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[/* @__PURE__ */ K(st,{children:[/* @__PURE__ */ G(H,{title:`文件总数`,value:i>0?i.toLocaleString():w}),/* @__PURE__ */ G(H,{title:`占用空间`,value:r?q(r.totalSize):w}),/* @__PURE__ */ G(H,{title:`今日新增`,value:r?.todayCount==null?w:r.todayCount.toLocaleString(),sub:`今日共上传`}),/* @__PURE__ */ G(H,{title:`本月新增`,value:r?.thisMonthCount==null?w:r.thisMonthCount.toLocaleString(),sub:`本月共上传`})]}),/* @__PURE__ */ G(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(min(160px, 100%), 1fr))`,gap:12},children:An.map(({type:e,label:t,Icon:r,color:a,bgColor:o})=>{let s=n?.typeStats.find(t=>t.type===e),c=s?.count??0,l=s?.size??0,u=i>0?c/i*100:0;return/* @__PURE__ */ K(`div`,{className:`zx-panel`,style:{padding:16,display:`flex`,flexDirection:`column`,gap:10},children:[/* @__PURE__ */ K(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:10},children:[/* @__PURE__ */ G(`div`,{style:{width:38,height:38,borderRadius:`var(--arc-antd-border-radius-large)`,background:o,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:/* @__PURE__ */ G(r,{size:19,color:a})}),/* @__PURE__ */ K(`div`,{style:{flex:1,minWidth:0},children:[/* @__PURE__ */ K(`div`,{style:{display:`flex`,alignItems:`baseline`,justifyContent:`space-between`,gap:4},children:[/* @__PURE__ */ G(`span`,{style:{fontSize:13,fontWeight:600,color:`var(--arc-antd-color-text-0)`},children:t}),/* @__PURE__ */ G(`span`,{style:{fontSize:18,fontWeight:700,color:`var(--arc-antd-color-text-0)`,flexShrink:0},children:c.toLocaleString()})]}),/* @__PURE__ */ G(`div`,{style:{fontSize:11,color:`var(--arc-antd-color-text-2)`,marginTop:3},children:q(l)})]})]}),/* @__PURE__ */ K(`div`,{children:[/* @__PURE__ */ K(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:5},children:[/* @__PURE__ */ G(`span`,{style:{fontSize:11,color:`var(--arc-antd-color-text-2)`},children:`占比`}),/* @__PURE__ */ K(`span`,{style:{fontSize:11,fontWeight:600,color:a},children:[u.toFixed(1),`%`]})]}),/* @__PURE__ */ G(Tn,{value:u,max:100,color:a,height:5})]})]},e)})}),/* @__PURE__ */ K(`div`,{className:`chart-grid`,children:[/* @__PURE__ */ K(`div`,{className:`zx-panel`,children:[/* @__PURE__ */ G(`div`,{style:Y,children:`存储类型分布`}),/* @__PURE__ */ G(z,{...s,options:V,height:220})]}),/* @__PURE__ */ K(`div`,{className:`zx-panel`,children:[/* @__PURE__ */ G(`div`,{style:Y,children:`月度上传趋势(近 12 个月)`}),/* @__PURE__ */ G(Cn,{...c,options:V,height:220})]})]}),/* @__PURE__ */ K(`div`,{className:`chart-grid`,children:[/* @__PURE__ */ K(`div`,{className:`zx-panel`,children:[/* @__PURE__ */ G(`div`,{style:Y,children:`文件大小分布`}),/* @__PURE__ */ G(z,{...l,options:V,height:220})]}),n&&n.uploaderStats.length>0&&/* @__PURE__ */ K(`div`,{className:`zx-panel`,children:[/* @__PURE__ */ G(`div`,{style:Y,children:`Top 上传人(按文件数)`}),/* @__PURE__ */ G(z,{...u,options:V,height:220})]})]})]})})}var On,kn,An,Y;function jn(){return(jn=e((()=>{x(),M(),wn(),Ye(),nt(),Ze(),dt(),nn(),vn(),hn(),on(),ln(),En(),C(),On=It,kn=[`#3b82f6`,`#10b981`,`#f59e0b`,`#ef4444`,`#8b5cf6`,`#06b6d4`,`#f97316`,`#84cc16`,`#ec4899`],An=[{type:`image`,label:`图片`,Icon:tn,color:`#3b82f6`,bgColor:`rgba(59,130,246,0.12)`},{type:`video`,label:`视频`,Icon:_n,color:`#8b5cf6`,bgColor:`rgba(139,92,246,0.12)`},{type:`audio`,label:`音频`,Icon:mn,color:`#f59e0b`,bgColor:`rgba(245,158,11,0.12)`},{type:`document`,label:`文档`,Icon:an,color:`#10b981`,bgColor:`rgba(16,185,129,0.12)`},{type:`other`,label:`其他`,Icon:cn,color:`#6b7280`,bgColor:`rgba(107,114,128,0.12)`}],Y={fontSize:14,fontWeight:600,color:`var(--arc-antd-color-text-0)`,marginBottom:12}})))()}function Mn(e){if(e===`success`)return`var(--arc-antd-color-success)`;if(e===`error`)return`var(--arc-antd-color-danger)`;if(e===`cancelled`)return`var(--arc-antd-color-disabled-text)`}function Nn(e,t,n,r,i,a){let o=e=>i(n=>n.map(n=>n.uid===t?e(n):n)),s=()=>o(e=>({...e,progress:100,status:`success`})),c=e=>o(t=>n.aborted?{...t,status:`cancelled`}:{...t,status:`error`,errorMsg:e instanceof Error?e.message:`上传失败`});if(o(e=>({...e,status:`uploading`})),e.size>r){$t(e,{signal:n,onProgress:e=>o(t=>({...t,progress:e}))}).then(s).catch(c);return}let l=new FormData;l.append(`file`,e),a(l,e=>o(t=>({...t,progress:e})),n).then(s).catch(c)}async function Pn(e){try{let t,n=e.directUrl??(/^https?:\/\//.test(e.url)?e.url:null);if(n)t=n;else{let n=await E(e.url);t=URL.createObjectURL(n)}return await new Promise(e=>{let r=new Image,i=()=>{n||URL.revokeObjectURL(t)};r.onload=()=>{i(),e({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{i(),e(null)},r.src=t})}catch{return null}}function Fn(){let[e,s]=Ht([`list`,`stats`],`list`),c=Nt(),{hasPermission:f}=Ot(),{preferences:p,setPreferences:m,canEditPreference:re}=wt(),ae={keyword:``,provider:void 0,fileType:void 0,timeRange:null},se=Ct(null),h=Ct(!1),[g,de]=W([]),[_,b]=W(!1),x=Ct(/* @__PURE__ */ new Map),{bind:S,bindKeyword:ve,submittedParams:C,handleSearch:w,handleReset:we}=At({defaults:ae,listKey:Ut.lists}),{page:Te,pageSize:T,setPage:E,setPageSize:D,buildPagination:je}=Mt({pageSize:(p.filesViewMode??`list`)===`grid`?$:Q,pageSizeOpts:Ln}),[O,k]=W([]),[Ne,Pe]=W(!1),[A,ze]=W(null),[j,M]=W(null),N=p.filesViewMode??`list`,P=Zt().data??null,Be=kt({keyword:C.keyword,provider:Et(Ft,C.provider),fileType:Et(Rt,C.fileType),...jt(C.timeRange)}),F=Jt({page:Te,pageSize:T,...Be}),I=F.data??null,L=Ie(()=>I?.list??[]),Ve=Xt(),He=Gt(),Ue=Kt(),We=Kt(),R=qt(A?.id,!!A),Ge=R.data??A,z=R.isFetching,Ke=e=>{if(!re(`filesViewMode`))return;h.current=!0,m({filesViewMode:e});let t=e===`grid`?$:Q;E(1),D(t),c.invalidateQueries({queryKey:Ut.lists})},qe=(e,t)=>{k(n=>t?[...n,e]:n.filter(t=>t!==e))},Je=e=>{let t=(I?.list??[]).map(e=>e.id);k(e?e=>{let n=[...e];for(let e of t)n.includes(e)||n.push(e);return n}:e=>e.filter(e=>!t.includes(e)))},Ye=e=>{ze(e),M(null)};St(()=>{if(h.current){h.current=!1;return}let e=N===`grid`?$:Q;E(1),D(e),c.invalidateQueries({queryKey:Ut.lists})},[N,E,D,c]),St(()=>{let e=R.data;e?.mimeType?.startsWith(`image/`)&&Pn(e).then(e=>{e&&M(e)})},[R.data]),St(()=>{if(_&&g.length>0&&g.every(Z)){let e=g.filter(e=>e.status===`success`).length,t=setTimeout(()=>{b(!1),e>0&&(r.success(e>1?`成功上传 ${e} 个文件`:`文件上传成功`),E(1),Wt(c))},1e3);return()=>clearTimeout(t)}},[g,_,c,E]);let Xe=()=>{se.current?.click()},Ze=e=>{let t=Array.from(e.target.files??[]);if(e.target.value=``,t.length===0)return;let n=t.map((e,t)=>({uid:`${e.name}-${Date.now()}-${t}`,name:e.name,size:e.size,progress:0,status:`pending`}));x.current.clear(),de(n),b(!0);for(let[e,r]of t.entries()){let t=new AbortController;x.current.set(n[e].uid,t),Nn(r,n[e].uid,t.signal,He,de,(e,t,n)=>Ve.mutateAsync({formData:e,onProgress:t,signal:n}))}},Qe=e=>{x.current.get(e)?.abort(Qt)},$e=async e=>{await Ue.mutateAsync([e.id]),r.success(`文件已删除`)},et=()=>{ye({title:`确认删除选中的 ${O.length} 个文件?`,content:`删除后将同步尝试删除实际存储对象,无法恢复。`,run:()=>We.mutateAsync(O),successMessage:`批量删除成功`,onDeleted:()=>k([])})},tt=async()=>{if(O.length!==0){Pe(!0);try{let e=await Vt.getBlob(Dt(Bt.batchDownload),{method:`POST`,body:JSON.stringify({ids:O})});if(!e)return;Pt(e,`files_${Date.now()}.zip`),r.success(`已打包 ${O.length} 个文件`)}catch{r.error(`批量下载失败`)}finally{Pe(!1)}}},B=async e=>{await Ce(e.directUrl??De(e.url),{success:`链接已复制`,error:`复制失败,请手动复制`})},nt=[{title:`文件名`,dataIndex:`originalName`,minWidth:220,ellipsis:{showTitle:!1},render:(e,t)=>{let n=Oe(t.mimeType,e);return/* @__PURE__ */ G(Le,{name:e,mimeType:t.mimeType,onClick:n?()=>void L.handlePreview(t):void 0})}},{title:`来源服务`,dataIndex:`storageName`,width:120,ellipsis:!0,render:(e,t)=>Se(t.storageName)},{title:`MIME 类型`,dataIndex:`mimeType`,width:160,ellipsis:!0,render:Se},{title:`大小`,dataIndex:`size`,width:100,align:`right`,render:e=>q(e)},xe(`上传时间`,`createdAt`),{title:`上传人`,dataIndex:`uploaderName`,width:100,ellipsis:!0,render:Se},_e({width:180,desktopInlineKeys:[`preview`,`download`],actions:e=>Me(e,{preview:L,onDetail:e=>{Ye(e)},onCopyUrl:B,onDelete:$e,canDelete:f(`system:file:delete`)})})],rt=o({keyword:/* @__PURE__ */ G(te,{placeholder:`搜索文件名 / 对象键 / 文件服务`,...ve(`keyword`),style:{width:`min(280px, 100%)`}}),filters:/* @__PURE__ */ K(Tt,{children:[/* @__PURE__ */ G(d,{placeholder:`全部存储类型`,items:Lt.filter(e=>[`local`,`s3`].includes(e.value)),...S(`provider`),width:140}),/* @__PURE__ */ G(d,{placeholder:`全部文件类型`,items:zt,...S(`fileType`),width:140}),/* @__PURE__ */ G(ne,{searchLabel:`上传时间`,type:`dateTimeRange`,...S(`timeRange`)})]}),onSearch:w,onReset:we,create:f(`system:file:upload`)&&/* @__PURE__ */ G(y,{type:`primary`,icon:/* @__PURE__ */ G(fe,{size:14}),loading:_&&g.some(e=>e.status===`uploading`||e.status===`pending`),disabled:!P,onClick:Xe,children:`上传文件`}),actions:O.length>0?/* @__PURE__ */ K(Tt,{children:[/* @__PURE__ */ K(y,{type:`tertiary`,theme:`light`,icon:/* @__PURE__ */ G(dn,{size:14}),loading:Ne,onClick:tt,children:[`批量下载 (`,O.length,`)`]}),f(`system:file:delete`)&&/* @__PURE__ */ G(ie,{count:O.length,loading:We.isPending,onClick:et}),/* @__PURE__ */ G(y,{type:`tertiary`,theme:`light`,icon:/* @__PURE__ */ G(pe,{size:12}),onClick:()=>k([]),children:`取消选择`})]}):null,filterTitle:`文件筛选`,actionTitle:`文件操作`});return/* @__PURE__ */ G(`div`,{className:`page-container page-tabs-page`,children:/* @__PURE__ */ K(i,{collapsible:`auto`,type:`line`,activeKey:e,onChange:e=>s(e),children:[/* @__PURE__ */ K(a,{tab:`文件列表`,itemKey:`list`,children:[N===`grid`&&/* @__PURE__ */ G(u,{config:rt}),/* @__PURE__ */ G(`input`,{ref:se,type:`file`,hidden:!0,multiple:!0,onChange:Ze}),/* @__PURE__ */ K(`div`,{className:`files-default-tip`,style:{padding:`8px 0`},children:[/* @__PURE__ */ K(v,{children:[/* @__PURE__ */ G(X,{strong:!0,children:`默认文件服务:`}),P?/* @__PURE__ */ G(X,{children:P.name}):/* @__PURE__ */ G(X,{type:`danger`,children:`未配置默认文件服务,请先前往"文件配置"设置。`})]}),re(`filesViewMode`)&&/* @__PURE__ */ K(v,{spacing:0,children:[/* @__PURE__ */ G(y,{size:`small`,theme:N===`list`?`solid`:`light`,type:N===`list`?`primary`:`tertiary`,icon:/* @__PURE__ */ G(ue,{size:14}),style:{borderRadius:`4px 0 0 4px`},onClick:()=>Ke(`list`)}),/* @__PURE__ */ G(y,{size:`small`,theme:N===`grid`?`solid`:`light`,type:N===`grid`?`primary`:`tertiary`,icon:/* @__PURE__ */ G(le,{size:14}),style:{borderRadius:`0 4px 4px 0`},onClick:()=>Ke(`grid`)})]})]}),/* @__PURE__ */ G(ke,{title:`上传进度`,visible:_,onCancel:()=>b(!1),footer:g.every(Z)?/* @__PURE__ */ G(y,{type:`primary`,onClick:()=>b(!1),children:`关闭`}):null,width:480,keepDOM:!1,children:/* @__PURE__ */ G(`div`,{style:{display:`flex`,flexDirection:`column`,gap:14,padding:`4px 0`},children:g.map(e=>/* @__PURE__ */ K(`div`,{children:[/* @__PURE__ */ K(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:4},children:[/* @__PURE__ */ K(v,{spacing:6,style:{overflow:`hidden`,flex:1,minWidth:0},children:[/* @__PURE__ */ G(`span`,{style:{display:`flex`,alignItems:`center`,flexShrink:0},children:Ee(void 0,14,e.name)}),/* @__PURE__ */ G(n.Text,{ellipsis:{showTooltip:!0},style:{fontSize:13,flex:1,minWidth:0},children:e.name})]}),/* @__PURE__ */ K(v,{spacing:6,style:{flexShrink:0,marginLeft:8},children:[/* @__PURE__ */ G(n.Text,{type:`tertiary`,size:`small`,children:q(e.size)}),e.status===`uploading`&&/* @__PURE__ */ K(n.Text,{size:`small`,children:[e.progress,`%`]}),e.status===`success`&&/* @__PURE__ */ G(oe,{size:14,color:`var(--arc-antd-color-success)`}),e.status===`error`&&/* @__PURE__ */ G(he,{content:e.errorMsg,children:/* @__PURE__ */ G(ce,{size:14,color:`var(--arc-antd-color-danger)`})}),e.status===`cancelled`&&/* @__PURE__ */ G(n.Text,{type:`tertiary`,size:`small`,children:`已取消`}),!Z(e)&&/* @__PURE__ */ G(he,{content:`取消上传`,children:/* @__PURE__ */ G(y,{theme:`borderless`,type:`tertiary`,size:`small`,icon:/* @__PURE__ */ G(pe,{size:14}),"aria-label":`取消上传 ${e.name}`,onClick:()=>Qe(e.uid)})})]})]}),/* @__PURE__ */ G(ge,{percent:e.progress,type:`line`,size:`small`,stroke:Mn(e.status),showInfo:!1,style:{margin:0}})]},e.uid))})}),/* @__PURE__ */ G(Re,{preview:L}),/* @__PURE__ */ G(Ae,{visible:!!A,file:Ge,loading:z,resolveUrl:e=>e.directUrl??De(e.url),onCopyUrl:e=>void B(e),onClose:()=>{ze(null),M(null)},extraRows:j?[{key:`分辨率`,value:`${j.width} × ${j.height} px`}]:[]}),N===`list`?/* @__PURE__ */ G(ee,{searchConfig:rt,columns:nt,empty:`暂无文件记录`,...be(F,{pagination:je,rowSelection:f(`system:file:delete`)?{selectedRowKeys:O,onChange:e=>k((e??[]).map(String))}:void 0})}):/* @__PURE__ */ K(Tt,{children:[f(`system:file:delete`)&&(I?.list??[]).length>0&&(()=>{let e=(I?.list??[]).map(e=>e.id),n=e.filter(e=>O.includes(e)),r=n.length===e.length,i=n.length>0&&!r;return/* @__PURE__ */ K(`div`,{className:`files-grid-select-bar`,style:{display:`flex`,alignItems:`center`,gap:8},children:[/* @__PURE__ */ G(t,{checked:r,indeterminate:i,onChange:()=>Je(!r),children:/* @__PURE__ */ K(`span`,{style:{fontSize:14,color:`var(--arc-antd-color-text-0)`},children:[`全选当前页`,n.length>0&&/* @__PURE__ */ K(`span`,{style:{marginLeft:4,color:`var(--arc-antd-color-text-2)`,fontWeight:400},children:[`(`,n.length,`/`,e.length,`)`]})]})}),O.length>0&&/* @__PURE__ */ K(y,{size:`small`,theme:`light`,type:`tertiary`,icon:/* @__PURE__ */ G(pe,{size:12}),onClick:()=>k([]),children:[`已选 `,O.length,` 项,取消选择`]})]})})(),/* @__PURE__ */ G(me,{grid:{gutter:[6,8],xs:8,sm:6,md:4,lg:3,xl:2,xxl:2},dataSource:I?.list??[],loading:F.isFetching,split:!1,emptyContent:/* @__PURE__ */ G(`div`,{className:`files-grid-empty`,children:`暂无文件记录`}),renderItem:e=>/* @__PURE__ */ G(me.Item,{style:{padding:0,height:`100%`},children:/* @__PURE__ */ G(Fe,{file:e,selected:O.includes(e.id),canSelect:f(`system:file:delete`),onSelect:qe,onPreview:L.handlePreview,onDownload:L.handleDownload,onDelete:$e,onDetail:Ye,onCopyUrl:B,canDelete:f(`system:file:delete`),previewLoading:L.previewLoadingId===e.id})},e.id)}),(I?.total??0)>0&&/* @__PURE__ */ G(`div`,{className:`files-grid-pagination`,children:/* @__PURE__ */ G(l,{currentPage:Te,pageSize:T,total:I?.total??0,onPageChange:e=>{E(e)},onPageSizeChange:e=>{D(e),E(1)},showSizeChanger:!0,showTotal:!0,pageSizeOpts:Rn})})]})]}),/* @__PURE__ */ G(a,{tab:`统计分析`,itemKey:`stats`,children:/* @__PURE__ */ G(Dn,{})})]})})}var X,In,Z,Q,$,Ln,Rn;function zn(){return(zn=e((()=>{D(),k(),x(),de(),fn(),h(),g(),ae(),se(),_(),T(),A(),je(),Pe(),jn(),O(),Ne(),C(),c(),S(),re(),ve(),s(),we(),f(),{Text:X}=n,In=[`pending`,`uploading`],Z=e=>!In.includes(e.status),Q=20,$=60,Ln=[20,50,100],Rn=[60,120,240]})))()}zn();export{Fn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,t as n}from"./mail-Cduf1OFr.js";import{n as r,t as i}from"./ModalFooter-vXDpmYTM.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./LoginField-Bu4C0-Mk.js";import{n as d,t as f}from"./AppModal-B_xvSaeq.js";import{useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useForgotPassword as g}from"@fudanda/react-core/hooks/queries/auth-public";function _({visible:e,onClose:t}){let[r,a]=p(!1),o=c(v,y),l=g(),d=l.isPending,_=()=>{a(!1),o.reset(),t()},b=async()=>{if(r){_();return}let e=o.validate();if(e&&!d)try{await l.mutateAsync({body:{email:e.email}}),a(!0)}catch(e){o.setFormError(e instanceof Error?e.message:`发送失败,请稍后重试`)}};return/* @__PURE__ */ m(f,{title:`找回密码`,visible:e,onCancel:_,footer:r?void 0:null,onOk:_,okText:`我知道了`,hasCancel:!1,width:400,children:r?/* @__PURE__ */ h(`div`,{style:{textAlign:`center`,padding:`24px 0`},children:[/* @__PURE__ */ m(n,{size:48,style:{color:`var(--arc-antd-color-primary)`,marginBottom:16}}),/* @__PURE__ */ m(`p`,{style:{fontSize:15,marginBottom:8,fontWeight:500},children:`重置链接已发送`}),/* @__PURE__ */ m(`p`,{style:{color:`var(--arc-antd-color-text-2)`,fontSize:13},children:`如邮箱已注册,重置链接已发送至您的邮箱,请在 30 分钟内完成重置。`})]}):/* @__PURE__ */ h(`form`,{className:`login-form`,onSubmit:e=>{e.preventDefault(),b()},noValidate:!0,children:[/* @__PURE__ */ m(`p`,{style:{color:`var(--arc-antd-color-text-2)`,fontSize:13,marginBottom:16},children:`请输入注册时使用的邮箱地址,我们将向该邮箱发送密码重置链接。`}),/* @__PURE__ */ m(u,{...o.field(`email`),id:`forgot-password-email`,label:`邮箱地址`,labelPosition:`left`,placeholder:`请输入邮箱`,prefix:/* @__PURE__ */ m(n,{size:14}),size:`large`,type:`email`,autoComplete:`email`,autoFocus:!0}),/* @__PURE__ */ m(s,{message:o.formError}),/* @__PURE__ */ m(i,{onCancel:_,onOk:b,okText:`发送重置链接`,loading:d})]})})}var v,y;function b(){return(b=e((()=>{t(),d(),r(),o(),l(),v={email:``},y={email:[{required:!0,message:`请输入邮箱地址`},{validator:e=>e&&!a(e)?`邮箱格式不正确`:void 0,message:`邮箱格式不正确`}]}})))()}b();export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{a as t,i as n}from"./controls-C5dPckUT.js";import{i as r}from"./feedback-D4BIfDNd.js";import{n as i}from"./tabs-BobA_IcO.js";import{i as a,s as o}from"./toolbar-controls-BFOuV86W.js";import{n as s,t as c}from"./info-BQa8C31Y.js";import{n as l,t as u}from"./save-w-NwiMMY.js";import{a as d,i as f,t as p}from"./form-DhQiOMvp.js";import{a as m,d as h,w as g}from"./ui-DoIHGuTR.js";import{n as _,t as v}from"./SearchToolbar-BAh56OAa.js";import{n as y,t as b}from"./useListPage-1Upr_ala.js";import{i as x,r as S}from"./table-columns-XaoxVUJN.js";import{useEffect as C,useRef as w,useState as T}from"react";import{Fragment as E,jsx as D,jsxs as O}from"react/jsx-runtime";import{usePermission as k}from"@fudanda/react-core/hooks/usePermission";import{ApiError as A}from"@fudanda/react-core/lib/query";import{SESSION_CONCURRENCY_SCOPES as j,SESSION_CONCURRENCY_SCOPE_LABELS as M,SESSION_EXCEED_ACTIONS as N,SESSION_EXCEED_ACTION_LABELS as P,identitySecurityContract as F}from"@fudanda/shared/identity";import{useSaveSettings as I,useSettings as L}from"@fudanda/react-core/hooks/queries/settings";import{formatSessionPolicyHint as R,identitySecuritySettingsSchema as z}from"@fudanda/shared/settings";import{useUrlTabState as B}from"@fudanda/react-core/hooks/useUrlTabState";import{useLoginRiskEventList as V}from"@fudanda/react-core/hooks/queries/identity-security";function H(e){return e<=0?`unlimited`:e===1?`single`:`limited`}function U(){let e=f(),{values:r}=d(),i=r?.session,a={maxSessions:i?.maxSessions??0,scope:i?.scope??`global`,exceedAction:i?.exceedAction??`kick-oldest`},o=H(a.maxSessions),s=o===`unlimited`,l=R(a),u=t=>{let n=t===`unlimited`?0:t===`single`?1:Math.max(a.maxSessions,W);e.setValue(`session.maxSessions`,n)};return/* @__PURE__ */ O(E,{children:[/* @__PURE__ */ D(p.Slot,{label:`同时在线`,children:/* @__PURE__ */ O(`div`,{className:`session-policy-limit`,children:[/* @__PURE__ */ O(t,{value:o,onChange:e=>u(e.target.value),"aria-label":`同时在线上限`,children:[/* @__PURE__ */ D(n,{value:`unlimited`,children:`不限制`}),/* @__PURE__ */ D(n,{value:`single`,children:`仅一处登录`}),/* @__PURE__ */ D(n,{value:`limited`,children:`最多 N 处`})]}),/* @__PURE__ */ D(p.InputNumber,{field:`session.maxSessions`,noLabel:!0,min:o===`limited`?2:0,max:20,style:{width:120},fieldStyle:{padding:0},fieldClassName:o===`limited`?void 0:`session-policy-limit-hidden`,suffix:`处`,"aria-label":`同时在线上限(处)`})]})}),/* @__PURE__ */ D(p.Select,{field:`session.scope`,label:`统计范围`,disabled:s,style:{width:260},optionList:j.map(e=>({value:e,label:M[e]})),extraText:`按终端分别计算时,网页、移动审批、桌面端各占一份名额`}),/* @__PURE__ */ D(p.RadioGroup,{field:`session.exceedAction`,label:`超限处理`,disabled:s,options:N.map(e=>({value:e,label:P[e]})),extraText:`拒绝新登录时,用户可在登录页选择下线其它设备后继续登录`}),/* @__PURE__ */ D(p.Slot,{label:` `,children:/* @__PURE__ */ O(`div`,{className:`session-policy-preview`,role:`status`,children:[/* @__PURE__ */ D(c,{size:14,"aria-hidden":!0}),/* @__PURE__ */ D(`span`,{children:l})]})})]})}var W;function G(){return(G=e((()=>{g(),s(),W=3})))()}function K(){let{hasPermission:e}=k(),t=e(`system:identity-security:manage`),n=[...t?[`policy`]:[]],[o,s]=B(n,t?`policy`:`risk`),c=w(null),[l,d]=T(J),{tableProps:f}=y({op:F.riskEvents,useList:V,enabled:!1}),g=L(`identitySecurity`,t&&o===`policy`),_=I(`identitySecurity`);C(()=>{g.data&&d(z.parse(g.data.effective))},[g.data]);async function b(){let e;try{e=await c.current?.validate()}catch{return}try{let t=await _.mutateAsync({body:{version:g.data?.version??0,data:e}});d(z.parse(t.effective)),r.success(`身份安全策略已保存`)}catch(e){e instanceof A&&e.code===409&&g.refetch()}}return S(`时间`,`createdAt`),n.length===0?/* @__PURE__ */ D(h,{description:`无访问权限`}):/* @__PURE__ */ D(`div`,{className:`page-container page-tabs-page`,children:/* @__PURE__ */ O(i,{collapsible:`auto`,type:`line`,keepDOM:!1,activeKey:o,onChange:e=>s(e),children:[t&&/* @__PURE__ */ O(q,{tab:`策略配置`,itemKey:`policy`,children:[/* @__PURE__ */ O(v,{children:[/* @__PURE__ */ D(m,{type:`primary`,icon:/* @__PURE__ */ D(u,{size:14}),loading:_.isPending,onClick:b,children:`保存`}),/* @__PURE__ */ D(a,{onClick:()=>void g.refetch(),loading:g.isFetching,children:`重载`})]}),/* @__PURE__ */ D(`div`,{style:{maxWidth:760,padding:`4px 0`},children:/* @__PURE__ */ O(p,{initValues:l,getFormApi:e=>{c.current=e},labelPosition:`left`,labelWidth:150,children:[/* @__PURE__ */ D(`div`,{className:`section-title`,children:`密码策略`}),/* @__PURE__ */ D(p.InputNumber,{field:`password.minLength`,label:`最小长度`,min:6,max:64}),/* @__PURE__ */ D(p.Switch,{field:`password.requireUppercase`,label:`必须包含大写`}),/* @__PURE__ */ D(p.Switch,{field:`password.requireSpecialChar`,label:`必须包含特殊字符`}),/* @__PURE__ */ D(p.Switch,{field:`password.expiryEnabled`,label:`启用密码过期`}),/* @__PURE__ */ D(p.InputNumber,{field:`password.expiryDays`,label:`过期天数`,min:1,max:3650}),/* @__PURE__ */ D(`div`,{className:`section-title`,style:{marginTop:24},children:`登录失败防护`}),/* @__PURE__ */ D(p.InputNumber,{field:`loginChallenge.maxAttemptsPerSource`,label:`单来源失败阈值`,min:1,max:1e3,extraText:`同一账号 + 同一 IP 的失败次数,达到后该来源需先过验证码`}),/* @__PURE__ */ D(p.InputNumber,{field:`loginChallenge.sourceLimit`,label:`多来源失败阈值`,min:1,max:100,extraText:`窗口内失败来源 IP 数,达到后该账号所有来源都需验证码(防分布式猜解)`}),/* @__PURE__ */ D(p.InputNumber,{field:`loginChallenge.windowMinutes`,label:`计数窗口(分钟)`,min:1,max:1440}),!1,/* @__PURE__ */ D(`div`,{className:`section-title`,style:{marginTop:24},children:`会话并发`}),/* @__PURE__ */ D(U,{}),!1]},JSON.stringify(l))})]}),!1]})})}var q,J;function Y(){return(Y=e((()=>{g(),l(),_(),x(),o(),b(),G(),{TabPane:q}=i,J=z.parse({})})))()}Y();export{K as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{o as t}from"./controls-C5dPckUT.js";import{t as n}from"./skeleton-CrjMjJNr.js";import{i as r}from"./feedback-D4BIfDNd.js";import{n as i,t as a}from"./chevron-down-mn2tSKQd.js";import{n as o,t as s}from"./trash-tHBT8Mpw.js";import{a as c,u as l,v as u,w as d,y as f}from"./ui-DoIHGuTR.js";import{Ar as p,Dr as m,Er as h,Ft as g,Gn as _,Hn as v,In as y,Kn as b,Lt as x,Nn as S,Nt as ee,Or as C,Pt as w,Un as te,Wn as ne,_ as re,_r as ie,b as ae,cr as oe,g as se,gr as ce,jr as le,kr as T,lr as ue,x as de}from"./chart-data-DOMSCLwj.js";import{n as fe,t as pe}from"./AppModal-B_xvSaeq.js";import{n as me,r as he}from"./PasswordInput--G8GKd5g.js";import{$n as ge,$r as _e,$t as ve,A as ye,An as be,Ar as xe,At as Se,Bt as Ce,Cn as we,Ct as Te,D as Ee,Dn as De,Dr as Oe,Dt as ke,E as Ae,En as je,Er as Me,Et as Ne,F as Pe,Fn as E,Ft as Fe,G as Ie,Gr as Le,Gt as Re,H as ze,Hr as Be,Ht as Ve,I as He,In as Ue,It as We,J as Ge,Jn as Ke,Jt as qe,K as Je,Kt as Ye,L as Xe,Ln as Ze,Lr as Qe,Lt as $e,M as et,Mn as tt,Mr as D,Mt as nt,N as rt,Nr as it,Nt as at,O as ot,On as st,Or as ct,Ot as lt,P as ut,Pn as dt,Pt as ft,Qr as pt,Qt as O,R as mt,Rr as ht,Rt as gt,Si as _t,Sn as vt,St as yt,T as bt,Ti as xt,Tn as St,Tr as Ct,Tt as wt,U as Tt,Ur as Et,Ut as Dt,Vr as Ot,Vt as kt,W as At,Wr as jt,Wt as Mt,Xr as k,Xt as Nt,Y as Pt,Yn as Ft,Yt as It,Zr as Lt,Zt as Rt,_ as zt,_i as Bt,_n as Vt,_t as Ht,ai as Ut,an as Wt,ar as Gt,br as Kt,bt as qt,ci as Jt,cn as Yt,dn as Xt,dr as Zt,ei as A,en as Qt,er as $t,fi as j,fn as en,gn as tn,gt as nn,hi as rn,hn as an,ht as on,ii as sn,in as cn,ir as ln,j as un,jn as M,jr as dn,jt as fn,k as pn,kn as mn,kt as hn,li as gn,ln as _n,mi as vn,mn as yn,mr as bn,mt as xn,n as Sn,ni as N,nn as Cn,nr as wn,oi as Tn,on as En,or as Dn,pi as P,pn as On,pr as kn,pt as An,q as jn,qt as Mn,r as Nn,ri as F,rn as Pn,rr as Fn,si as In,sn as I,sr as Ln,ti as Rn,tn as zn,un as Bn,ur as Vn,vi as Hn,vn as Un,vt as Wn,w as Gn,wi as Kn,wn as qn,wr as L,wt as Jn,xi as Yn,xr as Xn,xt as Zn,y as Qn,yi as $n,yt as er,z as tr,zt as nr}from"./StatCard-BwhGDWpE.js";import{a as rr,ar as ir,ir as ar,ln as or,o as sr,un as R}from"./chart-renderer-BWLqOvLF.js";import{useContext as cr,useState as z}from"react";import{Fragment as lr,jsx as B,jsxs as V}from"react/jsx-runtime";import ur from"dayjs";import{api as dr}from"@fudanda/react-core/lib/contract-query";import{ToolbarSlotContext as fr}from"@fudanda/react-core/components/toolbar-slot-context";import{authContract as pr}from"@fudanda/shared/identity";var mr;function hr(){return(hr=e((()=>{Ft(),y(),h(),mr=class extends Ke{constructor(){super(...arguments),this._getSeriesStyle=(e,t,n)=>{for(let n of S(t)){let t=this.series.getSeriesStyle(e)?.(n);if(!1!==t||n!==`fill`&&n!==`stroke`||(t=n===`fill`?this.series.getSeriesStyle(e)?.(`stroke`)?.[0]:this.series.getSeriesStyle(e)?.(`fill`)),m(t))return t}return n}}}})))()}var gr;function _r(){return(_r=e((()=>{Ze(),Vt(),gr=Object.assign(Object.assign(Object.assign({},Ue),Un),{area:{name:`area`,type:`area`}})})))()}var vr;function yr(){return(yr=e((()=>{Vn(),vr=()=>{Zt(),kn(),bn()}})))()}var br;function xr(){return(xr=e((()=>{h(),_n(),or(),br=class extends Yt{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(e){let t=!1!==e.point?.visible&&!1!==e.point?.style?.visible;this._addMarkLabelSpec(e,(e=>{let n=e.position===`inside-middle`;return!t||n?`area`:`point`})),this._addMarkLabelSpec(e,`area`,`areaLabel`,`initLineLabelMarkStyle`,void 0,!0)}_transformSpecAfterMergingTheme(e,t,n){var r;super._transformSpecAfterMergingTheme(e,t,n);let{area:i={},line:a={},seriesMark:o}=e,s=!1!==i.visible&&!1!==i.style?.visible,c=!1!==a.visible&&!1!==a.style?.visible;i.support3d=!(!i.support3d&&!a.support3d),i.zIndex=m(i.zIndex)||m(a.zIndex)?Math.max(i.zIndex??0,a.zIndex??0):void 0,i.style&&delete i.style.stroke,i.state&&Object.keys(i.state).forEach((e=>{`style`in i.state[e]?delete i.state[e].style.stroke:delete i.state[e].stroke}));let l=i,u=a;(o===`line`||c&&!s)&&(l=a,u=i),i.style=R({},u.style,l.style),i.state=R({},u.state,l.state),!1===i.interactive&&(i.style.fillPickable=!1),!1===a.interactive&&(a.style.strokePickable=!1),i.interactive=!(!i.interactive&&(r=a.interactive)!=null&&!r),e.area=i,e.line=a}}})))()}var Sr;function Cr(){return(Cr=e((()=>{Sr={label:{visible:!1,offset:5,position:`top`,style:{stroke:{type:`palette`,key:`backgroundColor`},lineWidth:2}},point:{style:{symbolType:`circle`}},seriesMark:`area`}})))()}var H,wr;function Tr(){return(Tr=e((()=>{ce(),tn(),we(),Ct(),In(),P(),tt(),wn(),en(),An(),Bn(),hr(),_r(),F(),yr(),xr(),St(),Ve(),Mt(),_e(),Ce(),gt(),Cr(),H=class e extends vt{constructor(){super(...arguments),this.type=j.area,this.transformerConstructor=br,this._sortDataByAxis=!1}_getSpecUpdatePolicy(){let e=super._getSpecUpdatePolicy();return Object.assign(Object.assign({},e),{dataRelatedKeys:Object.assign(Object.assign({},e.dataRelatedKeys),yn)})}initMark(){let t=this._spec.seriesMark??`area`,n=this._isAreaVisible()||this._isLineVisible();this._areaMark=this._createMark(e.mark.area,{groupKey:this._seriesField,isSeriesMark:n&&t!==`point`},{morphElementKey:this.getDimensionField()[0]}),this.initSymbolMark(t===`point`)}initMarkStyle(){this.initAreaMarkStyle(),this.initSymbolMarkStyle()}initAreaMarkStyle(){let e=this.getSpec().area?.style?.curveType??this.getSpec().line?.style?.curveType,t=e===`monotone`?this._direction===`horizontal`?`monotoneY`:`monotoneX`:e,n=this._areaMark;if(n){let e=this._isAreaVisible(),r=this._isLineVisible();e||r?n.setVisible(!0):n.setVisible(!1),this._direction===`horizontal`?this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:e=>{var t;return gn(this.dataToPositionX1(e),((t=this._xAxisHelper)?.getScale)?.call(t,0))},y:this.dataToPositionY.bind(this),y1:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,orient:this._direction},`normal`,L.Series):this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:this.dataToPositionX.bind(this),y1:e=>{var t;return gn(this.dataToPositionY1(e),((t=this._yAxisHelper)?.getScale)?.call(t,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},`normal`,L.Series),this.setMarkStyle(n,{fill:!!e&&this.getColorAttribute(),stroke:!!r&&this.getColorAttribute()},`normal`,L.Series),this._invalidType!==`zero`&&this.setMarkStyle(n,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},`normal`,L.Series),this.getStack()&&this.setMarkStyle(n,{zIndex:e=>-e[pt]},`normal`,L.Series),this.setMarkStyle(n,{curveType:t},`normal`,L.Built_In),Object.keys(n.stateStyle).forEach((e=>{n.stateStyle[e].stroke&&n.setPostProcess(`stroke`,(e=>[e,!1,!1,!1]),e)}))}}initAnimation(){let e={direction:this.direction},t=this._spec.animationAppear?.preset;if(this._lineMark&&this._lineMark.setAnimationConfig(M(N.getAnimationInKey(`line`)?.(e,t),E(`line`,this._spec,this._markAttributeContext))),this._areaMark&&this._areaMark.setAnimationConfig(M(N.getAnimationInKey(`area`)?.(e,t),E(`area`,this._spec,this._markAttributeContext))),this._symbolMark){let e=qn(this);this._symbolMark.setAnimationConfig(M(N.getAnimationInKey(`scaleInOut`)?.(),E(`point`,this._spec,this._markAttributeContext),e))}}_isAreaVisible(){let e=this._spec.area||{};return!1!==e.visible&&!1!==e.style?.visible}_isLineVisible(){let e=this._spec.line||{};return!1!==e.visible&&!1!==e.style?.visible}initTooltip(){this._tooltipHelper=new mr(this);let{group:e,mark:t}=this._tooltipHelper.activeTriggerSet;this._areaMark&&e.add(this._areaMark),this._lineMark&&e.add(this._lineMark),this._symbolMark&&(t.add(this._symbolMark),e.add(this._symbolMark))}viewDataStatisticsUpdate(e){super.viewDataStatisticsUpdate(e),this.encodeDefined(this._areaMark,`defined`)}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}getDefaultShapeType(){return`square`}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}onLayoutEnd(){super.onLayoutEnd(),this.reCompileSampling()}getSeriesStyle(e){return t=>{let n=this._spec.seriesMark??`area`,r=this._seriesMark?.getAttribute(t,e)??void 0;return t!==`fill`||r&&n!==`line`||(t=`stroke`,r=this._seriesMark?.getAttribute(t,e)??void 0),t===`stroke`&&ie(r)?r[0]:r}}},H.type=j.area,H.builtInTheme={area:Sr},H.mark=gr,H.transformerConstructor=br,v(H,an),wr=()=>{nr(),kt(),On(),xn(),Xt(),vr(),Re(),Dt(),N.registerSeries(H.type,H)}})))()}var U;function Er(){return(Er=e((()=>{at(),xe(),U=class extends nt{_getDefaultSeriesSpec(e){return super._getDefaultSeriesSpec(e,[`point`,`line`,`area`,`seriesMark`,`activePoint`,`sampling`,`samplingFactor`,`pointDis`,`pointDisMul`,`markOverlap`,`areaLabel`,`useSequentialAnimation`])}transformSpec(e){super.transformSpec(e),dn(e)}}})))()}var W,Dr;function Or(){return(Or=e((()=>{Tr(),P(),F(),Er(),$e(),fn(),lt(),Ne(),wt(),yt(),er(),Ht(),on(),W=class extends We{constructor(){super(...arguments),this.transformerConstructor=U,this.type=`area`,this.seriesType=j.area}_setModelOption(){this._modelOption.getDimensionInfo=Te,this._modelOption.getDimensionInfoByValue=Jn,this._modelOption.getRectByDimensionData=Zn}},W.type=`area`,W.seriesType=j.area,W.transformerConstructor=U,v(W,Se),Dr=()=>{qt(),Wn(),nn(),hn(),wr(),ke(),N.registerChart(W.type,W)}})))()}var kr;function Ar(){return(Ar=e((()=>{y(),h(),C(),se(),I(),st(),St(),Ot(),kr=class extends De{constructor(){super(...arguments),this.coordinate=`polar`,this._outerRadius=cn,this._innerRadius=0,this._angleField=[],this._radiusField=[],this._sortDataByAxis=!1}get outerRadius(){return this._outerRadius}get innerRadius(){return this._innerRadius}getAngleField(){return this._angleField}setAngleField(e){return this._angleField=m(e)?S(e):[],this._angleField}getRadiusField(){return this._radiusField}setRadiusField(e){return this._radiusField=m(e)?S(e):[],this._radiusField}get innerRadiusField(){return this._innerRadiusField}setInnerRadiusField(e){return this._innerRadiusField=S(e),this._innerRadiusField}get radiusScale(){return this._radiusScale}setRadiusScale(e){return this._radiusScale=e,e}get angleScale(){return this._angleScale}setAngleScale(e){return this._angleScale=e,e}get angleAxisHelper(){return this._angleAxisHelper}set angleAxisHelper(e){this._angleAxisHelper=e,this.onAngleAxisHelperUpdate()}get radiusAxisHelper(){return this._radiusAxisHelper}set radiusAxisHelper(e){this._radiusAxisHelper=e,this.onRadiusAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getCenter=()=>this.angleAxisHelper.center(),this._markAttributeContext.getLayoutRadius=()=>this._computeLayoutRadius()}valueToPosition(e,t){if(T(e)||T(t)||!this.angleAxisHelper||!this.radiusAxisHelper)return{x:NaN,y:NaN};let n=this.radiusAxisHelper.dataToPosition(S(t));if(n<0){if(this._invalidType===`break`||this._invalidType===`link`)return{x:NaN,y:NaN};if(this._invalidType===`zero`)return this.angleAxisHelper.center()}let r=this.angleAxisHelper.dataToPosition(S(e));return this.angleAxisHelper.coordToPoint({angle:r,radius:n})}dataToPosition(e,t){return e&&this.angleAxisHelper&&this.radiusAxisHelper?t&&!this.isDatumInViewData(e)?null:this.valueToPosition(this.getDatumPositionValues(e,this._angleField),this.getDatumPositionValues(e,this._radiusField)):null}dataToPositionX(e){return this.dataToPosition(e)?.x}dataToPositionY(e){return this.dataToPosition(e)?.y}dataToPositionZ(e){return 0}positionToData(e){}radiusToData(e){}angleToData(e){}getStatisticFields(){var e,t;let n=[];return(e=this.radiusAxisHelper)!=null&&e.getScale&&this._radiusField.forEach((e=>{let t={key:e,operations:[]};t.operations=re(this.radiusAxisHelper.getScale(0).type)?[`max`,`min`]:[`values`],n.push(t)})),(t=this.angleAxisHelper)!=null&&t.getScale&&this._angleField.forEach((e=>{let t={key:e,operations:[]};t.operations=re(this.angleAxisHelper.getScale(0).type)?[`max`,`min`]:[`values`],n.push(t)})),n}setAttrFromSpec(){super.setAttrFromSpec(),m(this._spec.outerRadius)&&(this._outerRadius=this._spec.outerRadius),m(this._spec.radius)&&(this._outerRadius=this._spec.radius),m(this._spec.innerRadius)&&(this._innerRadius=this._spec.innerRadius),m(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}onRadiusAxisHelperUpdate(){this.onMarkPositionUpdate()}onAngleAxisHelperUpdate(){this.onMarkPositionUpdate()}afterInitMark(){super.afterInitMark()}_computeLayoutRadius(){let e=this._angleAxisHelper||this._radiusAxisHelper;if(e)return e.layoutRadius();let{width:t,height:n}=this._region.getLayoutRect();return Math.min(t/2,n/2)}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(ht.scaleDomainUpdate,{filter:e=>e.model.id===this._angleAxisHelper?.getAxisId()},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var e;(e=this.getViewData()?.latestData)!=null&&e.length&&je(this.angleAxisHelper,this._angleField[0],this.getViewData().latestData)}getInvalidCheckFields(){let e=[];return this.angleAxisHelper.isContinuous&&this._angleField.forEach((t=>{e.push(t)})),this.radiusAxisHelper.isContinuous&&this._radiusField.forEach((t=>{e.push(t)})),e}}})))()}function G(e){return Yn(e)?Number.parseFloat(e):0}var jr,Mr;function Nr(){return(Nr=e((()=>{_t(),Hn(),I(),C(),g(),jr=(e,t)=>{let{asStartAngle:n,asEndAngle:r,asMiddleAngle:i,asRadian:a,asRatio:o,asQuadrant:s,asK:c,showAllZero:l,supportNegative:u,showEmptyCircle:d}=t,f=t.angleField(),p=t.startAngle(),m=t.endAngle(),h=t.minAngle(),g=e.map((e=>Object.assign({},e)));if(!g||g.length===0)return g;if(!l&&d&&Mr(g,f,u))return[];let _=(e,t,o)=>{e[n]=t,e[r]=t+o,e[i]=t+o/2,e[a]=o,e[s]=ee(t+o/2)},v=0,y=-1/0,b=!0;for(let e=0;e<g.length;e++){let t=u?Math.abs(G(g[e][f])):G(g[e][f]);v+=t,y=Math.max(t,y),b&&t!==0&&(b=!1),g[e][Pn]=t}let x=g.map((e=>Number(e[f]))),S=m-p,C=p,w=S,te=0,ne=Bt(x);if(g.forEach(((e,t)=>{let n=e[Pn],r=v?n/v:0,i=r*S;i<h?(i=h,w-=h):te+=n;let a=C,s=C+i;e[o]=r,e[c]=y?n/y:0,e._percent_=ne[t],_(e,a,i),C=s})),w<S){if(w<=.001){let e=S/g.length;g.forEach(((t,n)=>{_(t,p+n*e,e)}))}else{let e=w/te;C=p,g.forEach((t=>{let n=t[a]===h?h:t[Pn]*e;_(t,C,n),C+=n}))}}if(v!==0&&(g[g.length-1][r]=m),b&&l){let e=S/g.length;g.forEach(((t,n)=>{_(t,p+n*e,e)}))}return g},Mr=(e,t,n)=>!!T(e)||e.length===0||!!e.every((e=>G(e[t])===0))||!n&&e.reduce(((e,n)=>e+G(n[t])),0)===0})))()}function Pr(e,t,n){return(r,i,a)=>t?e.growField===`radius`?{overall:0}:{overall:e.growFrom(r,i,n)}:{overall:!1}}function Fr(e,t){if(!1===t)return{};switch(t){case`fadeIn`:return Lr;case`growRadius`:return Ir(Object.assign(Object.assign({},e),{growField:`radius`}));default:return Ir(Object.assign(Object.assign({},e),{growField:`angle`}))}}var Ir,Lr,Rr,zr,Br,Vr;function Hr(){return(Hr=e((()=>{it(),F(),Vn(),Ir=e=>({type:e.growField===`radius`?`growRadiusIn`:`growAngleIn`,options:Pr(e,!0,D.appear)}),Lr={type:`fadeIn`},Rr=e=>({type:e.growField===`radius`?`growRadiusIn`:`growAngleIn`,easing:`linear`,options:Pr(e,!0,D.enter)}),zr=e=>({type:e.growField===`radius`?`growRadiusOut`:`growAngleOut`,easing:`linear`,options:Pr(e,!0,D.exit)}),Br=()=>{N.registerAnimation(`pie`,((e,t)=>({appear:Fr(e,t),enter:Rr(e),exit:zr(e),disappear:{duration:Ln.disappear.duration}})))},Vr=()=>{N.registerAnimation(`emptyCircle`,((e,t)=>({appear:Fr(e,t)})))}})))()}function Ur(e,t){var n;let r=t.options?.distance??10,i=ue(t.duration)?t.duration/2:1e3,a=t.options.easing??`cubicOut`;return{oneByOne:t.oneByOne,loop:(n=t.loop)!=null&&n,timeSlices:[{duration:i,effects:{easing:a,channel:{x:{from:t=>e.getAttribute(`x`,t),to:t=>e.getAttribute(`x`,t)+x({x:0,y:0},r,t[O]).x},y:{from:t=>e.getAttribute(`y`,t),to:t=>e.getAttribute(`y`,t)+x({x:0,y:0},r,t[O]).y}}}},{duration:i,effects:{easing:a,channel:{x:{to:t=>e.getAttribute(`x`,t),from:t=>e.getAttribute(`x`,t)+x({x:0,y:0},r,t[O]).x},y:{to:t=>e.getAttribute(`y`,t),from:t=>e.getAttribute(`y`,t)+x({x:0,y:0},r,t[O]).y}}}}]}}function Wr(){return(Wr=e((()=>{I(),oe(),g()})))()}var Gr;function Kr(){return(Kr=e((()=>{Ze(),Gr=Object.assign(Object.assign({},Ue),{pie:{name:`pie`,type:`arc`},labelLine:{name:`labelLine`,type:`path`}})})))()}var qr;function Jr(){return(Jr=e((()=>{ce(),h(),or(),be(),qr=class extends mn{_transformLabelSpec(e){this._addMarkLabelSpec(e,`pie`)}_mergeThemeToSpec(e,t){let n=this._theme,r=e;if(this._shouldMergeThemeToSpec()){let n=this._getDefaultSpecFromChart(t);r=R({},this._theme,n,e);let i=(e,t)=>R({},e===`inside`||e===`inside-center`?this._theme.innerLabel:this._theme.outerLabel,t);ie(r.label)?r.label=r.label.map((e=>i(e.position,e))):r.label=i(r.label.position,r.label)}return{spec:r,theme:n}}_getDefaultSpecFromChart(e){let t=super._getDefaultSpecFromChart(e)??{},{centerX:n,centerY:r}=e;return m(n)&&(t.centerX=n),m(r)&&(t.centerY=r),Object.keys(t).length>0?t:void 0}}})))()}var Yr;function Xr(){return(Xr=e((()=>{Rn(),`${A}`,`${A}`,`${A}`,Yr=`${A}_LABEL_VISIBLE`,`${A}`,`${A}`})))()}var Zr;function Qr(){return(Qr=e((()=>{Zr={outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,interactive:!0,position:`outside`,style:{fontWeight:`normal`,stroke:{type:`palette`,key:`backgroundColor`},fillOpacity:1}},innerLabel:{style:{lineWidth:2}},emptyCircle:{style:{fill:{type:`palette`,key:`emptyCircleColor`},fillOpacity:1}}}})))()}var $r,ei,K,q,ti;function ni(){return(ni=e((()=>{h(),C(),g(),de(),I(),Ct(),_e(),Rn(),Hn(),In(),rn(),Ar(),P(),Nr(),Hr(),tt(),it(),Wr(),Ge(),Kr(),F(),Jr(),Xr(),Ot(),It(),Tn(),Xn(),Qr(),$r={valueField:!0,angleField:!0,startAngle:!0,endAngle:!0,minAngle:!0},ei={outerRadius:!0},K=class e extends kr{constructor(){super(...arguments),this.transformerConstructor=qr,this._pieMarkName=`pie`,this._pieMarkType=`arc`,this.getCenter=()=>{let e=this._region.getLayoutRect();return{x:sn(this._spec?.centerX,e.width,e,e.width/2),y:sn(this._spec?.centerY,e.height,e,e.height/2)}},this._startAngle=En,this._endAngle=Wt,this._pieMark=null,this._labelMark=null,this._labelLineMark=null,this._emptyArcMark=null,this.dataToCentralPosition=e=>{let t=e[O];if(T(t))return null;let n=this.computeDatumRadius(e),r=this.computeDatumInnerRadius(e),i=this.computeCenter(e);return x(i,(n+r)/2,t)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.getCenter().x,y:()=>this.getCenter().y}),this._markAttributeContext.startAngleScale=e=>this.startAngleScale(e),this._markAttributeContext.endAngleScale=e=>this.endAngleScale(e)}setAttrFromSpec(){var e,t,n;super.setAttrFromSpec(),this._centerOffset=this._spec.centerOffset??0,this._cornerRadius=this._spec.cornerRadius??0;let r=$n(m(this._spec.startAngle)?w(this._spec.startAngle):this._startAngle,m(this._spec.endAngle)?w(this._spec.endAngle):this._endAngle);this._startAngle=r.startAngle,this._endAngle=r.endAngle,this._padAngle=m(this._spec.padAngle)?w(this._spec.padAngle):0,this.setAngleField(this._spec.valueField||this._spec.angleField),this._spec.categoryField&&this.setSeriesField(this._spec.categoryField),this._radiusField=[],this._specAngleField=this._angleField.slice(),this._specRadiusField=[],this._showEmptyCircle=(e=this._spec.emptyPlaceholder?.showEmptyCircle)!=null&&e,this._showAllZero=(t=this._spec.showAllZero)!=null&&t,this._supportNegative=(n=this._spec.supportNegative)!=null&&n}initData(){super.initData();let e=this.getViewData();if(!e)return;Qe(this._dataSet,`pie`,jr),e.transform({type:`pie`,options:{angleField:()=>this._angleField[0],startAngle:()=>this._startAngle,endAngle:()=>this._endAngle,minAngle:()=>m(this._spec.minAngle)?w(this._spec.minAngle):0,asStartAngle:Cn,asEndAngle:Nt,asRatio:zn,asMiddleAngle:O,asRadian:Qt,asQuadrant:ve,asK:Rt,showAllZero:this._showAllZero,supportNegative:this._supportNegative,showEmptyCircle:this._showEmptyCircle}},!1);let t=new ae(this._dataSet,{name:`${A}_series_${this.id}_viewDataLabel`});t.parse([this.getViewData()],{type:`dataview`}),this._viewDataLabel=new Kt(this._option,t)}compileData(){var e;super.compileData(),(e=this._viewDataLabel)==null||e.compile()}initMark(){this._pieMark=this._createMark(Object.assign(Object.assign({},e.mark.pie),{name:this._pieMarkName,type:this._pieMarkType}),{key:Lt,groupKey:this._seriesField,isSeriesMark:!0},{morph:dt(this._spec,this._pieMarkName),morphElementKey:this._seriesField}),this._showEmptyCircle&&(this._emptyArcMark=this._createMark({name:`emptyCircle`,type:`arc`},{dataView:!1}),this._data.addRelatedMark(this._emptyArcMark))}startAngleScale(e){return vn(Cn)(e)}endAngleScale(e){return vn(Nt)(e)}_computeLayoutRadius(){return qe((()=>this._spec.layoutRadius),this.getLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}initMarkStyle(){let e={x:()=>this.getCenter().x,y:()=>this.getCenter().y,fill:this.getColorAttribute(),outerRadius:Jt(this._outerRadius)?this._outerRadius:()=>this._computeLayoutRadius()*this._outerRadius,innerRadius:Jt(this._innerRadius)?this._innerRadius:()=>this._computeLayoutRadius()*this._innerRadius,cornerRadius:()=>this._computeLayoutRadius()*this._cornerRadius,startAngle:e=>this.startAngleScale(e),endAngle:e=>this.endAngleScale(e),padAngle:this._padAngle,centerOffset:this._centerOffset},t=this._pieMark;t&&this.setMarkStyle(t,e,`normal`,L.Series);let n=this._emptyArcMark;n&&this.setMarkStyle(n,Object.assign(Object.assign({},e),{visible:()=>{let e=this.getViewData().latestData;return!e||!e.length}}),`normal`,L.Series)}getInteractionTriggers(){return this._parseInteractionConfig(this._pieMark?[this._pieMark]:[])}initTooltip(){super.initTooltip(),this._pieMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pieMark)}initMarkStyleWithSpec(e,t){if(super.initMarkStyleWithSpec(e,t),e.name===this._pieMarkName){let t=this.getSpec()[e.name];if(t)for(let n in t.state||{})this.setMarkStyle(e,this.generateRadiusStyle(t.state[n]),n,L.User_Mark)}e.name===`emptyCircle`&&this.setMarkStyle(e,this.generateRadiusStyle(t.style),`normal`,L.User_Mark)}initLabelMarkStyle(e){e&&this.setMarkStyle(e,{visible:vn(Yr).bind(this),text:e=>e[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:this.dataToPositionZ.bind(this)})}afterInitMark(){super.afterInitMark()}initEvent(){var e;super.initEvent(),(e=this._viewDataLabel.getDataView())==null||e.target.addListener(`change`,this.viewDataLabelUpdate.bind(this))}initGroups(){}onLayoutEnd(){this._viewDataLabel.getDataView().reRunAllTransform(),this.onMarkPositionUpdate(),super.onLayoutEnd()}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return this._specAngleField}viewDataLabelUpdate(){this.event.emit(ht.viewDataLabelUpdate,{model:this}),this._viewDataLabel.updateData()}generateRadiusStyle(e){if(!e)return;let t={};return e.outerRadius&&(t.outerRadius=()=>this._computeLayoutRadius()*e.outerRadius),e.innerRadius&&(t.innerRadius=()=>this._computeLayoutRadius()*e.innerRadius),e.cornerRadius&&(t.cornerRadius=()=>this._computeLayoutRadius()*e.cornerRadius),t}computeCenter(e){return{x:this._pieMark.getAttribute(`x`,e,`normal`),y:this._pieMark.getAttribute(`y`,e,`normal`)}}getRadius(e=`normal`){return(e===`normal`?this.getSpec()[this._pieMark?.name||`pie`]?.style?.outerRadius:this.getSpec()[this._pieMark?.name||`pie`]?.state?.[e]?.outerRadius)??this._outerRadius}getInnerRadius(e=`normal`){return(e===`normal`?this.getSpec()[this._pieMark?.name||`pie`]?.style?.innerRadius:this.getSpec()[this._pieMark?.name||`pie`]?.state?.[e]?.innerRadius)??this._innerRadius}computeRadius(e,t){return this._computeLayoutRadius()*e*(T(t)?1:t)+this._centerOffset}computeDatumRadius(e,t){return this._computeLayoutRadius()*this.getRadius(t)+this._centerOffset}_getSpecUpdatePolicy(){let e=super._getSpecUpdatePolicy();return Object.assign(Object.assign({},e),{compileOnlyKeys:Object.assign(Object.assign({},e.compileOnlyKeys),ei),dataRelatedKeys:Object.assign(Object.assign({},e.dataRelatedKeys),$r)})}_compareSpec(e,t,n){n??={data:!0};let r=[`centerX`,`centerY`,`centerOffset`,`radius`,`innerRadius`,`cornerRadius`,`startAngle`,`endAngle`,`padAngle`];r.forEach((e=>{n[e]=!0}));let i=super._compareSpec(e,t,n);return e??={},r.some((n=>e[n]!==t[n]))&&(i.reRender=!0,i.change=!0),i}computeDatumInnerRadius(e,t){return this._computeLayoutRadius()*this.getInnerRadius(t)+this._centerOffset}dataToPosition(e,t){let n=e[O];if(T(n)||t&&!this.isDatumInViewData(e))return null;let r=this.computeDatumRadius(e),i=this.computeCenter(e);return x(i,r,n)}initAnimation(){let e={growFrom:(e,t,n)=>{if(n===D.appear)return this._startAngle;if(n===D.disappear)return this._endAngle;let r=[D.disappear,D.exit],i=this._pieMark.getGraphics(),a=e?.[k];if(i.find((e=>e.context.data[0]?.[k]<a))===void 0)return this._startAngle;if(i.find((e=>e.context.data[0]?.[k]>a))===void 0)return this._endAngle;let o=[...i].reverse().find((e=>e.context.data[0]?.[k]<a));return r.includes(n)?o?.getFinalAttribute()?.endAngle:o?.attribute?.endAngle}},t=this._spec.animationAppear?.preset;if(this._pieMark){let n=M(N.getAnimationInKey(`pie`)?.(e,t),E(`pie`,this._spec,this._markAttributeContext));n.normal&&n.normal.type&&(n.normal=Ur(this._pieMark,n.normal)),this._pieMark.setAnimationConfig(n)}if(this._emptyArcMark){let n=M(N.getAnimationInKey(`emptyCircle`)?.(e,t??`fadeIn`));this._emptyArcMark.setAnimationConfig(n)}}getDefaultShapeType(){return`circle`}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return``}_noAnimationDataKey(e,t){return t}getActiveMarks(){return[this._pieMark]}},K.transformerConstructor=qr,K.mark=Gr,K.builtInTheme={pie:Zr},q=class extends K{constructor(){super(...arguments),this.type=j.pie}},q.type=j.pie,ti=()=>{Pt(),Br(),Vr(),N.registerSeries(q.type,q)}})))()}var ri;function ii(){return(ii=e((()=>{y(),ce(),C(),h(),Fe(),ri=class extends ft{_isValidSeries(e){return!this.seriesType||e===this.seriesType}getIndicatorSpec(e){let t=S(e.indicator),n=e.innerRadius??e.series?.[0]?.innerRadius;return m(n)&&t.forEach((e=>{T(e.limitRatio)&&(e.limitRatio=n)})),t}_getDefaultSeriesSpec(e,t){return super._getDefaultSeriesSpec(e,[`radius`,`outerRadius`,`innerRadius`,`startAngle`,`endAngle`,`centerX`,`centerY`,`sortDataByAxis`],t)}transformSpec(e){super.transformSpec(e),ie(e.dataZoom)&&e.dataZoom.length>0&&e.dataZoom.forEach((e=>{e.filterMode===`axis`&&(e.filterMode=`filter`)})),this.transformSeriesSpec(e),m(e.indicator)&&(e.indicator=this.getIndicatorSpec(e))}}})))()}var J;function ai(){return(ai=e((()=>{ii(),J=class extends ri{needAxes(){return!1}_getDefaultSeriesSpec(e){let t=super._getDefaultSeriesSpec(e,[`center`,`centerOffset`,`cornerRadius`,`padAngle`,`minAngle`,`emptyPlaceholder`,`showAllZero`,`supportNegative`,`useSequentialAnimation`,`layoutRadius`]);return this._addSeriesRelatedSpecKeys([`valueField`,`angleField`]),t.categoryField=e.categoryField||e.seriesField,t.valueField=e.valueField||e.angleField,t.emptyCircle=e.emptyPlaceholder?.emptyCircle,t}}})))()}var oi;function si(){return(si=e((()=>{$e(),ai(),oi=class extends We{constructor(){super(...arguments),this.transformerConstructor=J}},oi.transformerConstructor=J})))()}var Y,ci;function li(){return(li=e((()=>{ni(),P(),si(),F(),ai(),Ht(),Y=class extends oi{constructor(){super(...arguments),this.transformerConstructor=J,this.type=`pie`,this.seriesType=j.pie}},Y.type=`pie`,Y.seriesType=j.pie,Y.transformerConstructor=J,ci=()=>{Wn(),ti(),N.registerChart(Y.type,Y)}})))()}var ui;function di(){return(di=e((()=>{y(),p(),ui=(e,t)=>{let{datum:n,title:r,content:i}=le(t)?t():t,a=[],o=n.call(null);return r.visible&&a.push({type:`title`,index:0,datum:o,spec:r}),S(i).forEach(((e,t)=>{e.visible&&a.push({type:`content`,index:t,datum:o,spec:e})})),a}})))()}var fi,pi;function mi(){return(mi=e((()=>{fi=(e,t)=>({fontSize:{type:`token`,key:e},fill:{type:`palette`,key:t},fontWeight:`normal`,fillOpacity:1,textBaseline:`top`,textAlign:`center`}),pi={title:{visible:!0,autoLimit:!1,autoFit:!1,style:fi(`l1FontSize`,`primaryFontColor`)},content:{visible:!0,style:fi(`l2FontSize`,`tertiaryFontColor`)}}})))()}var hi,X,gi;function _i(){return(_i=e((()=>{de(),ct(),xt(),Mn(),or(),jt(),Tn(),te(),h(),p(),y(),_(),di(),Xn(),sr(),F(),$t(),Et(),mi(),hi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},X=class extends Ye{constructor(){super(...arguments),this.type=Kn.indicator,this.name=Kn.indicator,this.specKey=`indicator`,this.layoutType=`none`,this.layoutZIndex=Oe.Indicator,this.layoutLevel=Me.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(e){return ge(e,this.specKey,this.type,(e=>e&&!1!==e.visible))}created(){super.created(),this.initData(),this.initEvent()}setAttrFromSpec(){super.setAttrFromSpec(),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=S(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(S(this._spec.regionId),S(this._spec.regionIndex))}_compareSpec(e,t){let n=super._compareSpec(e,t);return ne(t,e)||n.reMake||n.reCompile||(n.change=!0,n.reRender=!0,n.effects=Object.assign(Object.assign({},n.effects),{component:!0,layout:!0,render:!0})),n}initEvent(){this._option.disableTriggerEvent||this._spec.trigger!==`none`&&(this._spec.trigger===`hover`?(this.event.on(`element-highlight:start`,(e=>{let t=e.graphics[0];this.isRelativeModel(t)&&this.updateDatum(Be(t))})),this.event.on(`element-highlight:reset`,(e=>{this._activeDatum&&this.updateDatum(null)}))):(this.event.on(`element-select:start`,(e=>{let t=e.graphics[0];this.isRelativeModel(t)&&this.updateDatum(Be(t))})),this.event.on(`element-select:reset`,(e=>{this._activeDatum&&this.updateDatum(null)}))))}updateDatum(e){this._activeDatum=e,this._displayData.updateData();let t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t)}initData(){Qe(this._option.dataSet,`indicatorFilter`,ui);let e=new ae(this._option.dataSet,{name:`${this.type}_${this.id}_data`});e.transform({type:`indicatorFilter`,options:()=>({title:this._title,content:this._content,datum:()=>this._activeDatum})}),e.target.addListener(`change`,this.updateDatum.bind(this)),this._displayData=new Kt(this._option,e)}updateLayoutAttribute(){let e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&this._activeDatum===null)return{visible:!1};let e=this._regions[0],{width:t,height:n}=e.getLayoutRect(),{x:r,y:i}=e.getLayoutStartPoint(),a=this._spec,{content:o,offsetX:s,offsetY:c,limitRatio:l,title:u}=a,d=hi(a,[`content`,`offsetX`,`offsetY`,`limitRatio`,`title`]),f=[];return S(o).forEach((e=>{let t=R({},this._theme.content,e);f.push({visible:!1!==t.visible&&(!t.field||this._activeDatum!==null),space:t.space||this._gap,autoLimit:t.autoLimit,autoFit:t.autoFit,fitPercent:t.fitPercent,fitStrategy:t.fitStrategy,style:Object.assign(Object.assign({},Le(b(t.style,[`text`]),this._activeDatum)),{text:this._createText(t.field,t.style.text)})})})),Object.assign({visible:!0,size:{width:t,height:n},zIndex:this.layoutZIndex,x:r,y:i,dx:s?Ut(s,this._computeLayoutRadius()):0,dy:c?Ut(c,this._computeLayoutRadius()):0,limitRatio:l||1/0,title:{visible:!1!==u.visible&&(!m(u.field)||this._activeDatum!==null),space:u.space||this._gap,autoLimit:u.autoLimit,autoFit:u.autoFit,fitPercent:u.fitPercent,fitStrategy:u.fitStrategy,style:Object.assign(Object.assign({},Le(b(u.style,[`text`]),this._activeDatum)),{text:this._createText(u.field,u.style.text)})},content:f},d)}_createOrUpdateIndicatorComponent(e){if(!1===e.visible)return this._indicatorComponent&&this._indicatorComponent.parent&&this._indicatorComponent.parent.removeChild(this._indicatorComponent),void(this._indicatorComponent=null);if(this._indicatorComponent)ne(e,this._cacheAttrs)||this._indicatorComponent.setAttributes(e);else{let t=this.getContainer(),n=new rr(e);n.name=`indicator`,t.add(n),this._indicatorComponent=n,this._indicatorComponent.on(`*`,((e,t)=>this._delegateEvent(this._indicatorComponent,e,t)))}this._cacheAttrs=e}_createText(e,t){return e?this._activeDatum?this._activeDatum[e]:``:le(t)?t(this._activeDatum,void 0)??``:t??``}_computeLayoutRadius(){let{width:e,height:t}=this._regions[0].getLayoutRect();return Math.min(e/2,t/2)}isRelativeModel(e){return this._regions.some((t=>!!t.getSeriesInId(e.context.modelId)))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}},X.type=Kn.indicator,X.builtInTheme={indicator:pi},X.specKey=`indicator`,gi=()=>{N.registerComponent(X.type,X)}})))()}var vi;function yi(){return(yi=e((()=>{ln(),Or(),He(),ut(),Ee(),Gn(),vi=Ae(`AreaChart`,{type:`area`,vchartConstructor:Fn},[Dr,Xe,Pe,...bt])})))()}var Z;function bi(){return(bi=e((()=>{At(),Je(),et(),ot(),mt(),ze(),ye(),Gt(),ar(),Z=[Dn,ir,Tt,un,jn,Ie,rt,pn,tr]})))()}var xi;function Si(){return(Si=e((()=>{ln(),li(),He(),_i(),Ee(),bi(),xi=Ae(`PieChart`,{type:`pie`,vchartConstructor:Fn},[ci,Xe,gi,...Z])})))()}function Ci({height:e=260,text:t=`暂无数据`,tone:n=`muted`}){return/* @__PURE__ */ B(`div`,{style:{height:e,display:`flex`,alignItems:`center`,justifyContent:`center`,color:n===`success`?`var(--arc-antd-color-success)`:`var(--arc-antd-color-text-2)`,fontSize:13},children:t})}function wi(){return(wi=e((()=>{})))()}function Ti({clean:e,onCleared:t}){let[n,i]=z(!1),[a,o]=z(180),[s,c]=z(``),[l,u]=z(``),[d,f]=z(!1);return{modalVisible:n,days:a,password:s,passwordError:l,verifying:d,openClearModal:e=>{o(e),c(``),u(``),i(!0)},closeModal:()=>i(!1),changePassword:e=>{c(e),u(``)},confirmClear:async()=>{if(!s)u(`请输入密码`);else{f(!0);try{await dr(pr.verifyPassword,{body:{password:s}},{skipAuth:!0})}catch{u(`密码错误,请重试`);return}finally{f(!1)}i(!1),await e(a),r.success(`清除成功`),t?.()}}}}var Q,$;function Ei(){return(Ei=e((()=>{d(),Q={30:`一个月前`,90:`三个月前`,180:`六个月前`,365:`一年前`},$=[365,180,90,30]})))()}function Di({loading:e,onClear:t,label:n=`日志`}){return cr(fr)===`mobile-actions`?/* @__PURE__ */ B(lr,{children:$.map(r=>/* @__PURE__ */ V(c,{type:`danger`,theme:`light`,icon:/* @__PURE__ */ B(s,{size:14}),loading:e,onClick:()=>t(r),children:[`清除`,Q[r],`的`,n]},r))}):/* @__PURE__ */ V(f,{children:[/* @__PURE__ */ V(c,{type:`danger`,theme:`light`,icon:/* @__PURE__ */ B(s,{size:14}),loading:e,onClick:()=>t($[0]),children:[`清除`,n]}),/* @__PURE__ */ B(l,{trigger:`click`,position:`bottomRight`,clickToHide:!0,render:/* @__PURE__ */ B(l.Menu,{children:$.map(e=>/* @__PURE__ */ V(l.Item,{onClick:()=>t(e),children:[`清除`,Q[e],`的`,n]},e))}),children:/* @__PURE__ */ B(c,{type:`danger`,theme:`light`,icon:/* @__PURE__ */ B(a,{size:14})})})]})}function Oi({logName:e,control:t}){return/* @__PURE__ */ V(pe,{title:`清除${Q[t.days]??`${t.days} 天前`}的${e}`,visible:t.modalVisible,onCancel:t.closeModal,okText:`确认清除`,okButtonProps:{type:`danger`,loading:t.verifying},onOk:t.confirmClear,maskClosable:!1,children:[/* @__PURE__ */ V(`p`,{style:{marginBottom:12},children:[`此操作将永久删除`,Q[t.days]??`${t.days} 天前`,`的`,e,`,不可恢复。`,/* @__PURE__ */ B(`br`,{}),`请输入您的管理员密码以确认:`]}),/* @__PURE__ */ B(me,{placeholder:`请输入密码`,value:t.password,onChange:t.changePassword,onEnterPress:t.confirmClear,validateStatus:t.passwordError?`error`:void 0}),t.passwordError&&/* @__PURE__ */ B(`p`,{style:{color:`var(--arc-antd-color-danger)`,marginTop:4,fontSize:12},children:t.passwordError})]})}function ki(){return(ki=e((()=>{he(),d(),i(),o(),fe(),Ei()})))()}function Ai(e){let t=Array(7).fill(0);for(let n of e??[])t[(ur(n.date).day()+6)%7]+=n.count;return Ri.map((e,n)=>({name:e,count:t[n]}))}function ji(e,t){return t>0?e-t:null}function Mi(e){return e==null||e.total===0?null:(e.successCount/e.total*100).toFixed(1)}function Ni(e,t){return e&&t&&e.total>0&&t.total>0?e.successCount/e.total-t.successCount/t.total:null}function Pi(){return/* @__PURE__ */ B(n,{loading:!0,active:!0,placeholder:/* @__PURE__ */ V(lr,{children:[/* @__PURE__ */ B(Sn,{style:{marginBottom:16},children:Array.from({length:4},(e,t)=>`sk-stat-${t}`).map(e=>/* @__PURE__ */ V(`div`,{children:[/* @__PURE__ */ B(n.Title,{style:{width:64,height:26,marginBottom:10}}),/* @__PURE__ */ B(n.Paragraph,{rows:1,style:{width:80,marginBottom:0}})]},e))}),/* @__PURE__ */ V(`div`,{className:`zx-panel`,style:{marginBottom:16},children:[/* @__PURE__ */ B(n.Title,{style:{width:180,height:14,marginBottom:16}}),/* @__PURE__ */ B(n.Image,{style:{width:`100%`,height:230}})]}),/* @__PURE__ */ B(`div`,{className:`chart-grid`,children:[`sk-chart-a`,`sk-chart-b`].map(e=>/* @__PURE__ */ V(`div`,{className:`zx-panel`,children:[/* @__PURE__ */ B(n.Title,{style:{width:120,height:14,marginBottom:16}}),/* @__PURE__ */ B(n.Image,{style:{width:`100%`,height:260}})]},e))})]}),children:null})}function Fi({days:e,onDaysChange:n,loading:r,fetching:i,children:a}){return/* @__PURE__ */ V(`div`,{children:[/* @__PURE__ */ B(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:16},children:/* @__PURE__ */ B(t,{value:e,onChange:e=>n(e),style:{width:140},children:Li.map(e=>/* @__PURE__ */ B(t.Option,{value:e.value,children:e.label},e.value))})}),r?/* @__PURE__ */ B(Pi,{}):/* @__PURE__ */ B(u,{spinning:i,children:a})]})}function Ii({title:e,children:t,danger:n}){return/* @__PURE__ */ V(`div`,{className:`zx-panel`,children:[/* @__PURE__ */ B(`div`,{style:{...Qn,color:n?`var(--arc-antd-color-danger)`:Qn.color},children:e}),t]})}var Li,Ri;function zi(){return(zi=e((()=>{d(),zt(),Nn(),Li=[{label:`最近 7 天`,value:7},{label:`最近 30 天`,value:30},{label:`最近 90 天`,value:90}],Ri=[`周一`,`周二`,`周三`,`周四`,`周五`,`周六`,`周日`]})))()}export{ti as C,ni as S,wr as T,Si as _,Ni as a,vi as b,Ai as c,ki as d,Ei as f,xi as g,wi as h,Mi as i,Di as l,Ci as m,Fi as n,ji as o,Ti as p,Ri as r,zi as s,Ii as t,Oi as u,bi as v,Tr as w,yi as x,Z as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{LoginField as t,LoginFormError as n,isEmail as r,useLoginForm as i}from"@fudanda/elements-antd";function a(){return(a=e((()=>{})))()}function o(){return(o=e((()=>{})))()}export{r as a,a as i,n,i as o,o as r,t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,t as n}from"./tabs-BobA_IcO.js";import{c as r,l as i}from"./ConfigurableTable-CyfZLgG0.js";import{a,n as o,o as s,r as c,t as l}from"./search-filters-BoRMIesR.js";import{n as u,t as d}from"./circle-check-RKAno__V.js";import{n as f,t as ee}from"./circle-x-BB5x-D-8.js";import{n as p,t as m}from"./log-in-OzbNes8i.js";import{w as h}from"./ui-DoIHGuTR.js";import{i as g,t as _}from"./table-columns-XaoxVUJN.js";import{In as v,K as y,Nn as b,Or as x,kr as S,q as C}from"./chart-data-DOMSCLwj.js";import{n as w,t as T}from"./LoginLogsTable-DfAlWPZb.js";import{n as E,t as D}from"./ExportButton-D4IvZKHy.js";import{An as O,C as k,Ci as te,Cn as ne,D as re,E as ie,Fn as ae,Gt as oe,Ht as se,I as ce,In as le,It as ue,Jn as de,L as fe,Ln as pe,Lt as me,Mn as he,Mt as ge,Nt as _e,Pn as ve,S as A,Sn as ye,T as be,Tn as xe,Tr as Se,Ut as Ce,Wt as we,X as Te,Yn as Ee,Z as De,_ as Oe,_t as ke,a as Ae,b as je,cr as Me,fi as j,gr as Ne,hr as Pe,i as Fe,ir as Ie,jn as Le,kn as Re,m as M,n as ze,ni as N,o as P,pi as F,r as Be,ri as I,rr as Ve,s as He,t as L,u as R,ur as Ue,v as z,vt as We,w as Ge,wn as Ke,wr as qe,x as Je}from"./StatCard-BwhGDWpE.js";import{Cn as Ye,hr as Xe,nt as Ze,rt as Qe,xn as $e}from"./chart-renderer-BWLqOvLF.js";import{_ as et,a as tt,b as nt,c as rt,d as it,f as at,g as B,h as ot,i as st,l as ct,m as V,n as lt,o as ut,p as dt,r as ft,s as pt,t as H,u as mt,x as ht}from"./LogStatsScaffold-BFwbN_MU.js";import{useMemo as U,useState as gt}from"react";import{Fragment as W,jsx as G,jsxs as K}from"react/jsx-runtime";import{enumValueOf as q}from"@fudanda/shared/core";import _t from"dayjs";import{useFilterQuery as vt}from"@fudanda/react-core/hooks/useFilterQuery";import{useListSearch as yt}from"@fudanda/react-core/hooks/useListSearch";import{formatDateTimeRangeForApi as bt,parseDateTimeParam as xt,shortDate as St}from"@fudanda/react-core/utils/date";import{useListDeepLink as Ct}from"@fudanda/react-core/hooks/useListDeepLink";import{LOGIN_EVENT_TYPES as wt,LOGIN_EVENT_TYPE_OPTIONS as Tt,LOGIN_STATUSES as Et,LOGIN_STATUS_OPTIONS as Dt}from"@fudanda/shared/identity";import{useUrlTabState as Ot}from"@fudanda/react-core/hooks/useUrlTabState";import{buildUserChartLabels as kt}from"@fudanda/react-core/utils/user-labels";import{loginLogKeys as At,useCleanLoginLogs as jt,useLoginLogList as Mt,useLoginLogStats as Nt}from"@fudanda/react-core/hooks/queries/login-logs";var J,Pt;function Ft(){return(Ft=e((()=>{I(),Ze(),te(),x(),Ne(),J=class e extends Pe{constructor(){super(...arguments),this.type=e.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{fill:void 0,lineWidth:0,padding:0})}_createGraphic(e={}){return Xe(e)}_transformGraphicAttributes(e,t,n){let r=super._transformGraphicAttributes(e,t,n),i=r.shape??r.symbolType??e.attribute?.symbolType;return r.symbolType=S(i)?`rect`:i,r}},J.type=`cell`,Pt=()=>{N.registerMark(J.type,J),N.registerGraphicComponent(`symbol`,Xe),Ye(),$e(),Qe()}})))()}function It(e){return!1===e?{}:{type:`fadeIn`}}var Lt;function Rt(){return(Rt=e((()=>{I(),Ue(),Lt=()=>{N.registerAnimation(`heatmap`,((e,t)=>Object.assign(Object.assign({},Me),{appear:It(t)})))}})))()}var zt;function Bt(){return(Bt=e((()=>{Ee(),zt=class extends de{enableByType(e){return e!==`dimension`}}})))()}var Vt;function Ht(){return(Ht=e((()=>{pe(),Vt=Object.assign(Object.assign({},le),{cell:{name:`cell`,type:`cell`},cellBackground:{name:`cellBackground`,type:`cell`}})})))()}var Y;function Ut(){return(Ut=e((()=>{O(),Y=class extends Re{_transformLabelSpec(e){this._addMarkLabelSpec(e,`cell`)}}})))()}var X;function Wt(){return(Wt=e((()=>{X={cell:{style:{shape:`rect`,fillOpacity:1}},cellBackground:{visible:!1},label:{style:{lineWidth:2}}}})))()}var Gt,Z,Kt;function qt(){return(qt=e((()=>{Ft(),ne(),Se(),Rt(),he(),Te(),F(),v(),y(),Bt(),Ht(),I(),xe(),Ut(),se(),we(),Wt(),Gt={valueField:!0},Z=class e extends ye{constructor(){super(...arguments),this.type=j.heatmap,this.transformerConstructor=Y}getFieldValue(){return this._fieldValue}setFieldValue(e){this._fieldValue=b(e)}_getSpecUpdatePolicy(){let e=super._getSpecUpdatePolicy();return Object.assign(Object.assign({},e),{dataRelatedKeys:Object.assign(Object.assign({},e.dataRelatedKeys),Gt)})}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){this._cellMark=this._createMark(e.mark.cell,{isSeriesMark:!0},{morph:ve(this._spec,e.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(e.mark.cellBackground)}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(e){e&&this.setMarkStyle(e,{fill:this._spec.cell?.style?.fill??this.getColorAttribute(),text:e=>e[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:e=>this.dataToPositionX(e),y:e=>this.dataToPositionY(e),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},`normal`,qe.Series)}initCellBackgroundMarkStyle(){let e=C(this._spec.cellBackground?.style?.padding??0);this.setMarkStyle(this._backgroundMark,{x:t=>{let n=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-n/2+e[3]},y:t=>{let n=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-n/2+e[0]},width:()=>this.getCellSize(this._xAxisHelper)-e[1]-e[3],height:()=>this.getCellSize(this._yAxisHelper)-e[0]-e[2]},`normal`,qe.Series)}getColorAttribute(){return{scale:this._option.globalScale.getScale(`color`)??this._getDefaultColorScale(),field:this.getFieldValue()[0]}}getInteractionTriggers(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){let e=this._spec?.animationAppear?.preset,t=Ke(this);this._cellMark.setAnimationConfig(Le(N.getAnimationInKey(`heatmap`)?.(e),ae(`cell`,this._spec,this._markAttributeContext),t))}getCellSize(e){return e.getBandwidth?.call(e,0)??6}initTooltip(){this._tooltipHelper=new zt(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return`rect`}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}},Z.type=j.heatmap,Z.mark=Vt,Z.builtInTheme={heatmap:X},Z.transformerConstructor=Y,Kt=()=>{De(),Pt(),Lt(),oe(),Ce(),N.registerSeries(Z.type,Z)}})))()}var Q;function Jt(){return(Jt=e((()=>{_e(),Q=class extends ge{_getDefaultSeriesSpec(e){return super._getDefaultSeriesSpec(e,[`valueField`,`cell`])}}})))()}var $,Yt;function Xt(){return(Xt=e((()=>{F(),qt(),I(),Jt(),me(),ke(),$=class extends ue{constructor(){super(...arguments),this.transformerConstructor=Q,this.type=`heatmap`,this.seriesType=j.heatmap}},$.type=`heatmap`,$.seriesType=j.heatmap,$.transformerConstructor=Q,Yt=()=>{We(),Kt(),N.registerChart($.type,$)}})))()}var Zt;function Qt(){return(Qt=e((()=>{Ie(),Xt(),ce(),re(),Ge(),Zt=ie(`HeatmapChart`,{type:`heatmap`,vchartConstructor:Ve},[Yt,fe,...be])})))()}function $t(e){let t=(/\(([^)]+)\)/.exec(e)?.[1]??e).split(`,`).map(e=>e.trim());return(t[1]||t[0]||e).slice(0,40)}function en(){let e=Je(),[t,n]=gt(30),r=Nt({days:t}),i=r.data??null,a=U(()=>{if(!i)return[];let e=new Map(i.dailyStats.map(e=>[e.date,e])),n=_t();return Array.from({length:t},(r,i)=>{let a=n.subtract(t-1-i,`day`).format(`YYYY-MM-DD`);return e.get(a)??{date:a,count:0,successCount:0,failCount:0}})},[i,t]),o=U(()=>rt(i?.dailyStats),[i]),{userChartData:s,userChartTitleOf:c}=U(()=>{let e=[...i?.userStats??[]].reverse(),{nameOf:t,fullOf:n}=kt(e);return{userChartData:e.map(e=>({name:t(e),count:e.count})),userChartTitleOf:e=>n.get(e)??e}},[i]),l=U(()=>[...i?.ipFailStats??[]].reverse().map(e=>({name:e.ip,count:e.count})),[i]),u=U(()=>(i?.hourlyStats??[]).map(e=>({name:`${String(e.hour).padStart(2,`0`)}:00`,count:e.count})),[i]),f=U(()=>(i?.browserStats??[]).map(e=>({name:e.browser,value:e.count})),[i]),p=U(()=>(i?.osStats??[]).map(e=>({name:e.os,value:e.count})),[i]),h=U(()=>(i?.failReasonStats??[]).map(e=>({name:e.message,value:e.count})),[i]),g=U(()=>[...i?.locationStats??[]].reverse().map(e=>({name:e.location,count:e.count})),[i]),v=U(()=>[...i?.resolutionStats??[]].reverse().map(e=>({name:e.resolution,count:e.count})),[i]),y=U(()=>[...i?.gpuStats??[]].reverse().map(e=>({name:$t(e.gpu),count:e.count})),[i]),b=U(()=>(i?.dowHourStats??[]).map(e=>({hour:`${String(e.hour).padStart(2,`0`)}h`,weekday:ft[e.dow-1]??`周${e.dow}`,count:e.count})),[i]),x=i?.summary,S=i?.prevSummary,C=st(x),w=tt(x,S),T=U(()=>x?[{name:`成功`,value:x.successCount},{name:`失败`,value:x.failCount}]:[],[x]),E=U(()=>Ae({data:a,xField:`date`,series:[{field:`successCount`,name:`成功`,color:e.success},{field:`failCount`,name:`失败`,color:e.danger}],palette:e,point:t<=7,pointSize:6,fillOpacity:.26,axis:{xLabel:St},tooltip:{title:e=>`日期:${e}`,value:e=>`${e} 次`}}),[t,a,e]),D=U(()=>P({data:s,xField:`name`,series:[{field:`count`,name:`登录次数`,color:e.success}],palette:e,horizontal:!0,barMinHeight:3,cornerRadius:5,showLabel:!0,labelColor:e.success,categoryAxisWidth:96,tooltip:{title:c,value:e=>`${e} 次`}}),[e,s,c]),O=U(()=>P({data:l,xField:`name`,series:[{field:`count`,name:`失败次数`,color:e.risk}],palette:e,horizontal:!0,barMinHeight:3,cornerRadius:5,showLabel:!0,labelColor:e.risk,categoryAxisWidth:120,tooltip:{value:e=>`${e} 次`}}),[l,e]),k=U(()=>P({data:u,xField:`name`,series:[{field:`count`,name:`登录次数`,color:e.active}],palette:e,barMaxWidth:18,axis:{xLabel:e=>e.replace(`:00`,`h`)},tooltip:{title:e=>`${e} - ${e.replace(`:00`,`:59`)}`,value:e=>`${e} 次`}}),[u,e]),te=U(()=>R({data:T,categoryField:`name`,valueField:`value`,palette:e,donut:!0,colors:[e.success,e.danger],outerRadius:.86,innerRadius:.58,padAngle:1.5,cornerRadius:5,label:`value`,labelPosition:`inside`,labelColor:`#fff`,labelFontSize:12,indicator:{title:C==null?`--`:`${C}%`,subtitle:`成功率`},indicatorTitleFontSize:28,tooltipKey:`次数`,valueUnit:`次`}),[e,T,C]),ne=U(()=>R({data:f,categoryField:`name`,valueField:`value`,palette:e,donut:!0,innerRadius:.48,outerRadius:.82,padAngle:1,cornerRadius:3,legendLabelFontSize:11,tooltipKey:`访问次数`,valueUnit:`次`}),[f,e]),re=U(()=>R({data:p,categoryField:`name`,valueField:`value`,palette:e,donut:!0,innerRadius:.48,outerRadius:.82,padAngle:1,cornerRadius:3,legendLabelFontSize:11,tooltipKey:`访问次数`,valueUnit:`次`}),[p,e]),ie=U(()=>P({data:o,xField:`name`,series:[{field:`count`,name:`登录次数`,color:e.primary}],palette:e,showLabel:!0,tooltip:{value:e=>`${e} 次`}}),[o,e]),ae=U(()=>R({data:h,categoryField:`name`,valueField:`value`,palette:e,donut:!0,innerRadius:.48,outerRadius:.82,padAngle:1,cornerRadius:3,legendLabelFontSize:11,tooltipKey:`失败次数`,valueUnit:`次`}),[h,e]),oe=U(()=>P({data:g,xField:`name`,series:[{field:`count`,name:`登录次数`,color:e.active}],palette:e,horizontal:!0,barMinHeight:3,cornerRadius:5,showLabel:!0,labelColor:e.active,categoryAxisWidth:120,tooltip:{value:e=>`${e} 次`}}),[g,e]),se=U(()=>P({data:v,xField:`name`,series:[{field:`count`,name:`登录次数`,color:e.dataColors[4]??e.primary}],palette:e,horizontal:!0,barMinHeight:3,cornerRadius:5,showLabel:!0,categoryAxisWidth:96,tooltip:{value:e=>`${e} 次`}}),[v,e]),ce=U(()=>P({data:y,xField:`name`,series:[{field:`count`,name:`登录次数`,color:e.dataColors[6]??e.primary}],palette:e,horizontal:!0,barMinHeight:3,cornerRadius:5,showLabel:!0,categoryAxisWidth:150,tooltip:{value:e=>`${e} 次`}}),[y,e]),le=U(()=>He({data:b,xField:`hour`,yField:`weekday`,valueField:`count`,palette:e,tooltip:{title:e=>`${e?.weekday??``} ${e?.hour??``}`,valueName:`登录次数`,value:e=>`${e} 次`}}),[b,e]);return/* @__PURE__ */ K(lt,{days:t,onDaysChange:n,loading:r.isLoading,fetching:r.isFetching,children:[/* @__PURE__ */ K(ze,{style:{marginBottom:16},children:[/* @__PURE__ */ G(L,{title:`总登录次数`,value:x?x.total.toLocaleString():_,sub:`近 ${t} 天累计`,icon:/* @__PURE__ */ G(m,{size:22}),accent:`var(--arc-antd-color-primary)`,delta:x&&S?ut(x.total,S.total):null,deltaLabel:`较上一周期`}),/* @__PURE__ */ G(L,{title:`登录成功率`,value:C==null?_:`${C}%`,sub:x?`成功 ${x.successCount.toLocaleString()} · 失败 ${x.failCount.toLocaleString()}`:void 0,icon:/* @__PURE__ */ G(d,{size:22}),accent:`var(--arc-antd-color-success)`,delta:w,deltaLabel:`较上一周期`,deltaFormat:`ratio`}),/* @__PURE__ */ G(L,{title:`登录失败次数`,value:x?x.failCount.toLocaleString():_,sub:`密码错误、账号锁定等`,icon:/* @__PURE__ */ G(ee,{size:22}),accent:x&&x.failCount>0?`var(--arc-antd-color-danger)`:void 0,delta:x&&S?ut(x.failCount,S.failCount):null,deltaLabel:`较上一周期`})]}),/* @__PURE__ */ G(H,{title:`每日登录趋势(成功 / 失败)`,children:z(a)?/* @__PURE__ */ G(V,{height:230}):/* @__PURE__ */ G(nt,{...E,options:M,height:230})}),/* @__PURE__ */ K(`div`,{className:`chart-grid`,style:{marginTop:16,marginBottom:16},children:[/* @__PURE__ */ G(H,{title:`Top 10 登录用户`,children:s.length===0?/* @__PURE__ */ G(V,{}):/* @__PURE__ */ G(A,{...D,options:M,height:260})}),/* @__PURE__ */ G(H,{danger:l.length>0,title:/* @__PURE__ */ K(W,{children:[`失败登录 Top 10 IP`,l.length>0&&/* @__PURE__ */ G(`span`,{style:{fontSize:12,fontWeight:400,marginLeft:8,color:`var(--arc-antd-color-text-2)`},children:`可能存在安全风险`})]}),children:l.length===0?/* @__PURE__ */ G(V,{tone:`success`,text:`该时间段无失败登录`}):/* @__PURE__ */ G(A,{...O,options:M,height:260})})]}),/* @__PURE__ */ K(`div`,{className:`chart-grid`,style:{marginBottom:16},children:[/* @__PURE__ */ G(H,{title:`按小时登录分布`,children:z(u)?/* @__PURE__ */ G(V,{height:240}):/* @__PURE__ */ G(A,{...k,options:M,height:240})}),/* @__PURE__ */ G(H,{title:`成功 / 失败占比`,children:z(T)?/* @__PURE__ */ G(V,{height:240}):/* @__PURE__ */ G(B,{...te,options:M,height:240})})]}),/* @__PURE__ */ K(`div`,{className:`chart-grid`,style:{marginBottom:16},children:[/* @__PURE__ */ G(H,{title:`浏览器分布`,children:f.length===0?/* @__PURE__ */ G(V,{height:260}):/* @__PURE__ */ G(B,{...ne,options:M,height:260})}),/* @__PURE__ */ G(H,{title:`操作系统分布`,children:p.length===0?/* @__PURE__ */ G(V,{height:260}):/* @__PURE__ */ G(B,{...re,options:M,height:260})})]}),/* @__PURE__ */ K(`div`,{className:`chart-grid`,style:{marginBottom:16},children:[/* @__PURE__ */ G(H,{danger:h.length>0,title:`失败原因分布`,children:h.length===0?/* @__PURE__ */ G(V,{tone:`success`,text:`该时间段无失败登录`,height:260}):/* @__PURE__ */ G(B,{...ae,options:M,height:260})}),/* @__PURE__ */ G(H,{title:`登录地点 Top 10`,children:g.length===0?/* @__PURE__ */ G(V,{height:260}):/* @__PURE__ */ G(A,{...oe,options:M,height:260})})]}),/* @__PURE__ */ G(H,{title:`星期 × 小时登录热力(近 ${t} 天)`,children:z(b)?/* @__PURE__ */ G(V,{height:280}):/* @__PURE__ */ G(Zt,{...le,options:M,height:280})}),/* @__PURE__ */ K(`div`,{className:`chart-grid`,style:{marginTop:16,marginBottom:16},children:[/* @__PURE__ */ G(H,{title:`设备分辨率 Top 8`,children:v.length===0?/* @__PURE__ */ G(V,{height:240}):/* @__PURE__ */ G(A,{...se,options:M,height:240})}),/* @__PURE__ */ G(H,{title:`设备 GPU Top 8`,children:y.length===0?/* @__PURE__ */ G(V,{height:240}):/* @__PURE__ */ G(A,{...ce,options:M,height:240})})]}),/* @__PURE__ */ G(H,{title:`按星期登录分布(近 ${t} 天)`,children:z(o)?/* @__PURE__ */ G(V,{height:220}):/* @__PURE__ */ G(A,{...ie,options:M,height:220})})]})}function tn(){return(tn=e((()=>{p(),u(),f(),ht(),k(),Qt(),et(),ot(),je(),Oe(),Fe(),Be(),pt(),g()})))()}function nn(){let[e,i]=Ot([`list`,`stats`],`list`),s={username:``,eventType:void 0,status:void 0,timeRange:null},{page:u,pageSize:d,setPage:f,buildPagination:ee,bind:p,bindKeyword:m,submittedParams:h,handleSearch:g,handleReset:_,applySearch:v}=yt({defaults:s,listKey:At.lists});Ct([`status`,`startTime`,`endTime`],e=>{let t=xt(e.startTime),n=xt(e.endTime);v({...s,status:q(Et,e.status),timeRange:t&&n?[t,n]:null})},{getNextParams:()=>({tab:`list`})});let y=vt({username:h.username,eventType:q(wt,h.eventType),status:q(Et,h.status),...bt(h.timeRange)}),b=Mt({page:u,pageSize:d,...y}),x=b.data?.list??[],S=b.data?.total??0,C=jt(),w=C.isPending,E=dt({clean:e=>C.mutateAsync({query:{days:e}}),onCleared:()=>f(1)});return/* @__PURE__ */ K(`div`,{className:`page-container page-tabs-page`,children:[/* @__PURE__ */ K(t,{collapsible:`auto`,type:`line`,lazyRender:!0,activeKey:e,onChange:e=>i(e),children:[/* @__PURE__ */ G(n,{tab:`日志列表`,itemKey:`list`,children:/* @__PURE__ */ G(T,{searchConfig:r({keyword:/* @__PURE__ */ G(c,{placeholder:`用户名 / 昵称`,...m(`username`),width:180}),filters:/* @__PURE__ */ K(W,{children:[/* @__PURE__ */ G(o,{placeholder:`全部事件`,items:Tt,...p(`eventType`)}),/* @__PURE__ */ G(a,{items:Dt,...p(`status`)}),/* @__PURE__ */ G(l,{searchLabel:`登录时间`,...p(`timeRange`)})]}),onSearch:g,onReset:_,actions:/* @__PURE__ */ K(W,{children:[/* @__PURE__ */ G(D,{entity:`system.login-logs`,query:y}),/* @__PURE__ */ G(ct,{loading:w,onClear:E.openClearModal})]}),filterTitle:`登录日志筛选`,actionTitle:`日志操作`}),dataSource:x,loading:b.isFetching,onRefresh:()=>void b.refetch(),pagination:ee(S)})}),/* @__PURE__ */ G(n,{tab:`统计分析`,itemKey:`stats`,children:/* @__PURE__ */ G(en,{})})]}),/* @__PURE__ */ G(mt,{logName:`登录日志`,control:E})]})}function rn(){return(rn=e((()=>{h(),i(),E(),w(),it(),at(),tn(),s()})))()}rn();export{nn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,t as n}from"./ConfigurableTable-CyfZLgG0.js";import{a as r,b as i,c as a,w as o}from"./ui-DoIHGuTR.js";import{i as s,r as c,s as l}from"./table-columns-XaoxVUJN.js";import{n as u,t as d}from"./AppModal-B_xvSaeq.js";import{n as f,t as p}from"./UserDisplay-BYhcfa84.js";import{useMemo as m,useState as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{formatDateTime as y}from"@fudanda/react-core/utils/date";import{LOGIN_EVENT_TYPE_LABELS as b}from"@fudanda/shared/identity";import{formatUserLabel as x}from"@fudanda/react-core/utils/user-labels";function S({status:e,size:t}){return/* @__PURE__ */ _(i,{color:e===`success`?`green`:`red`,size:t,children:e===`success`?`成功`:`失败`})}function C({eventType:e,size:t}){let n=e??`login`;return/* @__PURE__ */ _(i,{color:T[n],size:t,children:b[n]})}function w({searchConfig:e,dataSource:t,loading:i,pagination:o,onRefresh:s,columnSettings:u,columnSettingsKey:f}){let[b,w]=h(null),T=m(()=>[{title:`ID`,dataIndex:`id`,width:80,defaultHidden:!0},{title:`用户`,dataIndex:`username`,width:160,render:(e,t)=>/* @__PURE__ */ _(p,{username:e,nickname:t.nickname})},{title:`事件`,dataIndex:`eventType`,width:110,render:e=>/* @__PURE__ */ _(C,{eventType:e})},{title:`事件信息`,dataIndex:`message`,minWidth:160,render:l},{title:`IP 地址`,dataIndex:`ip`,width:150,render:e=>e??`-`},{title:`地点`,dataIndex:`location`,width:180,defaultHidden:!0,render:l},{title:`浏览器`,dataIndex:`browser`,width:150,defaultHidden:!0,render:l},{title:`操作系统`,dataIndex:`os`,width:150,defaultHidden:!0,render:l},c(`操作时间`,`createdAt`),{title:`状态`,dataIndex:`status`,width:90,fixed:`right`,render:e=>/* @__PURE__ */ _(S,{status:e})},{title:`操作`,key:`operation`,width:80,fixed:`right`,render:(e,t)=>/* @__PURE__ */ _(r,{theme:`borderless`,type:`primary`,size:`small`,onClick:()=>w(t),children:`详情`})}],[]);return/* @__PURE__ */ v(g,{children:[/* @__PURE__ */ _(n,{searchConfig:e,bordered:!0,columns:T,dataSource:t,loading:i,pagination:o,rowKey:`id`,onRefresh:s,columnSettings:u,columnSettingsKey:f}),/* @__PURE__ */ _(d,{title:`登录日志详情`,visible:b!==null,onCancel:()=>w(null),footer:null,width:560,style:{top:40},children:b&&/* @__PURE__ */ _(a,{data:[{key:`ID`,value:String(b.id)},{key:`用户`,value:x(b.username,b.nickname)},{key:`事件`,value:/* @__PURE__ */ _(C,{eventType:b.eventType,size:`small`})},{key:`状态`,value:/* @__PURE__ */ _(S,{status:b.status,size:`small`})},{key:`事件信息`,value:b.message??`-`},{key:`IP 地址`,value:b.ip??`-`},{key:`地点`,value:b.location??`-`},{key:`浏览器`,value:b.browser??`-`},{key:`操作系统`,value:b.os??`-`},{key:`User-Agent`,value:b.userAgent??`-`,span:2},{key:`操作时间`,value:y(b.createdAt),span:2},...b.screenWidth&&b.screenHeight?[{key:`屏幕分辨率`,value:[b.screenWidth,` × `,b.screenHeight,b.devicePixelRatio&&b.devicePixelRatio!==`1`?` (${b.devicePixelRatio}x)`:``].join(``),span:2}]:[],...b.gpu?[{key:`GPU`,value:b.gpu,span:2}]:[],...b.cpuCores?[{key:`CPU 核心数`,value:String(b.cpuCores)}]:[],...b.memoryGb?[{key:`内存`,value:`${b.memoryGb} GB`}]:[]],column:2,layout:`horizontal`,align:`left`})})]})}var T;function E(){return(E=e((()=>{o(),u(),t(),s(),f(),T={login:`cyan`,logout:`blue`,impersonate:`orange`,impersonate_end:`grey`,kicked:`red`}})))()}export{E as n,w as t};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t}from"./feedback-D4BIfDNd.js";import{n,t as r}from"./createLucideIcon-BtwfYE6A.js";import{n as i,t as a}from"./clock-CniP1gZS.js";import{n as o,r as s,t as c}from"./EntityRelationButton-C8Cl8wyh.js";import{n as l,t as u}from"./search-DYZU68h1.js";import{n as d,t as f}from"./x-Ak9hw1R9.js";import{v as p,w as m}from"./ui-DoIHGuTR.js";import{n as h,t as g}from"./icons-CbRx5Om7.js";import{Suspense as ee,useCallback as _,useEffect as v,useMemo as y,useRef as b,useState as x}from"react";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{useNavigate as T}from"react-router-dom";import{useIsMobile as E}from"@fudanda/react-core/hooks/useMediaQuery";import{textMatches as D}from"@fudanda/react-core/utils/pinyin";import{usePinyinReady as O}from"@fudanda/react-core/hooks/usePinyinReady";import{useGlobalSearch as k}from"@fudanda/react-core/hooks/queries/global-search";import{SEARCH_TYPE_ENTITY_TYPES as A}from"@fudanda/shared/platform/entity-catalog";import{GLOBAL_SEARCH_TYPE_LABELS as j,GLOBAL_SEARCH_TYPE_OPTIONS as M,isSafeInternalSearchRoute as N}from"@fudanda/react-core/utils/global-search";import{trackEvent as P}from"@fudanda/react-core/utils/tracker";var F,I;function L(){return(L=e((()=>{
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v1.53.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
n(),F={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]},F.node,I=r(F)})))()}function R(e,t){if(e.icon){let t=h(e.icon,13);if(t)return t}return C(t?a:I,{size:13})}function z(e){return(e.icon?h(e.icon,13):null)??/* @__PURE__ */ C(I,{size:13})}function B({menus:e,recentMenus:n,onClearRecents:r,onRemoveRecent:i,open:a,onClose:s}){let l=T(),[d,m]=x(null),h=E(),g=O(),[M,F]=x(``),[L,B]=x(`all`),[H,U]=x(0),W=b(null),G=b(null),K=k(M,a,L===`all`?void 0:[L]),q=y(()=>{if(!M.trim())return[];let t=M.trim().toLowerCase();return e.map((e,n)=>{let r=e.title.toLowerCase(),i=e.breadcrumb.some(e=>D(e,M));return{menu:e,score:r===t?0:r.startsWith(t)?1:r.includes(t)?2:i?3:g?4:5,index:n}}).filter(({menu:e})=>D(e.title,M)||e.breadcrumb.some(e=>D(e,M))).sort((e,t)=>e.score-t.score||e.index-t.index).slice(0,8).map(({menu:e})=>e)},[e,g,M]),J=y(()=>M.trim().length>=2?K.data?.results??[]:[],[M,K.data?.results]),te=y(()=>[...q.map(e=>({kind:`menu`,value:e})),...J.map(e=>({kind:`business`,value:e}))],[q,J]),Y=!M.trim(),X=Y?n.map(e=>({kind:`menu`,value:e})):te;v(()=>{a&&(F(``),B(`all`),U(0),setTimeout(()=>W.current?.focus(),30))},[a]),v(()=>{U(0)},[M]),v(()=>{(G.current?.querySelector(`[data-search-index="${H}"]`))?.scrollIntoView({block:`nearest`})},[H]);let Z=_(e=>{let t=e.kind===`menu`?e.value.path:e.value.route;if(e.kind===`business`){if(!N(e.value.route))return;P(`global_search_result_click`,{source:`palette`,type:e.value.type}),s(),l(e.value.route)}else s(),l(t)},[l,s]),Q=_(()=>{let e=M.trim(),t=L===`all`?``:`&type=${encodeURIComponent(L)}`;s(),l(e?`/search?q=${encodeURIComponent(e)}${t}`:`/search`)},[l,s,M,L]),ne=_(e=>{if(e.key===`Escape`)s();else if(e.key===`ArrowDown`)e.preventDefault(),U(e=>Math.min(e+1,Math.max(X.length-1,0)));else if(e.key===`ArrowUp`)e.preventDefault(),U(e=>Math.max(e-1,0));else if(e.key===`Enter`){if(e.ctrlKey||e.metaKey){e.preventDefault(),Q();return}let t=X[H];t&&Z(t)}},[X,Z,s,Q,H]),$=(e,t,n)=>{let r=t===H,a=e.kind===`menu`,c=a?e.value.breadcrumb.join(` › `):[j[e.value.type],e.value.subtitle,e.value.description].filter(Boolean).join(` · `),l=a?void 0:e.value.highlights[0]?.text,u=/* @__PURE__ */ w(`button`,{type:`button`,id:`global-search-result-${t}`,role:`option`,"aria-selected":r,"data-search-index":t,onClick:()=>Z(e),onMouseEnter:()=>U(t),style:{display:`flex`,alignItems:`center`,gap:10,width:`100%`,padding:n?`8px 44px 8px 16px`:`8px 16px`,border:`none`,background:r?`var(--arc-antd-color-primary-light-default)`:`transparent`,cursor:`pointer`,textAlign:`left`,transition:`background 0.1s`},children:[/* @__PURE__ */ C(`span`,{style:{width:28,height:28,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,borderRadius:`var(--arc-antd-border-radius-medium)`,background:r?`var(--arc-antd-color-primary)`:`var(--arc-antd-color-fill-1)`,color:r?`#fff`:`var(--arc-antd-color-primary)`},children:a?R(e.value,n):z(e.value)}),/* @__PURE__ */ w(`div`,{style:{flex:1,minWidth:0},children:[/* @__PURE__ */ C(`div`,{style:{fontSize:13,fontWeight:500,color:r?`var(--arc-antd-color-primary)`:`var(--arc-antd-color-text-0)`,lineHeight:1.4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.value.title}),c&&/* @__PURE__ */ C(`div`,{style:{fontSize:11,color:`var(--arc-antd-color-text-2)`,lineHeight:1.3,marginTop:1,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:c}),l&&l!==e.value.title&&/* @__PURE__ */ w(`div`,{style:{fontSize:11,color:`var(--arc-antd-color-text-2)`,lineHeight:1.3,marginTop:1,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:[`命中:`,l]})]}),r&&/* @__PURE__ */ C(`kbd`,{style:{fontSize:10,color:`var(--arc-antd-color-primary)`,background:`var(--arc-antd-color-primary-light-default)`,border:`1px solid var(--arc-antd-color-primary-light-hover)`,borderRadius:`var(--arc-antd-border-radius-small)`,padding:`1px 5px`,fontFamily:`monospace`,flexShrink:0},children:`↵`})]},a?`menu-${e.value.id}`:`${e.value.type}-${e.value.id}`);return e.kind===`business`?/* @__PURE__ */ w(`div`,{style:{display:`flex`,alignItems:`center`},children:[u,e.value.actions?.view!==!1&&/* @__PURE__ */ C(o,{entityRef:{type:A[e.value.type],key:String(e.value.id)},onOpen:e=>{m(e),s()}})]},`${e.value.type}-${e.value.id}`):!n||!a?u:/* @__PURE__ */ w(`div`,{style:{position:`relative`},children:[u,/* @__PURE__ */ C(`button`,{type:`button`,"aria-label":`移除${e.value.title}`,title:`移除最近访问`,onClick:t=>{t.stopPropagation(),i(e.value.id)},style:{position:`absolute`,right:12,top:`50%`,transform:`translateY(-50%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24,padding:0,border:`none`,borderRadius:`var(--arc-antd-border-radius-small)`,background:`transparent`,color:`var(--arc-antd-color-text-2)`,cursor:`pointer`},children:/* @__PURE__ */ C(f,{size:14})})]},`recent-${e.value.id}`)};return/* @__PURE__ */ w(S,{children:[/* @__PURE__ */ C(t,{visible:a,header:null,footer:null,closable:!1,onCancel:s,closeOnEsc:!1,maskClosable:!0,width:600,className:`cmd-palette-modal`,style:{margin:`12vh auto`,overflow:`hidden`,borderRadius:`var(--arc-antd-border-radius-large)`,padding:0},bodyStyle:{padding:0,overflow:`hidden`},zIndex:9999,keepDOM:!1,children:/* @__PURE__ */ w(`div`,{style:{display:`flex`,flexDirection:`column`,maxHeight:`60vh`},children:[/* @__PURE__ */ w(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`12px 16px`,borderBottom:`1px solid var(--arc-antd-color-border)`},children:[/* @__PURE__ */ C(u,{size:17,style:{color:`var(--arc-antd-color-text-2)`,flexShrink:0}}),/* @__PURE__ */ C(`input`,{ref:W,value:M,onChange:e=>F(e.target.value),onKeyDown:ne,placeholder:`全局搜索`,"aria-label":`全局搜索`,"aria-controls":`global-search-results`,"aria-activedescendant":X[H]?`global-search-result-${H}`:void 0,style:{flex:1,border:`none`,outline:`none`,background:`transparent`,fontSize:15,color:`var(--arc-antd-color-text-0)`,lineHeight:`22px`}}),K.isFetching&&M.trim().length>=2&&/* @__PURE__ */ C(p,{size:`small`}),M&&/* @__PURE__ */ C(`button`,{type:`button`,onClick:()=>F(``),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:20,height:20,border:`none`,borderRadius:`var(--arc-antd-border-radius-small)`,background:`var(--arc-antd-color-fill-1)`,color:`var(--arc-antd-color-text-2)`,cursor:`pointer`,padding:0,flexShrink:0},children:/* @__PURE__ */ C(`span`,{style:{fontSize:12,lineHeight:1},children:`✕`})}),/* @__PURE__ */ C(`button`,{type:`button`,onClick:Q,style:{border:`none`,background:`transparent`,color:`var(--arc-antd-color-primary)`,cursor:`pointer`,padding:`2px 4px`,fontSize:12,whiteSpace:`nowrap`,flexShrink:0},children:`搜索中心`}),!h&&/* @__PURE__ */ C(`kbd`,{className:`cmd-palette-esc`,style:{fontSize:11,color:`var(--arc-antd-color-text-2)`,background:`var(--arc-antd-color-fill-0)`,border:`1px solid var(--arc-antd-color-border)`,borderRadius:`var(--arc-antd-border-radius-small)`,padding:`1px 5px`,fontFamily:`monospace`,flexShrink:0},children:`ESC`})]}),M.trim().length>=2&&/* @__PURE__ */ C(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6,padding:`8px 16px 2px`,borderBottom:`1px solid var(--arc-antd-color-border)`},children:V.map(e=>{let t=L===e.value;return/* @__PURE__ */ C(`button`,{type:`button`,onClick:()=>B(e.value),style:{border:`1px solid ${t?`var(--arc-antd-color-primary)`:`var(--arc-antd-color-border)`}`,borderRadius:`var(--arc-antd-border-radius-large)`,padding:`2px 9px`,background:t?`var(--arc-antd-color-primary-light-default)`:`transparent`,color:t?`var(--arc-antd-color-primary)`:`var(--arc-antd-color-text-2)`,cursor:`pointer`,fontSize:11},children:e.label},e.value)})}),/* @__PURE__ */ w(`div`,{ref:G,id:`global-search-results`,role:`listbox`,"aria-label":`搜索结果`,style:{flex:1,overflowY:`auto`,padding:`6px 0`,minHeight:0},children:[Y&&n.length>0&&/* @__PURE__ */ w(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`2px 16px 6px`,marginBottom:2},children:[/* @__PURE__ */ C(`span`,{style:{fontSize:11,fontWeight:600,color:`var(--arc-antd-color-text-2)`,textTransform:`uppercase`,letterSpacing:`0.06em`},children:`最近访问`}),/* @__PURE__ */ C(`button`,{type:`button`,onClick:r,style:{border:`none`,background:`none`,cursor:`pointer`,fontSize:11,color:`var(--arc-antd-color-text-2)`,padding:`0 2px`},children:`清除`})]}),Y&&n.length===0&&/* @__PURE__ */ w(`div`,{style:{textAlign:`center`,padding:`32px 16px`,color:`var(--arc-antd-color-text-2)`,fontSize:13},children:[/* @__PURE__ */ C(I,{size:28,style:{margin:`0 auto 10px`,opacity:.35,display:`block`}}),`输入关键词搜索菜单或业务数据`]}),!Y&&q.length>0&&/* @__PURE__ */ C(`div`,{style:{padding:`4px 16px 3px`,fontSize:11,fontWeight:600,color:`var(--arc-antd-color-text-2)`},children:`菜单`}),Y?n.map((e,t)=>$({kind:`menu`,value:e},t,!0)):q.map((e,t)=>$({kind:`menu`,value:e},t,!1)),!Y&&J.length>0&&/* @__PURE__ */ C(`div`,{style:{padding:`8px 16px 3px`,fontSize:11,fontWeight:600,color:`var(--arc-antd-color-text-2)`},children:`业务数据`}),!Y&&J.map((e,t)=>$({kind:`business`,value:e},q.length+t,!1)),!Y&&X.length===0&&!K.isFetching&&/* @__PURE__ */ C(`div`,{style:{textAlign:`center`,padding:`32px 16px`,color:`var(--arc-antd-color-text-2)`,fontSize:13},children:`未找到匹配的菜单或业务数据`}),!Y&&K.error&&/* @__PURE__ */ w(`div`,{style:{padding:`12px 16px`,color:`var(--arc-antd-color-danger)`},children:[`搜索暂时不可用,请稍后重试 `,/* @__PURE__ */ C(`button`,{type:`button`,onClick:()=>{K.refetch()},style:{border:`none`,background:`transparent`,color:`var(--arc-antd-color-primary)`,cursor:`pointer`,padding:0},children:`重试`})]}),!Y&&K.data?.partial&&X.length>0&&/* @__PURE__ */ w(`div`,{style:{padding:`8px 16px`,color:`var(--arc-antd-color-text-2)`,fontSize:11},children:[`部分业务数据暂时不可用:`,K.data.failedTypes.map(e=>j[e]).join(`、`)]})]}),!h&&/* @__PURE__ */ w(`div`,{className:`cmd-palette-footer`,style:{display:`flex`,alignItems:`center`,gap:12,padding:`7px 16px`,borderTop:`1px solid var(--arc-antd-color-border)`,fontSize:11,color:`var(--arc-antd-color-text-2)`},children:[/* @__PURE__ */ w(`span`,{children:[/* @__PURE__ */ C(`kbd`,{style:{fontFamily:`monospace`,fontSize:10,padding:`0 3px`,border:`1px solid var(--arc-antd-color-border)`,borderRadius:`var(--arc-antd-border-radius-small)`},children:`↑↓`}),` 导航`]}),/* @__PURE__ */ w(`span`,{children:[/* @__PURE__ */ C(`kbd`,{style:{fontFamily:`monospace`,fontSize:10,padding:`0 3px`,border:`1px solid var(--arc-antd-color-border)`,borderRadius:`var(--arc-antd-border-radius-small)`},children:`↵`}),` 跳转`]}),/* @__PURE__ */ w(`span`,{children:[/* @__PURE__ */ C(`kbd`,{style:{fontFamily:`monospace`,fontSize:10,padding:`0 3px`,border:`1px solid var(--arc-antd-color-border)`,borderRadius:`var(--arc-antd-border-radius-small)`},children:`ESC`}),` 关闭`]}),/* @__PURE__ */ w(`span`,{style:{marginLeft:`auto`},children:[/* @__PURE__ */ C(`kbd`,{style:{fontFamily:`monospace`,fontSize:10,padding:`0 3px`,border:`1px solid var(--arc-antd-color-border)`,borderRadius:`var(--arc-antd-border-radius-small)`},children:`Ctrl K`}),` 快速打开`]})]})]})}),d&&/* @__PURE__ */ C(ee,{fallback:null,children:/* @__PURE__ */ C(c,{entityRef:d,onClose:()=>m(null)},`${d.type}:${d.key}`)})]})}var V;function H(){return(H=e((()=>{m(),l(),i(),L(),d(),g(),s(),V=[{value:`all`,label:`全部`},...M]})))()}H();export{B as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{i as t,n}from"./controls-C5dPckUT.js";import{c as r,l as i,n as a,r as o,t as s}from"./ConfigurableTable-CyfZLgG0.js";import{a as c,o as l,r as u}from"./search-filters-BoRMIesR.js";import{r as d,s as f}from"./toolbar-controls-BFOuV86W.js";import{n as p,t as m}from"./chevron-down-mn2tSKQd.js";import{i as h,n as g,r as ee,t as _}from"./chevrons-up-down-2M6hY6wt.js";import{n as v,t as y}from"./search-DYZU68h1.js";import{n as b,t as x}from"./x-Ak9hw1R9.js";import{s as te,t as S}from"./form-DhQiOMvp.js";import{n as C}from"./list-0CbyOlT9.js";import{C as w,a as ne,g as T,m as E,o as D,r as re,w as O}from"./ui-DoIHGuTR.js";import{n as ie,t as k}from"./useStatusToggle-B7KSIN75.js";import{n as ae,t as A}from"./useCrudOperationColumn-PObQMk2y.js";import{i as j,n as oe,s as M,t as se}from"./table-columns-XaoxVUJN.js";import{a as ce,i as N,r as P,t as le}from"./EditFormModal-D68dOnaj.js";import{n as F,r as I,t as L}from"./icons-CbRx5Om7.js";import{n as R,t as z}from"./DictTag-BerYvaUM.js";import{useCallback as ue,useEffect as B,useMemo as V,useRef as de,useState as H}from"react";import{jsx as U,jsxs as W}from"react/jsx-runtime";import{useDictItems as G}from"@fudanda/react-core/hooks/useDictItems";import{usePermission as fe}from"@fudanda/react-core/hooks/usePermission";import{useListSearch as pe}from"@fudanda/react-core/hooks/useListSearch";import{menuKeys as me,useDeleteMenu as he,useMenuDetail as ge,useMenuTree as _e,useSaveMenu as K}from"@fudanda/react-core/hooks/queries/menus";import{textMatches as ve}from"@fudanda/react-core/utils/pinyin";import{usePinyinReady as ye}from"@fudanda/react-core/hooks/usePinyinReady";import{useTreeExpansion as be}from"@fudanda/react-core/hooks/useTreeExpansion";function xe({value:e,onChange:t,style:r}){let[i,a]=H(``),[s,c]=H(!1),[l,u]=H(1),d=I(),f=V(()=>{let e=i.trim().toLowerCase();return e?d.filter(t=>t.toLowerCase().includes(e)):d},[i,d]),p=V(()=>f.slice((l-1)*q,l*q),[f,l]),h=e=>{a(e),u(1)},g=e=>{c(e),e&&(u(1),a(``))},ee=e=>{t?.(e),c(!1),a(``)},_=e=>{e.stopPropagation(),t?.(``)},v=/* @__PURE__ */ W(`div`,{className:`icon-picker-panel`,children:[/* @__PURE__ */ U(n,{size:`small`,prefix:/* @__PURE__ */ U(y,{size:13}),placeholder:`搜索图标(共 ${d.length} 个)…`,value:i,onChange:h,className:`icon-picker-search`,style:{marginBottom:8}}),/* @__PURE__ */ U(`div`,{className:`icon-picker-grid-wrap`,children:/* @__PURE__ */ U(C,{size:`small`,split:!1,grid:{span:3,gutter:4},dataSource:p,emptyContent:/* @__PURE__ */ U(`div`,{className:`icon-picker-empty-result`,children:`无匹配图标`}),renderItem:t=>/* @__PURE__ */ U(C.Item,{style:{padding:0},children:/* @__PURE__ */ U(`button`,{type:`button`,className:`icon-picker-cell${e===t?` icon-picker-cell--active`:``}`,onClick:()=>ee(t),title:t,children:F(t,18)})})})}),f.length>q&&/* @__PURE__ */ U(`div`,{className:`icon-picker-pagination`,children:/* @__PURE__ */ U(o,{size:`small`,hoverShowPageSelect:!0,total:f.length,pageSize:q,currentPage:l,onPageChange:e=>u(e),showSizeChanger:!1})})]});return/* @__PURE__ */ U(E,{content:v,visible:s,onVisibleChange:g,trigger:`click`,position:`bottomLeft`,showArrow:!1,children:/* @__PURE__ */ W(`div`,{className:`icon-picker-trigger ${s?`icon-picker-trigger--open`:``}`,style:r,children:[/* @__PURE__ */ U(`span`,{className:`icon-picker-preview`,children:e?F(e,16):null}),/* @__PURE__ */ U(`span`,{className:`icon-picker-label ${e?``:`icon-picker-label--placeholder`}`,children:e||`点击选择图标`}),e?/* @__PURE__ */ U(`button`,{type:`button`,className:`icon-picker-arrow icon-picker-arrow--clear`,onClick:_,children:/* @__PURE__ */ U(x,{size:13})}):/* @__PURE__ */ U(`span`,{className:`icon-picker-arrow`,children:/* @__PURE__ */ U(m,{size:13})})]})})}var q;function J(){return(J=e((()=>{O(),v(),p(),b(),L(),q=56})))()}function Se({field:e=`status`,label:t=`状态`,disabled:n,type:r,extraText:i,rules:a}){let{items:o}=G(`common_status`);return/* @__PURE__ */ U(S.RadioGroup,{field:e,label:t,disabled:n,type:r,extraText:i,rules:a,children:o.map(e=>/* @__PURE__ */ U(S.Radio,{value:e.value,children:e.label},e.value))})}function Y(){return(Y=e((()=>{O()})))()}function X(){let{hasPermission:e}=fe(),n=de(0),[i,a]=H(null),[o,l]=H(``),[f,p]=H(`menu`),[m,h]=H(!1),{bind:g,bindKeyword:v,submittedParams:y,handleSearch:b,handleReset:x}=pe({defaults:Ce,listKey:me.tree}),{items:C}=G(`menu_type`),{items:E}=G(`common_status`),{items:O}=G(`menu_visible`),k=_e(),A=V(()=>k.data??[],[k.data]),j=K(),N=ce({entityName:`菜单`,save:j,useDetail:ge,defaults:()=>({type:`menu`,status:`enabled`,visible:`show`,sort:0,parentId:n.current,isExternal:!1,embed:!1,keepAlive:!1}),toValues:e=>({...e,visible:e.visible?`show`:`hidden`,isExternal:e.isExternal??!1,embed:e.embed??!1,keepAlive:e.keepAlive??!1}),beforeSave:e=>({...e,parentId:i??0,icon:o,visible:e.visible===void 0||e.visible===`show`,embed:e.isExternal?e.embed??!1:!1})}),P=K(),I=he();B(()=>{let e=N.editing;e&&N.visible&&(a(e.parentId??0),l(e.icon??``),p(e.type),h(e.isExternal??!1))},[N.editing,N.visible]);let L=ue((e,t,n)=>e.reduce((e,r)=>{let i=r.children?.length?L(r.children,t,n):[],a=!t||ve(r.title,t),o=!n||r.status===n,s;return i.length>0?s=i:r.children?.length&&(s=[]),(a&&o||i.length>0)&&e.push({...r,children:s}),e},[]),[]),{keyword:R,status:q=``}=y,J=ye(),Y=V(()=>R||q?L(A,R,q):A,[A,R,q,L,J]),{expandedRowKeys:X,setExpandedRowKeys:Z,allRowKeys:we,isAllExpanded:Q,toggleExpandAll:Te,onExpandedRowsChange:Ee}=be(Y);B(()=>{(R||q)&&Z(we)},[R,q,we,Z]);let De=()=>{x(),Z([])};function Oe(e){return e.filter(e=>e.type!==`button`).map(e=>({label:e.title,value:e.id,key:String(e.id),children:e.children?.length?Oe(e.children):void 0}))}let ke=[{label:`顶级`,value:0,key:`0`},...Oe(A)],$=e=>{let t=e??0;n.current=t,a(t),l(``),p(`menu`),h(!1),N.openCreate()},Ae=e=>{a(e.parentId??0),l(e.icon??``),p(e.type),h(e.isExternal??!1),N.openEdit(e)},je=ie({toggle:(e,t)=>P.mutateAsync({id:e.id,values:{status:t?`enabled`:`disabled`}}),confirmDisable:e=>({danger:!0,title:`确认禁用菜单「${e.title}」?`,content:`禁用后该菜单将不可访问。`,okText:`确认禁用`}),disabled:!e(`system:menu:update`)}),Me=ae({permission:`system:menu`,edit:Ae,remove:e=>I.mutateAsync({params:{id:e.id}}),title:`确认删除此菜单?`,content:`子菜单也将一并删除`,extra:t=>[{key:`child`,label:`子项`,hidden:t.type===`button`||!e(`system:menu:create`),onClick:()=>$(t.id)}],width:210,desktopInlineKeys:[`child`,`edit`,`delete`]}),Ne=[{title:`菜单名称`,dataIndex:`title`,minWidth:280,useFullRender:!0,render:(e,t,n,r)=>{let i=r?.expandIcon,a=r?.indentText;return/* @__PURE__ */ W(`span`,{style:{display:`flex`,alignItems:`center`,minWidth:0},children:[a,i,t.icon&&/* @__PURE__ */ U(`span`,{style:{marginRight:6,marginLeft:4,display:`flex`,alignItems:`center`,color:`var(--arc-antd-color-text-1)`,flexShrink:0},children:F(t.icon,15)}),/* @__PURE__ */ U(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:String(e),children:e})]})}},{title:`类型`,dataIndex:`type`,width:90,render:e=>/* @__PURE__ */ U(z,{dictCode:`menu_type`,value:e})},{title:`路由路径`,dataIndex:`path`,width:180,render:M},{title:`组件路径`,dataIndex:`component`,width:250,render:M},{title:`权限标识`,dataIndex:`permission`,width:200,render:M},{title:`排序`,dataIndex:`sort`,width:70,align:`center`},oe,{title:`状态`,dataIndex:`status`,width:80,fixed:`right`,render:(e,t)=>t.type===`button`?se:je.renderSwitch(t)},{title:`显示`,dataIndex:`visible`,width:80,align:`center`,fixed:`right`,render:(e,t)=>t.type===`button`?se:/* @__PURE__ */ U(z,{dictCode:`menu_visible`,value:e?`show`:`hidden`})},Me],Pe=()=>/* @__PURE__ */ U(ne,{type:`primary`,icon:U(Q?ee:_,{size:14}),onClick:Te,children:Q?`全部折叠`:`全部展开`});return/* @__PURE__ */ W(`div`,{className:`page-container`,style:{height:`100%`,display:`flex`,flexDirection:`column`},children:[k.isError&&/* @__PURE__ */ U(re,{fullMode:!1,type:`danger`,bordered:!0,closeIcon:null,description:`菜单数据加载失败,请检查网络后点击表格右上角刷新重试`,style:{marginBottom:12}}),/* @__PURE__ */ U(`div`,{style:{flex:1,minHeight:0},children:/* @__PURE__ */ U(s,{searchConfig:r({keyword:/* @__PURE__ */ U(u,{placeholder:`菜单名称`,...v(`keyword`),width:200}),filters:/* @__PURE__ */ U(c,{items:E,...g(`status`)}),onSearch:b,onReset:De,create:/* @__PURE__ */ U(d,{permission:`system:menu:create`,onClick:()=>$()}),actions:Pe(),filterTitle:`菜单筛选`,actionTitle:`菜单操作`}),bordered:!0,columns:Ne,dataSource:Y,rowKey:`id`,loading:k.isFetching,onRefresh:()=>void k.refetch(),refreshLoading:k.isFetching,pagination:!1,expandedRowKeys:X,onExpandedRowsChange:Ee,childrenRecordName:`children`,virtualized:!0})}),/* @__PURE__ */ W(le,{modal:N,width:680,children:[/* @__PURE__ */ U(S.RadioGroup,{field:`type`,label:`菜单类型`,rules:[{required:!0}],onChange:e=>p(e.target.value),type:`button`,children:C.map(e=>/* @__PURE__ */ U(t,{value:e.value,children:e.label},e.value))}),/* @__PURE__ */ U(S.Slot,{label:{text:`父级菜单`},children:/* @__PURE__ */ U(te,{treeData:ke,value:i??0,onChange:e=>a(e),style:{width:`100%`},placeholder:`请选择父级菜单`,filterTreeNode:!0,showFilteredOnly:!0,virtualize:{height:300,itemSize:36}})}),/* @__PURE__ */ W(T,{gutter:16,children:[/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.Input,{field:`title`,label:`菜单名称`,placeholder:`请输入菜单名称`,rules:[{required:!0,message:`请输入菜单名称`}]})}),f!==`button`&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.Slot,{label:{text:`图标`},children:/* @__PURE__ */ U(xe,{value:o,onChange:l})})}),(f===`menu`||f===`directory`)&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.Input,{field:`path`,label:`路由路径`,placeholder:`请输入路由路径`,rules:f===`menu`?[{required:!0,message:`请输入路由路径`}]:void 0})}),f===`menu`&&!m&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.Input,{field:`component`,label:`组件路径`,placeholder:`例如: users/UsersPage`,rules:[{required:!0,message:`请输入组件路径`}]})}),f===`menu`&&!m&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.Input,{field:`name`,label:`组件名`,placeholder:`前端组件Name`})}),(f===`menu`||f===`directory`)&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.Input,{field:`query`,label:/* @__PURE__ */ U(w,{content:`访问路由的默认传递参数,如:{"id": 1, "name": "ry"}`,children:`路由参数`}),placeholder:`如:{"id": 1, "name": "ry"}`})}),(f===`menu`||f===`directory`)&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ W(S.RadioGroup,{field:`isExternal`,label:/* @__PURE__ */ U(w,{content:`选择是外链则路由地址需要以 http(s):// 开头`,children:`是否外链`}),type:`button`,onChange:e=>h(e.target.value),children:[/* @__PURE__ */ U(t,{value:!0,children:`是`}),/* @__PURE__ */ U(t,{value:!1,children:`否`})]})}),(f===`menu`||f===`directory`)&&m&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ W(S.RadioGroup,{field:`embed`,label:/* @__PURE__ */ U(w,{content:`内嵌:在系统内以 iframe 打开外链,保留侧边栏与页签;新窗口:浏览器新标签页打开`,children:`打开方式`}),type:`button`,children:[/* @__PURE__ */ U(t,{value:!1,children:`新窗口`}),/* @__PURE__ */ U(t,{value:!0,children:`内嵌`})]})}),f===`menu`&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ W(S.RadioGroup,{field:`keepAlive`,label:/* @__PURE__ */ U(w,{content:`开启后,多页签模式下切换页签保留该页面状态(搜索条件、滚动位置等),关闭页签时释放`,children:`页面缓存`}),type:`button`,children:[/* @__PURE__ */ U(t,{value:!0,children:`开启`}),/* @__PURE__ */ U(t,{value:!1,children:`关闭`})]})}),f===`button`&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.Input,{field:`permission`,label:`权限标识`,placeholder:`如:system:user:list`,rules:[{required:!0,message:`请输入权限标识`}]})}),/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.InputNumber,{field:`sort`,label:`排序`,placeholder:`请输入排序`,min:0,style:{width:`100%`}})})]}),/* @__PURE__ */ W(T,{gutter:16,children:[/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(Se,{type:`button`,rules:[{required:!0}]})}),f!==`button`&&/* @__PURE__ */ U(D,{span:12,children:/* @__PURE__ */ U(S.RadioGroup,{field:`visible`,label:`显示状态`,type:`button`,rules:[{required:!0}],children:O.map(e=>/* @__PURE__ */ U(t,{value:e.value,children:e.label},e.value))})})]})]})]})}var Ce;function Z(){return(Z=e((()=>{O(),h(),g(),a(),L(),J(),N(),R(),Y(),j(),f(),l(),i(),k(),A(),P(),Ce={keyword:``,status:void 0}})))()}Z();export{X as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t}from"./controls-C5dPckUT.js";import{n,t as r}from"./MasterDetailLayout-DDVFodpX.js";import{n as i,t as a}from"./ellipsis-Dux1Nxa5.js";import{n as o,t as s}from"./search-DYZU68h1.js";import{n as c}from"./list-0CbyOlT9.js";import{a as l,u,v as d,w as f}from"./ui-DoIHGuTR.js";import{n as p,t as m}from"./ScrollArea-DqjJmHDN.js";import{Children as h,Fragment as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";function b({title:e,headerExtra:n,search:i,loading:a,emptyText:o=`暂无数据`,footer:l,dataSource:u,renderItem:f,children:p,style:g,bodyNoPadding:b,rawBody:x}){let S=u!==void 0,C=(S?0:h.count(p))>0?p:null,w=i?/* @__PURE__ */ v(t,{prefix:/* @__PURE__ */ v(s,{size:14}),placeholder:i.placeholder??`搜索`,value:i.value,onChange:i.onChange,onEnterPress:i.onEnterPress,showClear:!0,size:`small`}):null;return/* @__PURE__ */ y(`div`,{className:`nav-list-panel`,style:g,children:[(e!==void 0||n!==void 0)&&/* @__PURE__ */ y(`div`,{className:`nav-list-panel__header`,children:[e!==void 0&&/* @__PURE__ */ v(`span`,{className:`nav-list-panel__title`,children:e}),/* @__PURE__ */ y(`div`,{className:`nav-list-panel__header-extra${e===void 0?` nav-list-panel__header-extra--full`:``}`,children:[n,/* @__PURE__ */ v(`span`,{className:`nav-list-panel__side-toggle`,children:/* @__PURE__ */ v(r.SideToggle,{})})]})]}),w!==null&&/* @__PURE__ */ v(`div`,{className:`nav-list-panel__search`,children:w}),/* @__PURE__ */ v(m,{className:`nav-list-panel__body${b?` nav-list-panel__body--no-padding`:``}`,role:`region`,"aria-label":typeof e==`string`?e:`导航列表`,children:x?/* @__PURE__ */ y(_,{children:[a&&/* @__PURE__ */ v(`div`,{style:{display:`flex`,justifyContent:`center`,padding:24},children:/* @__PURE__ */ v(d,{})}),!a&&p]}):/* @__PURE__ */ v(c,{split:!1,loading:a,emptyContent:/* @__PURE__ */ v(`div`,{className:`nav-list-panel__empty`,children:o}),dataSource:S?u:void 0,renderItem:S?f:void 0,className:`nav-list-panel__list`,children:S?null:C})}),l!=null&&/* @__PURE__ */ v(`div`,{className:`nav-list-panel__footer`,children:l})]})}function x({active:e,onClick:t,primary:n,secondary:r,meta:i,icon:a,extra:o,extraAlwaysVisible:s,style:l,className:u}){let d=/* @__PURE__ */ y(_,{children:[a&&/* @__PURE__ */ v(`span`,{className:`nav-list-item__icon`,children:a}),/* @__PURE__ */ y(`span`,{className:`nav-list-item__body`,children:[/* @__PURE__ */ y(`span`,{className:`nav-list-item__row1`,children:[/* @__PURE__ */ v(`span`,{className:`nav-list-item__primary`,children:n}),r!==void 0&&/* @__PURE__ */ y(_,{children:[/* @__PURE__ */ v(`span`,{className:`nav-list-item__sep`,children:`·`}),/* @__PURE__ */ v(`span`,{className:`nav-list-item__secondary`,children:r})]})]}),i!==void 0&&/* @__PURE__ */ v(`span`,{className:`nav-list-item__meta`,children:i})]})]});return/* @__PURE__ */ y(c.Item,{className:[`nav-list-item`,e?`nav-list-item--active`:``,u??``].filter(Boolean).join(` `),style:l,children:[t?/* @__PURE__ */ v(`button`,{type:`button`,className:`nav-list-item__select`,"aria-current":e?`true`:void 0,onClick:t,children:d}):/* @__PURE__ */ v(`div`,{className:`nav-list-item__select`,children:d}),o!==void 0&&/* @__PURE__ */ v(`div`,{className:`nav-list-item__extra${s?` nav-list-item__extra--visible`:``}`,children:o})]})}function S({items:e}){let t=e.filter(e=>!e.hidden);return t.length===0?null:/* @__PURE__ */ v(u,{trigger:`click`,position:`bottomRight`,clickToHide:!0,render:/* @__PURE__ */ v(u.Menu,{children:t.map((e,t)=>/* @__PURE__ */ y(g,{children:[e.dividerBefore&&t>0?/* @__PURE__ */ v(u.Divider,{}):null,/* @__PURE__ */ v(u.Item,{type:e.danger?`danger`:void 0,disabled:e.disabled,onClick:t=>{t.stopPropagation(),e.onClick()},children:/* @__PURE__ */ y(`span`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[e.icon,e.label]})})]},e.key))}),children:/* @__PURE__ */ v(l,{"aria-label":`更多操作`,theme:`borderless`,size:`small`,icon:/* @__PURE__ */ v(a,{size:14}),onClick:e=>e.stopPropagation()})})}function C(){return(C=e((()=>{f(),i(),o(),n(),p()})))()}export{C as i,S as n,b as r,x as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{a as t,i as n}from"./controls-C5dPckUT.js";import{t as r}from"./typography-DKK_iHcj.js";import{i}from"./feedback-D4BIfDNd.js";import{c as a,l as o,n as s,t as c}from"./ConfigurableTable-CyfZLgG0.js";import{n as l,r as u}from"./SessionClientTag-DafwXf-o.js";import{_ as d,b as f,w as p}from"./ui-DoIHGuTR.js";import{i as m,t as h}from"./confirm-CC2F8XXe.js";import{n as g,t as _}from"./ResponsiveTableActions-y54aSdhs.js";import{n as v,t as y}from"./useListPage-1Upr_ala.js";import{i as b,r as x,s as S}from"./table-columns-XaoxVUJN.js";import{useMemo as C}from"react";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{TOKEN_KEY as E}from"@fudanda/shared/core";import{usePermission as D}from"@fudanda/react-core/hooks/usePermission";import{sessionContract as O}from"@fudanda/shared/identity";import{useForceLogoutSession as k,useForceLogoutUserSessions as A,useSessionList as j}from"@fudanda/react-core/hooks/queries/sessions";function M(){let{hasPermission:e}=D(),o=v({contract:O,useList:j,table:{rowKey:`tokenId`,empty:`暂无在线用户`}}),{tableProps:s}=o,u=k(),p=A(),m=C(()=>{try{let e=localStorage.getItem(E);if(!e)return null;let t=JSON.parse(atob(e.split(`.`)[1]));return typeof t.jti==`string`?t.jti:null}catch{return null}},[]),g=e=>{let a=`single`;h({title:`强制下线`,content:/* @__PURE__ */ T(d,{vertical:!0,align:`start`,style:{width:`100%`},children:[/* @__PURE__ */ T(r.Text,{children:[`用户:`,e.username,`(`,e.nickname,`)`]}),/* @__PURE__ */ T(t,{defaultValue:`single`,onChange:e=>{a=e.target.value},children:[/* @__PURE__ */ w(n,{value:`single`,children:`仅下线此会话`}),/* @__PURE__ */ w(n,{value:`all`,children:`下线该用户全部会话`})]})]}),onOk:async()=>{a===`all`?await p.mutateAsync({params:{id:e.userId}}):await u.mutateAsync({params:{tokenId:e.tokenId}}),i.success(a===`all`?`已强制下线全部会话`:`已强制下线`)}})},y=[{title:`用户名`,dataIndex:`username`,width:180,render:(e,t)=>/* @__PURE__ */ T(d,{children:[/* @__PURE__ */ w(`span`,{children:e}),t.tokenId===m&&/* @__PURE__ */ w(f,{color:`blue`,size:`small`,children:`当前会话`}),t.impersonatorName&&/* @__PURE__ */ T(f,{color:`orange`,size:`small`,children:[`由 `,t.impersonatorName,` 模拟`]})]})},{title:`昵称`,dataIndex:`nickname`,minWidth:140},{title:`终端`,dataIndex:`client`,width:110,render:e=>/* @__PURE__ */ w(l,{client:e})},{title:`IP 地址`,dataIndex:`ip`,width:140},{title:`登录地点`,dataIndex:`location`,width:180,render:S},{title:`浏览器`,dataIndex:`browser`,width:160,render:S},{title:`操作系统`,dataIndex:`os`,width:160,render:S},x(`登录时间`,`loginAt`),x(`最近活跃`,`lastActiveAt`),_({width:120,actions:t=>[{key:`force-logout`,label:`强制下线`,danger:!0,hidden:!e(`system:session:forceLogout`),onClick:()=>g(t)}]})];return/* @__PURE__ */ w(`div`,{className:`page-container`,children:/* @__PURE__ */ w(c,{searchConfig:a({page:o,filters:[`keyword`,`client`],actionTitle:`会话操作`}),columns:y,...s})})}function N(){return(N=e((()=>{p(),s(),o(),g(),u(),b(),m(),y()})))()}N();export{M as default};
|