@abtnode/webapp 1.16.54-beta-20251030-060219-f2f1ed96 → 1.16.54-beta-20251031-043051-f3b56e3a
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-DenpZUIq.js → AdapterDayjs-B30A4e9V.js} +1 -1
- package/dist/assets/{Add-C7LRvIC3.js → Add-BqMKSndg.js} +1 -1
- package/dist/assets/ArrowDropDown-CQnQ9y90.js +1 -0
- package/dist/assets/{Autocomplete-CdGK2sfo.js → Autocomplete-DNyfxOFp.js} +1 -1
- package/dist/assets/{Breadcrumbs-CALUKrKQ.js → Breadcrumbs-D07iUOi2.js} +1 -1
- package/dist/assets/{ButtonGroup-CK4D_Ln2.js → ButtonGroup-Dh6lYgZM.js} +1 -1
- package/dist/assets/{CSSTransition-Dwgb1QPW.js → CSSTransition-BfkQpTwd.js} +1 -1
- package/dist/assets/{CallMerge-8YDqybOh.js → CallMerge-B-Wn3wH-.js} +1 -1
- package/dist/assets/{CardContent-CVZJ4z1h.js → CardContent-D50ZN2XJ.js} +1 -1
- package/dist/assets/{ChevronLeft-CEo37UIa.js → ChevronLeft-Uf3Zj0ny.js} +1 -1
- package/dist/assets/{ChevronRight-ByhLYhtZ.js → ChevronRight-CqQwaL1d.js} +1 -1
- package/dist/assets/{Clear-Cw2o-hjt.js → Clear-G8IA_JS7.js} +1 -1
- package/dist/assets/{DeleteOutline-C2P0A6Ux.js → DeleteOutline-BVyycjCe.js} +1 -1
- package/dist/assets/{Done-Bo9YVoGQ.js → Done-C3Xrj0cc.js} +1 -1
- package/dist/assets/{Edit-DAdo7ch2.js → Edit-0Bz5MCrU.js} +1 -1
- package/dist/assets/{ErrorOutline-VCscB3DM.js → ErrorOutline-Da9J9PWf.js} +1 -1
- package/dist/assets/{FilterList-sINld31b.js → FilterList-Cid-oBR0.js} +1 -1
- package/dist/assets/{Google-ItITGWAJ.js → Google-zFyeAexf.js} +1 -1
- package/dist/assets/{HelpOutline-QBu85sCP.js → HelpOutline-kYF98cPy.js} +1 -1
- package/dist/assets/{KeyboardArrowDown-Ctt8B4kp.js → KeyboardArrowDown-PDLBPIxK.js} +1 -1
- package/dist/assets/{Launch-nOPSX3Xw.js → Launch-Cw0IvqYQ.js} +1 -1
- package/dist/assets/{Link-CCkeWWJ4.js → Link-AjRLM7zT.js} +1 -1
- package/dist/assets/{ListItemButton-BdFzmSa7.js → ListItemButton-BH7vk_M8.js} +1 -1
- package/dist/assets/{ListSubheader-BicxfAd1.js → ListSubheader-XzhijlHC.js} +1 -1
- package/dist/assets/{LoadingButton-BkRqIXaM.js → LoadingButton-DX-iBNkr.js} +1 -1
- package/dist/assets/{MoreVert-CI4HEjN0.js → MoreVert-YC-2RtuS.js} +1 -1
- package/dist/assets/{OpenInNew-CNsJ4BFR.js → OpenInNew-Cs4iLXNI.js} +1 -1
- package/dist/assets/{Refresh-D8ICG9YW.js → Refresh-4WpQ7G17.js} +1 -1
- package/dist/assets/{Search-BuS9kxDD.js → Search-DVAqIV8y.js} +1 -1
- package/dist/assets/{Stepper-C9zuG0lI.js → Stepper-cPSi1Mx5.js} +1 -1
- package/dist/assets/{Switch-C_P2C8Xa.js → Switch-7IuDphWe.js} +1 -1
- package/dist/assets/{TableSearch-D9jLZhkp.js → TableSearch-CuYawmb9.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-zhxAcoRO.js → ToggleButtonGroup-DzPH8xLQ.js} +1 -1
- package/dist/assets/{UnfoldMore-CuZG_lwm.js → UnfoldMore-BkCizcCL.js} +1 -1
- package/dist/assets/{Verified-DeUAmldO.js → Verified-C_RgwaGs.js} +1 -1
- package/dist/assets/{VerifiedUser-DQAD_Zf4.js → VerifiedUser-cla-gxoO.js} +1 -1
- package/dist/assets/{ViewList-BncCYLkI.js → ViewList-Bb5x5Htb.js} +1 -1
- package/dist/assets/{_createAggregator-CCg6154Y.js → _createAggregator-lATQ9S4G.js} +1 -1
- package/dist/assets/{actions-lsvecBT1.js → actions-BTuanQTE.js} +1 -1
- package/dist/assets/{actions-CsBw5W6U.js → actions-DHHW8Ne9.js} +1 -1
- package/dist/assets/{agreement-BUjmPRc2.js → agreement-Dtg6hLTZ.js} +1 -1
- package/dist/assets/api-2w3ONNYp.js +1 -0
- package/dist/assets/{appearance-bv3rI7lk.js → appearance-DW09NETq.js} +1 -1
- package/dist/assets/{audit-logs-kv4f2FwD.js → audit-logs-DBzxIdH4.js} +1 -1
- package/dist/assets/{base-chart-CXk2GzK7.js → base-chart-mE2yuOdY.js} +1 -1
- package/dist/assets/{blocklet-DwHEwBiZ.js → blocklet-Dr_LK1Q2.js} +1 -1
- package/dist/assets/{chain-C7UmgQl6.js → chain-Dc18Nz_k.js} +1 -1
- package/dist/assets/{click-to-copy-Deba7opf.js → click-to-copy-PtCfJ87M.js} +1 -1
- package/dist/assets/cloneDeep-ClEOqAIj.js +1 -0
- package/dist/assets/{collapse-Pv0Zul5P.js → collapse-DXrrkJjt.js} +1 -1
- package/dist/assets/{config-navigation-COyT0pBq.js → config-navigation-C2qj2cw-.js} +3 -3
- package/dist/assets/{connect-to-Ds9JfRig.js → connect-to-CQ8x9XUb.js} +1 -1
- package/dist/assets/{cssMode-vJ8GoqNb.js → cssMode-BKzDL91g.js} +1 -1
- package/dist/assets/{delete-confirm-COg-Kyx9.js → delete-confirm-B5zJVhDV.js} +1 -1
- package/dist/assets/{depsEqual-C_BH-hM0.js → depsEqual-Dxl6Fkos.js} +1 -1
- package/dist/assets/{detail-BP3meRyi.js → detail-Qa1bqakf.js} +3 -3
- package/dist/assets/{domains-BgYJ9l-y.js → domains-pIwj2yNQ.js} +1 -1
- package/dist/assets/{download-h98wBvTQ.js → download-sLIfOCnR.js} +1 -1
- package/dist/assets/{edit.svg-BR_aQB1u.js → edit.svg-BBcWA2Yv.js} +1 -1
- package/dist/assets/emotion-cache.browser.esm-CHE9Rgf-.js +1 -0
- package/dist/assets/engine-V2gGW1_S.js +1 -0
- package/dist/assets/{freemarker2-DsLYTJ4D.js → freemarker2-HuIW7jf4.js} +1 -1
- package/dist/assets/{get-safe-url-D-cF2nX-.js → get-safe-url-D_h8kBns.js} +1 -1
- package/dist/assets/getValidReactChildren-2xps4qz5.js +1 -0
- package/dist/assets/{graphqlMode-sfVuma8f.js → graphqlMode-Dy0N-jd0.js} +2 -2
- package/dist/assets/{handlebars-DRbnxjAX.js → handlebars-BiP-Y0Yn.js} +1 -1
- package/dist/assets/{html-title-C0ZWlysm.js → html-title-BGLe2_e3.js} +1 -1
- package/dist/assets/{html-isoT3Ltk.js → html-xIZVKqOO.js} +1 -1
- package/dist/assets/{htmlMode-BHIP1cFY.js → htmlMode-CP4qCSLp.js} +1 -1
- package/dist/assets/{iframe-DFPz5jZg.js → iframe-C807ybR2.js} +1 -1
- package/dist/assets/{index-C6l5hpTj.js → index-B840ZI2-.js} +1 -1
- package/dist/assets/{index-CDvh7GeF.js → index-BMhMlOF3.js} +1 -1
- package/dist/assets/{index-CXWQi8L0.js → index-BQjC5QVz.js} +1 -1
- package/dist/assets/{index-DkI6knq_.js → index-BSuv2S-j.js} +2 -2
- package/dist/assets/{index-DbK31dFt.js → index-BfokqgHy.js} +3 -3
- package/dist/assets/{index-1KXTwIqr.js → index-BkVWAwPz.js} +1 -1
- package/dist/assets/{index-CE07KwkJ.js → index-Bq1Ow9Ag.js} +1 -1
- package/dist/assets/{index-BvQkWF2c.js → index-BveOElcP.js} +3 -3
- package/dist/assets/{index-DuXssMw-.js → index-C4kLAKHD.js} +1 -1
- package/dist/assets/{index-C9BjuzFT.js → index-C5LYAduR.js} +1 -1
- package/dist/assets/{index-CfyiyNfx.js → index-C76LlcBP.js} +1 -1
- package/dist/assets/{index-Ce2QiSVh.js → index-CFpGjsgX.js} +3 -3
- package/dist/assets/{index-7dhA_sHk.js → index-CUY9KYjX.js} +3 -3
- package/dist/assets/{index-D8tp1rSW.js → index-CZle5CbS.js} +1 -1
- package/dist/assets/{index-B7LBtGVg.js → index-C_WCV7QS.js} +1 -1
- package/dist/assets/{index-uKViDkd6.js → index-Cax6HGSy.js} +1 -1
- package/dist/assets/{index-DpQpV_b_.js → index-CcbY3K1e.js} +1 -1
- package/dist/assets/{index-CUYhzHNx.js → index-CfO1ocPd.js} +1 -1
- package/dist/assets/index-ChGhj4bz.js +1 -0
- package/dist/assets/{index-fK2TFREh.js → index-CnHjhHdP.js} +1 -1
- package/dist/assets/{index-UpEYMAvU.js → index-Cq343AIm.js} +1 -1
- package/dist/assets/{index-BBfrnytq.js → index-Cww9znhR.js} +1 -1
- package/dist/assets/{index-Cdhabg4y.js → index-DAP7V0hj.js} +1 -1
- package/dist/assets/{index-CiPRigy-.js → index-DIAjkldX.js} +1 -1
- package/dist/assets/{index-BX8O0ZHV.js → index-DTOWo4jq.js} +1 -1
- package/dist/assets/{index-D9scRZrq.js → index-DUCYys1s.js} +1 -1
- package/dist/assets/{index-CKt7JY59.js → index-DZoHX92P.js} +1 -1
- package/dist/assets/{index-D4MQDk9z.js → index-Dea9QPzX.js} +1 -1
- package/dist/assets/{index-mOCIkNdQ.js → index-DfnCJwAx.js} +1 -1
- package/dist/assets/{index-roMS8d9X.js → index-DmY-ECSO.js} +1 -1
- package/dist/assets/{index-CLLICC2z.js → index-DoFlCh-O.js} +1 -1
- package/dist/assets/{index-aUYmGzbh.js → index-DoLUCdoo.js} +1 -1
- package/dist/assets/{index-BCbmqTUZ.js → index-Fs3E_gDS.js} +1 -1
- package/dist/assets/{index-HVpfUEsS.js → index-T0ij7gEZ.js} +1 -1
- package/dist/assets/{index-CHl2w7db.js → index-VAKOMEgj.js} +1 -1
- package/dist/assets/{index-DxTV8NxB.js → index-YMUJi64L.js} +1 -1
- package/dist/assets/{index-VCTk1BN0.js → index-ZBdt2zLB.js} +1 -1
- package/dist/assets/{index-CDuEhJSp.js → index-aDyspHb_.js} +1 -1
- package/dist/assets/{index-DfjJClPZ.js → index-dbT-WrDi.js} +1 -1
- package/dist/assets/{index-DA08Z61I.js → index-eA_btxYY.js} +9 -9
- package/dist/assets/{index-xeh44vu3.js → index-eWsGrR-q.js} +1 -1
- package/dist/assets/{index-WuP8F7wO.js → index-fRxZFZ5g.js} +3 -3
- package/dist/assets/{index-D5TSjYwo.js → index-jGiUSwaE.js} +1 -1
- package/dist/assets/{index-BoLX042h.js → index-jRVN_1vm.js} +1 -1
- package/dist/assets/{index-BX8TIOlx.js → index-wvWBQjSc.js} +1 -1
- package/dist/assets/{index-CywXCFTo.js → index-xeIZXHWV.js} +1 -1
- package/dist/assets/{index-DJypfjpv.js → index-zI6sbIgD.js} +1 -1
- package/dist/assets/{index.esm-DfrzxWuO.js → index.esm-DzozubHa.js} +1 -1
- package/dist/assets/{install-from-url-D3DrZQJS.js → install-from-url-CgprkeO6.js} +1 -1
- package/dist/assets/{invitation-CH_Lzck2.js → invitation-BKHc6hH4.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-CcoUfdQX.js → is-path-prefix-equal-B-eGi6RZ.js} +1 -1
- package/dist/assets/{item-9zvzeQYB.js → item-lCXo2qau.js} +1 -1
- package/dist/assets/{javascript-DdnSMb4b.js → javascript-Dpm5asP_.js} +1 -1
- package/dist/assets/{jsonMode-Bg0Q4n_0.js → jsonMode-C1BoXm9W.js} +1 -1
- package/dist/assets/{liquid-CXdUQAQf.js → liquid-DPLK1AAV.js} +1 -1
- package/dist/assets/{list-header-Cl8gLzfo.js → list-header-C68bt277.js} +1 -1
- package/dist/assets/{lock.svg-B_LWkLVc.js → lock.svg-CvsvGAq6.js} +1 -1
- package/dist/assets/{log-ayIsHfiS.js → log-DvrNFWSu.js} +1 -1
- package/dist/assets/{lottie-react.esm-CH2GSfx5.js → lottie-react.esm-OxE6_tus.js} +1 -1
- package/dist/assets/{mdx-BfILcfPl.js → mdx-3eKvkGDE.js} +1 -1
- package/dist/assets/{memory-BOVBleTW.js → memory-CA11HykX.js} +1 -1
- package/dist/assets/{metric-D-t8b3PS.js → metric-DmeCDHRO.js} +1 -1
- package/dist/assets/omit-DyDj32t1.js +1 -0
- package/dist/assets/{overview-C_qhYB7p.js → overview-Ccocwg3J.js} +1 -1
- package/dist/assets/{permission-C9Y2XRsP.js → permission-B-96KXQR.js} +1 -1
- package/dist/assets/{preference-CqWbCajg.js → preference-D8eTwplp.js} +3 -3
- package/dist/assets/{python-DEhmOuwB.js → python-OBbKDfQA.js} +1 -1
- package/dist/assets/{raf-schd.esm-mo0KJqn3.js → raf-schd.esm-Y4eP19zD.js} +1 -1
- package/dist/assets/{razor-BRS1KTKZ.js → razor-CtidL9Xi.js} +1 -1
- package/dist/assets/{rotate-session-key-8bwJGNzn.js → rotate-session-key-BxXPHSLd.js} +1 -1
- package/dist/assets/{runtime-BFIA0peM.js → runtime-Dcq9x2vY.js} +1 -1
- package/dist/assets/schema-B9mRrKya.js +1 -0
- package/dist/assets/sdk-COh1FZhu.js +1 -0
- package/dist/assets/{service-Carp72X0.js → service-SNwwJvI1.js} +1 -1
- package/dist/assets/{shorten-label-SgarF_Ma.js → shorten-label-Rku853mZ.js} +1 -1
- package/dist/assets/{simple-select-DvScotEA.js → simple-select-D-ySkAbw.js} +1 -1
- package/dist/assets/{spaces-DT0rG8Ke.js → spaces-BltTDIy4.js} +1 -1
- package/dist/assets/{status-Cq_pMyWm.js → status-CeJnlK1J.js} +1 -1
- package/dist/assets/{status-D8QofLif.js → status-vKMdrOM1.js} +1 -1
- package/dist/assets/{switch-control-lkjjrTch.js → switch-control-C_8dVEZN.js} +1 -1
- package/dist/assets/{table-icons-DTHGIjyx.js → table-icons-rcNxsEUa.js} +1 -1
- package/dist/assets/{team-CWK-YI0_.js → team-Bz9weh46.js} +1 -1
- package/dist/assets/{toLower-Cg__GXKz.js → toLower-Cg3LtCaI.js} +1 -1
- package/dist/assets/toUpper-RY2q0HbV.js +1 -0
- package/dist/assets/{traffic-BzgoMKvP.js → traffic-0lJHbFOR.js} +1 -1
- package/dist/assets/{tsMode-DQfrAplw.js → tsMode-CU1vw8A1.js} +1 -1
- package/dist/assets/{typescript-CIO-eep4.js → typescript-A4RDRVZM.js} +1 -1
- package/dist/assets/{url-evaluation-CqBTA_SW.js → url-evaluation-D_cqsSRO.js} +1 -1
- package/dist/assets/{url-join-DeVtpQ7K.js → url-join-CI8YXAz9.js} +1 -1
- package/dist/assets/{use-mobile-C3U3R5Q3.js → use-mobile-BW2lFrSI.js} +1 -1
- package/dist/assets/{use-mobile-BAXyhqNj.js → use-mobile-DzC9s-qv.js} +1 -1
- package/dist/assets/{useAsync-CQocXlD2.js → useAsync-wJrllzXI.js} +1 -1
- package/dist/assets/{useAsyncRetry-XGg3A4Qt.js → useAsyncRetry-JUvvbo59.js} +1 -1
- package/dist/assets/{useLocalStorage-BMre6evC.js → useLocalStorage-C-HC7dIw.js} +1 -1
- package/dist/assets/{useThemeProps-DhBxLZiP.js → useThemeProps-xP0TFqAL.js} +1 -1
- package/dist/assets/{util-BGedStqW.js → util-DilHH-kW.js} +1 -1
- package/dist/assets/{wait-container-DcW-2Rk6.js → wait-container-0kquAukH.js} +1 -1
- package/dist/assets/{without-wallet-BCJJXxIm.js → without-wallet-DRpZoYCR.js} +1 -1
- package/dist/assets/wrap-locale-CEzbOAhF.js +1 -0
- package/dist/assets/{xml-BWysbc0z.js → xml-C21FWWuV.js} +1 -1
- package/dist/assets/{yaml-DPrHMwAz.js → yaml-Bw6oRx8U.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/ArrowDropDown-DT6bL4ID.js +0 -1
- package/dist/assets/api-VW_-gBps.js +0 -1
- package/dist/assets/cloneDeep-DtvXQkbq.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-D_e1cJtm.js +0 -1
- package/dist/assets/engine-DSF2IlH7.js +0 -1
- package/dist/assets/getValidReactChildren-BAFkQ3fw.js +0 -1
- package/dist/assets/index-DuHKLnMJ.js +0 -1
- package/dist/assets/omit-DZ74swD3.js +0 -1
- package/dist/assets/schema-utl-s0UR.js +0 -1
- package/dist/assets/sdk-BXxj54Wv.js +0 -1
- package/dist/assets/toUpper-DO7qEtmV.js +0 -1
- package/dist/assets/wrap-locale-CHnqR1BC.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as le,j as e,hw as ce,bd as ue,bn as Z,V as G,gj as ee,f7 as te,aP as re,cs as u,H as S,hx as M,K as R,t as x,hy as V,aU as H,O as p,ay as de,v as N,s as ie,aV as ne,z as me,y as fe,aH as he,r as U,p as xe,bz as pe}from"./index-DbK31dFt.js";import{T as ve}from"./html-title-C0ZWlysm.js";import{u as se,C as m}from"./index.esm-DfrzxWuO.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-Pv0Zul5P.js";import{u as ae}from"./blocklet-DwHEwBiZ.js";import{S as $}from"./Switch-C_P2C8Xa.js";const Re=le(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function ke(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function we(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=E;var t=b(ce()),d=b(ke());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function E(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var X;function Te(){return X||(X=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(we());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Se=Te();const Ee=ue(Se),B={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...B},s?.settings?.notification?.email||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(B))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,T=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...B},y?.settings?.notification?.email||{});q(oe),T&&S.success(t("oauth.saveSuccess"))}catch(y){if(T)S.error(y.message||t("oauth.saveFailed"));else throw y}}),W=u(async(r,g,T)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),S.success(t("notification.email.testSuccess"))}catch(y){S.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:T=>{l.testReceiver=T.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(T){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await W(r,g,y),T()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Ee(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),k=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),w=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?w:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,D={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...D},s?.settings?.notification?.pushKit||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,k,v=!0)=>{try{const{blocklet:w}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...D},w?.settings?.notification?.pushKit||{});q(I),v&&S.success(t("oauth.saveSuccess"))}catch(w){if(v)S.error(w.message||t("oauth.saveFailed"));else throw w}}),W=u(async(o,k)=>{try{i.isDirty&&await C(o,k,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,w=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:w}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),S.success(t("notification.pushKit.testSuccess"))}catch(v){S.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,k)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await W(o,k),v()}})}),F=u(o=>{const k=o?.trim();return k?V(k)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,Y=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=U.useState(Y[0].value),{locale:t}=U.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=U.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:Y,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
1
|
+
import{aF as le,j as e,hw as ce,bd as ue,bn as Z,V as G,gj as ee,f7 as te,aP as re,cs as u,H as S,hx as M,K as R,t as x,hy as V,aU as H,O as p,ay as de,v as N,s as ie,aV as ne,z as me,y as fe,aH as he,r as U,p as xe,bz as pe}from"./index-BfokqgHy.js";import{T as ve}from"./html-title-BGLe2_e3.js";import{u as se,C as m}from"./index.esm-DzozubHa.js";import{S as h,A as je,a as be,b as ge,c as ye}from"./collapse-DXrrkJjt.js";import{u as ae}from"./blocklet-Dr_LK1Q2.js";import{S as $}from"./Switch-7IuDphWe.js";const Re=le(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}));var K={exports:{}},O={exports:{}},z={exports:{}},J;function ke(){return J||(J=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=t;function t(d){return d==null}c.exports=s.default,c.exports.default=s.default}(z,z.exports)),z.exports}var Q;function we(){return Q||(Q=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=E;var t=b(ce()),d=b(ke());function b(n){return n&&n.__esModule?n:{default:n}}var f=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,P=/^[-+]?[0-9]+$/;function E(n,i){(0,t.default)(n),i=i||{};var _=i.allow_leading_zeroes===!1?f:P,q=!i.hasOwnProperty("min")||(0,d.default)(i.min)||n>=i.min,l=!i.hasOwnProperty("max")||(0,d.default)(i.max)||n<=i.max,a=!i.hasOwnProperty("lt")||(0,d.default)(i.lt)||n<i.lt,C=!i.hasOwnProperty("gt")||(0,d.default)(i.gt)||n>i.gt;return _.test(n)&&q&&l&&a&&C}c.exports=s.default,c.exports.default=s.default}(O,O.exports)),O.exports}var X;function Te(){return X||(X=1,function(c,s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=b;var t=d(we());function d(f){return f&&f.__esModule?f:{default:f}}function b(f){return(0,t.default)(f,{allow_leading_zeroes:!1,min:0,max:65535})}c.exports=s.default,c.exports.default=s.default}(K,K.exports)),K.exports}var Se=Te();const Ee=ue(Se),B={enabled:!1,secure:!1,from:"",host:"",port:"",user:"",password:"",companyName:"",companyLink:"",companyAddress:"",supportEmail:""};function Ce(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...B},s?.settings?.notification?.email||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(B))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(r,g,T=!0)=>{try{const{blocklet:y}=await c.configNotification({input:{did:f,notification:JSON.stringify({email:r})}}),oe=Object.assign({...B},y?.settings?.notification?.email||{});q(oe),T&&S.success(t("oauth.saveSuccess"))}catch(y){if(T)S.error(y.message||t("oauth.saveFailed"));else throw y}}),W=u(async(r,g,T)=>{try{i.isDirty&&await C(r,g,!1),await c.sendEmail({input:{did:f,receiver:T,email:JSON.stringify({body:"Your SMTP configuration is correct!",title:"Test email",type:"notification",attachments:[{type:"link",data:{url:"https://community.arcblock.io",title:"Community",image:"https://community.arcblock.io/.well-known/service/blocklet/logo-rect-dark",utm:{campaign:"test-campaign"}}}],utm:{content:"test-email-button"}})}}),S.success(t("notification.email.testSuccess"))}catch(y){S.error(y.message||t("notification.email.testfailed"))}}),A=u((r,g)=>{l.testReceiver=localStorage.getItem("test-receiver")||"",l.testReceiverError="",d.open({title:t("notification.email.testSendEmail"),content:()=>e.jsx(R,{sx:{width:"300px"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.email.inputTestReceiver"),value:l.testReceiver,onChange:T=>{l.testReceiver=T.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(T){const y=l.testReceiver?.trim();if(!y){l.testReceiverError=t("notification.email.receiverRequired");return}if(!M(y)){l.testReceiverError=t("notification.email.receiverInvalid");return}l.testReceiverError="",await W(r,g,y),T()}})}),F=u(r=>{const g=r?.trim();return g?M(g)?!0:t("notification.email.fromInvalid"):t("notification.email.fromRequired")}),L=u(r=>{const g=r?.trim();return g?V(g,{require_host:!1,protocols:[]})?!0:t("notification.email.hostInvalid"):t("notification.email.hostRequired")}),o=u(r=>r?Ee(r)?!0:t("notification.email.portInvalid"):t("notification.email.portRequired")),k=u(r=>r?.trim()?!0:t("notification.email.userRequired")),v=u(r=>r?.trim()?!0:t("notification.email.passwordRequired")),w=u(r=>r?.trim()&&!V(r,{protocols:["http","https"],require_protocol:!0})?t("notification.email.linkInvalid"):!0),I=u(r=>r?.trim()&&!M(r)?t("notification.email.emailInvalid"):!0),j=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(Pe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.email.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:r})=>e.jsx(H,{control:e.jsx($,{checked:r.value,...r})})})}),e.jsx(h,{title:t("notification.email.from"),children:e.jsx(m,{name:"from",control:n,rules:{validate:a?F:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,label:t("notification.email.from"),error:!!i.errors[r.name],helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.host"),children:e.jsx(m,{name:"host",control:n,rules:{validate:a?L:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.host"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.port"),children:e.jsx(m,{name:"port",control:n,rules:{validate:a?o:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"number",error:!!i.errors[r.name],label:t("notification.email.port"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.user"),children:e.jsx(m,{name:"user",control:n,rules:{validate:a?k:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,error:!!i.errors[r.name],label:t("notification.email.user"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.password"),children:e.jsx(m,{name:"password",control:n,rules:{validate:a?v:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",required:!0,type:"password",error:!!i.errors[r.name],label:t("notification.email.password"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.secure"),children:e.jsx(m,{name:"secure",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(H,{control:e.jsx($,{checked:r.value,...r,disabled:!a})})})})}),e.jsxs(je,{children:[e.jsxs(be,{expandIcon:e.jsx(ge,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:[t("notification.email.signature"),e.jsx(de,{title:t("notification.email.signatureTooltip"),children:e.jsx(Re,{fontSize:"small",sx:{ml:1,cursor:"help"}})})]}),e.jsxs(ye,{children:[e.jsx(h,{title:t("notification.email.companyName"),children:e.jsx(m,{name:"companyName",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyName"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyLink"),children:e.jsx(m,{name:"companyLink",control:n,rules:{validate:a?w:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyLink"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.companyAddress"),children:e.jsx(m,{name:"companyAddress",control:n,rules:{validate:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",error:!!i.errors[r.name],label:t("notification.email.companyAddress"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})}),e.jsx(h,{title:t("notification.email.supportEmail"),children:e.jsx(m,{name:"supportEmail",control:n,rules:{validate:a?I:j},render:({field:r})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...r,size:"small",type:"email",error:!!i.errors[r.name],label:t("notification.email.supportEmail"),helperText:i.errors[r.name]?.message||" ",disabled:!a})})})})]})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const Pe=ie(ne)``,D={enabled:!1,endpoint:"",did:void 0,pushPath:void 0};function _e(){const{api:c}=Z(),{blocklet:s}=ae(),{t}=G(),{confirmApi:d,confirmHolder:b}=ee(),f=s?.meta?.did,P=Object.assign({...D},s?.settings?.notification?.pushKit||{}),{handleSubmit:E,control:n,formState:i,watch:_,reset:q}=se({defaultValues:te(P,Object.keys(D))}),l=re({testReceiver:"",testReceiverError:""}),a=_("enabled"),C=u(async(o,k,v=!0)=>{try{const{blocklet:w}=await c.configNotification({input:{did:f,notification:JSON.stringify({pushKit:o})}}),I=Object.assign({...D},w?.settings?.notification?.pushKit||{});q(I),v&&S.success(t("oauth.saveSuccess"))}catch(w){if(v)S.error(w.message||t("oauth.saveFailed"));else throw w}}),W=u(async(o,k)=>{try{i.isDirty&&await C(o,k,!1);const v=(s?.configs||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value,w=me(fe(v,he.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo"),{v:s?.meta?.version,t:new Date(s?.updatedAt||0).getTime()}),I={type:"passthrough",passthroughType:"messageStatus",data:{message:{title:"Test push-kit notification",body:"This is message from push-kit config test",sender:{did:s?.appDid,fullName:s?.meta?.title,avatar:w}}}};await c.sendPush({input:{did:f,receiver:l.testReceiver,notification:JSON.stringify(I)}}),S.success(t("notification.pushKit.testSuccess"))}catch(v){S.error(v.message||t("notification.pushKit.testfailed"))}}),A=u((o,k)=>{l.testReceiverError="",d.open({title:t("notification.pushKit.testSend"),content:()=>e.jsx(R,{sx:{width:"450px",maxWidth:"100%"},children:e.jsx(x,{sx:{mt:1},fullWidth:!0,name:"testReceiver",label:t("notification.pushKit.inputTestReceiver"),value:l.testReceiver,onChange:v=>{l.testReceiver=v.target.value},error:!!l.testReceiverError,helperText:l.testReceiverError||" "})}),confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),async onConfirm(v){if(!l.testReceiver?.trim()){l.testReceiverError=t("notification.pushKit.receiverRequired");return}l.testReceiverError="",await W(o,k),v()}})}),F=u(o=>{const k=o?.trim();return k?V(k)?!0:t("notification.pushKit.endpointInvalid"):t("notification.pushKit.endpointRequired")}),L=u(()=>!0);return e.jsxs(R,{children:[e.jsxs(qe,{component:"form",onSubmit:E(C),disabled:!0,sx:{".section-left":{width:"160px"}},children:[e.jsx(h,{title:t("notification.pushKit.enable"),my:2.5,children:e.jsx(m,{name:"enabled",control:n,render:({field:o})=>e.jsx(H,{control:e.jsx($,{checked:o.value,...o})})})}),e.jsx(h,{title:t("notification.pushKit.endpoint"),children:e.jsx(m,{name:"endpoint",control:n,rules:{validate:a?F:L},render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",required:!0,label:t("notification.pushKit.endpoint"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})}),e.jsxs(h,{title:t("notification.pushKit.customOptions"),children:[e.jsx(m,{name:"did",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.did"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})}),e.jsx(m,{name:"pushPath",control:n,render:({field:o})=>e.jsx(p,{fullWidth:!0,children:e.jsx(x,{...o,size:"small",label:t("notification.pushKit.pushPath"),error:!!i.errors[o.name],helperText:i.errors[o.name]?.message||" ",disabled:!a})})})]}),e.jsxs(R,{sx:{display:"flex",justifyContent:"flex-end",gap:2,mt:3},children:[e.jsx(N,{variant:"outlined",color:"warning",onClick:E(A),disabled:!a,children:t("oauth.runTest")}),e.jsx(N,{type:"submit",variant:"contained",disabled:!i.isDirty,children:t("oauth.save")})]})]}),b]})}const qe=ie(ne)``,Y=[{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Email"}),value:"email"},{label:e.jsx(R,{sx:{textAlign:"center",width:"100%"},children:"Push Kit"}),value:"pushKit"}];function Ae(){const[c,s]=U.useState(Y[0].value),{locale:t}=U.useContext(xe),d=pe(()=>({email:e.jsx(Ce,{}),pushKit:e.jsx(_e,{})}),[t]),b=U.useMemo(()=>({padding:"10px 0"}),[]);return e.jsxs(R,{children:[e.jsx(ve,{tabs:Y,current:c,onChange:s}),e.jsx(R,{style:b,children:d[c]})]})}export{Ae as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as de,j as e,hh as Ts,hi as Es,bM as Is,r as q,s as xe,K as $,f3 as kt,t as U,eM as ft,a3 as ae,C as Ee,bi as zt,dJ as Ds,o as T,hj as Ls,b2 as Ht,cx as qs,cQ as Ms,dm as Bs,T as Y,dE as it,bn as ne,bA as mt,p as ue,hk as zs,bB as pt,b as W,bg as G,dG as ee,H as Z,aV as ie,V as oe,n as Nt,q as Hs,w as Ft,ac as Ns,i as Zt,gd as Fs,hl as Zs,at as Vs,aU as X,R as Te,$ as ke,D as Us,U as Ws,v as re,X as at,hm as Js,hn as Ks,ey as Gs,eA as Ys,F as je,aH as J,g1 as Xs,cY as St,W as Qs,fl as Vt,ay as te,aR as Ct,ho as er,f7 as Re,cs as E,bz as ge,aD as se,O as Q,aP as ye,hp as qe,a1 as tr,hq as Je,c3 as Ce,eB as sr,hr as rr,dF as ce,f as Oe,y as Ut,bw as ot,M as nr,cE as Wt,gc as ir,gj as Ze,hs as ar,b9 as or,L as lr,cr as Be,aK as He,ht as cr,Q as dr,bp as ur,af as Rt,a2 as Jt,bj as Ne,hu as Kt,b6 as hr,gD as we,f8 as Gt,cW as Yt,B as fr,b5 as Ot,fa as mr,ff as pr,G as Ke,J as gr,bu as yr}from"./index-DbK31dFt.js";import{F as xr,a as lt,s as vr,L as _e,S as br,B as jr}from"./preference-CqWbCajg.js";import{N as $t}from"./ChevronRight-ByhLYhtZ.js";import{T as Fe}from"./html-title-C0ZWlysm.js";import{w as Ie,P as _r}from"./permission-C9Y2XRsP.js";import{u as gt}from"./index-DuHKLnMJ.js";import{D as wr}from"./Done-Bo9YVoGQ.js";import{R as kr,S as M}from"./collapse-Pv0Zul5P.js";import{A as Sr,a as At}from"./Autocomplete-CdGK2sfo.js";import{C as Cr,R as Rr,S as Or,P as $r}from"./rotate-session-key-8bwJGNzn.js";import{u as le}from"./blocklet-DwHEwBiZ.js";import{C as Ar}from"./click-to-copy-Deba7opf.js";import{u as Ve}from"./team-CWK-YI0_.js";import{v as Xt}from"./index-CE07KwkJ.js";import{g as Pr}from"./chain-C7UmgQl6.js";import{V as Tr,d as Er}from"./status-Cq_pMyWm.js";import{S as pe}from"./Switch-C_P2C8Xa.js";import{B as Ir}from"./index-mOCIkNdQ.js";import{y as Dr}from"./index-DJypfjpv.js";import{I as Lr,J as qr,K as Mr,L as Br}from"./index-BX8O0ZHV.js";import{u as ve,C as H,b as Pt}from"./index.esm-DfrzxWuO.js";import{S as ze,u as zr}from"./switch-control-lkjjrTch.js";import{D as Tt,R as Qt,a as es}from"./url-evaluation-CqBTA_SW.js";import{A as Et}from"./Add-C7LRvIC3.js";import{H as Ue}from"./index-fK2TFREh.js";import{l as Hr}from"./index-1KXTwIqr.js";import{u as ts}from"./use-mobile-C3U3R5Q3.js";import{S as Ge}from"./simple-select-DvScotEA.js";import{G as Nr}from"./actions-CsBw5W6U.js";import{C as Fr}from"./CardContent-CVZJ4z1h.js";import"./omit-DZ74swD3.js";import"./index-DxTV8NxB.js";import"./edit.svg-BR_aQB1u.js";import"./ArrowDropDown-DT6bL4ID.js";import"./ButtonGroup-CK4D_Ln2.js";import"./getValidReactChildren-BAFkQ3fw.js";import"./index-UpEYMAvU.js";import"./iframe-DFPz5jZg.js";import"./ListSubheader-BicxfAd1.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-VCscB3DM.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-sINld31b.js";import"./CSSTransition-Dwgb1QPW.js";import"./emotion-cache.browser.esm-D_e1cJtm.js";import"./depsEqual-C_BH-hM0.js";import"./TableSearch-D9jLZhkp.js";import"./Search-BuS9kxDD.js";import"./Clear-Cw2o-hjt.js";import"./MoreVert-CI4HEjN0.js";import"./useLocalStorage-BMre6evC.js";import"./get-safe-url-D-cF2nX-.js";const ss=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Zr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Vr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Ur=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Jr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),ct=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Kr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Gr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Yr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),rs=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Xr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Qr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var en=Array.prototype,It=en.splice;function tn(v,R,O,C){var _=Es,j=-1,p=R.length,i=v;for(v===R&&(R=Ts(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(i,h,m))>-1;)i!==v&&It.call(i,m,1),It.call(v,m,1);return v}function sn(v,R){return v&&v.length&&R&&R.length?tn(v,R):v}var rn=Is(sn);const nn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function ns({label:v="",disabled:R=!1,required:O=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:i=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,a]=q.useState(!1),[u,g]=q.useState(!1),[y,k]=q.useState(""),w=q.useRef(null),[d,x]=q.useState(C),[b,S]=q.useState(d),A=q.useMemo(()=>{if(!m)return{};const z={};return m.forEach(I=>{z[I.code]=I}),z},[m]),P=()=>{if(!m)return[];if(!y)return m.map(I=>I.code);const z=new RegExp(y.toLowerCase());return m.filter(I=>{for(let B=0;B<r.length;B++){const F=r[B];if(z.test(I[F]?.toLowerCase()))return!0}return!1}).map(I=>I.code)},L=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),x(C)):(S(b),x(b))}catch{S(d)}finally{g(!1),a(!1)}},D=(z,I)=>{if(!Array.isArray(I)){S([]),_([]);return}const B=I.filter(F=>A[F]);if(!B.length){S([]),_([]);return}S(B),_(B)},N=z=>{z.stopPropagation(),a(!0),setTimeout(()=>{if(w.current){const I=w.current.querySelector("input");I&&I.focus()}},500)},V=n?e.jsx(Sr,{ref:w,options:m,value:b,onChange:D,inputValue:y,onInputChange:(z,I)=>{k(I)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:z=>A[z]?.name,renderInput:z=>e.jsx(U,{...z,label:"",placeholder:t}),renderOption:(z,I)=>{const B=b.indexOf(I)!==-1;return q.createElement(an,{component:"li",...z,key:I},l(A[I]||{}),e.jsx($,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:B?"700":"normal"},children:o(I,A[I])||A[I]?.name}),e.jsx($,{component:kt,sx:{opacity:.5,width:18,height:18},style:{visibility:B?"visible":"hidden"}}))},...c,slots:{popper:on}}):e.jsx($,{className:"form-item-input slot",onClick:N,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(z=>m.some(I=>I.code===z)).map(z=>e.jsx(ft,{label:m.find(I=>I.code===z).name,style:{marginRight:8},size:"small"},z))});return e.jsx(xr,{className:"form",style:j,children:e.jsxs($,{className:"form-item",children:[e.jsxs($,{className:"form-item-label",children:[v,O&&e.jsx(kr,{})]}),e.jsxs($,{className:"form-item-body",children:[e.jsx($,{className:"form-item-input",children:V}),n?e.jsx($,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ae,{"data-cy":"schema-form-item-confirm",onClick:L,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(wr,{})}),e.jsx(ae,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),a(!1)},disabled:R||u,size:"large",children:e.jsx(kt,{})})]})}):null]}),n&&h&&e.jsx(zt,{children:h})]})})}ns.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const an=xe.div`
|
|
1
|
+
import{aF as de,j as e,hh as Ts,hi as Es,bM as Is,r as q,s as xe,K as $,f3 as kt,t as U,eM as ft,a3 as ae,C as Ee,bi as zt,dJ as Ds,o as T,hj as Ls,b2 as Ht,cx as qs,cQ as Ms,dm as Bs,T as Y,dE as it,bn as ne,bA as mt,p as ue,hk as zs,bB as pt,b as W,bg as G,dG as ee,H as Z,aV as ie,V as oe,n as Nt,q as Hs,w as Ft,ac as Ns,i as Zt,gd as Fs,hl as Zs,at as Vs,aU as X,R as Te,$ as ke,D as Us,U as Ws,v as re,X as at,hm as Js,hn as Ks,ey as Gs,eA as Ys,F as je,aH as J,g1 as Xs,cY as St,W as Qs,fl as Vt,ay as te,aR as Ct,ho as er,f7 as Re,cs as E,bz as ge,aD as se,O as Q,aP as ye,hp as qe,a1 as tr,hq as Je,c3 as Ce,eB as sr,hr as rr,dF as ce,f as Oe,y as Ut,bw as ot,M as nr,cE as Wt,gc as ir,gj as Ze,hs as ar,b9 as or,L as lr,cr as Be,aK as He,ht as cr,Q as dr,bp as ur,af as Rt,a2 as Jt,bj as Ne,hu as Kt,b6 as hr,gD as we,f8 as Gt,cW as Yt,B as fr,b5 as Ot,fa as mr,ff as pr,G as Ke,J as gr,bu as yr}from"./index-BfokqgHy.js";import{F as xr,a as lt,s as vr,L as _e,S as br,B as jr}from"./preference-D8eTwplp.js";import{N as $t}from"./ChevronRight-CqQwaL1d.js";import{T as Fe}from"./html-title-BGLe2_e3.js";import{w as Ie,P as _r}from"./permission-B-96KXQR.js";import{u as gt}from"./index-ChGhj4bz.js";import{D as wr}from"./Done-C3Xrj0cc.js";import{R as kr,S as M}from"./collapse-DXrrkJjt.js";import{A as Sr,a as At}from"./Autocomplete-DNyfxOFp.js";import{C as Cr,R as Rr,S as Or,P as $r}from"./rotate-session-key-BxXPHSLd.js";import{u as le}from"./blocklet-Dr_LK1Q2.js";import{C as Ar}from"./click-to-copy-PtCfJ87M.js";import{u as Ve}from"./team-Bz9weh46.js";import{v as Xt}from"./index-Bq1Ow9Ag.js";import{g as Pr}from"./chain-Dc18Nz_k.js";import{V as Tr,d as Er}from"./status-CeJnlK1J.js";import{S as pe}from"./Switch-7IuDphWe.js";import{B as Ir}from"./index-DfnCJwAx.js";import{y as Dr}from"./index-zI6sbIgD.js";import{I as Lr,J as qr,K as Mr,L as Br}from"./index-DTOWo4jq.js";import{u as ve,C as H,b as Pt}from"./index.esm-DzozubHa.js";import{S as ze,u as zr}from"./switch-control-C_8dVEZN.js";import{D as Tt,R as Qt,a as es}from"./url-evaluation-D_cqsSRO.js";import{A as Et}from"./Add-BqMKSndg.js";import{H as Ue}from"./index-CnHjhHdP.js";import{l as Hr}from"./index-BkVWAwPz.js";import{u as ts}from"./use-mobile-BW2lFrSI.js";import{S as Ge}from"./simple-select-D-ySkAbw.js";import{G as Nr}from"./actions-DHHW8Ne9.js";import{C as Fr}from"./CardContent-D50ZN2XJ.js";import"./omit-DyDj32t1.js";import"./index-YMUJi64L.js";import"./edit.svg-BBcWA2Yv.js";import"./ArrowDropDown-CQnQ9y90.js";import"./ButtonGroup-Dh6lYgZM.js";import"./getValidReactChildren-2xps4qz5.js";import"./index-Cq343AIm.js";import"./iframe-C807ybR2.js";import"./ListSubheader-XzhijlHC.js";import"./visuallyHidden-Dan1xhjv.js";import"./ErrorOutline-Da9J9PWf.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./FilterList-Cid-oBR0.js";import"./CSSTransition-BfkQpTwd.js";import"./emotion-cache.browser.esm-CHE9Rgf-.js";import"./depsEqual-Dxl6Fkos.js";import"./TableSearch-CuYawmb9.js";import"./Search-DVAqIV8y.js";import"./Clear-G8IA_JS7.js";import"./MoreVert-YC-2RtuS.js";import"./useLocalStorage-C-HC7dIw.js";import"./get-safe-url-D_h8kBns.js";const ss=de([e.jsx("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),e.jsx("circle",{cx:"16",cy:"12",r:"1.5"},"1")]),Zr=de([e.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),e.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),Vr=de(e.jsx("path",{d:"M21 8V7l-3 2-3-2v1l3 2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2M8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3m6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1zm8-6h-8V6h8z"})),Ur=de(e.jsx("path",{d:"M24 9v2h-6V9zM8 4C5.79 4 4 5.79 4 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4m4.51-8.95C13.43 5.11 14 6.49 14 8s-.57 2.89-1.49 3.95C14.47 11.7 16 10.04 16 8s-1.53-3.7-3.49-3.95m4.02 9.78C17.42 14.66 18 15.7 18 17v3h2v-3c0-1.45-1.59-2.51-3.47-3.17"})),Wr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),Jr=de(e.jsx("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"})),ct=de(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Kr=de([e.jsx("path",{d:"M18 11c.7 0 1.37.1 2 .29V10c0-1.1-.9-2-2-2h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h6.26c-.79-1.13-1.26-2.51-1.26-4 0-3.87 3.13-7 7-7M8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9z"},"0"),e.jsx("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m0 2c.83 0 1.5.67 1.5 1.5S18.83 18 18 18s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5m0 6c-1.03 0-1.94-.52-2.48-1.32.73-.42 1.57-.68 2.48-.68s1.75.26 2.48.68c-.54.8-1.45 1.32-2.48 1.32"},"1")]),Gr=de(e.jsx("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"})),Yr=de(e.jsx("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"})),rs=de(e.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m4.24 16L12 15.45 7.77 18l1.12-4.81-3.73-3.23 4.92-.42L12 5l1.92 4.53 4.92.42-3.73 3.23z"})),Xr=de(e.jsx("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"})),Qr=de(e.jsx("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}));var en=Array.prototype,It=en.splice;function tn(v,R,O,C){var _=Es,j=-1,p=R.length,i=v;for(v===R&&(R=Ts(R));++j<p;)for(var m=0,f=R[j],h=f;(m=_(i,h,m))>-1;)i!==v&&It.call(i,m,1),It.call(v,m,1);return v}function sn(v,R){return v&&v.length&&R&&R.length?tn(v,R):v}var rn=Is(sn);const nn={width:24,height:24,body:'<path fill="currentColor" d="M4.975 15q-.425 0-.7-.288T4 14q0-.425.288-.713T5 13h14.025q.425 0 .7.288T20 14q0 .425-.288.713T19 15H4.975Zm0 4q-.425 0-.7-.288T4 18q0-.425.288-.713T5 17h14.025q.425 0 .7.288T20 18q0 .425-.288.713T19 19H4.975Zm0-8q-.425 0-.7-.288T4 10q0-.425.288-.713T5 9h14.025q.425 0 .7.288T20 10q0 .425-.288.713T19 11H4.975Zm0-4q-.425 0-.7-.288T4 6q0-.425.288-.713T5 5h14.025q.425 0 .7.288T20 6q0 .425-.288.713T19 7H4.975Z"/>'};function ns({label:v="",disabled:R=!1,required:O=!1,initialValue:C="",onChange:_=()=>{},style:j={},onSubmit:p=()=>{},triggers:i=[],options:m=[],formatterBeforeSubmit:f=n=>n.join(","),helperText:h="",placeholder:t="",renderImage:l=()=>null,renderLabel:o=()=>"",filterKeys:r=["name"],noEmpty:s=!1,...c}){const[n,a]=q.useState(!1),[u,g]=q.useState(!1),[y,k]=q.useState(""),w=q.useRef(null),[d,x]=q.useState(C),[b,S]=q.useState(d),A=q.useMemo(()=>{if(!m)return{};const z={};return m.forEach(I=>{z[I.code]=I}),z},[m]),P=()=>{if(!m)return[];if(!y)return m.map(I=>I.code);const z=new RegExp(y.toLowerCase());return m.filter(I=>{for(let B=0;B<r.length;B++){const F=r[B];if(z.test(I[F]?.toLowerCase()))return!0}return!1}).map(I=>I.code)},L=async()=>{g(!0);try{await p(typeof f=="function"?f(b):b)===!1?S(d):s&&!b.length?(S(C),x(C)):(S(b),x(b))}catch{S(d)}finally{g(!1),a(!1)}},D=(z,I)=>{if(!Array.isArray(I)){S([]),_([]);return}const B=I.filter(F=>A[F]);if(!B.length){S([]),_([]);return}S(B),_(B)},N=z=>{z.stopPropagation(),a(!0),setTimeout(()=>{if(w.current){const I=w.current.querySelector("input");I&&I.focus()}},500)},V=n?e.jsx(Sr,{ref:w,options:m,value:b,onChange:D,inputValue:y,onInputChange:(z,I)=>{k(I)},fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:P,getOptionLabel:z=>A[z]?.name,renderInput:z=>e.jsx(U,{...z,label:"",placeholder:t}),renderOption:(z,I)=>{const B=b.indexOf(I)!==-1;return q.createElement(an,{component:"li",...z,key:I},l(A[I]||{}),e.jsx($,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:B?"700":"normal"},children:o(I,A[I])||A[I]?.name}),e.jsx($,{component:kt,sx:{opacity:.5,width:18,height:18},style:{visibility:B?"visible":"hidden"}}))},...c,slots:{popper:on}}):e.jsx($,{className:"form-item-input slot",onClick:N,style:{whiteSpace:"pre-wrap",cursor:"text"},sx:{px:1},children:b.filter(z=>m.some(I=>I.code===z)).map(z=>e.jsx(ft,{label:m.find(I=>I.code===z).name,style:{marginRight:8},size:"small"},z))});return e.jsx(xr,{className:"form",style:j,children:e.jsxs($,{className:"form-item",children:[e.jsxs($,{className:"form-item-label",children:[v,O&&e.jsx(kr,{})]}),e.jsxs($,{className:"form-item-body",children:[e.jsx($,{className:"form-item-input",children:V}),n?e.jsx($,{className:"form-item-action",children:e.jsxs(e.Fragment,{children:[e.jsx(ae,{"data-cy":"schema-form-item-confirm",onClick:L,disabled:R||u,size:"large",children:u?e.jsx(Ee,{size:24}):e.jsx(wr,{})}),e.jsx(ae,{"data-cy":"schema-form-item-cancel",onClick:()=>{S(d),a(!1)},disabled:R||u,size:"large",children:e.jsx(kt,{})})]})}):null]}),n&&h&&e.jsx(zt,{children:h})]})})}ns.propTypes={style:T.object,onSubmit:T.func,onChange:T.func,label:T.string,initialValue:T.string,required:T.bool,disabled:T.bool,triggers:T.array,options:T.array,helperText:T.string,formatterBeforeSubmit:T.func,placeholder:T.string,renderImage:T.func,filterKeys:T.arrayOf(T.string),noEmpty:T.bool,renderLabel:T.func};const an=xe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cF as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cS as qm,be as JL,r as QL}from"./index-
|
|
1
|
+
import{cF as $m,bd as jL,g_ as oT,ba as Xm,bb as Zm,cS as qm,be as JL,r as QL}from"./index-BfokqgHy.js";/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,p as n,j as t,s as r}from"./index-
|
|
1
|
+
import{r as o,p as n,j as t,s as r}from"./index-BfokqgHy.js";import{p as a}from"./index-T0ij7gEZ.js";function c(){const{t:s}=o.useContext(n);return t.jsx(e,{style:{paddingTop:"25vh"},children:t.jsx(a,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const e=r.main``;export{c as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as H,u as W,r as i,a as R,b as $,j as e,o as y,d as Q,e as Y,p as F,f as X,W as D,L as J,g as j,h as K,i as z,k,T as h,G as v,l as Z,m as B,s as q,C as ee}from"./index-
|
|
1
|
+
import{c as H,u as W,r as i,a as R,b as $,j as e,o as y,d as Q,e as Y,p as F,f as X,W as D,L as J,g as j,h as K,i as z,k,T as h,G as v,l as Z,m as B,s as q,C as ee}from"./index-BfokqgHy.js";import{f as ne}from"./index-BojVbZw0.js";import{v as U}from"./index-Bq1Ow9Ag.js";import{M as V}from"./metric-DmeCDHRO.js";import{C as M}from"./click-to-copy-PtCfJ87M.js";var se=H(function(a,d,r){return a+(r?" ":"")+d.toLowerCase()});const L=i.createContext({}),{Provider:ae,Consumer:he}=L;function te({children:a}){const{api:d,info:r}=W(),[u,l]=i.useState(null),[c,t]=i.useState(!1),[s,p]=i.useState([]),_=4,f=async({silent:o=!0,retries:m=_}={})=>{o||t(!0);try{l(null);const{users:x}=await d.getUsers({input:{teamDid:r.did,paging:{pageSize:100}}});t(!1),p(x)}catch(x){m>0?setTimeout(()=>f({silent:o,retries:m-1}),1e3):(t(!1),l(x))}};i.useEffect(()=>{f({silent:!1})},[]),R($.TeamEvents.userAdded,({teamDid:o})=>{o===r.did&&f()}),R($.TeamEvents.userRemoved,({teamDid:o,user:{did:m}})=>{o===r.did&&p(x=>x.filter(N=>N.did!==m))}),R($.TeamEvents.userUpdated,({teamDid:o})=>{o===r.did&&f()});const b={loading:c,error:u,users:s,refresh:f};return e.jsx(ae,{value:{users:b},children:a})}function re(){const{users:a}=i.useContext(L);return a}const g={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},oe=(a,d)=>{const[r,u]=i.useState(0),l=s=>s>=g.oneDay?g.oneDay:s>=g.oneHour?g.oneHour:s>=g.oneMin?g.oneMin:g.oneSecond,[c,t]=i.useState(l(a/1e3));return i.useEffect(()=>{const s=setInterval(()=>{u(r+c);const p=l(a/1e3+r+c);c!==p&&t(p)},c*1e3);return()=>clearInterval(s)},[c,r]),i.useEffect(()=>{u(0),t(l(a/1e3))},[a]),d(a+r*1e3)};y.number.isRequired,y.func;const ie=async a=>{const d=await a.getNodeEnv();return Object.assign({},d.info||{})};y.number.isRequired;y.string.isRequired,y.string.isRequired,y.string.isRequired;function le(){const{info:a,api:d,loading:r}=W(),{data:u,externalData:l}=Q(),{users:c}=re(),t=Y(()=>ie(d)),{t:s,locale:p}=i.useContext(F),_=X(),f=oe(+new Date-a.startAt,o=>{const m={compact:!0,verbose:!0,locale:B(p)};return Z(o,m)});let b=null;if(r)b=e.jsx(ee,{});else{const o=[{name:s("dashboard.nodeDid"),value:e.jsx(D,{did:a.did,showQrcode:!0})}];a.nodeOwner&&o.push({name:s("dashboard.ownerDid"),value:e.jsx(D,{did:a.nodeOwner.did,showQrcode:!0})});let m=[];a.launcher&&(m=[{name:s("common.did"),value:e.jsx(D,{did:a.launcher.did,showQrcode:!0})},{name:s("common.type"),value:a.launcher.type},{name:s("launcher.provider"),value:a.launcher.provider},{name:s("launcher.adminUrl"),value:e.jsx(J,{target:"_blank",href:a.launcher.url,underline:"hover",children:a.launcher.url})}]);const x=(n,w)=>!n&&!w?"-":n==="-"?n:!w||w==="-"?e.jsxs(h,{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}):e.jsxs(h,{component:"ul",children:[e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV4"}),e.jsx(M,{children:n})]}),e.jsxs("li",{className:"ip-item",children:[e.jsx(j,{children:"IPV6"}),e.jsx(M,{children:w})]})]}),N=()=>{const n=[{name:`${s("common.internalIp")}`,value:x(t.value.ip.internalV4,t.value.ip.internalV6)},{name:`${s("common.externalIp")}`,value:x(t.value.ip.externalV4,t.value.ip.externalV6)}];return t.value.docker?[]:n},T=t.value?[{name:`${s("common.version")}`,value:a.version},...N(),{name:`${s("common.os")}`,value:t.value.os},t.value.docker?{name:`${s("common.docker")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null,t.value.gitpod?{name:`${s("common.gitpod")}`,value:e.jsx(j,{type:"success",children:"Yes"})}:null].filter(Boolean):[];Array.isArray(K(t,"value.blockletEngines",null))&&t.value.blockletEngines.filter(n=>n.visible&&n.available).forEach(n=>{T.push({name:n.displayName,value:e.jsx(j,{type:"success",children:`${n.version}`||"N/A"})})});const G=c.length,A=c.filter(n=>n.approved).length;let P=G;A&&(P+=`<small><strong>${se(s("common.approved"))} ${A}</strong></small>`);let S=0,C=0;u&&(S=u.length,C=u.filter(n=>z.isBlockletRunning(n)).length),Array.isArray(l)&&(S+=l.length,C+=l.filter(n=>z.isBlockletRunning(n)).length);let I=S;C&&(I+=`<small>${s("common.running")} ${C}</small>`);const O=[{name:s("common.blocklets"),value:I},{name:s("common.members"),value:P},{name:s("common.uptime"),value:f},{name:s("common.created"),value:ne(new Date(a.createdAt).getTime(),B(p))}];let E=[];t.value&&t.value.disk&&Object.values(t.value.disk).some(n=>n>0)&&(E=[{name:s("common.blockletsStorage"),value:k(t.value.disk.blocklets||0).toUpperCase()},{name:s("common.dataStorage"),value:k(t.value.disk.data||0).toUpperCase()},{name:s("common.logStorage"),value:k(t.value.disk.log||0).toUpperCase()},{name:s("common.cacheStorage"),value:k(t.value.disk.cache||0).toUpperCase()},{name:s("common.coreStorage"),value:k(t.value.disk.app||0).toUpperCase()}]),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.overview")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:O.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),E.length>0&&e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.storage")}),e.jsx(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:E.map(n=>e.jsx(v,{size:{xl:2,lg:3,md:4,sm:6,xs:6},children:e.jsx(V,{...n})},n.name))})]}),e.jsxs("div",{className:"section",children:[e.jsx(h,{className:"section__header",component:"h2",variant:"h4",color:"textPrimary",children:s("common.meta")}),e.jsxs(v,{className:"page-metrics",container:!0,spacing:{xs:2,sm:3,md:4,lg:5},children:[e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.dAddress")}),o.map(n=>e.jsx(U,{nameWidth:150,name:n.name,children:n.value},n.name)),m.length>0&&e.jsxs("div",{style:{marginTop:_.spacing(8)},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.launcher")}),m.map(n=>e.jsx(U,{nameWidth:150,name:n.name,children:n.value},n.name))]})]},"address"),e.jsxs(v,{size:{lg:6,md:12,sm:12,xs:12},children:[e.jsx(h,{className:"section__header",component:"h3",variant:"h5",color:"textPrimary",children:s("common.env")}),T.map(n=>e.jsx(U,{valueComponent:"div",nameWidth:150,name:n.name,children:n.value},n.name))]},"environment")]})]})]})}return e.jsx(ce,{children:b})}const ce=q.main`
|
|
2
2
|
.page-header {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as v,j as n,K as a,dc as w,V as z,f as p,dj as F}from"./index-
|
|
1
|
+
import{aF as v,j as n,K as a,dc as w,V as z,f as p,dj as F}from"./index-BfokqgHy.js";const k=v(n.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m4.3 14.3c-.39.39-1.02.39-1.41 0L12 13.41 9.11 16.3c-.39.39-1.02.39-1.41 0a.996.996 0 0 1 0-1.41L10.59 12 7.7 9.11a.996.996 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L12 10.59l2.89-2.89c.39-.39 1.02-.39 1.41 0s.39 1.02 0 1.41L13.41 12l2.89 2.89c.38.38.38 1.02 0 1.41"}));function r({icon:e=null,title:t="",description:o="",extra:y=null,...b}){return n.jsxs(E,{...b,children:[e,typeof t=="string"?n.jsx(a,{sx:{mt:3,fontSize:22,fontWeight:400,color:"text.primary",textAlign:"center"},children:t}):t,typeof o=="string"?n.jsx(a,{sx:{mt:1,fontSize:14,color:"text.secondary",textAlign:"center"},children:o}):o,n.jsx(a,{sx:{mt:3},children:y})]})}const E=w("div")`
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{co as x,r as n,p as g,cp as r,B as u,j as s,K as m,cq as d}from"./index-
|
|
1
|
+
import{co as x,r as n,p as g,cp as r,B as u,j as s,K as m,cq as d}from"./index-BfokqgHy.js";function P(){const i=x(),{blocklets:c,refresh:p}=i,{t:l}=n.useContext(g),y=r.generateKey(),[a]=u();return n.useEffect(()=>{const o=r.getNotificationQueryParams(y)??{},t=a.get("entityId"),e=a.get("severity"),f={...o,...e?{severity:e==="all"?[]:e.split(","),paging:{...o.paging,page:1}}:{},...t?{entityId:t==="all"?[]:t.split(",")}:{},componentDid:[]};p(f)},[]),s.jsxs(m,{children:[s.jsx("h1",{children:l("notification.title")}),s.jsx(d,{tabType:"line",blocklets:c,context:i,filterType:"entity",type:"server"})]})}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ex as k}from"./index-
|
|
1
|
+
import{ex as k}from"./index-BfokqgHy.js";var m,C;function S(){if(C)return m;C=1;function v(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,f=-1,t=0,n,l=0;l<=o.length;++l){if(l<o.length)n=o.charCodeAt(l);else{if(n===47)break;n=47}if(n===47){if(!(f===l-1||t===1))if(f!==l-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),f=l,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,f=l,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(f+1,l):r=o.slice(f+1,l),i=l-f-1;f=l,t=0}else n===46&&t!==-1?++t:t=-1}return r}function b(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,f=arguments.length-1;f>=-1&&!r;f--){var t;f>=0?t=arguments[f]:(i===void 0&&(i=k.cwd()),t=i),v(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(v(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return v(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];v(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(v(e),v(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var f=e.length,t=f-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var l=r.length,s=l-n,c=t<s?t:s,u=-1,a=0;a<=c;++a){if(a===c){if(s>c){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>c&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var h=e.charCodeAt(i+a),y=r.charCodeAt(n+a);if(h!==y)break;h===47&&(u=a)}var d="";for(a=i+u+1;a<=f;++a)(a===f||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(v(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,f=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){f=n;break}}else t=!1;return f===-1?i?"/":".":i&&f===1?"//":e.slice(0,f)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');v(e);var i=0,f=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(c===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(f=n):(l=-1,f=s))}return i===f?f=s:f===-1&&(f=e.length),e.slice(i,f)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else f===-1&&(t=!1,f=n+1);return f===-1?"":e.slice(i,f)}},extname:function(e){v(e);for(var r=-1,i=0,f=-1,t=!0,n=0,l=e.length-1;l>=0;--l){var s=e.charCodeAt(l);if(s===47){if(!t){i=l+1;break}continue}f===-1&&(t=!1,f=l+1),s===46?r===-1?r=l:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||f===-1||n===0||n===1&&r===f-1&&r===i+1?"":e.slice(r,f)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return b("/",e)},parse:function(e){v(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),f=i===47,t;f?(r.root="/",t=1):t=0;for(var n=-1,l=0,s=-1,c=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}s===-1&&(c=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===l+1?s!==-1&&(l===0&&f?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(l,s)):(l===0&&f?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(l,n),r.base=e.slice(l,s)),r.ext=e.slice(n,s)),l>0?r.dir=e.slice(0,l-1):f&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return g.posix=g,m=g,m}export{S as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,K as g,Z as ue,s as R,_ as K,V as U,r as f,a0 as fe,y as v,a1 as Me,a2 as ze,o as E,a3 as oe,a4 as We,H as I,X as Q,T as $,a5 as He,v as B,$ as Ve,D as qe,t as Ye,U as xe,C as ge,a6 as Ke,a7 as Qe,a8 as Xe,u as N,p as Ze,a9 as M,n as se,B as Je,aa as re,A as ye,q as ne,ab as et,W as ae,L as X,w as we,x as Z,ac as tt,ad as ke,ae as st,b as P,af as le,ag as ot,I as rt,ah as nt,ai as at,M as it,i as lt,f as ct,aj as dt,ak as be,al as Se,am as ve,an as L,ao as je,ap as Re,aq as Ce,ar as Pe,as as Te,at as pt,au as ce}from"./index-
|
|
1
|
+
import{j as e,K as g,Z as ue,s as R,_ as K,V as U,r as f,a0 as fe,y as v,a1 as Me,a2 as ze,o as E,a3 as oe,a4 as We,H as I,X as Q,T as $,a5 as He,v as B,$ as Ve,D as qe,t as Ye,U as xe,C as ge,a6 as Ke,a7 as Qe,a8 as Xe,u as N,p as Ze,a9 as M,n as se,B as Je,aa as re,A as ye,q as ne,ab as et,W as ae,L as X,w as we,x as Z,ac as tt,ad as ke,ae as st,b as P,af as le,ag as ot,I as rt,ah as nt,ai as at,M as it,i as lt,f as ct,aj as dt,ak as be,al as Se,am as ve,an as L,ao as je,ap as Re,aq as Ce,ar as Pe,as as Te,at as pt,au as ce}from"./index-BfokqgHy.js";import{t as mt}from"./toLower-Cg3LtCaI.js";import{a as W,u as ht,W as ut,P as Ee,L as Be}from"./index-jGiUSwaE.js";import{A as ft,D as ie,u as xt,W as gt,P as yt,a as De,L as Ue}from"./wait-container-0kquAukH.js";import{g as J}from"./get-safe-url-D_h8kBns.js";import{u as de}from"./useLocalStorage-C-HC7dIw.js";import{L as wt}from"./Launch-Cw0IvqYQ.js";import{D as kt}from"./DeleteOutline-BVyycjCe.js";import{g as bt,i as St}from"./spaces-BltTDIy4.js";import{I as vt}from"./MoreVert-YC-2RtuS.js";import{y as jt}from"./index-zI6sbIgD.js";import"./url-join-CI8YXAz9.js";import"./use-mobile-BW2lFrSI.js";import"./api-2w3ONNYp.js";function Oe({children:s,selected:a=!1}){return e.jsxs(Rt,{children:[s,e.jsx(g,{className:`selected-container ${a?"selected":""}`,children:e.jsx(ue,{className:"selected-icon"})})]})}const Rt=R(g)`
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
.selected-container {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aF as je,j as e,u as Q,r as h,e as Oe,aG as Ur,aH as k,aI as zr,aJ as an,aK as Gn,aL as sn,aM as et,V as z,ac as le,s as ne,aN as ln,o as p,aO as Br,aP as cn,aQ as Mr,H as re,M as dn,T as A,t as q,ay as fe,aR as _e,C as K,U as be,v as Y,aS as Kn,X as pe,K as W,p as Mt,N as tt,aT as Wr,d as Wt,aU as Ie,aV as me,a9 as qr,aW as Hr,aX as Gr,y as Kr,A as Vn,W as un,g as mn,h as te,aY as qt,a as Et,Q as X,b as ct,aZ as Yn,a_ as Xn,R as Qn,a3 as Pt,a$ as Vr,b0 as Yr,b1 as Xr,b2 as Qr,b3 as nt,i as fn,b4 as Zr,aE as Ge,b5 as Jr,a8 as jt,a5 as wt,b6 as ei,a6 as _t,L as Ht,I as ti,b7 as ni,b8 as Zn,a7 as ri,b9 as Jn,ba as De,bb as ke,bc as ii,bd as Gt,be as oi,$ as er,D as At,f as tr,bf as ai,bg as pn,aj as si,bh as li,bi as ee,bj as ci,S as gn,l as hn,m as xn,bk as di,bl as ui,bm as mi}from"./index-
|
|
1
|
+
import{aF as je,j as e,u as Q,r as h,e as Oe,aG as Ur,aH as k,aI as zr,aJ as an,aK as Gn,aL as sn,aM as et,V as z,ac as le,s as ne,aN as ln,o as p,aO as Br,aP as cn,aQ as Mr,H as re,M as dn,T as A,t as q,ay as fe,aR as _e,C as K,U as be,v as Y,aS as Kn,X as pe,K as W,p as Mt,N as tt,aT as Wr,d as Wt,aU as Ie,aV as me,a9 as qr,aW as Hr,aX as Gr,y as Kr,A as Vn,W as un,g as mn,h as te,aY as qt,a as Et,Q as X,b as ct,aZ as Yn,a_ as Xn,R as Qn,a3 as Pt,a$ as Vr,b0 as Yr,b1 as Xr,b2 as Qr,b3 as nt,i as fn,b4 as Zr,aE as Ge,b5 as Jr,a8 as jt,a5 as wt,b6 as ei,a6 as _t,L as Ht,I as ti,b7 as ni,b8 as Zn,a7 as ri,b9 as Jn,ba as De,bb as ke,bc as ii,bd as Gt,be as oi,$ as er,D as At,f as tr,bf as ai,bg as pn,aj as si,bh as li,bi as ee,bj as ci,S as gn,l as hn,m as xn,bk as di,bl as ui,bm as mi}from"./index-BfokqgHy.js";import{u as fi,T as pi}from"./html-title-BGLe2_e3.js";import{A as gi}from"./ArrowDropDown-CQnQ9y90.js";import{u as Kt,C as B,a as yn}from"./index.esm-DzozubHa.js";import{S as ae}from"./switch-control-C_8dVEZN.js";import{P as ie}from"./permission-B-96KXQR.js";import{H as nr,g as hi}from"./index-CnHjhHdP.js";import{A as rr}from"./Link-AjRLM7zT.js";import{D as ve,R as ir,a as It,b as xi}from"./url-evaluation-D_cqsSRO.js";import{D as dt}from"./delete-confirm-B5zJVhDV.js";import{v as rt}from"./index-Bq1Ow9Ag.js";import{s as yi}from"./logo-BKA11TRi.js";import{u as bi}from"./useLocalStorage-C-HC7dIw.js";import{R as vi}from"./Refresh-4WpQ7G17.js";import{L as ji}from"./LoadingButton-DX-iBNkr.js";import{C as wi,R as Ci,P as or,S as Si}from"./rotate-session-key-BxXPHSLd.js";import{A as Le}from"./Add-BqMKSndg.js";import{B as ar,D as bn,W as Ke}from"./status-vKMdrOM1.js";import{i as Di}from"./is-path-prefix-equal-B-eGi6RZ.js";import{N as ki}from"./ChevronRight-CqQwaL1d.js";import{I as Ri}from"./MoreVert-YC-2RtuS.js";import{E as sr}from"./Edit-0Bz5MCrU.js";import{A as Ti}from"./CallMerge-B-Wn3wH-.js";import{C as Ei}from"./CardContent-D50ZN2XJ.js";import"./Switch-7IuDphWe.js";import"./FilterList-Cid-oBR0.js";import"./CSSTransition-BfkQpTwd.js";import"./emotion-cache.browser.esm-CHE9Rgf-.js";import"./index-DTOWo4jq.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-Dxl6Fkos.js";import"./index-zI6sbIgD.js";import"./TableSearch-CuYawmb9.js";import"./Search-DVAqIV8y.js";import"./Clear-G8IA_JS7.js";import"./click-to-copy-PtCfJ87M.js";import"./visuallyHidden-Dan1xhjv.js";const Pi=je(e.jsx("path",{d:"m7 14 5-5 5 5z"})),_i=je(e.jsx("path",{d:"M12 3 2 21h20zm1 5.92L18.6 19H13zm-2 0V19H5.4z"})),Ai=je(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"})),lr=je(e.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z"})),Ii=je(e.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),Li=je(e.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"})),Fi=je(e.jsx("path",{d:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"})),ye="Dashboard",cr=h.createContext({}),{Provider:Oi,Consumer:as}=cr,vn=[ye,k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP],Ni=(t,r)=>{if(t.name===k.DOMAIN_FOR_DEFAULT_SITE)return-1;if(r.name===k.DOMAIN_FOR_DEFAULT_SITE)return 1;const n=vn.includes(t.name),i=vn.includes(r.name);return n&&i?sn(t.name,r.name):n?-1:i?1:sn(t.name,r.name)},$i=({sites:t,nodePort:r})=>{const n=window.location.hostname,a=(t||[]).map(o=>{const{id:s,rules:u=[],corsAllowedOrigins:m=[]}=o;let{domain:d,domainAliases:c}=o;c=c||[],[k.DOMAIN_FOR_IP_SITE,k.DOMAIN_FOR_IP_SITE_REGEXP].includes(d)&&(d=ye,c.find(y=>y.value===n)||c.unshift({protected:!1,value:n}));const w={id:s,name:d,type:"domain",items:[],domainAliases:c,isProtected:o.isProtected,corsAllowedOrigins:m};return(u||[]).forEach(y=>{const{id:C,isProtected:E,from:{pathPrefix:j},to:D}=y;if(D.type===k.ROUTING_RULE_TYPES.BLOCKLET){let S="";Number.parseInt(D.port,10)===Number.parseInt(r,10)?(S="Blocklet Server Dashboard",D.type=k.ROUTING_RULE_TYPES.DAEMON):S=D.did,w.items.push({id:C,name:an(j||"/"),title:S,type:"rule",isProtected:E,pathPrefix:j,to:D})}else w.items.push({id:C,pathPrefix:j,name:an(j||"/"),title:"Blocklet Server Dashboard",type:"rule",isProtected:E,to:D})}),w.items=Gn(w.items,y=>y.name),w}).sort(Ni),l=a.reduce((o,s)=>{let{name:u}=s;return u.endsWith(k.BLOCKLET_SITE_GROUP_SUFFIX)&&([u]=u.split(".")),o[u]={...s,rules:s.items},o},{});return{sites:a,siteMap:l}},Ui=({did:t,domain:r,mountPoint:n,siteMap:i,params:a}={})=>{if(!i)return null;const l=i[t];if(!l)return null;const o=r||(l.domainAliases||[])[0];if(!o)return null;let s=n;if(!s){const u=l.rules.filter(m=>!m.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];s=u?u.name:"/"}return et(o.value,s,a)},zi=({did:t,mountPoint:r,siteMap:n,params:i}={})=>{if(!n)return[];const a=n[t];if(!a)return[];const l=a.domainAliases||[];if(!l.length)return[];let o=r;if(!o){const s=a.rules.filter(u=>!u.name.startsWith(k.WELLKNOWN_PATH_PREFIX))[0];o=s?s.name:"/"}return l.map(s=>et(s.value,o,i))},Bi=t=>{const r=t.map(i=>i.domain).filter(i=>![k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE].includes(i));let n=[];return t.forEach(i=>n.push(...i.domainAliases||[])),n=n.map(i=>typeof i=="string"?{value:i,isProtected:!1}:i),{domains:r,domainsAliases:n}};function jn({children:t}){const{api:r,info:n}=Q(),[i,a]=h.useState([]),[l,o]=h.useState([]),[s,u]=h.useState([]),m=Oe(async()=>{const{sites:P}=await r.getRoutingSites({input:{snapshotHash:""}}),v=P||[];await Promise.all(v.map(async g=>(g.domainAliases=await Ur(g.domainAliases,{getIP:zr}),g)));const f=Bi(v);a(v),o(f.domains),u([window.location.hostname,...f.domains,...f.domainsAliases.map(g=>g.value)])},[n]),d=(P,v)=>{a(f=>f.map(g=>g.id===P?v.domain?v:{...v,domain:g.domain}:g))},c=P=>r.takeRoutingSnapshot({input:{dryRun:!1,message:encodeURIComponent(P)}}),w=async P=>{const v=await r.addRoutingSite({input:P});a(i.concat(v.site))},y=async(P,v)=>{const f=await r.updateRoutingSite({input:{id:P,...v}});if(f.site&&f.site.id){const g=i.findIndex(R=>R.id===f.site.id);g!==-1&&(i.splice(g,1,f.site),a([].concat(i)))}},C=async P=>{await r.deleteRoutingSite({input:{id:P}}),a(i.filter(v=>v.id!==P))},E=async(P,v,f)=>{const g=await r.addDomainAlias({input:{id:P,domainAlias:v,force:f}});d(P,g.site)},j=async(P,v)=>{const f=await r.deleteDomainAlias({input:{id:P,domainAlias:v}});d(P,f.site)},D=async(P,v)=>{const{site:f}=await r.addRoutingRule({input:{id:P,rule:v}});d(P,f)},S=async(P,v)=>{const{site:f}=await r.updateRoutingRule({input:{id:P,rule:v}});d(P,f)},b=async(P,v)=>{const{site:f}=await r.deleteRoutingRule({input:{id:P,ruleId:v}});d(P,f)},x={loading:m.loading,error:m.error,refresh:m.retry,api:r,actions:{addSite:w,updateSite:y,deleteSite:C,addDomainAlias:E,deleteDomainAlias:j,takeSnapshot:c,addRule:D,updateRule:S,deleteRule:b}},{sites:L,siteMap:F}=$i({sites:i,nodePort:n.port});return x.sites=L,x.siteMap=F,x.domains=l,x.allDomains=s,x.getBlockletUrl=({did:P,domain:v,mountPoint:f,params:g})=>Ui({did:P,domain:v,mountPoint:f,siteMap:x.siteMap,params:g}),x.getBlockletUrls=({did:P,mountPoint:v,params:f})=>zi({did:P,mountPoint:v,siteMap:x.siteMap,params:f}),e.jsx(Oi,{value:{routing:x},children:t})}function de(){const{routing:t}=h.useContext(cr);return t}function Vt(t){const r=[k.DOMAIN_FOR_IP_SITE_REGEXP,k.DOMAIN_FOR_DEFAULT_SITE,k.DOMAIN_FOR_IP_SITE];return typeof window<"u"&&typeof window.location<"u"&&r.push(window.location.hostname),r.includes(t)}function Mi(){return null}function dr({confirm:t=null}){const[r,n]=h.useState(null),{t:i}=z(),a=()=>{n(null)},l=async s=>{if(s){let u=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";u==="/"?ln.push(`${s.pathname}`):(u.endsWith("/")&&(u=u.substring(0,u.length-1)),ln.push(`${u}${s.pathname}`)),window.location.reload()}},o=(s,...u)=>{let m=typeof t=="function"?t(s,...u):t;return m?(typeof m=="string"&&(m={description:m}),n({title:i("common.noticeTitle"),description:i("common.leavePageTip"),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:()=>l(s),onCancel:()=>a(),...m}),!1):!0};return e.jsxs(Wi,{children:[e.jsx(Mi,{message:o}),r&&e.jsx(le,{title:r.title,description:r.description,confirm:r.confirm,cancel:r.cancel,params:r.params,onConfirm:r.onConfirm,onCancel:r.onCancel})]})}dr.propTypes={confirm:p.oneOfType([p.object,p.string,p.func])};const Wi=ne.div`
|
|
2
2
|
margin-bottom: 24px;
|
|
3
3
|
.top-btns-alert {
|
|
4
4
|
@media (max-width: ${t=>t.theme.breakpoints.values.sm}px) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aH as L,bn as I,bo as Ke,V as S,j as e,N as B,r as h,O as X,P as G,S as Q,Q as J,K as p,bp as ce,o as x,n as Re,v as U,C as Se,ac as le,aV as Y,t as H,p as De,y as _,$ as de,aU as Ie,R as $e,s as P,at as Be,H as Pe,m as Ne,bq as W,W as Ee,br as pe,bs as me,bt as ue,bu as _e,i as ze,T as $,bv as Le,ay as ie,a3 as ae,aR as re,bk as We,bw as Me,U as qe,X as Ue,A as He,u as Fe,bm as Oe,d as Ve,bx as Xe}from"./index-
|
|
1
|
+
import{aH as L,bn as I,bo as Ke,V as S,j as e,N as B,r as h,O as X,P as G,S as Q,Q as J,K as p,bp as ce,o as x,n as Re,v as U,C as Se,ac as le,aV as Y,t as H,p as De,y as _,$ as de,aU as Ie,R as $e,s as P,at as Be,H as Pe,m as Ne,bq as W,W as Ee,br as pe,bs as me,bt as ue,bu as _e,i as ze,T as $,bv as Le,ay as ie,a3 as ae,aR as re,bk as We,bw as Me,U as qe,X as Ue,A as He,u as Fe,bm as Oe,d as Ve,bx as Xe}from"./index-BfokqgHy.js";import{u as Ge,T as Qe}from"./html-title-BGLe2_e3.js";import Je from"./audit-logs-DBzxIdH4.js";import{T as xe,M as Ye}from"./index-DUCYys1s.js";import{r as he,P as Ze}from"./index-B840ZI2-.js";import{u as z,T as et}from"./team-Bz9weh46.js";import{g as tt,H as st}from"./index-CnHjhHdP.js";import{D as nt}from"./url-evaluation-D_cqsSRO.js";import{E as ot}from"./Edit-0Bz5MCrU.js";import{y as it}from"./index-zI6sbIgD.js";import{A as at}from"./Add-BqMKSndg.js";import{l as F}from"./index-BkVWAwPz.js";import{C as O}from"./click-to-copy-PtCfJ87M.js";import{f as rt}from"./index-BojVbZw0.js";import{D as ct}from"./delete-confirm-B5zJVhDV.js";import{P as lt}from"./permission-B-96KXQR.js";import{u as dt}from"./blocklet-Dr_LK1Q2.js";import{u as Z}from"./use-mobile-BW2lFrSI.js";import{A as pt}from"./actions-BTuanQTE.js";import{u as mt}from"./useAsyncRetry-JUvvbo59.js";import"./TableSearch-CuYawmb9.js";import"./Search-DVAqIV8y.js";import"./Clear-G8IA_JS7.js";import"./useLocalStorage-C-HC7dIw.js";import"./index-BQjC5QVz.js";import"./decode-DPztD6kB.js";import"./UnfoldMore-BkCizcCL.js";import"./shorten-label-Rku853mZ.js";import"./ViewList-Bb5x5Htb.js";import"./index-DIAjkldX.js";import"./ButtonGroup-Dh6lYgZM.js";import"./getValidReactChildren-2xps4qz5.js";import"./index.esm-DzozubHa.js";import"./Google-zFyeAexf.js";import"./cloneDeep-ClEOqAIj.js";import"./Autocomplete-DNyfxOFp.js";import"./ListSubheader-XzhijlHC.js";import"./AdapterDayjs-B30A4e9V.js";import"./useThemeProps-xP0TFqAL.js";import"./CSSTransition-BfkQpTwd.js";import"./visuallyHidden-Dan1xhjv.js";import"./index-Bq1Ow9Ag.js";import"./Verified-C_RgwaGs.js";import"./DeleteOutline-BVyycjCe.js";import"./ErrorOutline-Da9J9PWf.js";import"./index-C4kLAKHD.js";import"./emotion-cache.browser.esm-CHE9Rgf-.js";import"./sdk-COh1FZhu.js";import"./index-eWsGrR-q.js";import"./ua-parser-DP5omx3I.js";import"./edit.svg-BBcWA2Yv.js";import"./list-header-C68bt277.js";import"./chain-Dc18Nz_k.js";import"./ToggleButtonGroup-DzPH8xLQ.js";import"./lock.svg-CvsvGAq6.js";import"./FilterList-Cid-oBR0.js";import"./index-DTOWo4jq.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-Dxl6Fkos.js";import"./MoreVert-YC-2RtuS.js";import"./useAsync-wJrllzXI.js";function ee({value:s}){const{t,locale:n}=S(),i=new Date;return new Date(s)<i?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}ee.propTypes={value:x.string.isRequired};function te({value:s,onChange:t,...n}){const{t:i}=S(),a=h.useMemo(()=>[{value:"signature",title:i("setting.accessKey.signature"),description:i("setting.accessKey.signatureDesc")},{value:"simple",title:i("setting.accessKey.simple"),description:i("setting.accessKey.simpleDesc")}],[i]);return e.jsxs(X,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(G,{children:i("setting.accessKey.authType")}),e.jsx(Q,{value:s,onChange:t,fullWidth:!0,label:i("setting.accessKey.authType"),IconComponent:r=>e.jsx(ce,{...r,width:20,height:20}),children:a.map(r=>e.jsx(J,{value:r.value,children:e.jsxs(p,{children:[e.jsx("span",{children:r.title}),e.jsx(p,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:r.description})]})},r.value))})]})}te.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const se=()=>{const s=L.RBAC_CONFIG.roles.filter(a=>a.passport),{inService:t}=I(),{roles:n}=z(),i=[...s,...t?n:[]];return Ke(i,"name").filter(a=>a.name!==L.ROLES.OWNER)};function fe(){const{session:s}=Re(),t=se();return h.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const i=t.filter(r=>r.name==="guest");return[...t.filter(r=>r.name!=="guest").filter(r=>s.user.passports.find(f=>f.role===r.name)),...i]},[t,s?.user?.passports,s?.user?.role])}function ge({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:i}=z(),{t:a}=S(),[r,f]=h.useState(!1),[m,b]=h.useState(null),u=fe(),T=()=>{f(!1),b(null)},v=async l=>{const{remark:k,passport:g,authType:o}=l;f(!0);const j=await n.createAccessKey({input:{teamDid:i,remark:k.trim(),passport:g,expireAt:l.expireAt?new Date(l.expireAt).getTime():null,authType:o}}),{data:A}=j;s(A),b(null),f(!1)},c={title:`${a("common.create")} ${a("accessKey")}`,description:(l,k,g)=>e.jsxs(Y,{sx:{gap:3},children:[e.jsx(H,{label:a("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:l.remark,onChange:o=>{k({...l,remark:o.target.value,__disableConfirm:!l.passport||!o.target.value.trim()}),o.target.value.trim()?g(""):g(a("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(X,{style:{width:"100%"},variant:"outlined",children:[e.jsx(G,{sx:{width:"calc(100% - 46px)"},children:a("setting.accessKey.passport")}),e.jsx(Q,{"data-cy":"create-access-key-select-passport",value:l.passport,onChange:o=>{const j=o.target.value;g(null),k({...l,passport:j,__disableConfirm:!l.remark||!j})},fullWidth:!0,label:a("setting.accessKey.passport"),disabled:r,IconComponent:o=>e.jsx(ce,{...o,width:20,height:20}),children:u.map(o=>e.jsx(J,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(p,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(p,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(te,{value:l.authType,onChange:o=>{k({...l,authType:o.target.value})}}),e.jsx(xe,{placeholder:a("setting.accessKey.expireTime"),value:l.expireAt,onChange:o=>{k({...l,expireAt:o,__disableConfirm:!l.passport||!l.remark||!o})}})]}),confirm:a("common.confirm"),cancel:a("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:v,onCancel:T};return e.jsxs(e.Fragment,{children:[e.jsxs(U,{sx:{color:"common.white"},edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:()=>b(c),className:"rule-action",children:[r?e.jsx(Se,{size:16}):e.jsx(at,{style:{fontSize:16}}),a("common.create")]}),m&&e.jsx(le,{title:m.title,description:m.description,confirm:m.confirm,color:m.color,cancel:m.cancel,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}ge.propTypes={remark:x.string,onCreate:x.func};function ye({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:i=!0}){const{t:a}=h.useContext(De),[r,f]=h.useState(!1),[m,b]=h.useState(()=>i),u=I(),T=()=>{b(!m)},v=g=>{f(g.target.checked)},c=_(window.location.origin,u?.info?.routing?.adminPath),l=h.useMemo(()=>i?`const Client = require('@blocklet/server-js');
|
|
2
2
|
const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
|
|
3
3
|
const { joinURL } = require('ufo');
|
|
4
4
|
|