@abtnode/blocklet-services 1.17.6-beta-20251217-144034-62fafb94 → 1.17.6-beta-20251218-120326-5b44dadf
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/api/index.js +43 -34
- package/api/util/attach-shared-utils.js +8 -2
- package/api/util/federated.js +2 -2
- package/dist/assets/{AdapterDayjs-DqOr9LFk.js → AdapterDayjs-CyjsNBLx.js} +1 -1
- package/dist/assets/{Google-CQ1n6aSx.js → Google-qJPhO3Bv.js} +1 -1
- package/dist/assets/{access-control-Br0Q24U5.js → access-control-DnaC-ntN.js} +1 -1
- package/dist/assets/{add-component-core-BjIc5CSC.js → add-component-core-DppKYxsT.js} +1 -1
- package/dist/assets/{add-resource-Xb-x4g1C.js → add-resource-nZx6jcxt.js} +1 -1
- package/dist/assets/{addon-Bb-IvkBm.js → addon-CWepU-kl.js} +1 -1
- package/dist/assets/{advanced-J7PaqOkP.js → advanced-D8m1Ueie.js} +1 -1
- package/dist/assets/{aigne-BisxPU40.js → aigne-JZcfPzC6.js} +1 -1
- package/dist/assets/api-C_w0YD2j.js +1 -0
- package/dist/assets/{appearance-DB7npajX.js → appearance-0EszN89M.js} +1 -1
- package/dist/assets/{audit-logs-ChUneyZT.js → audit-logs-CI4WysnU.js} +2 -2
- package/dist/assets/{authorize-Y82VNxRU.js → authorize-D44ooZQv.js} +1 -1
- package/dist/assets/{base-chart-CRe-9w5H.js → base-chart-Cs8rd9f2.js} +1 -1
- package/dist/assets/{base32-BqL5pnrU.js → base32-Dms5J8BI.js} +1 -1
- package/dist/assets/{bind-account-D6v5gT9Q.js → bind-account-JV34J5Xm.js} +1 -1
- package/dist/assets/{branding-DMSOM95n.js → branding-BJCkGiFk.js} +1 -1
- package/dist/assets/{branding-CEFq0bR-.js → branding-CWSPHmrR.js} +1 -1
- package/dist/assets/branding-DdXH_RvS.js +1 -0
- package/dist/assets/{bundle-avatar-B4iapkc8.js → bundle-avatar-BtFusdVR.js} +1 -1
- package/dist/assets/{button-C2uxCAba.js → button-dwhnNiIp.js} +1 -1
- package/dist/assets/{click-to-copy-03_3P1nz.js → click-to-copy-P5mPeLGL.js} +1 -1
- package/dist/assets/{cloneDeep-DqDclz1x.js → cloneDeep-BbaR0xRl.js} +1 -1
- package/dist/assets/{complete-8l4TIdOc.js → complete-C2eZZOXC.js} +1 -1
- package/dist/assets/{component-wVyJUR9k.js → component-BaU5hHKk.js} +2 -2
- package/dist/assets/{config--7XaVDtf.js → config-CCnS9IQP.js} +1 -1
- package/dist/assets/{config-Cg-4HKDk.js → config-DVWLcvSS.js} +1 -1
- package/dist/assets/config-kfbhKizi.js +53 -0
- package/dist/assets/{config-navigation-C25bf49D.js → config-navigation-DGBH-fH3.js} +3 -3
- package/dist/assets/{config-space-a5CPzcRH.js → config-space-Cung-olH.js} +1 -1
- package/dist/assets/{confirm-Bae4Q6hA.js → confirm-8-up_m-t.js} +1 -1
- package/dist/assets/{connect-Kqg-Hvf0.js → connect-CO3sXyDi.js} +1 -1
- package/dist/assets/{connect-DcNJuYMP.js → connect-DUE3spg6.js} +1 -1
- package/dist/assets/{connect-to-CAxA9YCt.js → connect-to-R3QLEY0t.js} +1 -1
- package/dist/assets/{create-passport-svg-Cs4mVLsE.js → create-passport-svg-DisoTWuv.js} +1 -1
- package/dist/assets/{createClass-BRKh_6kd.js → createClass-BKsWaCf4.js} +1 -1
- package/dist/assets/dashboard-8MVLDFcc.js +103 -0
- package/dist/assets/{delete-confirm-BH4us77q.js → delete-confirm-D_45dT2a.js} +1 -1
- package/dist/assets/{did-address-DpdRECuJ.js → did-address-BjZvgDzc.js} +1 -1
- package/dist/assets/{domain-A_x2C7hZ.js → domain-BraDyagy.js} +1 -1
- package/dist/assets/{domain-action-card-qfAg2FOU.js → domain-action-card-BmOv4oe5.js} +2 -2
- package/dist/assets/domains-Dy7ECa6U.js +1 -0
- package/dist/assets/{email-B41P48YL.js → email-CkeAvsAa.js} +1 -1
- package/dist/assets/engine-Cm_CGBhX.js +1 -0
- package/dist/assets/{exchange-passport-DmJ-ZNn7.js → exchange-passport-Fp943JxR.js} +1 -1
- package/dist/assets/{form--M8l8TAR.js → form-jl_s7BGq.js} +1 -1
- package/dist/assets/{form-text-input-CsXLsIFW.js → form-text-input-DTxgomuw.js} +1 -1
- package/dist/assets/{fuel-CKdRvbMh.js → fuel-D-LdwjdC.js} +1 -1
- package/dist/assets/{gen-access-key-DpcudUJv.js → gen-access-key-BRr17t_H.js} +1 -1
- package/dist/assets/{gen-simple-access-key-bBIGQFVa.js → gen-simple-access-key-BxMBs7fK.js} +1 -1
- package/dist/assets/get-safe-url-dvWY0L5j.js +1 -0
- package/dist/assets/{home-Br4wv3nM.js → home-Bn4iii2m.js} +1 -1
- package/dist/assets/{iframe-DEDZfTQS.js → iframe-C0AgQvx8.js} +1 -1
- package/dist/assets/{index-CCV_gr1l.js → index-2gt9VfEc.js} +1 -1
- package/dist/assets/{index-gb3Omoer.js → index-B-I6un5k.js} +1 -1
- package/dist/assets/{index-DZnXlBSX.js → index-B5vc0eG5.js} +1 -1
- package/dist/assets/{index-DDNwkWcx.js → index-B8k8ZH-U.js} +1 -1
- package/dist/assets/{index-BMx1LEw9.js → index-BAp7_uhB.js} +1 -1
- package/dist/assets/{index-B09kmneh.js → index-BFym_Z-b.js} +1 -1
- package/dist/assets/{index-Drd8GwRz.js → index-BQ5NNc-7.js} +1 -1
- package/dist/assets/{index-D-PNqbj6.js → index-BR0Wem2b.js} +1 -1
- package/dist/assets/{index-B4sVJOOj.js → index-BTECQw0p.js} +1 -1
- package/dist/assets/{index-BuQB-bBx.js → index-BjNeXyVY.js} +6 -6
- package/dist/assets/{index-CbOKD65A.js → index-BjehQLKB.js} +2 -2
- package/dist/assets/{index-CCp_Tje1.js → index-BlSveGp8.js} +61 -61
- package/dist/assets/{index-DFIvDEic.js → index-C50skInm.js} +1 -1
- package/dist/assets/{index-B8FnxSR4.js → index-CJDEYakY.js} +1 -1
- package/dist/assets/{index-wfFuxfIU.js → index-CPxL8CpH.js} +1 -1
- package/dist/assets/{index-DFNR7XPL.js → index-CTE1ENlu.js} +12 -12
- package/dist/assets/{index-BTLkS2yC.js → index-CajO0kKX.js} +4 -4
- package/dist/assets/{index-CeGNmiXz.js → index-Cv24xb2K.js} +1 -1
- package/dist/assets/index-D0eI1uWt.js +270 -0
- package/dist/assets/{index-DzshGHRk.js → index-DIzANfR6.js} +1 -1
- package/dist/assets/{index-CiQKtWIW.js → index-DM9inqt9.js} +1 -1
- package/dist/assets/{index-ChsRYmOX.js → index-DQ-SL5-m.js} +1 -1
- package/dist/assets/{index-suU5cUfF.js → index-DS9mwDyh.js} +1 -1
- package/dist/assets/{index-Du-44Mnl.js → index-DoK2Rtvh.js} +2 -2
- package/dist/assets/{index-t-iCgvnA.js → index-Dp17qZ6C.js} +1 -1
- package/dist/assets/{index-ds5CY5te.js → index-DrhZQ_wV.js} +1 -1
- package/dist/assets/{index-BHZ1NI4D.js → index-Dtrjy5pJ.js} +5 -5
- package/dist/assets/{index-Dp5SQewL.js → index-DyLgcKhb.js} +1 -1
- package/dist/assets/{index-97PFSvcx.js → index-dfs551o8.js} +1 -1
- package/dist/assets/{index-Ck7gs4Oo.js → index-kbCgvprY.js} +1 -1
- package/dist/assets/{index-DZNC_-b1.js → index-rDhoTVbw.js} +1 -1
- package/dist/assets/{invitation-CmMAFxUf.js → invitation-BAxrjUDG.js} +1 -1
- package/dist/assets/{invitations-BGoj-6ca.js → invitations-CO0Ty2S9.js} +2 -2
- package/dist/assets/{invite-xCk-bD5o.js → invite-CYXl5uc3.js} +1 -1
- package/dist/assets/{isURL-FbWmvlGY.js → isURL-BxZzphzW.js} +1 -1
- package/dist/assets/{issue-passport-ogite141.js → issue-passport-DYOdrLjy.js} +1 -1
- package/dist/assets/{item-DB2BQlzi.js → item-Ccb0OQkt.js} +1 -1
- package/dist/assets/{landing-page-_7E5uTzY.js → landing-page-CmKJmT-U.js} +1 -1
- package/dist/assets/{layout-bs5efDjb.js → layout-CHuGuIJt.js} +1 -1
- package/dist/assets/{list-DzPoX6hE.js → list-B6W2DONO.js} +1 -1
- package/dist/assets/{list-CY3qo6ZZ.js → list-miYDTaUU.js} +1 -1
- package/dist/assets/localization-C3-q8joh.js +1 -0
- package/dist/assets/{log-YDgW4rdG.js → log-DdfRRLsZ.js} +1 -1
- package/dist/assets/logger-CzWbEvKU.js +1 -0
- package/dist/assets/{login-BX3PcB9B.js → login-92eabaMB.js} +1 -1
- package/dist/assets/{login-oauth-callback-74_L5-PV.js → login-oauth-callback-9GVt-otv.js} +1 -1
- package/dist/assets/{logo-uploader-BiccA0Y_.js → logo-uploader-ficxc3SB.js} +1 -1
- package/dist/assets/{lost-passport-DQpqnLzY.js → lost-passport-BDvFLXED.js} +1 -1
- package/dist/assets/{omit-5AwbF-Ja.js → omit-BgmLPtMY.js} +1 -1
- package/dist/assets/{open-window-DwdCOSRH.js → open-window-NxoiKlpc.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-vMGDLCRH.js → over-due-invoice-payment-Bag2QJw8.js} +1 -1
- package/dist/assets/{overview-DlaOwZTf.js → overview-B-FL9Ztc.js} +3 -3
- package/dist/assets/{passport-item-D-26SswO.js → passport-item-2TTg8u8i.js} +1 -1
- package/dist/assets/passport-ksgWSkVe.js +1 -0
- package/dist/assets/{permission-DSq5t-Gl.js → permission-BJlcNSeA.js} +1 -1
- package/dist/assets/{preferences-CU_TcWh8.js → preferences-vSJ26-Kf.js} +1 -1
- package/dist/assets/profile-embed-q0jzSGic.js +1 -0
- package/dist/assets/{publish-resource-CJMQG20J.js → publish-resource-N_xsM7eE.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-By1RE6ef.js → react-beautiful-dnd.esm-B8-BZPPH.js} +1 -1
- package/dist/assets/runtime-BK5XjM1-.js +1 -0
- package/dist/assets/{sanitize-BOo6OPJZ.js → sanitize-DyRfEGVu.js} +1 -1
- package/dist/assets/sdk-CIR3zRqK.js +1 -0
- package/dist/assets/{security-BtvdwO9M.js → security-CKHrp32s.js} +1 -1
- package/dist/assets/{session-BjDe0kgL.js → session-Cqrj8_SK.js} +1 -1
- package/dist/assets/{setup-Dznue6f2.js → setup-CHheNDuH.js} +1 -1
- package/dist/assets/{spaces-QwBC54Y6.js → spaces-BAJFHyzr.js} +1 -1
- package/dist/assets/{start-8dFdO02W.js → start-BOYluYHu.js} +1 -1
- package/dist/assets/{starting-progress-SGklUl5j.js → starting-progress-CkCYTd53.js} +1 -1
- package/dist/assets/{status-BVh3qQZF.js → status-P5i7qkCz.js} +1 -1
- package/dist/assets/{step-actions-YQj43Dic.js → step-actions-DS32mD8U.js} +1 -1
- package/dist/assets/{studio-Dse7ZOUk.js → studio-eOX0BkA6.js} +1 -1
- package/dist/assets/{switch-wqsJ2qIA.js → switch-BEaA4jUC.js} +1 -1
- package/dist/assets/{switch-control-BDwQ53GS.js → switch-control-Cz02PQSr.js} +1 -1
- package/dist/assets/{table-tips-BEPJMiqj.js → table-tips-D04ygJ3S.js} +1 -1
- package/dist/assets/{team-CMLIpBpv.js → team-BDtQ1KMK.js} +1 -1
- package/dist/assets/{traffic-CMz6_p1P.js → traffic-8-96Vd63.js} +1 -1
- package/dist/assets/{transfer-ZsNcWxY6.js → transfer-Ctl7gLHf.js} +1 -1
- package/dist/assets/{unsubscribe-C6wQSJz0.js → unsubscribe-BdG3wOyd.js} +1 -1
- package/dist/assets/{use-app-logo-C6aWxAKK.js → use-app-logo-CSWr6R3N.js} +1 -1
- package/dist/assets/{use-window-close-edYntLdV.js → use-window-close-Dyba-7KK.js} +1 -1
- package/dist/assets/{useAsync-DOpjtrvS.js → useAsync-VEqKX7rF.js} +1 -1
- package/dist/assets/{useAsync-BSd-eaZO.js → useAsync-xXSiXzwr.js} +1 -1
- package/dist/assets/{useAsyncRetry-v1aVMcV-.js → useAsyncRetry--1T7wYe2.js} +1 -1
- package/dist/assets/{useLocalStorage-8LihN_xG.js → useLocalStorage-C6lmxNb2.js} +1 -1
- package/dist/assets/{user-center-CySi62qy.js → user-center-CnMx7tGr.js} +1 -1
- package/dist/assets/{user-follower-DaQ4cmnn.js → user-follower-DJYfIqdF.js} +1 -1
- package/dist/assets/{util-LZOTlX2w.js → util-B7Ad6Wyn.js} +1 -1
- package/dist/assets/{util-CQLL-C6x.js → util-CKkTy1Qb.js} +1 -1
- package/dist/assets/{vendor-arcblock-DRfhQ9Yl.js → vendor-arcblock-BwnwoPBM.js} +1 -1
- package/dist/assets/{vendor-hooks-DpqqC65c.js → vendor-hooks-cYMUGE4V.js} +1 -1
- package/dist/assets/{vendor-utils-BqKQizRf.js → vendor-utils-drLlzTVq.js} +1 -1
- package/dist/assets/{vendor-ux-KtPBvlG0.js → vendor-ux-B5w9dHEo.js} +3 -3
- package/dist/assets/{wait-connect-D-KXzGB8.js → wait-connect-BqfPKCyo.js} +1 -1
- package/dist/assets/{wizard-DplFy6RF.js → wizard-BVhYBjmA.js} +1 -1
- package/dist/assets/{wizard-components-D5SEvV5d.js → wizard-components-DL5NPso6.js} +1 -1
- package/dist/assets/wrap-locale-PrRlPUBM.js +1 -0
- package/dist/assets/{zh-BEQJoajM.js → zh-ChCVOElr.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +34 -34
- package/dist/assets/api-2a4FTO9k.js +0 -1
- package/dist/assets/branding-Beas39XM.js +0 -1
- package/dist/assets/config-CAG_E71y.js +0 -53
- package/dist/assets/dashboard-4ch_JDWe.js +0 -106
- package/dist/assets/domains-BdyK4uC-.js +0 -1
- package/dist/assets/engine-ChxMyLlO.js +0 -1
- package/dist/assets/get-safe-url-DhW3uplX.js +0 -1
- package/dist/assets/index-Csq5V3mf.js +0 -270
- package/dist/assets/localization-DNXKCjZt.js +0 -1
- package/dist/assets/logger-D3ELa8t7.js +0 -1
- package/dist/assets/passport-BpAOwZW1.js +0 -1
- package/dist/assets/profile-embed-B0Xzyt0-.js +0 -1
- package/dist/assets/runtime-CV7GMTXM.js +0 -1
- package/dist/assets/sdk-CfmFeEbO.js +0 -1
- package/dist/assets/wrap-locale-BkGdB3jW.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as e,W as m,a6 as O,T as j,at as Ne,D as _e,e7 as
|
|
2
|
-
`)},backgroundColor:n.palette.background.paper,borderColor:n.palette.divider,textStyle:{color:n.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${n.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:X[600]},{min:-9,max:-6,color:X[500]},{min:-6,max:-3,color:X[400]},{min:-3,max:-1,color:X[300]},{min:0,max:0,color:n.palette.grey[200]},{min:1,max:3,color:J[300]},{min:3,max:6,color:J[400]},{min:6,max:9,color:J[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:J[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:n.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,color:n.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:n.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:n.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:We[200],color:"inherit"}}}}),[i,t,n]);return e.jsxs(e.Fragment,{children:[e.jsx(h,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(h,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Tt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(h,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(F,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Nt=fe(({className:t,...o})=>e.jsx(ge,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({status:t,message:o="",createdAt:a}){const{t:s}=D(),r=t===I.BACKUPS.STATUS.PROGRESS&&E().diff(a,"hours")>=I.BACKUPS.TIMEOUT_HOURS,n=r&&s("common.timeoutError"),c=t===I.BACKUPS.STATUS.PROGRESS&&!r,i=t===I.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(O,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(q,{type:"success",children:s("common.succeeded")}):e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:s("common.failed")}),e.jsx(ge,{style:{display:"flex",alignItems:"center",flexShrink:0},title:o||n,children:e.jsx(be,{children:e.jsx(Ge,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ae.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function ve({metadata:t={}}){const{t:o}=D();if(H(t))return e.jsx(q,{type:"success",children:o("common.succeeded")});const a=t.count||0,s=t.size||0,r=It(s,{iec:!0}),n=e.jsxs(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[o("common.fileCount"),": ",a]}),e.jsxs(j,{variant:"body2",children:[o("common.fileSize"),": ",r]})]});return e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:o("common.succeeded")}),e.jsx(Nt,{title:n,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(be,{children:e.jsx(Ke,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ve.propTypes={metadata:m.object};function Oe(){const{t,locale:o}=D(),{spaceGateways:a,backups:s,backupsLoading:r}=z(),n=b.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:x,createdAt:p}=s[i],f=x===I.BACKUPS.STATUS.PROGRESS&&E().diff(p,"hours")>=I.BACKUPS.TIMEOUT_HOURS,u=x===I.BACKUPS.STATUS.SUCCEEDED&&!f,k=l||a.find(w=>d?.includes(xe(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(Fe,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>H(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:x,createdAt:p,metadata:f}=d,u=l===I.BACKUPS.STATUS.PROGRESS&&E().diff(p,"hours")>=I.BACKUPS.TIMEOUT_HOURS,k=l===I.BACKUPS.STATUS.PROGRESS&&!u,w=l===I.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(O,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(ve,{metadata:f}):e.jsx(Ae,{status:l,message:x,createdAt:p})}}}],[s,a,t]),c=b.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(rt,{title:"",loading:r,data:s,columns:n,emptyNode:t("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function _t(){const{t}=D();return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(xt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(Ie,{})]}),e.jsxs(h,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Pe,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Re,{})]})}function ze({spaceGateway:t,onConfirm:o=()=>{},onCancel:a=()=>{}}){const{t:s}=D(),[r,n]=b.useState(!1),[c,i]=b.useState(!1),d=(p,f)=>{p?.preventDefault(),p?.stopPropagation(),n(f)},l=async p=>{try{p?.stopPropagation(),i(!0),await o?.(t),n(!1)}catch(f){console.error(f),B.error(`${s("storage.space.gateway.delete.failed")}: ${Q(f)}`)}finally{n(!1),i(!1)}},x=p=>{d(p,!1),a?.(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(G,{color:"red",onClick:p=>d(p,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Ye,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(it,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:x,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}ze.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ue({spaceGateway:t,selected:o,onDelete:a=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:n=!1,...c}){const{abortBlockletBackup:i}=z(),[d,l]=b.useState(null),{t:x}=D(),[p,f]=b.useState(!1),u=(S,y)=>{S.stopPropagation(),S.preventDefault(),l(y&&S.currentTarget)},k=async S=>{try{f(!0),u(S,!1),await s(t)}catch(y){console.error(y),B.error(y.message)}finally{f(!1)}},w=async S=>{try{f(!0),u(S,!1),await i()}catch(y){console.error(y),B.error(y.message)}finally{f(!1)}};return e.jsxs(e.Fragment,{children:[p||t?.loading?e.jsx(O,{sx:{ml:1},size:"24px"}):e.jsx($e,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>u(S,!0),...c,children:e.jsx(qe,{})}),e.jsxs(He,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:S=>u(S,!1),children:[e.jsxs(G,{onClick:S=>{u(S,!1),window.open(Se(t.endpoint?Ct(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Qe,{fontSize:"small"})}),e.jsx($,{children:x("common.open")})]}),e.jsxs(G,{onClick:S=>{u(S,!1),window.open(Se(wt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!o&&r&&e.jsxs(G,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Xe,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.switchToSpace")})]}),n&&e.jsxs(G,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Je,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!n&&e.jsx(ze,{spaceGateway:t,onConfirm:async()=>{l(null),await a?.(t)},onCancel:()=>l(null)})]})]})}Ue.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Wt=fe(({className:t,...o})=>e.jsx(ge,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Le({spaceGateway:t,spaceStatus:o,selected:a,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:n=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=M(),{api:l,info:{did:x}}=N(),{appDid:p,appName:f,appDescription:u,scopes:k,appUrl:w,referrer:S}=Be({blocklet:d}),{backupProgress:y,updateSpaceGateway:Z,deleteSpaceGateway:ee,refreshBackupSummary:te,refreshBackups:se}=z(),[_,U]=b.useState(!1),[T,P]=b.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:f},i),scan:c("storage.spaces.authorize.scan",{appName:f},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{P(C=>({...C,open:!1}))}}),ne=a&&!_&&o===de.DISCONNECTED,oe=a&&!_&&!t.loading&&o===de.CONNECTED,K=a&&_&&o===de.CONNECTED&&y?.progress>=0,V=async()=>{try{if(await Bt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:L.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}P(C=>({...C,open:!0,prefix:me(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Ce.create({baseURL:me(t.url,"space")}).get,extraParams:{appDid:p,appName:f,appDescription:u,scopes:k,appUrl:w,referrer:S,nodeDid:x,spaceDid:t.did}}))},ae=async(C,g)=>{const v=g(C.endpoint),R=xe(v),A=C.space?g(C.space):{};if(t.did&&R!==t.did){P(Me=>({...Me,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:A?.name?A.name:""});B.error(W),s?.(new Error(W),t);return}const ce={...t,name:A.name??"DID Space",did:A.did??xe(v),endpoint:v};await Z(ce),P(W=>({...W,open:!1})),s?.(null,ce)},re=async()=>{try{if(_)return;U(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),n?.(C,t)}finally{U(!0)}},ie=async()=>{try{await ee(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return b.useEffect(()=>{y?.completed?(a&&(y?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),n?.(null,t)):y.message&&n?.(new Error(y?.message),t),y.progress=0,y.message=""),U(!1),te(),se()):y.progress&&U(!0)},[y]),e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[oe&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:re,children:c("storage.spaces.strategy.backupNow")}),ne&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:V,children:c("storage.spaces.disconnected.reconnectNow")}),K&&e.jsx(Wt,{title:y?.message&&e.jsx(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:y.message})}),children:e.jsxs(le,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(O,{variant:"determinate",value:y?.progress,size:14,sx:{mr:1}}),y?.progress,"%"]})}),e.jsx(ot,{forceConnected:!1,saveConnect:!1,prefix:T.prefix,open:T.open,popup:!0,action:T.action,baseUrl:T.baseUrl,checkFn:T.checkFn,onSuccess:ae,onClose:T.onClose,checkTimeout:T.checkTimeout,extraParams:T.extraParams,messages:T.messages,locale:i},"get-endpoint")]}),e.jsx(Ue,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:a,onDelete:ie,onConnect:V,enableSwitchToSpace:y?.completed||H(y?.message),backupInProgress:K})]})}Le.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function Ft({...t}){const{t:o}=D();return e.jsxs(h,{...t,children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:o("storage.spaces.backup.records")})}),e.jsx(Pe,{}),e.jsx(Oe,{})]})}function Kt({...t}){const{t:o}=D(),{autoBackup:a,updateAutoBackup:s}=z(),r=async()=>{try{const n=!a?.enabled;await s({enabled:n}),B.success(o(n?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(n){B.error(n.message)}};return e.jsx(Rt,{checked:!!a?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:o("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function Gt(){const{t}=D(),{spaceGateways:o,spaceGatewaysLoading:a,spaceGatewayIsSelected:s}=z(),r=a&&!o?.length,n=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(Le,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:x=>x&&l()});return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(Kt,{}),e.jsx(Ie,{})]}),e.jsx(h,{sx:{mt:2},children:r?e.jsx(h,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(O,{})}):e.jsx(he,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:o.map(c=>e.jsx(he,{size:{xs:12,md:6},children:e.jsx(ft,{endpoint:c.endpoint,selected:s(c),action:n},c.endpoint)},c.endpoint))})})}),e.jsx(Ft,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Re,{})]})}function Yt(){const{spaceGatewaysFirstLoading:t,spaceGateways:o}=z();return t?e.jsx(we,{relative:"parent",children:e.jsx(O,{})}):H(o)?e.jsx(_t,{}):e.jsx(Gt,{})}function $t(){return e.jsx(Te,{children:e.jsx(Yt,{})})}function qt(){const{spaceGateway:t,settingStorageEndpoint:o,updateSpaceGateway:a,hasStorageEndpoint:s,loading:r,storageEndpoint:n}=At(),c=ue(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(we,{relative:"parent",children:e.jsx(O,{})}):e.jsxs(h,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(gt,{spaceGateway:t,settingStorageEndpoint:o}):e.jsx(ht,{}),e.jsx(h,{sx:c,children:e.jsx(St,{onConnect:a,storageEndpoint:n})})]})}function Ht(){const{t}=D();return e.jsxs(Pt,{children:[e.jsxs(F,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(qt,{})]})}function Qt({navOrientation:t="vertical",...o}){const{t:a,locale:s}=D(),{blocklet:r}=M(),n=lt({key:"md"}),[c,i]=et(),d=c.get("tab")||"backup",l=n?"horizontal":t,x=ue(()=>{const w=[{label:a("common.backup"),value:"backup"}],S=r?.capabilities?.didSpace;return(S===L.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===L.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:a("common.storage"),value:"storage"}),w},[s,l]),f=ue(()=>({backup:e.jsx($t,{}),storage:e.jsx(Ht,{})}))[d],u=w=>{i(S=>(w==="backup"?S.delete("tab"):S.set("tab",w),S))};if(x.length<=1)return e.jsx(pe,{children:f});const k=e.jsx(ct,{tabs:x,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(h,{...o,children:e.jsxs(F,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(h,{sx:{flexShrink:0},children:e.jsx(ye,{left:k})}),e.jsx(h,{sx:{flexGrow:1,minWidth:0},children:e.jsx(pe,{sx:{mt:1},children:f})})]})});if(l==="horizontal")return e.jsxs(h,{...o,children:[e.jsx(ye,{left:k}),e.jsx(pe,{sx:{mt:2},children:f})]})}Qt.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const pe=fe(h)`
|
|
1
|
+
import{j as e,W as m,a6 as O,T as j,at as Ne,D as _e,e7 as V,ao as J,e8 as We,ak as h,b6 as F,bb as Fe,s as fe,e9 as be,br as Ke,am as ge,cF as Ge,M as G,aO as Y,bO as Ye,aP as $,Q as $e,a$ as qe,aR as He,ea as Qe,eb as Xe,ec as Ve,dF as Je,b4 as he}from"./vendor-mui-core-DnR6WYuU.js";import{q as Ze,l as ke,a as ue}from"./vendor-hooks-cYMUGE4V.js";import{r as b,j as et}from"./vendor-react-CTtPmzVP.js";import{Y as M,Z as N,Q as E,J as L,bI as tt,bX as st,al as nt,c as I,l as ot}from"./index-BlSveGp8.js";import{H as B,V as D,aT as at,aU as q,aO as rt,R as it,w as le,aW as ct}from"./vendor-ux-B5w9dHEo.js";import{u as lt}from"./use-mobile-BINJTzMb.js";import{a as H,d as je,N as dt,c as pt,D as Ce,C as me}from"./vendor-utils-drLlzTVq.js";import{o as we}from"./vendor-arcblock-BwnwoPBM.js";import{a as ut,u as mt,c as xt,D as de,b as ft}from"./index-DQ-SL5-m.js";import"./index-Cv24xb2K.js";import"./index-BojVbZw0.js";import"./api-C_w0YD2j.js";import{u as Be,C as gt,D as ht,a as St}from"./connect-to-R3QLEY0t.js";import{c as yt,g as bt,d as kt,i as jt,e as xe,f as Ct,h as wt,j as Bt}from"./spaces-BAJFHyzr.js";import{f as Q}from"./index-DBs9Ljax.js";import{v as Dt}from"./index-DM9inqt9.js";import{a as Et}from"./dashboard-8MVLDFcc.js";import{E as Tt}from"./index-B5vc0eG5.js";import{x as It}from"./index-DRYJ0xIl.js";import{g as Se}from"./get-safe-url-dvWY0L5j.js";import{S as Rt}from"./switch-control-Cz02PQSr.js";import{C as Pt,u as At}from"./config-space-Cung-olH.js";import{L as ye}from"./list-header-Cl3jykCe.js";import"./lottie-web-4koyQiv_.js";import"./session-Cqrj8_SK.js";import"./team-BDtQ1KMK.js";import"./isURL-BxZzphzW.js";import"./use-app-logo-CSWr6R3N.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./useSetState-L-f8mSga.js";import"./index-BQ5NNc-7.js";import"./zh-ChCVOElr.js";import"./over-due-invoice-payment-Bag2QJw8.js";import"./useLocalStorage-C6lmxNb2.js";import"./confirm-8-up_m-t.js";import"./passport-ksgWSkVe.js";import"./create-passport-svg-DisoTWuv.js";import"./index-kbCgvprY.js";async function vt({blockletDid:t,nodeApi:o,spaceGateways:a}){let s=!1;const r=await Promise.all(a.map(async n=>{let{name:c}=n;const i=await yt(n.endpoint);return!H(i)&&i!==c&&(c=i,s=!0),{...n,name:c}}));return s&&await Promise.all(r.filter(n=>n.did).map(n=>o.updateBlockletSpaceGateway({input:{did:t,where:{did:n.did},spaceGateway:{...n}}}))),r}function Ot({refresh:t}={}){const{blocklet:o}=M(),a=o?.meta?.did,{api:s}=N();return Ze(async()=>{if(!a)return[];const{spaceGateways:r}=await s.getBlockletSpaceGateways({input:{did:a}});return await vt({blockletDid:a,nodeApi:s,spaceGateways:r})??[]},{refreshDeps:[a,t],onError(r){r?.message?.includes("not logged")?console.warn(r):(console.error(r),B.error(Q(r)))}})}function De({deps:t,setLoading:o,backupDate:a}={deps:[],setLoading:()=>{},backupDate:new Date}){const{blocklet:s}=M(),[r,n]=b.useState([]),{api:c}=N(),[i,d]=b.useMemo(()=>a?[E(a).startOf("day").toISOString(),E(a).endOf("day").toISOString()]:[E().startOf("year").toISOString(),E().endOf("day").toISOString()],[a]),l=je(async()=>{try{if(o(!0),!s){n([]);return}const{backups:x}=await c.getBlockletBackups({input:{did:s.meta.did,startTime:i,endTime:d}});n(x??[])}catch(x){console.error(x),B.error(Q(x))}finally{o(!1)}},1e3);return ke(async()=>{l()},[s?.meta?.did].concat(t)),{backups:r}}function zt({appDid:t}){const{backups:o}=De(),[a,s]=b.useState({message:"",progress:0,completed:!1}),r=N(),{ws:{useSubscription:n}}=r;return n(L.BlockletEvents.backupProgress,c=>{t===c?.appDid&&s(()=>({...c}))},[t]),b.useEffect(()=>{if(o?.length&&dt(o[0]?.status)){const[c]=o;s(()=>({message:c.message,progress:c.progress,completed:c.progress>=100}))}},[o]),a}function Ut({deps:t=[],setLoading:o=()=>{}}={}){const{blocklet:a}=M(),[s,r]=b.useState([]),{api:n}=N(),c=b.useCallback(je(async()=>{if(!n||!a?.meta?.did){r([]);return}try{o(!0);const i=E(),d=i.subtract(1,"year"),{summary:l}=await n.getBlockletBackupSummary({input:{did:a.meta.did,startTime:d.toISOString(),endTime:i.toISOString()}}),x=Array.isArray(l)?l.map(p=>({...p,successCount:+p.successCount,errorCount:+p.errorCount})):[];r(x)}catch(i){console.error("Failed to fetch backup summary:",i),B.error(Q(i)),r([])}finally{o(!1)}},1e3),[]);return ke(async()=>(await c(),()=>{c.cancel()}),[a?.meta?.did].concat(t)),{backupSummary:s}}const Ee=b.createContext({}),{Provider:Lt,Consumer:zs}=Ee;function Te({children:t}){const{t:o}=D(),{api:a}=N(),{blocklet:s}=M(),[r,n]=b.useState(null),[c,i]=b.useState(!1),{data:d,loading:l,mutate:x}=Ot({refresh:c}),p=pt(d),f=zt({appDid:s?.appDid}),u=b.useMemo(()=>bt(s?.environments),[s?.environments]),[k,w]=b.useState(!1),[S,y]=b.useState(0),{backups:Z}=De({deps:[S,r],setLoading:w,backupDate:r}),[ee,te]=b.useState(0),{backupSummary:se}=Ut({deps:[ee]}),[_,U]=b.useState(d?.find(g=>g.endpoint===u)),T=s?.settings?.autoBackup,P=()=>{i(g=>!g)},ne=()=>{te(g=>g+1)},oe=()=>{y(g=>g+1)},K=async g=>{await a.updateAutoBackup({input:{did:s.meta.did,autoBackup:g}})},X=async()=>{await a.abortBlockletBackup({input:{appPid:s.meta.did}})},ae=async(g,v)=>{try{x(R=>{const A=[...R];return A.push({...g,loading:!0}),A}),await a.addBlockletSpaceGateway({input:{did:s.meta.did,spaceGateway:g}}),u!==v&&await a.configBlocklet({input:{did:[s.meta.did],configs:[{key:L.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:v}]}}),U(g),P(),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"}))}catch(R){throw console.error(R),x(A=>[...A].filter(W=>W.did!==g.did)),R}},re=async g=>{g&&(g.endpoint===u&&(await a.configBlocklet({input:{did:[s.meta.did],configs:[{key:L.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:""}]}}),T?.enabled&&await K({enabled:!1})),await a.deleteBlockletSpaceGateway({input:{did:s.meta.did,spaceGatewayDid:g?.did}}),x(v=>{const R=[...v];return R.splice(R.indexOf(g),1),R}),U(g),P())},ie=async g=>{await Promise.all([a.updateBlockletSpaceGateway({input:{did:s.meta.did,where:{did:g.did},spaceGateway:g}}),u!==g.endpoint&&a.configBlocklet({input:{did:[s.meta.did],configs:[{key:L.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:g.endpoint}]}})]),B.success(o("storage.spaces.connectedWithName",{name:g?.name??"DID Spaces"})),P()},C=g=>g?.endpoint===u;return e.jsx(Lt,{value:{spaceGateways:d||[],selectedSpaceGateway:_,addSpaceGateway:ae,deleteSpaceGateway:re,updateSpaceGateway:ie,refreshSpaceGateways:P,spaceGatewaysLoading:l,spaceGatewaysFirstLoading:p,spaceGatewayIsSelected:C,updateAutoBackup:K,abortBlockletBackup:X,backupEndpoint:u,backupProgress:f,backups:Z,backupSummary:se,refreshBackupSummary:ne,refreshBackups:oe,setBackupDate:n,backupsLoading:k,autoBackup:T},children:t})}Te.propTypes={children:m.any.isRequired};function z(){return b.useContext(Ee)}function Ie({...t}){const{blocklet:o}=M(),{info:a}=N(),{t:s}=D(),r=Be({blocklet:o}),n=tt(a),{spaceGateways:c,addSpaceGateway:i}=z(),d={checkFn:Ce.create({baseURL:me(window.location.origin,st())}).get,webWalletUrl:n,extraParams:{appPid:o.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:a.did}},l=async({endpoint:p,name:f,did:u})=>{const k=await kt(p);if(!await jt(k)){B.error(s("storage.spaces.gateway.add.invalidUrl"));return}if(c.some(y=>y.endpoint===p)){B.error(s("storage.spaces.gateway.add.duplicate",{name:f}));return}await i({name:f,did:u,url:k,endpoint:p},p)},x=async({spaceGateway:p})=>{try{await l(p)}catch(f){console.error(f),B.error(Q(f))}};return e.jsx(ut,{...t,connectScope:"app",options:d,onSuccess:x})}function Re({...t}){const{t:o}=b.useContext(at),{blocklet:a,loading:s}=Et();if(a?.diskInfo){const r=(i,d,l)=>e.jsxs(j,{children:[i," ",e.jsx("strong",{children:d?nt(d):"empty"})]}),n=a.environments.reduce((i,d)=>(i[d.key]=d.value,i),{}),c=[{key:"appDir",name:o("blocklet.diskInfo.appDir"),value:r(n.BLOCKLET_APP_DIR,a.diskInfo.app)},{key:"dataDir",name:o("blocklet.diskInfo.dataDir"),value:r(n.BLOCKLET_DATA_DIR,a.diskInfo.data)},{key:"logDir",name:o("blocklet.diskInfo.logDir"),value:r(n.BLOCKLET_LOG_DIR,a.diskInfo.log)},{key:"cacheDir",name:o("blocklet.diskInfo.cacheDir"),value:r(n.BLOCKLET_CACHE_DIR,a.diskInfo.cache)}];return e.jsx(Mt,{component:"div",...t,children:c.map(i=>e.jsx(Dt,{valueComponent:"div",nameWidth:120,name:i.name,children:i.value},i.key))})}return s?e.jsx(O,{}):e.jsx(j,{children:o("blocklet.diskInfo.empty")})}const Mt=Ne(j)``;function Pe(){const{t}=D(),{setBackupDate:o,backupSummary:a}=z(),s=mt({key:"lg"}),r=b.useRef(null),n=_e(),c=b.useCallback(l=>{o(l)},[o]),i=b.useMemo(()=>{const l=E().add(1,"day"),x=l.subtract(1,"year"),p=new Map(a.map(u=>[u.date,{date:u.date,successCount:u.successCount,errorCount:u.errorCount}])),f=[];for(let u=x.clone();E(u).isBefore(l);u=u.add(1,"day")){const k=u.format("YYYY-MM-DD");f.push(p.get(k)||{date:k,successCount:0,errorCount:0})}return f},[a]),d=b.useMemo(()=>({grid:{containLabel:!0,right:10,top:30,bottom:12},tooltip:{formatter:k=>{const{date:w,successCount:S,errorCount:y}=i[k.dataIndex]||{date:k.data[0],successCount:0,errorCount:0};return[`<div>${t("common.time")}: ${w}</div>`,`<div>${t("common.succeeded")}: ${S}</div>`,`<div>${t("common.failed")}: ${y}</div>`].join(`
|
|
2
|
+
`)},backgroundColor:n.palette.background.paper,borderColor:n.palette.divider,textStyle:{color:n.palette.text.primary,fontSize:14},extraCssText:`box-shadow: ${n.shadows[2]}; border-radius: 4px;`,padding:[8,10]},visualMap:{show:!1,min:-12,max:12,pieces:[{min:Number.MIN_SAFE_INTEGER,max:-9,color:V[600]},{min:-9,max:-6,color:V[500]},{min:-6,max:-3,color:V[400]},{min:-3,max:-1,color:V[300]},{min:0,max:0,color:n.palette.grey[200]},{min:1,max:3,color:J[300]},{min:3,max:6,color:J[400]},{min:6,max:9,color:J[500]},{min:9,max:Number.MAX_SAFE_INTEGER,color:J[600]}],orient:"horizontal",left:"center",bottom:12,itemWidth:12,itemHeight:12,textStyle:{color:n.palette.text.secondary,fontSize:12}},calendar:{top:30,left:50,right:10,bottom:4,cellSize:[8,8],splitLine:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,color:n.palette.background.default},dayLabel:{show:!0,firstDay:0,nameMap:["","Mon","","Wed","","Fri",""],position:"start",margin:4,fontSize:10,color:n.palette.text.primary,fontWeight:"400",width:20},monthLabel:{show:!0,nameMap:"cn",align:"left",color:n.palette.text.primary,fontWeight:"400",fontSize:12,position:"start",margin:4,width:30,padding:[0,2]},yearLabel:{show:!1},range:[E().subtract(11,"month").startOf("month").format("YYYY-MM-DD"),E().endOf("month").format("YYYY-MM-DD")],orient:"horizontal"},series:{type:"heatmap",coordinateSystem:"calendar",data:i.map(k=>[k.date,k.errorCount?-k.errorCount:k.successCount]),label:{show:!1},itemStyle:{borderWidth:2,borderColor:n.palette.background.default,borderRadius:4},emphasis:{itemStyle:{borderWidth:2,borderColor:We[200],color:"inherit"}}}}),[i,t,n]);return e.jsxs(e.Fragment,{children:[e.jsx(h,{ref:r,sx:{maxWidth:"1280px",border:"1px solid",borderColor:"divider",padding:"8px",overflowX:"auto"},children:e.jsx(h,{sx:{width:"1200px",height:"180px",position:"relative"},children:e.jsx(Tt,{option:d,style:{height:"100%",width:"100%"},notMerge:!0,lazyUpdate:!1,opts:{renderer:"canvas"},onEvents:{click:l=>{l.componentType==="series"&&l.data&&c(l.data[0])}}})})}),e.jsx(h,{sx:{display:"flex",justifyContent:"flex-end",mt:1,mr:s?2:5,mb:2},children:e.jsxs(F,{direction:s?"column":"row",spacing:s?2:1,sx:{width:"100%",justifyContent:"flex-start",alignItems:s?"flex-start":"center"},children:[e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #8B5000 0%, #A36200 33%, #C17700 66%, #E29000 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.failed")})]}),e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,bgcolor:"grey.200",border:"1px solid",borderColor:"grey.200"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.without")})]}),e.jsxs(F,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[e.jsx(h,{sx:{width:32,height:12,borderRadius:.5,background:"linear-gradient(90deg, #9be9a8 0%, #40c463 33%, #30a14e 66%, #216e39 100%)"}}),e.jsx(j,{variant:"body2",sx:{color:"text.secondary"},children:t("storage.spaces.backup.succeeded")})]})]})})]})}const Nt=fe(({className:t,...o})=>e.jsx(ge,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Ae({status:t,message:o="",createdAt:a}){const{t:s}=D(),r=t===I.BACKUPS.STATUS.PROGRESS&&E().diff(a,"hours")>=I.BACKUPS.TIMEOUT_HOURS,n=r&&s("common.timeoutError"),c=t===I.BACKUPS.STATUS.PROGRESS&&!r,i=t===I.BACKUPS.STATUS.SUCCEEDED&&!r;return c?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(O,{sx:{marginRight:"4px"},size:"12px"}),s("common.progress")]}):i?e.jsx(q,{type:"success",children:s("common.succeeded")}):e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"error",children:s("common.failed")}),e.jsx(ge,{style:{display:"flex",alignItems:"center",flexShrink:0},title:o||n,children:e.jsx(be,{children:e.jsx(Ge,{style:{width:"24px",height:"24px"},color:"error"})})})]})}Ae.propTypes={status:m.string.isRequired,message:m.string,createdAt:m.string.isRequired};function ve({metadata:t={}}){const{t:o}=D();if(H(t))return e.jsx(q,{type:"success",children:o("common.succeeded")});const a=t.count||0,s=t.size||0,r=It(s,{iec:!0}),n=e.jsxs(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:[e.jsxs(j,{variant:"body2",children:[o("common.fileCount"),": ",a]}),e.jsxs(j,{variant:"body2",children:[o("common.fileSize"),": ",r]})]});return e.jsxs(h,{sx:{display:"inline-flex",alignItems:"center"},children:[e.jsx(q,{type:"success",children:o("common.succeeded")}),e.jsx(Nt,{title:n,style:{display:"flex",alignItems:"center",flexShrink:0},placement:"left",children:e.jsx(be,{children:e.jsx(Ke,{style:{width:"24px",height:"24px"},color:"primary"})})})]})}ve.propTypes={metadata:m.object};function Oe(){const{t,locale:o}=D(),{spaceGateways:a,backups:s,backupsLoading:r}=z(),n=b.useMemo(()=>[{label:"DID Space",name:"target",options:{customBodyRenderLite:i=>{const{targetUrl:d,targetName:l,status:x,createdAt:p}=s[i],f=x===I.BACKUPS.STATUS.PROGRESS&&E().diff(p,"hours")>=I.BACKUPS.TIMEOUT_HOURS,u=x===I.BACKUPS.STATUS.SUCCEEDED&&!f,k=l||a.find(w=>d?.includes(xe(w?.endpoint)))?.name||"Unknown DID Space";return u?e.jsx(Fe,{href:d,target:"_blank",sx:{fontSize:"16px"},children:k}):e.jsx(j,{variant:"body1",sx:{fontSize:"16px"},children:k})}}},{label:t("common.strategy"),name:"strategy",options:{customBodyRender:i=>{const d=t(i===0?"common.auto":"common.manual");return e.jsx(q,{children:d})}}},{label:t("common.startTime"),name:"createdAt",options:{customBodyRender:i=>E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.endTime"),name:"updatedAt",options:{customBodyRender:i=>H(i)?"":E(i).format("YYYY-MM-DD HH:mm:ss")}},{label:t("common.status"),name:"status",options:{customBodyRenderLite:i=>{const d=s?.[i]??{},{status:l,message:x,createdAt:p,metadata:f}=d,u=l===I.BACKUPS.STATUS.PROGRESS&&E().diff(p,"hours")>=I.BACKUPS.TIMEOUT_HOURS,k=l===I.BACKUPS.STATUS.PROGRESS&&!u,w=l===I.BACKUPS.STATUS.SUCCEEDED&&!u;return k?e.jsxs(j,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},children:[e.jsx(O,{sx:{marginRight:"4px"},size:"12px"}),t("common.progress")]}):w?e.jsx(ve,{metadata:f}):e.jsx(Ae,{status:l,message:x,createdAt:p})}}}],[s,a,t]),c=b.useMemo(()=>!s?.length,[s]);return e.jsx(e.Fragment,{children:c?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",color:"#9397A1",marginTop:"16px",marginBottom:"24px"},children:t("storage.spaces.record.emptyData")}):e.jsx(rt,{title:"",loading:r,data:s,columns:n,emptyNode:t("storage.spaces.record.emptyData",o),options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}})})}function _t(){const{t}=D();return e.jsxs(h,{children:[e.jsxs(h,{sx:{display:"flex",gap:3,flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minWidth:240},children:[e.jsx(xt,{style:{cursor:"pointer",width:"150px",height:"100%",maxHeight:160}}),e.jsx(j,{sx:{my:2,textAlign:"center",color:"text.secondary"},children:t("storage.spaces.connect.provider")}),e.jsx(Ie,{})]}),e.jsxs(h,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.spaces.backup.records")})}),e.jsx(Pe,{})]})]}),e.jsx(Oe,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2,mt:2},children:t("common.dataStorage")}),e.jsx(Re,{})]})}function ze({spaceGateway:t,onConfirm:o=()=>{},onCancel:a=()=>{}}){const{t:s}=D(),[r,n]=b.useState(!1),[c,i]=b.useState(!1),d=(p,f)=>{p?.preventDefault(),p?.stopPropagation(),n(f)},l=async p=>{try{p?.stopPropagation(),i(!0),await o?.(t),n(!1)}catch(f){console.error(f),B.error(`${s("storage.space.gateway.delete.failed")}: ${Q(f)}`)}finally{n(!1),i(!1)}},x=p=>{d(p,!1),a?.(p)};return e.jsxs(e.Fragment,{children:[e.jsxs(G,{color:"red",onClick:p=>d(p,!0),children:[e.jsx(Y,{style:{minWidth:24,color:"red"},children:e.jsx(Ye,{fontSize:"small"})}),e.jsx($,{style:{color:"red"},children:s("common.disconnect")})]}),e.jsx(it,{title:s("storage.spaces.gateway.delete.title"),open:r,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:c}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined",disabled:c}},onConfirm:l,onCancel:x,children:e.jsx(j,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForBackup",{name:`${t?.name}`})})})]})}ze.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool}).isRequired,onConfirm:m.func,onCancel:m.func};function Ue({spaceGateway:t,selected:o,onDelete:a=()=>{},onConnect:s=()=>{},enableSwitchToSpace:r=!0,backupInProgress:n=!1,...c}){const{abortBlockletBackup:i}=z(),[d,l]=b.useState(null),{t:x}=D(),[p,f]=b.useState(!1),u=(S,y)=>{S.stopPropagation(),S.preventDefault(),l(y&&S.currentTarget)},k=async S=>{try{f(!0),u(S,!1),await s(t)}catch(y){console.error(y),B.error(y.message)}finally{f(!1)}},w=async S=>{try{f(!0),u(S,!1),await i()}catch(y){console.error(y),B.error(y.message)}finally{f(!1)}};return e.jsxs(e.Fragment,{children:[p||t?.loading?e.jsx(O,{sx:{ml:1},size:"24px"}):e.jsx($e,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions",variant:"outlined",size:"small",onClick:S=>u(S,!0),...c,children:e.jsx(qe,{})}),e.jsxs(He,{id:"simple-menu",anchorEl:d,keepMounted:!0,open:!!d,onClose:S=>u(S,!1),children:[e.jsxs(G,{onClick:S=>{u(S,!1),window.open(Se(t.endpoint?Ct(t.endpoint):t.url,{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Qe,{fontSize:"small"})}),e.jsx($,{children:x("common.open")})]}),e.jsxs(G,{onClick:S=>{u(S,!1),window.open(Se(wt(t.endpoint),{allowDomains:null}))},children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Xe,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.strategy.viewBackupFiles")})]}),!o&&r&&e.jsxs(G,{onClick:k,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Ve,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.switchToSpace")})]}),n&&e.jsxs(G,{onClick:w,children:[e.jsx(Y,{style:{minWidth:24},children:e.jsx(Je,{fontSize:"small"})}),e.jsx($,{children:x("storage.spaces.connect.abortBlockletBackup")})]}),!n&&e.jsx(ze,{spaceGateway:t,onConfirm:async()=>{l(null),await a?.(t)},onCancel:()=>l(null)})]})]})}Ue.propTypes={spaceGateway:m.shape({name:m.string.isRequired,url:m.string.isRequired,protected:m.bool,endpoint:m.string.isRequired,loading:m.bool}).isRequired,selected:m.bool.isRequired,enableSwitchToSpace:m.bool,onDelete:m.func,onConnect:m.func,backupInProgress:m.bool};const Wt=fe(({className:t,...o})=>e.jsx(ge,{...o,classes:{popper:t}}))(()=>({".MuiTooltip-tooltip":{backgroundColor:"transparent",padding:0,margin:0,boxShadow:"none",maxWidth:"none"},".MuiTooltip-arrow":{color:"rgba(230, 235, 245, 1)"}}));function Le({spaceGateway:t,spaceStatus:o,selected:a,onConnected:s=()=>{},onDeleted:r=()=>{},onBackedUp:n=()=>{}}){const{t:c,locale:i}=D(),{blocklet:d}=M(),{api:l,info:{did:x}}=N(),{appDid:p,appName:f,appDescription:u,scopes:k,appUrl:w,referrer:S}=Be({blocklet:d}),{backupProgress:y,updateSpaceGateway:Z,deleteSpaceGateway:ee,refreshBackupSummary:te,refreshBackups:se}=z(),[_,U]=b.useState(!1),[T,P]=b.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:c("storage.spaces.authorize.title",{appName:f},i),scan:c("storage.spaces.authorize.scan",{appName:f},i),confirm:"",success:e.jsx(j,{gutterBottom:!0,children:c("storage.spaces.authorize.success")})},onClose:()=>{P(C=>({...C,open:!1}))}}),ne=a&&!_&&o===de.DISCONNECTED,oe=a&&!_&&!t.loading&&o===de.CONNECTED,K=a&&_&&o===de.CONNECTED&&y?.progress>=0,X=async()=>{try{if(await Bt(t?.endpoint)){await l.configBlocklet({input:{did:[d.meta.did],configs:[{key:L.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_BACKUP_ENDPOINT,value:t.endpoint}]}}),B.success(c("storage.spaces.connect.switchToSpaceSucceeded",{name:t.name?`(${t.name})`:""})),s?.(null,t);return}}catch(C){console.error(C),s?.(C,t);return}P(C=>({...C,open:!0,prefix:me(t.url,"space/api/did"),baseUrl:new URL(t.url).origin,checkFn:Ce.create({baseURL:me(t.url,"space")}).get,extraParams:{appDid:p,appName:f,appDescription:u,scopes:k,appUrl:w,referrer:S,nodeDid:x,spaceDid:t.did}}))},ae=async(C,g)=>{const v=g(C.endpoint),R=xe(v),A=C.space?g(C.space):{};if(t.did&&R!==t.did){P(Me=>({...Me,open:!1}));const W=c("storage.spaces.gateway.switch.failedForMismatchSpace",{name:A?.name?A.name:""});B.error(W),s?.(new Error(W),t);return}const ce={...t,name:A.name??"DID Space",did:A.did??xe(v),endpoint:v};await Z(ce),P(W=>({...W,open:!1})),s?.(null,ce)},re=async()=>{try{if(_)return;U(!0),await l.backupBlocklet({input:{appDid:d.appDid,to:"spaces"}})}catch(C){console.error(C),B.error(C.message),n?.(C,t)}finally{U(!0)}},ie=async()=>{try{await ee(t),B.success(c("storage.spaces.gateway.delete.succeeded",{name:t.name?`(${t.name})`:""})),r?.(null,t)}catch(C){console.error(C),r?.(C,t)}};return b.useEffect(()=>{y?.completed?(a&&(y?.progress===100?(B.success(c("storage.spaces.backupSuccessfully")),n?.(null,t)):y.message&&n?.(new Error(y?.message),t),y.progress=0,y.message=""),U(!1),te(),se()):y.progress&&U(!0)},[y]),e.jsxs(e.Fragment,{children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",".action-btn":{borderRadius:1,marginLeft:1}},children:[oe&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:re,children:c("storage.spaces.strategy.backupNow")}),ne&&e.jsx(le,{className:"action-btn",variant:"outlined",size:"small",onClick:X,children:c("storage.spaces.disconnected.reconnectNow")}),K&&e.jsx(Wt,{title:y?.message&&e.jsx(h,{sx:{p:1,borderRadius:1,boxShadow:2,color:"black",backgroundColor:"white"},children:e.jsx(j,{variant:"body2",children:y.message})}),children:e.jsxs(le,{className:"action-btn",variant:"outlined",size:"small",sx:{minWidth:70},children:[e.jsx(O,{variant:"determinate",value:y?.progress,size:14,sx:{mr:1}}),y?.progress,"%"]})}),e.jsx(ot,{forceConnected:!1,saveConnect:!1,prefix:T.prefix,open:T.open,popup:!0,action:T.action,baseUrl:T.baseUrl,checkFn:T.checkFn,onSuccess:ae,onClose:T.onClose,checkTimeout:T.checkTimeout,extraParams:T.extraParams,messages:T.messages,locale:i},"get-endpoint")]}),e.jsx(Ue,{sx:{minWidth:32,padding:"2px 4px",ml:1},spaceGateway:t,selected:a,onDelete:ie,onConnect:X,enableSwitchToSpace:y?.completed||H(y?.message),backupInProgress:K})]})}Le.propTypes={spaceGateway:m.shape({did:m.string.isRequired,name:m.string.isRequired,url:m.string.isRequired,endpoint:m.string.isRequired,protected:m.bool,loading:m.bool}).isRequired,spaceStatus:m.string.isRequired,selected:m.bool.isRequired,onConnected:m.func,onDeleted:m.func,onBackedUp:m.func};function Ft({...t}){const{t:o}=D();return e.jsxs(h,{...t,children:[e.jsx(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:o("storage.spaces.backup.records")})}),e.jsx(Pe,{}),e.jsx(Oe,{})]})}function Kt({...t}){const{t:o}=D(),{autoBackup:a,updateAutoBackup:s}=z(),r=async()=>{try{const n=!a?.enabled;await s({enabled:n}),B.success(o(n?"storage.spaces.autoBackup.enabled":"storage.spaces.autoBackup.disabled"))}catch(n){B.error(n.message)}};return e.jsx(Rt,{checked:!!a?.enabled,onChange:r,name:"enableWelcomePage",labelProps:{label:e.jsx(j,{sx:{marginRight:"8px"},children:e.jsx("span",{children:o("storage.spaces.autoBackup.title")})})},style:{...t.style}})}function Gt(){const{t}=D(),{spaceGateways:o,spaceGatewaysLoading:a,spaceGatewayIsSelected:s}=z(),r=a&&!o?.length,n=({spaceGateway:c,spaceStatus:i,selected:d,refresh:l})=>e.jsx(Le,{spaceGateway:c,spaceStatus:i,selected:d,onConnected:()=>l(),onBackedUp:x=>x&&l()});return e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:{xs:1,md:2},justifyContent:{xs:"center",md:"flex-start"},alignItems:{xs:"flex-start",md:"center"}},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",flexGrow:1},children:t("storage.spaces.connected.title")}),e.jsx(Kt,{}),e.jsx(Ie,{})]}),e.jsx(h,{sx:{mt:2},children:r?e.jsx(h,{sx:{display:"flex",justifyContent:"center"},children:e.jsx(O,{})}):e.jsx(he,{container:!0,spacing:2,children:e.jsx(e.Fragment,{children:o.map(c=>e.jsx(he,{size:{xs:12,md:6},children:e.jsx(ft,{endpoint:c.endpoint,selected:s(c),action:n},c.endpoint)},c.endpoint))})})}),e.jsx(Ft,{sx:{marginTop:"24px"}}),e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold",mb:2},children:t("common.dataStorage")}),e.jsx(Re,{})]})}function Yt(){const{spaceGatewaysFirstLoading:t,spaceGateways:o}=z();return t?e.jsx(we,{relative:"parent",children:e.jsx(O,{})}):H(o)?e.jsx(_t,{}):e.jsx(Gt,{})}function $t(){return e.jsx(Te,{children:e.jsx(Yt,{})})}function qt(){const{spaceGateway:t,settingStorageEndpoint:o,updateSpaceGateway:a,hasStorageEndpoint:s,loading:r,storageEndpoint:n}=At(),c=ue(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"16px"}));return r?e.jsx(we,{relative:"parent",children:e.jsx(O,{})}):e.jsxs(h,{sx:{maxWidth:"md",position:"relative"},children:[s?e.jsx(gt,{spaceGateway:t,settingStorageEndpoint:o}):e.jsx(ht,{}),e.jsx(h,{sx:c,children:e.jsx(St,{onConnect:a,storageEndpoint:n})})]})}function Ht(){const{t}=D();return e.jsxs(Pt,{children:[e.jsxs(F,{spacing:1,sx:{marginBottom:2},children:[e.jsx(j,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:t("storage.appLevel.title")}),e.jsx(j,{sx:{color:"text.secondary"},children:t("storage.appLevel.description")})]}),e.jsx(qt,{})]})}function Qt({navOrientation:t="vertical",...o}){const{t:a,locale:s}=D(),{blocklet:r}=M(),n=lt({key:"md"}),[c,i]=et(),d=c.get("tab")||"backup",l=n?"horizontal":t,x=ue(()=>{const w=[{label:a("common.backup"),value:"backup"}],S=r?.capabilities?.didSpace;return(S===L.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED||S===L.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP)&&w.push({label:a("common.storage"),value:"storage"}),w},[s,l]),f=ue(()=>({backup:e.jsx($t,{}),storage:e.jsx(Ht,{})}))[d],u=w=>{i(S=>(w==="backup"?S.delete("tab"):S.set("tab",w),S))};if(x.length<=1)return e.jsx(pe,{children:f});const k=e.jsx(ct,{tabs:x,current:d,orientation:l,onChange:u,sx:[{borderRight:1,height:"100%",borderColor:"divider"},l==="horizontal"&&{borderRight:0}]});if(l==="vertical")return e.jsx(h,{...o,children:e.jsxs(F,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(h,{sx:{flexShrink:0},children:e.jsx(ye,{left:k})}),e.jsx(h,{sx:{flexGrow:1,minWidth:0},children:e.jsx(pe,{sx:{mt:1},children:f})})]})});if(l==="horizontal")return e.jsxs(h,{...o,children:[e.jsx(ye,{left:k}),e.jsx(pe,{sx:{mt:2},children:f})]})}Qt.propTypes={navOrientation:m.oneOf(["vertical","horizontal"])};const pe=fe(h)`
|
|
3
3
|
position: relative;
|
|
4
4
|
min-height: 66vh;
|
|
5
5
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,at as r}from"./vendor-mui-core-DnR6WYuU.js";import{r as s}from"./vendor-react-CTtPmzVP.js";import{aT as a}from"./vendor-ux-
|
|
1
|
+
import{j as t,at as r}from"./vendor-mui-core-DnR6WYuU.js";import{r as s}from"./vendor-react-CTtPmzVP.js";import{aT as a}from"./vendor-ux-B5w9dHEo.js";import{V as n}from"./index-BlSveGp8.js";import"./vendor-utils-drLlzTVq.js";import"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BwnwoPBM.js";function l(){const{t:o}=s.useContext(a);return t.jsx(p,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const p=r.main``;export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as r}from"./vendor-ux-
|
|
1
|
+
import{_ as r}from"./vendor-ux-B5w9dHEo.js";import{be as _,bf as e}from"./index-BlSveGp8.js";const m={en:_(e),ar:()=>r(()=>import("./ar-BBr9bsOg.js"),[],import.meta.url).then(t=>_(t.default)),de:()=>r(()=>import("./de-CDBOH3k5.js"),[],import.meta.url).then(t=>_(t.default)),es:()=>r(()=>import("./es-BJ8CsIZi.js"),[],import.meta.url).then(t=>_(t.default)),fr:()=>r(()=>import("./fr-DSXQFpNy.js"),[],import.meta.url).then(t=>_(t.default)),hi:()=>r(()=>import("./hi-DLsQ4VdX.js"),[],import.meta.url).then(t=>_(t.default)),id:()=>r(()=>import("./id-AzAQyOHL.js"),[],import.meta.url).then(t=>_(t.default)),ja:()=>r(()=>import("./ja-C3ccbBe-.js"),[],import.meta.url).then(t=>_(t.default)),ko:()=>r(()=>import("./ko-9Vbo8tR2.js"),[],import.meta.url).then(t=>_(t.default)),pt:()=>r(()=>import("./pt-iqygmSLa.js"),[],import.meta.url).then(t=>_(t.default)),ru:()=>r(()=>import("./ru-BkfMvpq6.js"),[],import.meta.url).then(t=>_(t.default)),th:()=>r(()=>import("./th-D-pgFsDa.js"),[],import.meta.url).then(t=>_(t.default)),vi:()=>r(()=>import("./vi-BuffIn3I.js"),[],import.meta.url).then(t=>_(t.default)),"zh-TW":()=>r(()=>import("./zh-tw-BiloxWNq.js"),[],import.meta.url).then(t=>_(t.default)),zh:()=>r(()=>import("./zh-CSl2KD_S.js"),[],import.meta.url).then(t=>_(t.default))};export{m as t};
|