iobroker.eos-admin 8.0.0 → 8.0.2
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/NEXOWATT_EOS_BUILD_INFO.json +7 -6
- package/NEXOWATT_EOS_PREBUILT_MANIFEST.json +195 -107
- package/START_HERE_8.0.1.md +36 -0
- package/START_HERE_8.0.2.md +41 -0
- package/adminWww/.vite/manifest.json +278 -278
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +333 -329
- package/adminWww/assets/{AccessTime-Dpa6PKHY.js → AccessTime-5f47qrw7.js} +1 -1
- package/adminWww/assets/{AceEditor-DTzNaeVy.js → AceEditor-CJ-_Ev2E.js} +1 -1
- package/adminWww/assets/{AdapterUpdateDialog-B3y8RL_5.js → AdapterUpdateDialog-QwlPbETd.js} +3 -3
- package/adminWww/assets/Adapters-gKngfaOu.js +7 -0
- package/adminWww/assets/{AdminUtils-DDT_kD8H.js → AdminUtils-CopxRJZ2.js} +1 -1
- package/adminWww/assets/{Apps-C8LE9l6Z.js → Apps-BKnx1gzD.js} +1 -1
- package/adminWww/assets/{Book-QmHxDaHb.js → Book-DrhneQH0.js} +1 -1
- package/adminWww/assets/{Cached-f77QQBQD.js → Cached-XJmxLN4E.js} +1 -1
- package/adminWww/assets/{Computer-DFIUq-fL.js → Computer-DDMBRY5r.js} +1 -1
- package/adminWww/assets/{Config-BZDUILCW.js → Config-BwTa1LdH.js} +1 -1
- package/adminWww/assets/{ConfigManager-CFuOc_kb.js → ConfigManager-DYwC4yq9.js} +1 -1
- package/adminWww/assets/{CustomModal-B8vdCRn1.js → CustomModal-DjI4oCb8.js} +1 -1
- package/adminWww/assets/{CustomTab-DSPqif6P.js → CustomTab-_HYUrXsZ.js} +1 -1
- package/adminWww/assets/{DeleteForever-BnEM-6_v.js → DeleteForever-Caoe64_y.js} +1 -1
- package/adminWww/assets/EasyMode-CCRqFtQq.js +1 -0
- package/adminWww/assets/Enums-BTurn3-x.js +92 -0
- package/adminWww/assets/{Extension-DU1jqvic.js → Extension-D-tNJv4S.js} +1 -1
- package/adminWww/assets/{Fields-DnckPMA8.js → Fields-C2Bn4V04.js} +1 -1
- package/adminWww/assets/{Files-CwUHx0pF.js → Files-XdmhxGOR.js} +1 -1
- package/adminWww/assets/Hosts-DiTMe9fw.js +120 -0
- package/adminWww/assets/{InfoOutlined-l86Si1qa.js → InfoOutlined-DIGDQvu6.js} +1 -1
- package/adminWww/assets/Instances-DA6FIgRs.js +4 -0
- package/adminWww/assets/Intro-CJpwLg8Q.js +2 -0
- package/adminWww/assets/{KeyboardArrowRight-zZUJhG9e.js → KeyboardArrowRight-DVPBjTKi.js} +1 -1
- package/adminWww/assets/Logs-CA0mEMlO.js +2 -0
- package/adminWww/assets/{MoreHoriz-CR2kD-dc.js → MoreHoriz-BYaCptH0.js} +1 -1
- package/adminWww/assets/Objects-B2IC3Bce.js +301 -0
- package/adminWww/assets/{Overview-WwP6FjK-.js → Overview-HG8fAMFM.js} +2 -2
- package/adminWww/assets/{Pageview-DBITLOzI.js → Pageview-DFHddrKX.js} +1 -1
- package/adminWww/assets/{PersonOff-ANdO5Nu4.js → PersonOff-BwYQLD1M.js} +1 -1
- package/adminWww/assets/{PushPinOutlined-DvxsqPHo.js → PushPinOutlined-CEBeTmNm.js} +1 -1
- package/adminWww/assets/Remove-BPxvNccW.js +1 -0
- package/adminWww/assets/{Schedule-BMMrgd7j.js → Schedule-BQlh1nhQ.js} +1 -1
- package/adminWww/assets/{Star-DNdm064z.js → Star-ChMjBwLn.js} +1 -1
- package/adminWww/assets/State-UGfoS6qW.js +1 -0
- package/adminWww/assets/Storage-DrC3j-wf.js +1 -0
- package/adminWww/assets/{TextSnippet-Bywi1YuG.js → TextSnippet-BQ4TSmvS.js} +1 -1
- package/adminWww/assets/{Timeline-IQCnSLiw.js → Timeline-CEyldmz2.js} +1 -1
- package/adminWww/assets/{Timer-Be9yF62g.js → Timer-I0twtyWh.js} +1 -1
- package/adminWww/assets/{UnfoldMore-Du7-8wYn.js → UnfoldMore-_DDSfPKk.js} +1 -1
- package/adminWww/assets/{Usb-Ca47vqRv.js → Usb-Dwk7qdYu.js} +1 -1
- package/adminWww/assets/{UsedResources-CMTzFOX3.js → UsedResources-B6HWeXGX.js} +2 -2
- package/adminWww/assets/Users-DFeYuC5y.js +1 -0
- package/adminWww/assets/{ViewCompact-C3SC0jFF.js → ViewCompact-BbfomOIi.js} +1 -1
- package/adminWww/assets/ViewList-1pB5VinA.js +1 -0
- package/adminWww/assets/{ViewSidebar-kHvah-XS.js → ViewSidebar-DdedDirX.js} +1 -1
- package/adminWww/assets/{VpnKey-iMA7KrB-.js → VpnKey-o8QeqmnU.js} +1 -1
- package/adminWww/assets/{WifiTethering-Da8nW7Do.js → WifiTethering-Cp63fmkC.js} +1 -1
- package/adminWww/assets/{_virtual_mf-localSharedImportMap___mfe_internal__iobroker_admin__mf_owner__1-CpelrCgN.js → _virtual_mf-localSharedImportMap___mfe_internal__iobroker_admin__mf_owner__1-uaKFfE5p.js} +1 -1
- package/adminWww/assets/{bootstrap-Bs4TZ7iA.js → bootstrap-DSDOwKWU.js} +33 -33
- package/adminWww/assets/{date-fns-Bpgjk9P-.js → date-fns-ukillHs-.js} +1 -1
- package/adminWww/assets/helpers-CDcY0YJ-.js +1 -0
- package/adminWww/assets/{hostInit-2xIZYDSq.js → hostInit-Cd61hJHh.js} +1 -1
- package/adminWww/assets/{icons-material-BLgrEUSv.js → icons-material-Dms1APQk.js} +1 -1
- package/adminWww/assets/{index-BZifaJHi.js → index-D6uhIclX.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-Pe6-VnD2.js → installSVGRenderer-BR-zIijZ.js} +1 -1
- package/adminWww/assets/{lib-CE1B3iHH.js → lib-BZRGBDoe.js} +2 -2
- package/adminWww/assets/{loadShare-eager-CRNcc8D7.js → loadShare-eager-BpwDZfDr.js} +93 -93
- package/adminWww/assets/{mf-entry-bootstrap-0-a6a54377.js → mf-entry-bootstrap-0-2d631020.js} +3 -3
- package/adminWww/assets/{pendingShares-CuQbFsaK.js → pendingShares-D1Vr_qYv.js} +2 -2
- package/adminWww/assets/{sentry-B4uGc7ut.js → sentry-BFzW-2KQ.js} +1 -1
- package/adminWww/assets/{setYear-DurmWw03.js → setYear-DhVdgUBF.js} +1 -1
- package/adminWww/css/nexowatt-native-shell.css +72 -0
- package/adminWww/index.html +21 -21
- package/adminWww/js/eos-license-link.js +9 -16
- package/adminWww/js/nexowatt-native-shell.js +2 -2
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/{remoteEntry-eos-8.0.0.js → remoteEntry-eos-8.0.2.js} +2 -2
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosSessionSecurity.js +12 -4
- package/build/lib/eosSessionSecurity.js.map +1 -1
- package/build/lib/vendor/webserver/LICENSE +21 -0
- package/build/lib/vendor/webserver/README.md +506 -0
- package/build/lib/vendor/webserver/build/index.d.ts +9 -0
- package/build/lib/vendor/webserver/build/index.js +42 -0
- package/build/lib/vendor/webserver/build/index.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/acmeChallenge.d.ts +65 -0
- package/build/lib/vendor/webserver/build/lib/acmeChallenge.js +149 -0
- package/build/lib/vendor/webserver/build/lib/acmeChallenge.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/certificateManager.d.ts +60 -0
- package/build/lib/vendor/webserver/build/lib/certificateManager.js +128 -0
- package/build/lib/vendor/webserver/build/lib/certificateManager.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/http2Compat.d.ts +21 -0
- package/build/lib/vendor/webserver/build/lib/http2Compat.js +109 -0
- package/build/lib/vendor/webserver/build/lib/http2Compat.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-authcode.d.ts +167 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-authcode.js +619 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-authcode.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-clients.d.ts +92 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-clients.js +230 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-clients.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-model.d.ts +84 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-model.js +388 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-model.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/oauth2.d.ts +75 -0
- package/build/lib/vendor/webserver/build/lib/oauth2.js +625 -0
- package/build/lib/vendor/webserver/build/lib/oauth2.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/securityChecker.d.ts +6 -0
- package/build/lib/vendor/webserver/build/lib/securityChecker.js +96 -0
- package/build/lib/vendor/webserver/build/lib/securityChecker.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/usedResources.d.ts +62 -0
- package/build/lib/vendor/webserver/build/lib/usedResources.js +231 -0
- package/build/lib/vendor/webserver/build/lib/usedResources.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/utils.d.ts +35 -0
- package/build/lib/vendor/webserver/build/lib/utils.js +110 -0
- package/build/lib/vendor/webserver/build/lib/utils.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/webServer.d.ts +164 -0
- package/build/lib/vendor/webserver/build/lib/webServer.js +454 -0
- package/build/lib/vendor/webserver/build/lib/webServer.js.map +1 -0
- package/build/lib/vendor/webserver/package.json +63 -0
- package/build/lib/web.js +26 -6
- package/build/lib/web.js.map +1 -1
- package/docs/ADMIN8_MIGRATION_8.0.0_DE.md +4 -0
- package/docs/cra/CRA_IEC_GAP_ANALYSIS_2026-09-30.md +10 -0
- package/docs/security/admin8-2026-11-04/development-1.log +4 -4
- package/docs/security/admin8-2026-11-04/development-2.log +275 -233
- package/docs/security/admin8-2026-11-05/copy-update/evidence-sha256.json +0 -5
- package/docs/security/admin8-2026-11-05/login-fix/BACKEND_DIAGNOSE_DE.md +48 -0
- package/docs/security/admin8-2026-11-05/login-fix/REPORT_DE.md +47 -0
- package/docs/security/admin8-2026-11-05/login-fix/REVIEW_DE.md +7 -0
- package/docs/security/admin8-2026-11-05/login-fix/controller-adapter-api.ts.txt +122 -0
- package/docs/security/admin8-2026-11-05/login-fix/controller-file-view.ts.txt +75 -0
- package/docs/security/admin8-2026-11-05/login-fix/controller-redis-view.ts.txt +471 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/LICENSE-webserver-3.4.0 +21 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/REPORT_DE.md +41 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/evidence-sha256.json +116 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/http-consumer-check.cjs +58 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/README_DE.md +9 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/REJECTED-webserver-3.4.0-eos-oauth.provenance.json +263 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/REJECTED-webserver-3.4.0-eos-oauth.tgz +0 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/admission.log +16 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-audit-stderr.log +1 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-audit.json +22 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-fixture-1.0.0.tgz +0 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-fixture-package.json +11 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-npm10-package-lock.json +387 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-npm11-package-lock.json +387 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/evidence-sha256.json +85 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/http-consumer-npm10-node22.json +11 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/http-consumer-npm11-node24.json +11 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/local-tests.json +38 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/tests-node22.log +168 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/tests-node24.log +36 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests-node22.log +224 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests-node24.log +42 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests.json +31 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/webserver-3.4.0-upstream.tgz +0 -0
- package/docs/security/admin8-2026-11-05/login-fix/eos-session-8.0.0.js.txt +385 -0
- package/docs/security/admin8-2026-11-05/login-fix/evidence-sha256.json +59 -0
- package/docs/security/admin8-2026-11-05/login-fix/path-budget.json +6 -0
- package/docs/security/admin8-2026-11-05/login-fix/provenance.json +51 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/admission.log +21 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/archive-scan.json +13 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/artifacts.log +6 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/backend-build.log +5 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/consumer-package-lock.json +3258 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/copy-update-journal.json +165 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/development.log +365 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/frontend-build.log +149 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-audit.json +22 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-audit.stderr +2 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-final-install-node22.log +9 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node22.json +15 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node22.stderr +2 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node24.json +15 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node24.stderr +0 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/inventory.log +8 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/npm-pack-final.json +7809 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/npm-pack-final.stderr +6 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/overlay-final-publish-node22.json +10213 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/overlay-final-publish-node22.stderr +282 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/pipeline.json +72 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/seal.log +6 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/vendor-final-review-node24.log +18 -0
- package/docs/security/admin8-2026-11-05/login-fix/reproduce.cjs +79 -0
- package/docs/security/admin8-2026-11-05/login-fix/reproduction.json +80 -0
- package/docs/security/admin8-2026-11-05/login-fix/upstream-LICENSE.txt +22 -0
- package/docs/security/admin8-2026-11-05/login-fix/validation.json +85 -0
- package/docs/security/admin8-2026-11-05/system-fix/BACKEND_ROLE_REVIEW_DE.md +79 -0
- package/docs/security/admin8-2026-11-05/system-fix/NAVIGATION_DE.md +30 -0
- package/docs/security/admin8-2026-11-05/system-fix/REPORT_DE.md +51 -0
- package/docs/security/admin8-2026-11-05/system-fix/REVIEW_DE.md +65 -0
- package/docs/security/admin8-2026-11-05/system-fix/SCOPE_DE.md +21 -0
- package/docs/security/admin8-2026-11-05/system-fix/SYSTEM_DE.md +44 -0
- package/docs/security/admin8-2026-11-05/system-fix/archive-scan.json +12 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/README.md +46 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/integrity.json +16 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/system-browser-result.json +3607 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/system-browser.cjs +221 -0
- package/docs/security/admin8-2026-11-05/system-fix/browser/system-fixture.cjs +60 -0
- package/docs/security/admin8-2026-11-05/system-fix/evidence-sha256.json +49 -0
- package/docs/security/admin8-2026-11-05/system-fix/license-ui-tests-node22.log +80 -0
- package/docs/security/admin8-2026-11-05/system-fix/license-ui-tests-node24.log +19 -0
- package/docs/security/admin8-2026-11-05/system-fix/navigation/lint.log +0 -0
- package/docs/security/admin8-2026-11-05/system-fix/navigation/node22-tests.log +56 -0
- package/docs/security/admin8-2026-11-05/system-fix/navigation/node24-tests.log +15 -0
- package/docs/security/admin8-2026-11-05/system-fix/navigation/source-sha256.json +11 -0
- package/docs/security/admin8-2026-11-05/system-fix/path-budget.json +7 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/artifacts.log +6 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/audit-root.json +22 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/audit-root.stderr +1 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/backend-build.log +5 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/clean.log +6 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/consumer-audit.json +22 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/consumer-audit.stderr +2 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/consumer-install.log +4 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/consumer-package-lock.json +3258 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/development.log +392 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/frontend-build.log +149 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/http-node22.json +15 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/http-node24.json +15 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/inventory.log +8 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/overlay-journal.json +452 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/overlay-publish.log +10790 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/overlay-validation.json +12 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/pack.json +8104 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/pack.stderr +6 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/retired-801.json +68 -0
- package/docs/security/admin8-2026-11-05/system-fix/release/seal.log +6 -0
- package/docs/security/admin8-2026-11-05/system-fix/review-tests.log +30 -0
- package/docs/security/admin8-2026-11-05/system-fix/role-context-before.log +86 -0
- package/docs/security/admin8-2026-11-05/system-fix/role-context-lint.log +0 -0
- package/docs/security/admin8-2026-11-05/system-fix/role-context-node22.log +44 -0
- package/docs/security/admin8-2026-11-05/system-fix/role-context-test.log +13 -0
- package/docs/security/admin8-2026-11-05/system-fix/validation.json +90 -0
- package/docs/third-party/admin8/NOTICE-PROVENANCE.json +3 -3
- package/io-package.json +13 -15
- package/package.json +10 -4
- package/release-manifests/admin8-development-validation.json +136 -43
- package/reports/security/artifact-inventory.json +822 -587
- package/reports/security/inventory-summary.json +39 -17
- package/reports/security/sbom-backend-lock.cdx.json +108 -111
- package/reports/security/sbom-frontend-lock.cdx.json +5 -5
- package/reports/security/source-runtime-manifest.json +553 -163
- package/tools/nexowatt-admin8-development-check.cjs +8 -1
- package/tools/nexowatt-artifact-inventory.cjs +8 -1
- package/tools/nexowatt-installer-ems-selftest.cjs +1 -1
- package/tools/nexowatt-lock-provenance-check.cjs +8 -3
- package/tools/nexowatt-repair-lock-metadata.cjs +3 -3
- package/tools/nexowatt-role-security-selftest.cjs +2 -2
- package/tools/nexowatt-security-inventory.cjs +22 -1
- package/tools/nexowatt-user-area-selftest.cjs +1 -1
- package/tools/nexowatt-v7109-clean-core-selftest.cjs +1 -1
- package/tools/nexowatt-vendored-webserver.cjs +69 -0
- package/tools/vendor/eos-retired-release-files.json +268 -1
- package/tools/vendor/webserver-3.4.0-source.provenance.json +244 -0
- package/adminWww/assets/Adapters-BDxfhfGe.js +0 -7
- package/adminWww/assets/EasyMode-TwIN5yxu.js +0 -1
- package/adminWww/assets/Enums-CSzSzWm7.js +0 -92
- package/adminWww/assets/Hosts-QkyuASJy.js +0 -120
- package/adminWww/assets/Instances-BaWBemTT.js +0 -4
- package/adminWww/assets/Intro-DsfrPrWv.js +0 -2
- package/adminWww/assets/Logs-Cngy2Opt.js +0 -2
- package/adminWww/assets/Objects-DY8KS7zK.js +0 -301
- package/adminWww/assets/Remove-DplJatnC.js +0 -1
- package/adminWww/assets/State-vP1o2BCL.js +0 -1
- package/adminWww/assets/Storage-COo2RkS1.js +0 -1
- package/adminWww/assets/Users-BjTGOjzL.js +0 -1
- package/adminWww/assets/ViewList-DuKCnBnc.js +0 -1
- package/adminWww/assets/helpers-DBoACUHw.js +0 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"name": "@iobroker/webserver",
|
|
4
|
+
"version": "3.4.0",
|
|
5
|
+
"upstream": {
|
|
6
|
+
"url": "https://registry.npmjs.org/@iobroker/webserver/-/webserver-3.4.0.tgz",
|
|
7
|
+
"integrity": "sha512-o9IM9/uZsB/wAgTioVsXPUnmRRUugmokfQ98uc5vwvlDKt5vNhaVwrEySk9j5SWwmz8C7m6JX5z8x5hzhXbwNQ==",
|
|
8
|
+
"sha256": "9da0473e723b0863ac1e1d2622e4ed268fa332d7f82448201692f213346ebf32",
|
|
9
|
+
"archive": "docs/security/admin8-2026-11-05/login-fix/dependency/webserver-3.4.0-upstream.tgz",
|
|
10
|
+
"license": "MIT"
|
|
11
|
+
},
|
|
12
|
+
"sourceRoot": "src/lib/vendor/webserver",
|
|
13
|
+
"runtimeRoot": "build/lib/vendor/webserver",
|
|
14
|
+
"changes": {
|
|
15
|
+
"upstreamFilesChanged": 0,
|
|
16
|
+
"upstreamFilesTotal": 39,
|
|
17
|
+
"integration": "Source-vendored upstream package; root dependency oauth2-server is the exact maintained npm alias. No file: package dependency remains."
|
|
18
|
+
},
|
|
19
|
+
"directDependencies": {
|
|
20
|
+
"oauth2-server": {
|
|
21
|
+
"specifier": "npm:@node-oauth/oauth2-server@5.3.1",
|
|
22
|
+
"entry": {
|
|
23
|
+
"name": "@node-oauth/oauth2-server",
|
|
24
|
+
"version": "5.3.1",
|
|
25
|
+
"resolved": "https://registry.npmjs.org/@node-oauth/oauth2-server/-/oauth2-server-5.3.1.tgz",
|
|
26
|
+
"integrity": "sha512-zT822tqX/Y7VWTcxN02uzeYn8RirKpRAuX56JARb0Bl5RIL+LBMjkW5GAPAl0yZps3ReqNT5J+Mn58Oyljy3Lw=="
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"jsonwebtoken": {
|
|
30
|
+
"specifier": "9.0.3",
|
|
31
|
+
"entry": {
|
|
32
|
+
"version": "9.0.3",
|
|
33
|
+
"resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz",
|
|
34
|
+
"integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g=="
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"jwks-rsa": {
|
|
38
|
+
"specifier": "4.1.0",
|
|
39
|
+
"entry": {
|
|
40
|
+
"version": "4.1.0",
|
|
41
|
+
"resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-4.1.0.tgz",
|
|
42
|
+
"integrity": "sha512-sbkByqyATKYJP5F4RXj03N5TUNC0QLTjCAZvwTzC4BwJZ8e0/cWxN8YROnyUth2g1/ONWi4eSFHeu6oYalrc3Q=="
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
{
|
|
48
|
+
"path": "LICENSE",
|
|
49
|
+
"bytes": 1117,
|
|
50
|
+
"sha256": "25eafd015052f4cacfaaecf7625544f1f546cf9ead289bd0e5b1f43f709db8a7"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"path": "README.md",
|
|
54
|
+
"bytes": 26622,
|
|
55
|
+
"sha256": "0a2281681675298ae37784f9cb045ebd69293333b54ba246355a8d182e4cd39b"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"path": "build/index.d.ts",
|
|
59
|
+
"bytes": 846,
|
|
60
|
+
"sha256": "9f98a0b18fe2c59aef32b53db855b91760664d2b79a58a3be4d9f56d2deabd1a"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"path": "build/index.js",
|
|
64
|
+
"bytes": 3945,
|
|
65
|
+
"sha256": "c9f552e66b06cb2884c1122db0424698bce6a038f79fe0eb9690fae1c4c3aecf"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"path": "build/index.js.map",
|
|
69
|
+
"bytes": 597,
|
|
70
|
+
"sha256": "e4a8fca4764823304f9405da77407da673edc5fc523885999e29ab8c73c962b1"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"path": "build/lib/acmeChallenge.d.ts",
|
|
74
|
+
"bytes": 2917,
|
|
75
|
+
"sha256": "b6cae135e2dce695d6b37535998ecced7ea1fe543307966e368d1554d6f1e696"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"path": "build/lib/acmeChallenge.js",
|
|
79
|
+
"bytes": 5933,
|
|
80
|
+
"sha256": "9fa156ba5961a7b3d16897a0c0054d4e5712dde32ca7754546a06499640bcc07"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"path": "build/lib/acmeChallenge.js.map",
|
|
84
|
+
"bytes": 2849,
|
|
85
|
+
"sha256": "eb5ae2d9af3f63aa8cb4b748528a32796df2dccc3aae4bff9944c4ca137ceede"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"path": "build/lib/certificateManager.d.ts",
|
|
89
|
+
"bytes": 2348,
|
|
90
|
+
"sha256": "faed9f8df8a074bc2e60f89fb15f68e48931f22fad1571c06a1c837d7f241721"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"path": "build/lib/certificateManager.js",
|
|
94
|
+
"bytes": 4999,
|
|
95
|
+
"sha256": "5a39b7b10fe7197cf846479a8873ca119d32177fc604cf359a7065f45345b980"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"path": "build/lib/certificateManager.js.map",
|
|
99
|
+
"bytes": 3403,
|
|
100
|
+
"sha256": "60198771e60c0b6767567712655d8be972c82560c3eb2fae36dc8dc5225804b2"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"path": "build/lib/http2Compat.d.ts",
|
|
104
|
+
"bytes": 1285,
|
|
105
|
+
"sha256": "5f49d6b8de92176c90a000e01328680f82710d370a024f37961908a30bf03351"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"path": "build/lib/http2Compat.js",
|
|
109
|
+
"bytes": 5842,
|
|
110
|
+
"sha256": "0822d5bcbf3157b5940dd027a36976aead38e407dfdb1911e1165a788148ef09"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"path": "build/lib/http2Compat.js.map",
|
|
114
|
+
"bytes": 3140,
|
|
115
|
+
"sha256": "6a522526272eb1c116bc94a534bbcccc93f74cde71e0db24ed7a920561f20d91"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"path": "build/lib/oauth2-authcode.d.ts",
|
|
119
|
+
"bytes": 6752,
|
|
120
|
+
"sha256": "0bc02a98868697533a613b77f52692d9287545d40fd03514eba7c742ba813a5b"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"path": "build/lib/oauth2-authcode.js",
|
|
124
|
+
"bytes": 28279,
|
|
125
|
+
"sha256": "ef4c3c13bfb3213fce33dd04a0ccc76fe2c705e18b99cabc1bbaa5114540bb71"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"path": "build/lib/oauth2-authcode.js.map",
|
|
129
|
+
"bytes": 17168,
|
|
130
|
+
"sha256": "9f9fa457b60a2588176eeccdbad2a1e8968beb2a2cf94f3cc5df3f6b3e7d0f11"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"path": "build/lib/oauth2-clients.d.ts",
|
|
134
|
+
"bytes": 4094,
|
|
135
|
+
"sha256": "5760c7cdec8acd699e97a2ea4279729c73dbd57833632b1f6dc83edc185a6452"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"path": "build/lib/oauth2-clients.js",
|
|
139
|
+
"bytes": 10772,
|
|
140
|
+
"sha256": "8e3132f084aa43d06f599b90e9be7536bfd90be6f09d61f25682507ae68f53cb"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"path": "build/lib/oauth2-clients.js.map",
|
|
144
|
+
"bytes": 6721,
|
|
145
|
+
"sha256": "6963ffba4664afef71b1e3405516abbfb1f055f9ab6758dfa4436369bbb926e6"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"path": "build/lib/oauth2-model.d.ts",
|
|
149
|
+
"bytes": 3464,
|
|
150
|
+
"sha256": "a7667303fe7b4fcf7c53f78f36922156304ceb0815fb0f939d3effd3a7b624dd"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"path": "build/lib/oauth2-model.js",
|
|
154
|
+
"bytes": 18232,
|
|
155
|
+
"sha256": "3c28f83e2d19e53bbec6722bf332b0996d6cd9f27c424eb6aced2e4f5f2172e6"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"path": "build/lib/oauth2-model.js.map",
|
|
159
|
+
"bytes": 13397,
|
|
160
|
+
"sha256": "c1b40e0ec9c34a0ab9bd219dffc0422db5b53362f99d86e09926d2916d82c6ca"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"path": "build/lib/oauth2.d.ts",
|
|
164
|
+
"bytes": 4141,
|
|
165
|
+
"sha256": "2477e031b84a9fb9d83548089b2838ac6af25639ab5e2c9611e1bb4c87356ae1"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"path": "build/lib/oauth2.js",
|
|
169
|
+
"bytes": 29682,
|
|
170
|
+
"sha256": "fd8df9984ce5d1bc91f6d6ceb01736baa3c625b18f0251e7c5aa824996194207"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"path": "build/lib/oauth2.js.map",
|
|
174
|
+
"bytes": 18401,
|
|
175
|
+
"sha256": "a7a7dec34e86e8af22fcc4e91f4fb58ca26d8a3c3e46b4fc3ccc1e0cab37b22e"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"path": "build/lib/securityChecker.d.ts",
|
|
179
|
+
"bytes": 262,
|
|
180
|
+
"sha256": "d5060ee1e796982efe6c2cdbe53bd79a6173bf56a5964e46028d294f4aae1f75"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"path": "build/lib/securityChecker.js",
|
|
184
|
+
"bytes": 3844,
|
|
185
|
+
"sha256": "e11aa966e39f2841086196d877693aa0a0153327377b214d7a15ab83a7f5ae9e"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"path": "build/lib/securityChecker.js.map",
|
|
189
|
+
"bytes": 3343,
|
|
190
|
+
"sha256": "7a67a00617809584b2aac656c5484bac7c11339f38eb8f79c6861082b13bcf6d"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"path": "build/lib/usedResources.d.ts",
|
|
194
|
+
"bytes": 3012,
|
|
195
|
+
"sha256": "693d47767d706722372f3bbee830309b69cd5195d72c1871623e50c8b3949ff9"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"path": "build/lib/usedResources.js",
|
|
199
|
+
"bytes": 10382,
|
|
200
|
+
"sha256": "f36a4a09decc157c7427660ed2003c5b27bbcb55bc0d87df430f3623c42a8420"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"path": "build/lib/usedResources.js.map",
|
|
204
|
+
"bytes": 4676,
|
|
205
|
+
"sha256": "424297f2dda07c7e288440a07b094dbfac408feebbbba12f270b6ccd0c0fffa4"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"path": "build/lib/utils.d.ts",
|
|
209
|
+
"bytes": 1481,
|
|
210
|
+
"sha256": "a4ff620f30cba1c777fed7c5ed2aeefa1aa375d6a5ab5e44163a23780b1c3337"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"path": "build/lib/utils.js",
|
|
214
|
+
"bytes": 3853,
|
|
215
|
+
"sha256": "aa0addf0a2cf77801d231d54bafa7fd5df94fccc3fe107cc07e44a3024d8fb3f"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"path": "build/lib/utils.js.map",
|
|
219
|
+
"bytes": 3043,
|
|
220
|
+
"sha256": "cf7999464f6df42b86b25e42bf6309eff3d1216b06c15496cc5687aa594bfdb4"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"path": "build/lib/webServer.d.ts",
|
|
224
|
+
"bytes": 6980,
|
|
225
|
+
"sha256": "de62ab1e7e9e795de518f829e9ace4ea47d5b915a439f26731f4f9cdbe67f0dc"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"path": "build/lib/webServer.js",
|
|
229
|
+
"bytes": 22191,
|
|
230
|
+
"sha256": "99fd42ad30ebc4a273a6ab86e475d04f9fddeac0d015811095c054e1b8738f50"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"path": "build/lib/webServer.js.map",
|
|
234
|
+
"bytes": 13558,
|
|
235
|
+
"sha256": "9bc89141be382911bf380e4f9e78bf82c1d8f0e4bb749b37136334b178931216"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"path": "package.json",
|
|
239
|
+
"bytes": 1691,
|
|
240
|
+
"sha256": "36427ac6c75e2360a231b383ba2664273f903e92c0474ec66beffc10f66783d6"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"limitations": "Original package metadata describes its upstream packaging, not the EOS install graph. Only the root manifest and lock define installed direct dependencies."
|
|
244
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{$a as e,$o as t,An as n,Ar as r,Br as i,Ci as a,Ds as o,Eo as s,Es as c,Fo as l,Ga as u,Go as d,Gr as f,Ho as p,Hs as m,Is as h,Jo as g,Ka as _,Ls as v,Mo as y,Ni as ee,No as b,On as te,Oo as x,Pi as ne,Qo as re,Qs as ie,Rr as ae,Rs as oe,So as se,To as ce,Tr as S,Ts as C,Ua as le,Ui as ue,Us as w,Vo as de,Vs as T,Xn as fe,Yo as pe,Zo as E,_o as D,as as me,ba as he,bo as O,br as ge,ca as _e,co as ve,da as ye,ei as be,eo as xe,es as Se,fa as Ce,gs as we,ho as k,io as Te,is as Ee,ja as De,jo as A,ki as Oe,kn as ke,ls as Ae,ma as je,mo as j,ms as Me,no as M,oc as Ne,oo as N,po as Pe,ps as Fe,qa as P,qo as F,qs as I,r as L,ro as Ie,rs as Le,ss as R,ta as Re,tc as z,tn as ze,to as Be,ts as Ve,uo as B,us as He,vi as Ue,wi as We,wo as Ge,zo as Ke,zr as qe,zs as Je}from"./loadShare-eager-CRNcc8D7.js";import{a as Ye,c as Xe,d as Ze,f as Qe,i as $e,l as et,n as tt,o as nt,p as rt,r as it,s as at,t as ot,u as st}from"./Star-DNdm064z.js";import{f as ct}from"./WifiTethering-Da8nW7Do.js";import{t as lt}from"./DeleteForever-BnEM-6_v.js";import{t as ut}from"./Remove-DplJatnC.js";import{t as dt}from"./ViewList-DuKCnBnc.js";import{n as ft,o as pt,r as mt,t as ht}from"./AdminUtils-DDT_kD8H.js";import{A as gt,E as _t,F as V,I as vt,O as yt,Q as bt,_t as xt,i as St,j as Ct,n as wt,q as Tt}from"./bootstrap-Bs4TZ7iA.js";import{n as Et,r as Dt,t as Ot}from"./sentry-B4uGc7ut.js";import{i as kt,n as At,r as jt,t as Mt}from"./AdapterUpdateDialog-B3y8RL_5.js";import{t as Nt}from"./CustomModal-B8vdCRn1.js";c();var H={smallAvatar:{width:24,height:24},listItem:e=>({mb:`2px`,background:e.palette.background,"@media screen and (max-width: 400px)":{pl:`2px`}}),toVersion:e=>({color:e.palette.mode===`dark`?`#00dc00`:`#008100`,fontWeight:`bold`,ml:`4px`}),updateDone:{background:`#5ef05e80`,opacity:.7},minWidthCss:{"@media screen and (max-width: 400px)":{minWidth:32}},wrapperButton:{},typography:{paddingRight:30},versions:{minWidth:110,display:`inline-block`},closeButton:e=>({position:`absolute`,right:8,top:8,color:e.palette.grey[500]}),languageButton:{position:`absolute`,right:60,top:8},languageButtonActive:e=>({color:e.palette.primary.main}),versionHeader:e=>({background:`#4dabf5`,borderRadius:`3px`,pl:`10px`,fontWeight:`bold`,color:e.palette.mode===`dark`?`black`:`white`}),repoStableVersionText:e=>({color:e.palette.mode===`dark`?`#8dff7a`:`#2b9800`,fontWeight:`bold`,marginLeft:`4px`}),repoLatestVersionText:e=>({color:e.palette.mode===`dark`?`#a3fcff`:`#005498`,fontWeight:`bold`,marginLeft:`4px`})},Pt=class e extends z{constructor(e){super(e),C(this,`updateAvailable`,void 0),C(this,`initialVersions`,void 0),C(this,`currentRef`,void 0),C(this,`current`,void 0),this.updateAvailable=this.detectUpdates(),this.initialVersions={},this.updateAvailable.forEach(e=>this.initialVersions[e]=this.props.installed[e].version),this.state={showNews:null},this.currentRef=I.createRef(),this.current=e.current,this.props.onUpdateSelected([...this.updateAvailable],this.updateAvailable)}static isUpdateAvailable(e){let{oldVersion:t,newVersion:n,name:r}=e;try{return L.gt(n,t)}catch{return console.warn(`Cannot compare "${n}" and "${t}" of adapter ${r}`),!1}}detectUpdates(){let t=[];return Object.keys(this.props.repository).forEach(n=>{let r=this.props.installed[n];n!==`js-controller`&&n!==`admin`&&n!==`eos-admin`&&r&&this.props.repository[n].version&&r.ignoreVersion!==this.props.repository[n].version&&e.isUpdateAvailable({oldVersion:r.version,newVersion:this.props.repository[n].version,name:n})&&(At(this.props.repository[n].messages,r.version,this.props.repository[n].version)?console.log(`Adapter ${n} is filtered out from update all functionality, because it has messages which need to be read before update`):this.props.rightDependenciesFunc(n)?t.push(n):console.log(`Adapter ${n} is filtered out from update all functionality, because its dependencies are not met`))}),t.sort(),t}getNews(e){let t=this.props.repository[e],n=this.props.installed[e],r=[],i=t==null?void 0:t.news;return n&&i&&Object.keys(i).forEach(t=>{try{L.gt(t,n.version)&&r.push({version:t,news:this.props.noTranslation?i[t].en:i[t][this.props.lang]||i[t].en})}catch{console.warn(`Cannot compare "${t}" and "${n.version}" of adapter ${e}`)}}),r}renderOneAdapter(e){var t;let n=this.props.selected.includes(e);if((this.props.finished||this.props.inProcess)&&!n||!this.props.installed[e])return null;let r=this.props.installed[e].localIcon,i=r?`.${r}`:((t=this.props.repository[e])==null?void 0:t.extIcon)||`img/no-image.svg`;return w(Se,{dense:!0,sx:{"&.MuiListItem-root":f.getStyle(this.props.theme,H.listItem,this.props.updated.includes(e)&&H.updateDone)},ref:this.props.current===e?this.currentRef:null,secondaryAction:!this.props.finished&&!this.props.inProcess?m(s,{edge:`end`,checked:n,tabIndex:-1,disableRipple:!0,disabled:this.props.inProcess,onClick:()=>{let t=[...this.props.selected],n=t.indexOf(e);n===-1?(t.push(e),t.sort()):t.splice(n,1),this.props.onUpdateSelected(t)}}):this.props.current===e&&!this.props.stopped&&!this.props.finished&&m(x,{}),children:[m(Le,{sx:H.minWidthCss,children:m(we,{variant:`square`,alt:e,src:i,style:H.smallAvatar})}),m(Ee,{primary:e,title:this.getNews(e).map(e=>`${e.version}: ${e.news}`).join(`
|
|
2
|
-
`),secondary:w(`span`,{children:[w(`div`,{style:H.versions,children:[this.initialVersions[e],` →`,m(D,{component:`span`,sx:H.toVersion,children:this.props.repository[e].version})]}),m(F,{title:S.t(`Show change log`),onClick:()=>this.setState({showNews:{adapter:e,version:this.props.repository[e].version,fromVersion:this.initialVersions[e]}}),size:`small`,children:m(Re,{})})]})})]},e)}getReactNews(e,t){let n=this.props.repository[e],r=this.props.installed[e];t||=r.version;let i=[],a,o,s=this.props.repository._repoInfo;if(s!=null&&s.stable){var c,l;a=(c=this.props.repository[e])==null?void 0:c.version,o=(l=this.props.repository[e])==null?void 0:l.latestVersion}else{var u,f;a=(u=this.props.repository[e])==null?void 0:u.stable,o=(f=this.props.repository[e])==null?void 0:f.version}let p=n==null?void 0:n.news;return r&&p&&Object.keys(p).forEach(n=>{try{if(L.gt(n,t)&&p[n]){let e=(this.props.noTranslation?p[n].en||``:p[n][this.props.lang]||p[n].en||``).split(`
|
|
3
|
-
`).map(e=>kt(e.trim()).replace(/<!--[^>]*->/g,``).replace(/<! -[^>]*->/g,``).trim()).filter(e=>!!e);i.push(w(d,{children:[w(k,{sx:H.versionHeader,children:[n,o===n?m(D,{component:`span`,sx:H.repoLatestVersionText,children:`(latest)`}):null,a===n?m(D,{component:`span`,sx:H.repoStableVersionText,children:`(${S.t(`stable`)})`}):null]}),e.map((e,t)=>m(jt,{text:e},`${n}-${t}`))]},n))}}catch{console.warn(`Cannot compare "${n}" and "${t}" of adapter ${e}`)}}),i}renderShowNews(){if(this.state.showNews){let e=this.getReactNews(this.state.showNews.adapter,this.state.showNews.fromVersion),t=f.getStyle(this.props.theme,H.closeButton),n=f.getStyle(this.props.theme,H.languageButtonActive);return w(A,{onClose:()=>this.setState({showNews:null}),open:!0,children:[m(l,{children:w(k,{component:`h2`,variant:`h6`,sx:{"&.MuiTypography-root":H.typography},children:[m(`div`,{style:{width:`calc(100% - 60px)`},children:S.t(`Update "%s" to v%s`,this.state.showNews.adapter,this.state.showNews.version)}),m(F,{size:`large`,style:t,onClick:()=>this.setState({showNews:null}),children:m(P,{})}),S.getLanguage()!==`en`&&this.props.toggleTranslation?m(F,{size:`large`,style:{...H.languageButton,...this.props.noTranslation?n:void 0},onClick:this.props.toggleTranslation,title:S.t(`Disable/Enable translation`),children:m(De,{})}):null]})}),m(b,{dividers:!0,children:m(d,{container:!0,spacing:2,wrap:`nowrap`,sx:{flexDirection:`column`},children:e.length?w(d,{children:[m(k,{variant:`h6`,gutterBottom:!0,children:S.t(`Change log`)}),m(d,{container:!0,spacing:2,wrap:`nowrap`,sx:{flexDirection:`column`},children:e})]}):S.t(`No change log available`)})}),m(y,{style:H.wrapperButton,children:m(O,{variant:`contained`,onClick:()=>this.setState({showNews:null}),color:`grey`,startIcon:m(P,{}),children:S.t(`Close`)})})]})}return null}render(){return this.current!==this.props.current&&(this.current=this.props.current,setTimeout(()=>{var e;return(e=this.currentRef.current)==null?void 0:e.scrollIntoView()},200)),w(t,{style:H.root,children:[this.updateAvailable.map(e=>this.renderOneAdapter(e)),this.renderShowNews()]})}};c();var U={dialogRoot:{height:`calc(100% - 64px)`},wrapperHead:{justifyContent:`space-between`,display:`flex`},checkbox:{marginRight:10},appBar:e=>({flexWrap:`wrap`,position:`sticky`,bottom:-10,pl:1,pr:1,borderRadius:`${e.shape.borderRadius}px`,background:e.palette.background.paper}),container:{overflow:`hidden`,flex:`1 1 auto`,minHeight:0,flexWrap:`nowrap`,"@media screen and (max-width: 602px)":{flex:`none`,flexWrap:`wrap`}},content:{display:`flex`,flexDirection:`column`,"& > .MuiToolbar-root":{flexShrink:0},"@media screen and (max-width: 500px)":{p:1}},languageButton:{position:`absolute`,right:73,top:11},languageButtonActive:e=>({color:e.palette.primary.main})},Ft=class extends z{constructor(e){super(e),C(this,`updateAvailable`,[]),C(this,`onAdapterFinished`,null),C(this,`processList`,[]),this.state={selected:[],inProcess:!1,finished:!1,current:``,updated:[],stopped:!1,debug:(window._localStorage||window.localStorage).getItem(`AdaptersUpdaterDialog.debug`)===`true`,stopOnError:(window._localStorage||window.localStorage).getItem(`AdaptersUpdaterDialog.stopOnError`)!==`false`,closeOnFinished:(window._localStorage||window.localStorage).getItem(`AdaptersUpdaterDialog.closeOnFinished`)===`true`,currentVersion:``},this.updateAvailable=[]}updateAdapter(e,t,n){this.onAdapterFinished=n,this.setState({current:e,currentVersion:t})}onStartUpdate(){this.props.ready?this.setState({inProcess:!0},()=>{this.props.onSetCommandRunning(!0),this.processList=[...this.state.selected].sort((e,t)=>e===`eos-admin`?1:t===`eos-admin`?-1:e.localeCompare(t)).map(e=>{var t;return{adapter:e,version:(t=this.props.repository[e])==null?void 0:t.version}}),this.updateAdapters(()=>{this.setState({inProcess:!1,finished:!0},()=>{this.props.onSetCommandRunning(!1),this.state.closeOnFinished&&this.props.onClose(!!this.state.updated.length)})})}):window.alert(this.props.t(`The connection is not ready yet. Please wait a moment and try again.`))}updateAdapters(e){if(!this.processList||!this.processList.length||this.state.stopped)e&&e();else{let{adapter:t,version:n}=this.processList.shift();this.updateAdapter(t,n,()=>{let n=[...this.state.updated];n.push(t),this.setState({updated:n},()=>setTimeout(()=>this.updateAdapters(e),200))})}}render(){let e=this.props.noTranslation?f.getStyle(this.props.theme,U.languageButtonActive):void 0;return w(A,{open:!0,maxWidth:`lg`,fullWidth:!!this.state.current,onClose:()=>this.props.onClose(!!this.state.updated.length),"aria-labelledby":`update-dialog-title`,"aria-describedby":`update-dialog-description`,sx:{"& .MuiPaper-root":U.dialogRoot},scroll:`paper`,children:[m(l,{id:`update-dialog-title`,children:w(`div`,{style:U.wrapperHead,children:[this.props.t(`Update %s adapter(s)`,this.state.selected.length),!this.state.finished&&!this.state.inProcess&&m(j,{title:this.props.t(`Select/Unselect all`),slotProps:{popper:{sx:{pointerEvents:`none`}}},children:m(s,{checked:this.state.selected.length===this.updateAvailable.length,style:U.checkbox,tabIndex:-1,indeterminate:this.state.selected.length!==this.updateAvailable.length&&this.state.selected.length!==0,disableRipple:!0,onClick:()=>{let e=[];this.state.selected.length!==this.updateAvailable.length&&(e=[...this.updateAvailable]),this.setState({selected:e})}})}),S.getLanguage()!==`en`&&this.props.toggleTranslation?m(F,{size:`large`,style:{...U.languageButton,...e},onClick:()=>{var e,t;return(e=(t=this.props).toggleTranslation)==null?void 0:e.call(t)},title:S.t(`Disable/Enable translation`),children:m(De,{})}):null]})}),w(b,{sx:{"&.MuiDialogContent-root":U.content},children:[w(d,{container:!0,direction:`row`,sx:U.container,children:[m(d,{style:{height:`100%`,overflow:`hidden`,width:this.state.current?250:`100%`},children:m(`div`,{style:{height:`100%`,overflow:`auto`},children:m(Pt,{finished:this.state.finished,inProcess:this.state.inProcess,selected:this.state.selected,current:this.state.current,stopped:this.state.stopped,updated:this.state.updated,lang:this.props.lang,installed:this.props.installed,repository:this.props.repository,noTranslation:!!this.props.noTranslation,toggleTranslation:this.props.toggleTranslation||(()=>{}),onUpdateSelected:(e,t)=>{t&&(this.updateAvailable=t),this.setState({selected:e})},theme:this.props.theme,rightDependenciesFunc:this.props.rightDependenciesFunc})})}),!!this.state.current&&m(d,{style:{height:`100%`,overflow:`hidden`,width:`calc(100% - 260px)`,minWidth:240},children:m(vt,{noSpacing:!0,ready:this.props.ready,host:this.props.currentHost,socket:this.props.socket,t:this.props.t,cmd:`upgrade ${this.state.current}@${this.state.currentVersion}${this.state.debug?` --debug`:``}`,onFinished:()=>{var e;return(e=this.onAdapterFinished)==null?void 0:e.call(this)},errorFunc:()=>{if(this.state.stopOnError)this.setState({stopped:!0,finished:!0}),this.onAdapterFinished=null,this.props.onSetCommandRunning(!1);else{var e;(e=this.onAdapterFinished)==null||e.call(this)}}},this.state.current)})]}),w(Pe,{variant:`dense`,disableGutters:!0,sx:U.appBar,children:[m(p,{control:m(s,{disabled:this.state.finished,checked:this.state.stopOnError,onChange:()=>{(window._localStorage||window.localStorage).setItem(`AdaptersUpdaterDialog.stopOnError`,this.state.stopOnError?`false`:`true`),this.setState({stopOnError:!this.state.stopOnError})}}),label:this.props.t(`Stop on error`)}),m(p,{control:m(s,{disabled:this.state.finished,checked:this.state.closeOnFinished,onChange:()=>{(window._localStorage||window.localStorage).setItem(`AdaptersUpdaterDialog.closeOnFinished`,this.state.closeOnFinished?`false`:`true`),this.setState({closeOnFinished:!this.state.closeOnFinished})}}),label:this.props.t(`Close on finished`)}),m(p,{control:m(s,{disabled:this.state.finished||this.state.inProcess,checked:this.state.debug,onChange:()=>{(window._localStorage||window.localStorage).setItem(`AdaptersUpdaterDialog.debug`,this.state.debug?`false`:`true`),this.setState({debug:!this.state.debug})}}),label:this.props.t(`Debug info`)})]})]}),w(y,{children:[m(O,{id:`adapters-update-dialog-update`,variant:`contained`,disabled:this.state.stopped||this.state.inProcess||this.state.finished||!this.state.selected.length||!this.props.ready,onClick:()=>this.onStartUpdate(),color:`primary`,autoFocus:!0,startIcon:m(u,{}),children:this.props.t(`Update`)}),m(O,{id:`adapters-update-dialog-cancel`,variant:`contained`,disabled:!this.state.inProcess,color:`grey`,startIcon:m(be,{}),onClick:()=>{this.setState({stopped:!0,finished:!0}),this.props.onSetCommandRunning(!1)},children:this.props.t(`Cancel`)}),m(O,{id:`adapters-update-dialog-close`,variant:`contained`,onClick:()=>this.props.onClose(!!this.state.updated.length),disabled:this.state.inProcess&&!this.state.stopped,color:this.state.stopped?`error`:`grey`,startIcon:m(P,{}),children:this.props.t(`Close`)})]})]})}},It=o(w(T,{children:[m(`path`,{d:`M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3z`}),m(`path`,{d:`M8.6 8.7h2.9v2.9H8.6zM12.5 8.7h2.9v2.9h-2.9zM8.6 12.6h2.9v2.9H8.6zM12.5 12.6h2.9v2.9h-2.9z`})]}),`UpdateAll`);c();var Lt=class extends _t{constructor(e,t){super(e,`${t}.adapter`,`adapter`),C(this,`host`,void 0),C(this,`prefix`,void 0),this.prefix=`${t}.adapter.`,this.host=t}getObject(e){return this.objects&&this.objects[this.prefix+e]||null}getHost(){return this.host}};function Rt(e){var t;return(e==null||(t=e.licenseInformation)==null?void 0:t.link)||zt(e)}function zt(e){if(!e)return``;let t=e.licenseUrl;if(!t||!t.includes(`/LICENSE`)||!t.includes(`raw.githubusercontent.com`)){if(t=e.extIcon,!t){if(t=e.readme,!t)return console.error(`No extIcon for ${e.name||JSON.stringify(e)}`),``;t=t.replace(`github.com`,`raw.githubusercontent.com`).replace(`/blob/`,`/`),t.includes(`/main`)?t=`${t.split(`/main`)[0]}/main/LICENSE`:t.includes(`/master`)&&(t=`${t.split(`/master`)[0]}/master/LICENSE`)}if(t.includes(`/main`))t=`${t.split(`/main`)[0]}/main/LICENSE`;else if(t.includes(`/master`))t=`${t.split(`/master`)[0]}/master/LICENSE`;else return``}return t}function Bt(e){if(!e)return null;let t=e.trim().split(`?`)[0].split(`#`)[0],n=t.match(/iobroker\.([a-z\d][a-z\d_-]*?)-\d+\.\d+\.\d+[^/\\]*\.tgz$/i);if(n)return n[1].toLowerCase();let r=t.match(/iobroker\.([a-z\d][a-z\d_-]*)/i);return r?r[1].toLowerCase():/^[a-z\d][a-z\d_-]*$/i.test(t)?t.toLowerCase():null}var Vt=`data:image/svg+xml,%3csvg%20viewBox='0%200%202500%202500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%200h2500v2500H0z'%20fill='%23c00'/%3e%3cpath%20d='M1241.5%20268.5h-973v1962.9h972.9V763.5h495v1467.9h495V268.5z'%20fill='%23fff'/%3e%3c/svg%3e`;function Ht(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=r.result,n=e.indexOf(`,`);t(n===-1?e:e.substring(n+1))},r.onerror=()=>n(r.error||Error(`Cannot read file`)),r.readAsDataURL(e)})}function Ut(e){return{id:`github-install-dialog-tab-${e}`,"aria-controls":`github-install-dialog-panel-${e}`}}var W={root:e=>({backgroundColor:e.palette.background.paper,width:`100%`,height:`100%`}),paper:{maxWidth:1e3},tabPaper:{padding:16},title:e=>({mt:`10px`,p:1,ml:1,fontSize:18,color:e.palette.primary.main}),warningText:{color:`#f53939`},noteText:{marginTop:16},errorTextNoGit:{fontSize:13,color:`#ff1616`},listIcon:{width:24,height:24},listIconWithMargin:{width:24,height:24,marginRight:8},tabSelected:e=>({color:e.palette.mode===`dark`?e.palette.secondary.contrastText:`#222 !important`})};function Wt(e){let t=[];for(let n=0;n<e.length;n++)typeof e[n]==`object`?e[n].forEach(e=>t.push(e)):t.push(e[n]);return t}var Gt=10,Kt=class extends I.Component{constructor(e){super(e);let t=[],n=(window._localstorage||window.localStorage).getItem(`App.npmHistory`);if(n)try{t=JSON.parse(n)}catch{}this.state={autoCompleteValue:(window._localstorage||window.localStorage).getItem(`App.autocomplete`)||null,debug:(window._localstorage||window.localStorage).getItem(`App.gitDebug`)===`true`,createInstance:(window._localstorage||window.localStorage).getItem(`App.createInstanceAfterInstall`)!==`false`,url:(window._localstorage||window.localStorage).getItem(`App.userUrl`)||``,currentTab:(window._localstorage||window.localStorage).getItem(`App.gitTab`)||`npm`,customHistory:t,selectedFile:null,restartAfterInstall:(window._localstorage||window.localStorage).getItem(`App.restartAfterInstall`)!==`false`,uploading:!1,selectedHost:e.currentHost,cmdExecFilesSupported:!1}}async componentDidMount(){try{let e=await this.props.socket.checkFeatureSupported(`CONTROLLER_CMD_EXEC_FILES`);this.setState({cmdExecFilesSupported:!!e})}catch(e){console.error(`Cannot read feature: ${e}`)}}async uploadFileToServer(){if(!this.state.selectedFile)return null;this.setState({uploading:!0});try{let e=new FormData;e.append(`file`,this.state.selectedFile);let t=await fetch(`./upload-adapter`,{method:`POST`,body:e});if(!t.ok){let e;try{e=(await t.json()).error||`Upload failed with status ${t.status}`}catch{e=`Upload failed with status ${t.status}`}throw Error(e)}return(await t.json()).filePath}catch(e){return window.alert(`${S.t(`Upload failed`)}: ${e.message}`),null}finally{this.setState({uploading:!1})}}async restartInstances(e){if(!this.state.restartAfterInstall||!e)return;let t=await this.props.socket.getAdapterInstances(e);for(let e of t){var n;e!=null&&(n=e.common)!=null&&n.enabled&&await this.props.socket.extendObject(e._id,{})}}async createInstanceIfDesired(e,t){if(this.state.createInstance&&e)try{await this.props.createInstance(e,t)}catch(t){console.error(`Cannot create the instance of ${e}: ${t.message}`)}}async installFile(){if(!this.state.selectedFile)return;let e=Bt(this.state.selectedFile.name)||``;if(this.state.cmdExecFilesSupported){try{let t=await Ht(this.state.selectedFile),n=this.state.selectedFile.name.replace(/[^a-zA-Z0-9._-]/g,`_`),r=await this.props.installFromUrl(n,this.state.debug,!0,{host:this.state.selectedHost,files:[{name:n,file:t}]});await this.restartInstances(e),r&&await this.createInstanceIfDesired(e,this.state.selectedHost)}catch(e){console.error(`Installation from file failed: ${e.message}`)}return}let t=await this.uploadFileToServer();if(t)try{let n=await this.props.installFromUrl(t,this.state.debug,!0);await this.restartInstances(e),n&&await this.createInstanceIfDesired(e)}catch(e){console.error(`Installation from file failed: ${e.message}`)}}async handleInstall(){if(this.state.currentTab===`GitHub`){var e;let t=(((e=this.state.autoCompleteValue)==null?void 0:e.value)||``).split(`/`),n=`${t[1]}/ioBroker.${t[0]}`;await this.props.installFromUrl(n,this.state.debug,!0)&&await this.createInstanceIfDesired(t[0])}else if(this.state.currentTab===`URL`){let e=this.state.customHistory.filter(e=>e!==this.state.url);e.unshift(this.state.url),e.length>Gt&&e.pop(),(window._localstorage||window.localStorage).setItem(`App.npmHistory`,JSON.stringify(e));let t=this.state.url.includes(`.`)?this.state.url:`iobroker.${this.state.url}`;await this.props.installFromUrl(t,this.state.debug,!0)&&await this.createInstanceIfDesired(Bt(t))}else if(this.state.currentTab===`File`)await this.installFile();else if(this.state.currentTab===`npm`){var t;let e=(((t=this.state.autoCompleteValue)==null?void 0:t.value)||``).split(`/`)[0],n=e.includes(`.`)?e.split(`.`)[1]:e;try{let e=await this.props.installFromUrl(`iobroker.${n}@latest`,this.state.debug,!0);await this.props.upload(n),e&&await this.createInstanceIfDesired(n)}catch(e){console.error(`Installation from url failed: ${e.message}`)}}}renderCreateInstance(){return m(`div`,{style:{display:`flex`,alignItems:`center`},children:m(p,{control:m(s,{checked:this.state.createInstance,onChange:e=>{(window._localstorage||window.localStorage).setItem(`App.createInstanceAfterInstall`,e.target.checked?`true`:`false`),this.setState({createInstance:e.target.checked})}}),label:this.props.t(`Create instance if it does not exist yet`)})})}renderNpm(){return this.state.currentTab===`npm`?w(He,{style:W.tabPaper,id:`github-install-dialog-panel-npm`,children:[m(`div`,{style:{display:`flex`,alignItems:`center`},children:m(p,{control:m(s,{checked:this.state.debug,onChange:e=>{(window._localstorage||window.localStorage).setItem(`App.gitDebug`,e.target.checked?`true`:`false`),this.setState({debug:e.target.checked})}}),label:this.props.t(`Debug outputs`)})}),this.renderCreateInstance(),w(`div`,{style:{display:`flex`,alignItems:`flex-end`},children:[m(it,{style:{marginRight:10}}),m(Ae,{fullWidth:!0,value:this.state.autoCompleteValue,onChange:(e,t)=>{(window._localstorage||window.localStorage).setItem(`App.autocomplete`,t||void 0),this.setState({autoCompleteValue:t||null})},options:this.getList(),getOptionLabel:e=>(e==null?void 0:e.name)??``,renderInput:e=>{var t;return m(B,{variant:`standard`,...e,slotProps:{...e.slotProps,input:{...e.slotProps.input,startAdornment:m(g,{position:`start`,children:m(ge,{src:((t=this.state.autoCompleteValue)==null?void 0:t.icon)||``,style:W.listIcon})})}},label:S.t(`Select adapter`)})},renderOption:(e,t)=>w(D,{component:`li`,sx:{"& > img":{mr:2,flexShrink:0}},...e,children:[m(ge,{src:(t==null?void 0:t.icon)||``,style:W.listIconWithMargin}),(t==null?void 0:t.name)??``]})})]}),m(`div`,{style:{fontSize:24,fontWeight:`bold`,marginTop:40},children:this.props.t(`Warning!`)}),m(`div`,{style:W.warningText,children:this.props.t(`npm_warning`,`NPM`,`NPM`)}),m(`div`,{style:W.noteText,children:this.props.t(`github_note`)})]}):null}renderGitHub(){return this.state.currentTab===`GitHub`?w(He,{style:W.tabPaper,id:`github-install-dialog-panel-github`,children:[m(`div`,{style:{display:`flex`,alignItems:`center`},children:m(p,{control:m(s,{checked:this.state.debug,onChange:e=>{(window._localstorage||window.localStorage).setItem(`App.gitDebug`,e.target.checked?`true`:`false`),this.setState({debug:e.target.checked})}}),label:this.props.t(`Debug outputs`)})}),this.renderCreateInstance(),w(`div`,{style:{display:`flex`,alignItems:`flex-end`},children:[m(it,{style:{marginRight:10}}),m(Ae,{fullWidth:!0,value:this.state.autoCompleteValue,getOptionDisabled:e=>!!(e!=null&&e.nogit),renderOption:(e,t)=>w(D,{component:`li`,sx:{"& > img":{mr:2,flexShrink:0}},...e,children:[m(ge,{src:(t==null?void 0:t.icon)||``,style:W.listIconWithMargin}),(t==null?void 0:t.name)??``,(t==null?void 0:t.nogit)&&m(`div`,{style:W.errorTextNoGit,children:S.t(`This adapter cannot be installed from git as must be built before installation.`)})]}),onChange:(e,t)=>{(window._localstorage||window.localStorage).setItem(`App.autocomplete`,t),this.setState({autoCompleteValue:t})},options:this.getList(),getOptionLabel:e=>(e==null?void 0:e.name)??``,renderInput:e=>{var t;return m(B,{variant:`standard`,...e,slotProps:{...e.slotProps,input:{...e.slotProps.input,startAdornment:m(g,{position:`start`,children:m(ge,{src:((t=this.state.autoCompleteValue)==null?void 0:t.icon)||``,style:W.listIconWithMargin})})}},label:S.t(`Select adapter`)})}})]}),m(`div`,{style:{fontSize:24,fontWeight:`bold`,marginTop:40},children:this.props.t(`Warning!`)}),m(`div`,{style:W.warningText,children:this.props.t(`github_warning`,`GitHub`,`GitHub`)}),m(`div`,{style:W.noteText,children:this.props.t(`github_note`)})]}):null}renderCustom(){return this.state.currentTab===`URL`?w(He,{style:W.tabPaper,id:`github-install-dialog-panel-custom`,children:[m(`div`,{style:{display:`flex`,alignItems:`center`},children:m(p,{control:m(s,{checked:this.state.debug,onChange:e=>{(window._localstorage||window.localStorage).setItem(`App.gitDebug`,e.target.checked?`true`:`false`),this.setState({debug:e.target.checked})}}),label:this.props.t(`Debug outputs`)})}),this.renderCreateInstance(),m(`div`,{style:{display:`flex`,alignItems:`center`},children:m(Ae,{fullWidth:!0,value:this.state.url||``,onInputChange:(e,t)=>{(window._localstorage||window.localStorage).setItem(`App.userUrl`,t||``),this.setState({url:t||``})},onChange:(e,t)=>{(window._localstorage||window.localStorage).setItem(`App.userUrl`,t||``),this.setState({url:t||``})},renderOption:(e,t)=>w(D,{component:`li`,...e,style:{display:`flex`,alignItems:`left`},children:[t,m(`div`,{style:{flexGrow:1}}),m(F,{size:`small`,onClick:e=>{e.stopPropagation();let n=this.state.customHistory.filter(e=>e!==t);(window._localstorage||window.localStorage).setItem(`App.npmHistory`,JSON.stringify(n)),this.setState({customHistory:n})},children:m(le,{})})]}),freeSolo:!0,options:this.state.customHistory,renderInput:e=>m(B,{variant:`standard`,...e,onKeyUp:e=>{e.key===`Enter`&&this.state.url&&this.handleInstall().then(()=>{this.setState({autoCompleteValue:null,url:``}),this.props.onClose()})},helperText:this.props.t(`URL or file path`),label:this.props.t(`URL`)})})}),m(`div`,{style:{fontSize:24,fontWeight:`bold`,marginTop:40},children:this.props.t(`Warning!`)}),m(`div`,{style:W.warningText,children:this.props.t(`github_warning`,`URL`,`URL`)}),m(`div`,{style:W.noteText,children:this.props.t(`github_note`)})]}):null}renderFile(){return this.state.currentTab===`File`?w(He,{style:W.tabPaper,id:`github-install-dialog-panel-file`,children:[w(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[w(O,{variant:`outlined`,component:`label`,startIcon:m(Ce,{}),disabled:this.state.uploading,children:[this.props.t(`Select file`),m(`input`,{type:`file`,accept:`.tgz`,hidden:!0,onChange:e=>{var t;let n=((t=e.target.files)==null?void 0:t[0])||null;this.setState({selectedFile:n,url:``}),(window._localstorage||window.localStorage).setItem(`App.userUrl`,``),e.target.value=``}})]}),this.state.selectedFile&&w(T,{children:[m(k,{variant:`body2`,style:{flex:1},children:this.state.selectedFile.name}),m(F,{size:`small`,onClick:()=>this.setState({selectedFile:null}),children:m(P,{})})]}),this.state.uploading&&m(x,{size:24})]}),this.state.selectedFile&&m(p,{control:m(s,{checked:this.state.restartAfterInstall,onChange:e=>{(window._localstorage||window.localStorage).setItem(`App.restartAfterInstall`,e.target.checked?`true`:`false`),this.setState({restartAfterInstall:e.target.checked})}}),label:this.props.t(`Restart adapter after install`)}),this.renderCreateInstance(),this.state.cmdExecFilesSupported&&w(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:8},children:[w(k,{variant:`body2`,children:[this.props.t(`Install on host`),`:`]}),m(yt,{socket:this.props.socket,currentHost:this.state.selectedHost,hostsWorker:this.props.hostsWorker,expertMode:this.props.expertMode,themeType:this.props.themeType,tooltip:this.props.t(`Install on host`),setCurrentHost:(e,t)=>this.setState({selectedHost:t})})]}),m(`div`,{style:{fontSize:24,fontWeight:`bold`,marginTop:40},children:this.props.t(`Warning!`)}),m(`div`,{style:W.warningText,children:this.props.t(`github_warning`,`File`,`File`)}),m(`div`,{style:W.noteText,children:this.props.t(`github_note`)})]}):null}getList(){let e=Wt(this.props.categories.map(e=>e.adapters));return e.sort(),e.map((t,n)=>{if(n&&e[n-1]===t)return null;let r=this.props.repository[t];if(!(r!=null&&r.controller)){let e=(r.extIcon||r.meta||r.readme||``).toString().split(`/`),n=r==null?void 0:r.name;n||=(n=r.titleLang,n&&typeof n==`object`?n[S.getLanguage()]||n.en:r.title||t);let i={value:`${t}/${e[3]}`,name:`${n} [${e[3]}]`,icon:r.extIcon||r.icon||``,nogit:!!r.nogit,title:t};return this.props.installed[n]&&n!==`admin`&&(i.icon=pt(`adapter/${t}/${(r.icon||``).split(`/admin/`).pop()}`)),i}return null}).filter(e=>e).sort((e,t)=>e.name<t.name?-1:+(e.name>t.name))}render(){var t;let n=()=>this.setState({autoCompleteValue:null,url:``,selectedFile:null,uploading:!1});return w(A,{onClose:()=>this.props.onClose(),open:!0,sx:{"& .MuiDialog-paper":W.paper},children:[m(b,{dividers:!0,children:w(D,{component:`div`,sx:W.root,children:[m(me,{position:`static`,color:`default`,children:w(ve,{value:this.state.currentTab,onChange:(e,t)=>{(window._localstorage||window.localStorage).setItem(`App.gitTab`,t),this.setState({currentTab:t})},variant:`fullWidth`,indicatorColor:`secondary`,children:[m(e,{label:this.props.t(`From npm`),wrapped:!0,sx:{"&.Mui-selected":W.tabSelected},icon:m(`img`,{src:Vt,alt:`npm`,width:24,height:24}),...Ut(`npm`),value:`npm`}),m(e,{label:this.props.t(`From github`),wrapped:!0,sx:{"&.Mui-selected":W.tabSelected},icon:m(ue,{style:{width:24,height:24},width:24,height:24}),...Ut(`github`),value:`GitHub`}),m(e,{label:this.props.t(`Custom`),wrapped:!0,sx:{"&.Mui-selected":W.tabSelected},icon:m(De,{width:24,height:24}),...Ut(`custom`),value:`URL`}),m(e,{label:this.props.t(`From file`),wrapped:!0,sx:{"&.Mui-selected":W.tabSelected},icon:m(Ue,{style:{width:24,height:24}}),...Ut(`file`),value:`File`})]})}),m(D,{component:`div`,sx:W.title,children:this.props.t(`Install or update the adapter from %s`,this.state.currentTab||`npm`)}),this.renderNpm(),this.renderGitHub(),this.renderCustom(),this.renderFile()]})}),w(y,{children:[m(O,{id:`github-install-dialog-ok`,variant:`contained`,disabled:this.state.uploading||this.props.commandRunning||(this.state.currentTab===`GitHub`||this.state.currentTab===`npm`)&&!((t=this.state.autoCompleteValue)!=null&&t.value)||this.state.currentTab===`URL`&&!this.state.url||this.state.currentTab===`File`&&!this.state.selectedFile,autoFocus:!0,onClick:async()=>{await this.handleInstall(),this.props.onClose(),n()},color:`primary`,startIcon:this.props.commandRunning?m(x,{size:20}):m(u,{}),children:this.props.t(`Install`)}),m(O,{id:`github-install-dialog-close`,variant:`contained`,onClick:()=>{this.props.onClose(),n()},color:`grey`,startIcon:m(P,{}),children:this.props.t(`Close`)})]})]})}};c();var G={formControl:{marginTop:24,width:100},closeButton:e=>({position:`absolute`,right:8,top:8,color:e.palette.grey[500]}),languageButton:{position:`absolute`,right:60,top:8},languageButtonActive:e=>({color:e.palette.primary.main}),paper:{},typography:{pr:`30px`},messageText:{},messageColor_warn:{color:`#cb7642`},messageColor_error:{color:`#f5614d`},messageColor_info:{color:`#5abd29`},messageTitle_warn:e=>({background:`#cb7642`,borderRadius:`3px`,pl:`10px`,fontWeight:`bold`,color:e.palette.mode===`dark`?`black`:`white`}),messageTitle_error:e=>({background:`#f5614d`,borderRadius:`3px`,pl:`10px`,fontWeight:`bold`,color:e.palette.mode===`dark`?`black`:`white`}),messageTitle_info:e=>({background:`#5abd29`,borderRadius:`3px`,pl:`10px`,fontWeight:`bold`,color:e.palette.mode===`dark`?`black`:`white`}),deps:e=>({m:`10px`,fontSize:16,color:e.palette.mode===`dark`?`#e70000`:`#840101`})},qt=class extends z{constructor(e){super(e),C(this,`t`,void 0),C(this,`messages`,null),C(this,`lang`,void 0),this.state={instanceNumbers:[]},this.t=e.t,this.lang=S.getLanguage(),this.messages=At(e.adapterObject.messages,null,e.adapterObject.version,e.instances)}componentDidMount(){this.props.instancesWorker.getObjects().then(e=>{let t=Object.keys(e||{}).filter(t=>{var n;return(e==null||(n=e[t])==null||(n=n.common)==null?void 0:n.name)===this.props.adapter}).map(e=>e.substring(e.lastIndexOf(`.`)+1));this.setState({instanceNumbers:t})})}getAvailableInstances(){let e=[];e.push(m(R,{value:`auto`,children:this.t(`auto`)},`auto`));for(let t=0;t<=100&&(this.state.instanceNumbers.includes(t.toString())||e.push(m(R,{value:t.toString(),children:t},t)),!(e.length>11));t++);return e}checkDependencies(e=this.props.dependencies){if(!e)return``;let t=[];for(let r of e){var n;r.installedVersion?(n=r.wrongHosts)!=null&&n.length?t.push(w(`div`,{children:[m(`div`,{children:this.props.t(`The following hosts do not fulfill the required version %s of %s:`,r.version||`unknown`,r.name)}),m(`ul`,{style:{margin:`4px 0`},children:r.wrongHosts.map(e=>w(`li`,{children:[e.host,`: `,e.installedVersion]},e.host))})]},r.name)):r.rightVersion||t.push(m(`div`,{children:`${this.props.t(`Invalid version of %s. Required %s. Current `,r.name,r.version||`unknown`)}${r.installedVersion}`},r.name)):t.push(m(`div`,{children:this.props.t(`No version of %s`,r.name,r.name)},r.name))}return t.length?t:``}getText(e,t){return e&&typeof e==`object`?t?e.en:e[this.lang]||e.en:typeof e==`object`?``:e}renderOneMessage(e,t){return w(d,{children:[m(k,{sx:G[`messageTitle_${e.level||`warn`}`],children:this.getText(e.title,this.props.noTranslation)||``}),m(k,{component:`div`,variant:`body2`,style:G.messageText,children:this.getText(e.text,this.props.noTranslation)||``}),e.link?m(O,{onClick:()=>{let t=window.open(e.link,`_blank`);t==null||t.focus()},startIcon:m(fe,{}),variant:`contained`,color:`grey`,children:this.getText(e.linkText||``,this.props.noTranslation)||this.props.t(`More info`)}):null]},t)}renderMessages(){return this.messages?m(d,{container:!0,spacing:2,wrap:`nowrap`,sx:{marginBottom:1,flexDirection:`column`},children:this.messages.map((e,t)=>this.renderOneMessage(e,t))}):null}render(){let e=this.checkDependencies();return w(A,{onClose:()=>{},open:!0,sx:{"& .MuiDialog-paper":G.paper},children:[m(l,{children:w(k,{component:`h2`,variant:`h6`,sx:{"&.MuiTypography-root":G.typography},children:[this.t(`You are going to add new instance:`),` `,this.props.adapter,m(F,{size:`large`,sx:G.closeButton,onClick:()=>this.props.onClose(!1),children:m(P,{})}),this.messages&&this.lang!==`en`&&this.props.toggleTranslation?m(F,{size:`large`,style:f.getStyle(this.props.theme,G.languageButton,this.props.noTranslation&&G.languageButtonActive),onClick:this.props.toggleTranslation,title:S.t(`Disable/Enable translation`),children:m(De,{})}):null]})}),w(b,{dividers:!0,children:[this.renderMessages(),!e&&this.props.expertMode?w(d,{container:!0,sx:{flexDirection:`column`},children:[m(yt,{tooltip:this.t(`Select host to add the instance`),expertMode:!0,socket:this.props.socket,hostsWorker:this.props.hostsWorker,currentHost:this.props.currentHost,setCurrentHost:(e,t)=>this.props.onHostChange(t.replace(/^system\.host\./,``))}),w(de,{variant:`standard`,style:G.formControl,children:[m(pe,{id:`instance-label`,children:this.t(`Instance`)}),m(Me,{variant:`standard`,labelId:`instance-label`,value:this.props.currentInstance,onChange:this.props.onInstanceChange,children:this.getAvailableInstances()})]})]}):null,m(D,{component:`div`,sx:G.deps,children:e})]}),w(y,{children:[m(O,{id:`instance-add-dialog-ok`,variant:`contained`,autoFocus:!0,disabled:!!e,onClick:()=>this.props.onClose(!0),color:`primary`,startIcon:m(We,{}),children:this.t(`Add`)}),m(O,{id:`instance-add-dialog-cancel`,variant:`contained`,onClick:()=>this.props.onClose(!1),color:`grey`,startIcon:m(P,{}),children:this.t(`Close`)})]})]})}},K=class e extends z{constructor(e){super(e),this.state={showDialog:!1,showLicenseDialog:null,addInstanceHostName:``,addInstanceId:`auto`,addInstanceDialog:``}}renderLicenseDialog(t){var n;return this.state.showLicenseDialog?m(St,{licenseType:this.state.showLicenseDialog.licenseType,url:this.state.showLicenseDialog.url,link:(n=t.repository[this.state.showLicenseDialog.adapterName])==null||(n=n.licenseInformation)==null?void 0:n.link,onClose:n=>{let r=n?this.state.showLicenseDialog:null;this.setState({showLicenseDialog:null,showDialog:!1},()=>{r&&(r.upload?e.upload(r.adapterName,t):this.addInstance({adapterName:r.adapterName,context:t}).catch(e=>window.alert(`Cannot add instance: ${e}`)))})}}):null}async addInstance(t){if(!t.customUrl){let e=t.context.repository[t.adapterName],n=At(e.messages,null,e.version,t.context.compactInstances);if(!t.instance&&(t.context.expertMode||n))return this.setState({addInstanceDialog:t.adapterName,showDialog:!0,addInstanceHostName:t.context.currentHost.replace(/^system\.host\./,``),addInstanceId:t.instance||`auto`}),!1;if(t.instance){let e=await t.context.instancesWorker.getObjects();if(e&&e[`system.adapter.${t.adapterName}.${t.instance}`])return window.alert(t.context.t(`Instance %s already exists`,`${t.adapterName}.${t.instance}`)),!1}}let n=(t.host||this.state.addInstanceHostName||t.context.currentHost).replace(/^system\.host\./,``);if(!t.customUrl){let r=await e.getSingletonRefusal(t.adapterName,n,t.context);if(r)return window.alert(r),!1}try{await new Promise((e,r)=>{t.context.executeCommand(`${t.customUrl?`url`:`add`} ${t.adapterName} ${t.instance?`${t.instance} `:``}--host ${n} ${t.debug||t.context.expertMode?`--debug`:``}`,n,t=>t?r(Error(`The process returned an exit code of ${t}`)):e(),t.files)})}catch(e){return window.alert(`${S.t(`Cannot install`)}: ${e}`),!1}return!0}static isSingletonInstalled(e,t){var n;if(!((n=t.adapters[`system.adapter.${e}`])!=null&&(n=n.common)!=null&&n.singleton))return!1;let r=`system.adapter.${e}.`;return Object.keys(t.compactInstances).some(e=>e.startsWith(r))}static async getSingletonRefusal(e,t,n){var r;let i=(r=n.adapters[`system.adapter.${e}`])==null?void 0:r.common;if(!(i!=null&&i.singleton)&&!(i!=null&&i.singletonHost))return null;let a=await n.instancesWorker.getObjects().catch(()=>null)||{},o=`system.adapter.${e}.`,s=Object.values(a).filter(e=>e==null?void 0:e._id.startsWith(o));if(i.singleton&&s.length)return n.t(`Adapter "%s" allows only one instance, and %s exists already`,e,s[0]._id.substring(15));let c=s.find(e=>e.common.host===t);return i.singletonHost&&c?n.t(`Adapter "%s" allows only one instance per host, and %s exists already on host "%s"`,e,c._id.substring(15),t):null}static async createInstanceIfNotExists(e){let{adapterName:t,context:n}=e,r=(e.host||n.currentHost).replace(/^system\.host\./,``),i;for(let e=0;e<5&&!i;e++){await new Promise(e=>setTimeout(e,500));try{i=await n.socket.getObject(`system.adapter.${t}`)}catch{}}if(!i){console.warn(`Cannot create an instance: adapter "${t}" not found after the installation`);return}let a=await n.instancesWorker.getObjects(!0);if(!(a&&Object.keys(a).find(e=>e.startsWith(`system.adapter.${t}.`))))try{await new Promise((i,a)=>{n.executeCommand(`add ${t} --host ${r} ${e.debug||n.expertMode?`--debug`:``}`,r,e=>e?a(Error(`The process returned an exit code of ${e}`)):i())})}catch(e){window.alert(`${S.t(`Cannot create instance`)}: ${e}`)}}static getDependencies(e,t){let n=t.repository[e],r=[];if(n){let e=n.dependencies?Array.isArray(n.dependencies)?n.dependencies:[n.dependencies]:[],a=n.globalDependencies?Array.isArray(n.globalDependencies)?n.globalDependencies:[n.globalDependencies]:[],o=n.node;if(e.length)for(let n of e){let e={name:``,version:null,installed:!1,installedVersion:null,rightVersion:!1},i=typeof n!=`string`,a=Object.keys(n);if(e.name=(i?a?a[0]:``:n)||``,e.version=i?n[e.name]:null,e.name){let n=t.installed[e.name];e.installed=!!n,e.installedVersion=n?n.version:null;try{e.rightVersion=n?!i||L.satisfies(n.version,e.version||`*`,{includePrerelease:!0}):!1}catch{e.rightVersion=!0}}r.push(e)}if(a.length)for(let e of a){let n={name:``,version:null,installed:!1,installedVersion:null,rightVersion:!1},a=typeof e!=`string`,o=Object.keys(e);if(n.name=(a?o?o[0]:``:e)||``,n.version=a?e[n.name]:null,n.name){var i;let e=t.installedGlobal[n.name];n.installed=!!e,n.installedVersion=e?e.version:null;let r=(i=t.installedGlobalHosts)==null?void 0:i[n.name];if(a&&r&&Object.keys(r).length>1){let t=[];for(let[e,i]of Object.entries(r)){let r;try{r=L.satisfies(i,n.version||`*`,{includePrerelease:!0})}catch{r=!0}r||t.push({host:e,installedVersion:i})}n.wrongHosts=t,n.rightVersion=e?!t.length:!1}else try{n.rightVersion=e?!a||L.satisfies(e.version,n.version||`*`,{includePrerelease:!0}):!1}catch{n.rightVersion=!0}}r.push(n)}let s=n.ifInstalledDependencies||{};if(typeof s==`object`&&!Array.isArray(s)){let e=Object.keys(s);for(let n of e){let e={name:n,version:s[n],installed:!1,installedVersion:null,rightVersion:!1};if(e.name){let n=t.installedGlobal[e.name];e.installed=!!n,e.installedVersion=n?n.version:null;try{e.rightVersion=!n||L.satisfies(n.version,e.version||`*`,{includePrerelease:!0})}catch{e.rightVersion=!0}}r.push(e)}}if(o){let e={name:`node`,version:o,installed:!0,installedVersion:t.nodeJsVersion,rightVersion:!1};try{e.rightVersion=L.satisfies(t.nodeJsVersion,o)}catch{e.rightVersion=!0}r.push(e)}}return r}renderAddInstanceDialog(t){return this.state.addInstanceDialog?m(qt,{adapter:this.state.addInstanceDialog,socket:t.socket,hostsWorker:t.hostsWorker,instancesWorker:t.instancesWorker,dependencies:e.getDependencies(this.state.addInstanceDialog,t),currentHost:`system.host.${this.state.addInstanceHostName}`,currentInstance:this.state.addInstanceId,t:t.t,onClose:e=>{let n=e?this.state.addInstanceDialog:``,r=e?this.state.addInstanceId:``;this.setState({addInstanceDialog:``,addInstanceId:`auto`,showDialog:!1},()=>{if(n)try{this.addInstance({adapterName:n,instance:r,context:t})}catch(e){window.alert(`Cannot add instance: ${e}`)}})},onHostChange:e=>this.setState({addInstanceHostName:e.replace(/^system\.host\./,``)}),onInstanceChange:e=>this.setState({addInstanceId:e.target.value.toString()}),adapterObject:t.repository[this.state.addInstanceDialog],instances:t.compactInstances,toggleTranslation:t.toggleTranslation,noTranslation:this.props.noTranslation,expertMode:t.expertMode,theme:t.theme}):null}static upload(e,t){t.executeCommand(`upload ${e}${t.expertMode?` --debug`:``}`)}onAddInstance(e,t){var n;let r=t.repository[e],i=zt(r),a=((n=r.licenseInformation)==null?void 0:n.license)||r.license;a===`MIT`||a===`Apache-2.0`||a===`ISC`||a===`BSD-3-Clause`||a===`BSD-2-Clause`||!a?this.addInstance({adapterName:e,context:t}).catch(e=>window.alert(`Cannot add instance: ${e}`)):this.setState({showLicenseDialog:{url:i,adapterName:e,licenseType:a},showDialog:!0})}renderDialogs(e){return this.state.showDialog?w(T,{children:[this.renderAddInstanceDialog(e),this.renderLicenseDialog(e)]}):null}},q={name:{flexWrap:`nowrap`,width:300,marginTop:0},nameDiv:{display:`flex`,alignItems:`center`},categoryName:{fontWeight:`bold`,cursor:`pointer`},green:{color:v[500]},blue:{color:oe[700]},category:{backgroundColor:`background.default`},marginRight5:{marginRight:5}};function Jt(e){let{installedCount:t,name:r,categoryName:i}=e;return w(N,{hover:!1,sx:q.category,children:[m(M,{children:m(d,{container:!0,spacing:1,style:q.name,sx:{alignItems:`center`},children:m(d,{component:`div`,children:m(F,{size:`small`,onClick:e.onToggle,children:e.expanded?m(n,{}):m(Qe,{})})})})}),m(M,{onClick:e.onToggle,children:w(`div`,{style:{...q.nameDiv,...q.categoryName},children:[m(Dt,{iconName:i,style:q.marginRight5}),r]})}),w(M,{colSpan:e.descHidden?5:6,children:[m(k,{component:`span`,variant:`body2`,style:q.green,children:t}),` ${e.t(`of`)} `,m(k,{component:`span`,variant:`body2`,style:q.blue,children:e.count}),` ${e.t(`Adapters from this Group installed`)}`]})]})}var J={rating:{marginBottom:20},listRating:{marginRight:8},listTime:{opacity:.5,fontStyle:`italic`},list:{},listOwn:e=>({backgroundColor:e.palette.mode===`light`?`#16516e2e`:e.palette.secondary.dark}),listTitle:e=>({backgroundColor:e.palette.primary.dark,pt:`4px`,pb:`4px`,mb:`4px`,color:`#ffffff`,textAlign:`center`}),languageFilter:{width:300},ratingTextControl:{width:`calc(100% - 138px)`,marginRight:8},ratingLanguageControl:{width:130},noComments:{width:`100%`,textAlign:`center`,marginTop:16},commentCount:{marginTop:2,marginLeft:8,opacity:.8,fontSize:10,float:`right`},infoText:{textAlign:`left`,fontSize:`14px`},infoTextContainer:{display:`flex`,paddingBottom:`10px`,alignItems:`center`,gap:`10px`}},Yt=[{id:`en`,title:`English`},{id:`de`,title:`Deutsch`},{id:`ru`,title:`русский`},{id:`pt`,title:`Portugues`},{id:`nl`,title:`Nederlands`},{id:`fr`,title:`français`},{id:`it`,title:`Italiano`},{id:`es`,title:`Espanol`},{id:`pl`,title:`Polski`},{id:`uk`,title:`Українська`},{id:`zh-cn`,title:`简体中文`}],Xt=class extends z{constructor(e){super(e),this.state={ratingNumber:0,ratingComment:``,votings:null,ratingLang:this.props.lang,filterLang:(window._localStorage||window.localStorage).getItem(`app.commentLang`)||this.props.lang,commentsByLanguage:{}}}componentDidMount(){fetch(`https://rating.iobroker.net/adapter/${this.props.adapter}?uuid=${this.props.uuid}`).then(e=>e.json()).then(e=>{e||={},e.rating||={};let t=Object.keys(e.rating);t.sort((t,n)=>e.rating[t].ts>e.rating[n].ts?-1:+(e.rating[t].ts<e.rating[n].ts));let n={};if(e.comments&&(e.comments.sort((e,t)=>e.ts>t.ts?-1:+(e.ts<t.ts)),e.comments.forEach(e=>{n[e.lang]=n[e.lang]||0,n[e.lang]++})),t.length){let r=e.rating[t[0]];this.setState({votings:e,ratingNumber:r?r.r:0,commentsByLanguage:n})}else this.setState({votings:e,commentsByLanguage:n})})}setAdapterRating(e,t,n,r,i){return fetch(`https://rating.iobroker.net/vote`,{method:`POST`,headers:{"Content-Type":`application/json`},redirect:`follow`,body:JSON.stringify({uuid:this.props.uuid,adapter:e,version:t,rating:n,comment:r,lang:i})}).then(e=>e.json()).then(r=>(window.alert(`${this.props.t(`Vote:`)} ${e}@${t}=${n}`),delete r.adapter,r)).catch(e=>(window.alert(`Cannot vote: ${e}`),null))}renderInfoText(){return w(`div`,{style:J.infoTextContainer,children:[m(Re,{}),m(k,{style:J.infoText,children:this.props.t(`use GitHub for issues`)})]})}renderComments(){var e;if((e=this.state.votings)!=null&&e.comments&&this.state.votings.comments.length){let e=this.state.votings.comments.find(e=>!(this.state.filterLang&&this.state.filterLang!==`_`&&e.lang!==this.state.filterLang));return w(`div`,{style:{width:`100%`,textAlign:`left`},children:[m(D,{component:`h3`,sx:J.listTitle,children:this.props.t(`Comments`)}),w(de,{variant:`standard`,style:J.languageFilter,children:[m(pe,{children:this.props.t(`Show comments in language`)}),w(Me,{variant:`standard`,value:this.state.filterLang,onChange:e=>{(window._localStorage||window.localStorage).setItem(`app.commentLang`,e.target.value),this.setState({filterLang:e.target.value})},children:[w(R,{value:`_`,children:[this.props.t(`All`),` `,m(`span`,{style:J.commentCount,children:this.state.votings.comments.length})]}),Yt.map(e=>w(R,{value:e.id,children:[e.title,` `,this.state.commentsByLanguage[e.id]?m(`span`,{style:J.commentCount,children:this.state.commentsByLanguage[e.id]}):null]},e.id))]})]}),w(t,{style:J.list,dense:!0,disablePadding:!0,children:[e&&this.state.votings.comments.map((e,t)=>this.state.filterLang&&this.state.filterLang!==`_`&&e.lang!==this.state.filterLang?null:e?w(Se,{title:e.uuid?this.props.t(`Your comment`):``,sx:{"&.MuiListItem-root":e.uuid?J.listOwn:void 0},dense:!0,children:[m(Ve,{style:J.listRating,children:m(Fe,{readOnly:!0,defaultValue:e.rating,size:`small`})}),m(Ee,{primary:e.comment,secondary:`${new Date(e.ts).toLocaleString()} / v${e.version}`,sx:{"& .MuiListItemText-secondary":J.listTime}})]},t):null),!e&&m(`div`,{style:J.noComments,children:this.props.t(`No comments in selected language`)})]})]})}return null}render(){var e,t;let n,r;if(this.state.votings){let e=this.state.votings.rating||{};r=Object.keys(e),r.sort((t,n)=>e[t].ts>e[n].ts?-1:+(e[t].ts<e[n].ts)),r.length&&(n=e[r[0]])}return w(A,{open:!0,onClose:()=>this.props.onClose(),children:[m(l,{children:`${this.props.t(`Review`)} ${this.props.adapter}${this.props.version?`@${this.props.version}`:``}`}),w(b,{style:{textAlign:`center`},title:((e=this.props.currentRating)==null?void 0:e.title)||``,children:[this.renderInfoText(),m(Fe,{style:J.rating,name:this.props.adapter,value:this.props.version?this.state.ratingNumber:(t=this.props.currentRating)==null||(t=t.rating)==null?void 0:t.r,size:`large`,readOnly:!this.props.version,onChange:(e,t)=>this.setState({ratingNumber:t})}),this.props.version?w(`div`,{style:{width:`100%`,textAlign:`left`},children:[m(B,{variant:`standard`,style:J.ratingTextControl,value:this.state.ratingComment,label:this.props.t(`Comment to version`),helperText:this.props.t(`Max length %s characters`,200),onChange:e=>this.setState({ratingComment:e.target.value}),slotProps:{input:{endAdornment:this.state.ratingComment?m(g,{position:`end`,children:m(F,{tabIndex:-1,size:`small`,onClick:()=>this.setState({ratingComment:``}),children:m(P,{})})}):null},htmlInput:{maxLength:200}}}),w(de,{variant:`standard`,style:J.ratingLanguageControl,children:[m(pe,{children:this.props.t(`Language`)}),m(Me,{variant:`standard`,value:this.state.ratingLang,onChange:e=>this.setState({ratingLang:e.target.value}),children:Yt.map(e=>m(R,{value:e.id,children:e.title},e.id))})]})]}):null,this.props.version?m(`div`,{style:{paddingTop:20,paddingBottom:16},children:this.props.t(`Rate how good this version of the adapter works on your system. You can vote for every new version.`)}):null,r&&n?m(`div`,{children:this.props.t(`You voted for %s on %s`,r[0],new Date(n.ts).toLocaleDateString())}):null,this.renderComments()]}),w(y,{children:[this.props.version&&m(O,{variant:`contained`,autoFocus:!0,color:`primary`,disabled:!this.state.ratingNumber||this.state.votings===null,onClick:()=>{this.state.ratingNumber!==(n==null?void 0:n.r)||this.state.ratingComment?this.setAdapterRating(this.props.adapter,this.props.version,this.state.ratingNumber||5,this.state.ratingComment,this.state.ratingLang).then(e=>this.props.onClose(e)):this.props.onClose()},startIcon:m(Xe,{}),children:this.props.t(`Rate`)}),m(O,{autoFocus:!this.props.version,variant:`contained`,onClick:()=>this.props.onClose(),color:`grey`,startIcon:m(P,{}),children:this.props.t(`Close`)})]})]})}};c();var Zt={formControl:{marginTop:24},closeButton:e=>({position:`absolute`,right:8,top:8,color:e.palette.grey[500]}),typography:{paddingRight:30}},Qt=class extends z{constructor(e){super(e),C(this,`t`,void 0),this.state={deleteCustom:!1,deleteCustomSupported:!1},this.t=e.t}componentDidMount(){this.props.socket.checkFeatureSupported(`DEL_INSTANCE_CUSTOM`).then(e=>{if(e)return this.props.socket.getObject(`system.adapter.${this.props.adapter}`).then(e=>{e!=null&&e.common?e.common.supportCustoms&&this.setState({deleteCustomSupported:e.common.supportCustoms}):this.setState({deleteCustomSupported:!0})})})}render(){return w(A,{onClose:this.props.onClose,open:!0,children:[m(l,{children:w(k,{component:`h2`,variant:`h6`,sx:{"&.MuiTypography-root":Zt.typography},children:[this.t(`Please confirm`),m(F,{size:`large`,sx:Zt.closeButton,onClick:this.props.onClose,children:m(P,{})})]})}),w(b,{dividers:!0,children:[m(k,{gutterBottom:!0,children:this.t(`Are you sure you want to delete adapter %s?`,this.props.adapter)}),this.state.deleteCustomSupported&&m(p,{control:m(s,{checked:this.state.deleteCustom,onChange:e=>this.setState({deleteCustom:e.target.checked})}),label:this.t(`Delete all custom object settings of this adapter too`)})]}),w(y,{children:[m(O,{id:`adapter-delete-dialog-ok`,variant:`contained`,autoFocus:!0,onClick:()=>{this.props.onClick(this.state.deleteCustom),this.props.onClose()},color:`primary`,startIcon:m(u,{}),children:this.t(`Ok`)}),m(O,{id:`adapter-delete-dialog-cancel`,variant:`contained`,autoFocus:!0,onClick:()=>this.props.onClose(),color:`grey`,startIcon:m(P,{}),children:this.t(`Close`)})]})]})}},$t={none:m(et,{}),patch:m(nt,{style:{color:`green`}}),minor:m($e,{style:{color:`orange`}}),major:m(ee,{style:{color:`red`}})},en=class extends I.Component{constructor(e){super(e),this.state={currentSavedPolicy:`none`,policy:`none`,repositories:[],supported:!0}}async componentDidMount(){await this.getConfiguredRepositories(),await this.getCurrentAutoUpgradeSetting()}async getConfiguredRepositories(){var e;let t=await this.props.socket.getObject(`system.config`);if(!(t!=null&&(e=t.common)!=null&&e.adapterAutoUpgrade))return;let n=Object.entries(t.common.adapterAutoUpgrade.repositories).filter(([,e])=>e).map(([e])=>e);this.setState({repositories:n})}getAdapterId(){return`${this.props.hostId}.adapter.${this.props.adapter}`}async getCurrentAutoUpgradeSetting(){let e=await this.props.socket.getObject(this.getAdapterId());e?this.setState({policy:e.common.automaticUpgrade||`none`,currentSavedPolicy:e.common.automaticUpgrade||`none`}):(console.error(`no adapter object existing`),this.setState({supported:!1}))}async save(){let e=await this.props.socket.getObject(this.getAdapterId());e?(e.common.automaticUpgrade=this.state.policy,await this.props.socket.setObject(this.getAdapterId(),e),this.setState({currentSavedPolicy:this.state.policy},()=>this.props.onClose())):(console.error(`no adapter object existing`),this.setState({supported:!1}))}render(){return w(A,{open:!0,maxWidth:`md`,fullWidth:!0,children:[m(l,{children:S.t(`Auto upgrade policy for %s`,this.props.adapter)}),w(b,{style:{padding:`0 20px`,overflow:`hidden`},children:[m(V,{value:!this.state.supported,children:m(k,{children:S.t(`This feature is supported up from js-controller Kiera (Version 6)!`)})}),w(V,{value:this.state.supported,children:[m(k,{children:S.t(`Allow only the following upgrades to be performed automatically:`)}),m(Me,{variant:`standard`,style:{marginTop:20,minWidth:150,marginBottom:8},value:this.state.policy,onChange:e=>this.setState({policy:e.target.value}),children:mt.map(e=>m(R,{value:e,children:w(`div`,{style:{display:`flex`,gap:8},children:[$t[e],ft[e]]})},e))}),m(V,{value:this.state.repositories.includes(`beta`)&&this.state.policy!==`none`,children:m(r,{type:`warning`,children:S.t(`repo_update_hint`)})}),m(V,{value:this.state.policy===`major`,children:m(r,{type:`warning`,children:S.t(`The current selected configuration will allow to automatically pull in incompatible changes of this adapter!`)})})]})]}),w(y,{children:[m(O,{disabled:this.state.currentSavedPolicy===this.state.policy,color:`primary`,variant:`contained`,startIcon:m(_,{}),onClick:()=>this.save(),children:S.t(`Save`)}),m(O,{variant:`contained`,onClick:()=>this.props.onClose(),color:`grey`,startIcon:m(P,{}),children:S.t(`Close`)})]})]})}};c();var tn=new Set([`admin`,`eos-admin`,`backitup`,`nexowatt-devices`,`nexowatt-device`,`nexowatt-dev`,`nexowatt-ui`]),nn=e=>String(e||``).toLowerCase().replace(/^system\.adapter\./,``).replace(/^iobroker\./,``).replace(/^@nexowatt\/iobroker\./,``).replace(/^@nexowatt\//,``).replace(/\.\d+$/,``),rn=e=>{let t=nn(e);return tn.has(t)},an={hidden:{display:`none`},buttonUpdate:{border:`1px solid`,padding:`0px 7px`,borderRadius:5,display:`flex`,alignItems:`center`,cursor:`pointer`,transition:`background 0.5s`,"&:hover":{background:`#00800026`}},buttonUpdateIcon:{height:20,width:20,marginRight:10},classPoll:{color:`orange`},classPush:{color:`green`},classAssumption:{color:`red`,transform:`rotate(90deg)`},marginLeft5:{marginLeft:5},ratingSet:{cursor:`pointer`},sentry:{width:21,height:21,objectFit:`fill`,marginTop:3,filter:`invert(0%) sepia(90%) saturate(1267%) hue-rotate(-260deg) brightness(99%) contrast(97%)`},tooltip:{pointerEvents:`none`},wrongDependencies:{color:Je[700]},updateAvailable:{color:v[700]},repositoryVersionAvailable:{color:h[800]},currentVersion:e=>({cursor:`pointer`,mb:`6px`,mr:`8px`,mt:`4px`,"&:hover":{background:e.palette.primary.dark}}),header:e=>({fontWeight:`bold`,background:e.palette.secondary.main,p:`10px`}),modalDialog:{height:`calc(100% - 64px)`,overflowY:`hidden`},currentVersionText:e=>({color:e.palette.mode===`dark`?`#a3ffa3`:`#009800`,fontWeight:`bold`,marginLeft:`4px`}),repoStableVersionText:e=>({color:e.palette.mode===`dark`?`#8dff7a`:`#2b9800`,fontWeight:`bold`,marginLeft:`4px`}),repoLatestVersionText:e=>({color:e.palette.mode===`dark`?`#a3fcff`:`#005498`,fontWeight:`bold`,marginLeft:`4px`}),rating:{},containerVersion:{},containerSpecificVersion:{},versionWarn:{color:h[500]},cardContentFlexBetween:{},cardContentFlex:{}},on=class e extends K{constructor(e){super(e),C(this,`installedVersion`,``),Object.assign(this.state,{autoUpgradeDialogOpen:!1,showUpdateDialog:!1,installRepositoryVersion:!1,adapterDeletionDialog:!1,adapterInstallSpecificVersion:``,showInstallVersion:!1,showSetRating:null})}static renderImage(e){var t;let{style:n,alt:r,...i}=e,a=(t=n.backgroundImage)==null?void 0:t.substring(5,n.backgroundImage.length-2);return m(`img`,{...i,alt:r,src:a,onError:e=>{e.target&&(e.target.onerror=null,e.target.src=`img/no-image.svg`)}})}renderAddInstanceButton(){let e=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterInstall;return m(V,{value:e!==!1&&!K.isSingletonInstalled(this.props.adapterName,this.props.context),children:m(j,{title:this.props.context.t(`Add instance`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(F,{size:`small`,disabled:this.props.commandRunning,style:this.props.cached.rightOs?void 0:this.styles.hidden,onClick:this.props.cached.rightOs?e=>{e.preventDefault(),e.stopPropagation(),this.onAddInstance(this.props.adapterName,this.props.context)}:void 0,children:m(We,{})})})})}renderAutoUpgradeButton(){var e;let t=this.props.context.hostAdapterWorker.getObject(this.props.adapterName);if(!t)return m(`div`,{style:{width:34,height:34,display:`inline-block`}});let n=(e=t.common)==null?void 0:e.automaticUpgrade;return m(j,{title:this.props.context.t(`Automatic Upgrade Policy`)+(n?`: ${n}`:``),slotProps:{popper:{sx:this.styles.tooltip}},children:m(F,{size:`small`,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.setState({autoUpgradeDialogOpen:!0,showDialog:!0})},children:!n||n===`none`?m(at,{}):$t[n]})})}renderReadmeButton(){let e=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterReadme;return m(V,{value:e,children:m(j,{title:this.props.context.t(`Readme`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(F,{size:`small`,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.openInfoDialog()},children:m(ne,{})})})})}renderRating(){var e,t;let n=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterRating;return this.props.context.isTileView&&(this.props.context.sortPopularFirst||this.props.context.sortRecentlyUpdated||this.props.context.sortRecentlyCreated)||!this.props.context.repository[this.props.adapterName].stat||n===!1?null:m(`div`,{onClick:()=>this.setState({showSetRating:{version:this.installedVersion,rating:this.props.context.repository[this.props.adapterName].rating},showDialog:!0}),style:{...this.styles.rating,...this.styles.ratingSet},title:(e=this.props.context.repository[this.props.adapterName].rating)==null?void 0:e.title,children:m(Fe,{name:this.props.adapterName,precision:.5,size:`small`,readOnly:!0,value:((t=this.props.context.repository[this.props.adapterName].rating)==null||(t=t.rating)==null?void 0:t.r)||0})})}renderConnectionType(){var e;let t=(e=this.props.context.repository[this.props.adapterName])==null?void 0:e.connectionType;return t===`cloud`?m(j,{title:this.props.context.t(`Adapter requires the specific cloud access for these devices/service`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(xt,{})}):t===`local`?m(j,{title:this.props.context.t(`Adapter does not use the cloud for these devices/service`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(Ze,{})}):null}renderDataSource(){var e;let t=(e=this.props.context.repository[this.props.adapterName])==null?void 0:e.dataSource;return t?m(`div`,{style:this.styles.marginLeft5,title:t,children:t===`poll`?m(j,{title:this.props.context.t(`The device or service will be periodically asked`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(ke,{style:this.styles.classPoll})}):t===`push`?m(j,{title:this.props.context.t(`The device or service delivers the new state actively`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(te,{style:this.styles.classPush})}):t===`assumption`?m(j,{slotProps:{popper:{sx:this.styles.tooltip}},title:this.props.context.t(`Adapter cannot request the exactly device status and the status will be guessed on the last sent command`),children:m(ut,{style:this.styles.classAssumption})}):m(`div`,{style:{width:24,height:24}})}):null}renderLicenseInfo(e=!1){var t,n,r,i;let a=this.props.context.repository[this.props.adapterName],o=Rt(a),s=(t=a.licenseInformation)!=null&&t.type?m(re,{href:o,target:`_blank`,rel:`noopener`,sx:e=>({color:e.palette.mode===`dark`?`white`:`black`,"&:hover":{color:e.palette.mode===`dark`?`white`:`black`}}),children:((n=a.licenseInformation)==null?void 0:n.type)===`paid`?m(j,{title:this.props.context.t(`The adapter requires a paid license.`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(Ye,{})}):((r=a.licenseInformation)==null?void 0:r.type)===`commercial`?m(j,{slotProps:{popper:{sx:this.styles.tooltip}},title:this.props.context.t(`The adapter requires a paid license for commercial use.`),children:m(Ye,{opacity:.5})}):((i=a.licenseInformation)==null?void 0:i.type)===`limited`?m(j,{slotProps:{popper:{sx:this.styles.tooltip}},title:this.props.context.t(`The adapter has a limited functionality without a paid license.`),children:m(Ye,{opacity:.5})}):null}):null;return!s&&e?m(`div`,{style:{width:24,height:24}}):s}renderSentryInfo(){var e;return(e=this.props.context.repository[this.props.adapterName])!=null&&(e=e.plugins)!=null&&e.sentry?m(`div`,{style:this.styles.marginLeft5,children:m(j,{title:`sentry`,slotProps:{popper:{sx:this.styles.tooltip}},children:m(ce,{style:this.styles.sentry,component:`img`,image:Ot})})}):null}getDependencies(){let e=K.getDependencies(this.props.adapterName,this.props.context);if(!e)return null;let t=[];for(let r of e){var n;r.installedVersion?(n=r.wrongHosts)!=null&&n.length?t.push(`${this.props.context.t(`The following hosts do not fulfill the required version %s of %s:`,r.version||`unknown`,r.name)} ${r.wrongHosts.map(e=>`${e.host} (${e.installedVersion})`).join(`, `)}`):r.rightVersion||t.push(`${this.props.context.t(`Invalid version of %s. Required %s. Current `,r.name,r.version||`unknown`)}${r.installedVersion}`):t.push(this.props.context.t(`No version of %s`,r.name,r.name))}return t.length?(t.unshift(this.props.context.t(`Wrong dependencies`)),t.map((e,t)=>m(`div`,{style:t?void 0:{fontWeight:`bold`,fontSize:`larger`},children:e},e))):null}renderVersion(){let e=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterUpdate,t=this.props.context.repository[this.props.adapterName],n=t==null?void 0:t.version;return n?!this.props.commandRunning&&e!==!1&&this.isRepositoryVersionInstallable()?m(j,{title:this.props.context.t(`Install version %s from repository`,n),slotProps:{popper:{sx:this.styles.tooltip}},children:w(`div`,{onClick:()=>this.setState({showUpdateDialog:!0,showDialog:!0,installRepositoryVersion:!0}),style:{...this.styles.buttonUpdate,...this.props.cached.rightDependencies?this.styles.repositoryVersionAvailable:void 0},children:[m(F,{style:this.styles.buttonUpdateIcon,size:`small`,children:m(bt,{})}),n]})}):!this.props.commandRunning&&this.props.cached.updateAvailable&&e!==!1?m(j,{title:this.props.context.t(`Update`),slotProps:{popper:{sx:this.styles.tooltip}},children:w(`div`,{onClick:e=>{e.preventDefault(),e.stopPropagation(),this.setState({showUpdateDialog:!0,showDialog:!0,installRepositoryVersion:!1})},style:{...this.styles.buttonUpdate,...this.props.cached.rightDependencies?this.styles.updateAvailable:void 0},children:[m(F,{style:this.styles.buttonUpdateIcon,size:`small`,children:m(ye,{})}),n]})}):m(j,{title:this.getDependencies(),slotProps:{popper:{sx:this.styles.tooltip}},children:m(`span`,{style:this.props.cached.rightDependencies?void 0:this.styles.wrongDependencies,children:n})}):m(`span`,{style:this.styles.wrongDependencies,children:this.props.context.t(`not maintained`)})}isRepositoryVersionInstallable(){var e,t,n;let r=(e=this.props.context.repository[this.props.adapterName])==null?void 0:e.version,i=(t=this.props.context.installed[this.props.adapterName])==null?void 0:t.version;if(!r||!i||this.props.cached.updateAvailable)return!1;if(r!==i)return ht.updateAvailable(r,i,`adapter "${this.props.adapterName}"`);let a=(n=this.props.context.adapters[`system.adapter.${this.props.adapterName}`])==null||(n=n.common)==null?void 0:n.installedFrom;return!!a&&!a.startsWith(`iobroker.${this.props.adapterName}@`)}static extractGitHubCommitHash(e){if(!e)return null;let t=e.indexOf(`#`);if(t===-1)return null;let n=e.substring(t+1);return n.length>=7?n.substring(0,7):n}renderInstalledVersion(t){var n;let r=this.props.context.installed[this.props.adapterName],i=(n=this.props.context.adapters[`system.adapter.${this.props.adapterName}`])==null||(n=n.common)==null?void 0:n.installedFrom,{adapterName:a}=this.props,o=i&&!i.startsWith(`iobroker.${a}@`),s=o?e.extractGitHubCommitHash(i):null,c=o&&s?`${this.installedVersion}+${s}`:this.installedVersion;if(t){let e=r==null?void 0:r.enabled,t=r==null?void 0:r.count;return w(d,{container:!0,wrap:`nowrap`,spacing:1,sx:{alignItems:`center`},children:[this.installedVersion?m(d,{children:c+(t?` (${t}${t===e?``:`~`})`:``)}):null,o&&m(d,{container:!0,children:m(j,{title:`${this.props.context.t(`Non-NPM-Version`)}: ${i}`,slotProps:{popper:{sx:this.styles.tooltip}},children:m(st,{fontSize:`small`,style:this.styles.versionWarn})})})]})}return this.installedVersion?w(k,{component:`span`,style:this.styles.cardContentFlexBetween,children:[w(`div`,{children:[this.props.context.t(`Installed version`),`:`]}),w(`div`,{style:this.styles.cardContentFlex,children:[o&&m(j,{title:`${this.props.context.t(`Non-NPM-Version`)}: ${i}`,slotProps:{popper:{sx:this.styles.tooltip}},children:m(st,{fontSize:`small`,style:this.styles.versionWarn})}),c]})]}):null}renderUploadButton(){return this.props.context.expertMode&&this.installedVersion?m(j,{title:this.props.context.t(`Upload`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(F,{size:`small`,disabled:this.props.commandRunning,"data-eos-adapter-action":`upload`,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.onUpload()},children:m(Ce,{})})}):null}renderDeleteButton(){let e=rn(this.props.adapterName);return m(V,{value:!!this.installedVersion&&!e,children:m(j,{title:this.props.context.t(`Delete adapter`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(F,{size:`small`,disabled:this.props.commandRunning,"data-eos-adapter-action":`delete`,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.setState({adapterDeletionDialog:!0,showDialog:!0})},children:m(lt,{})})})})}renderInstallSpecificVersionButton(){return this.props.context.expertMode&&this.installedVersion?m(j,{title:this.props.context.t(`Install a specific version`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(F,{disabled:this.props.commandRunning,size:`small`,"data-eos-adapter-action":`install-specific-version`,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.setState({showInstallVersion:!0,showDialog:!0})},children:m(rt,{})})}):null}renderRebuildButton(){return!this.props.context.expertMode||!this.installedVersion?null:m(j,{title:this.props.context.t(`Rebuild`),children:m(F,{size:`small`,disabled:this.props.commandRunning,"data-eos-adapter-action":`rebuild`,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.rebuild()},children:m(a,{})})})}renderAutoUpdateDialog(){return this.state.autoUpgradeDialogOpen?m(en,{onClose:()=>this.setState({autoUpgradeDialogOpen:!1,showDialog:!1}),adapter:this.props.adapterName,hostId:this.props.context.adminHost,socket:this.props.context.socket}):null}async ignoreVersion(e){let t=await this.props.context.socket.getObject(`system.adapter.${this.props.adapterName}`);t!=null&&t.common?(t.common.ignoreVersion=e,this.props.context.socket.setObject(t._id,t).catch(e=>window.alert(`Cannot write object: ${e}`))):window.alert(`Adapter "${this.props.adapterName}" does not exist!`),this.props.context.removeUpdateAvailable(this.props.adapterName)}renderUpdateAdapterDialog(){var e,t;if(!this.state.showUpdateDialog)return null;this.installedVersion=(e=this.props.context.installed[this.props.adapterName])==null?void 0:e.version;let n=(t=this.props.context.repository[this.props.adapterName])==null?void 0:t.version;return m(Mt,{textTitle:this.state.installRepositoryVersion?this.props.context.t(`Install "%s" v%s from repository instead of v%s`,this.props.adapterName,n,this.installedVersion):void 0,textUpdate:this.state.installRepositoryVersion?this.props.context.t(`Install`):void 0,adapter:this.props.adapterName,adapterObject:this.props.context.repository[this.props.adapterName],t:this.props.context.t,dependencies:K.getDependencies(this.props.adapterName,this.props.context),rightDependencies:this.props.context.rightDependenciesFunc(this.props.adapterName),news:this.getNews(),toggleTranslation:this.props.context.toggleTranslation,noTranslation:this.props.noTranslation,installedVersion:this.installedVersion,onUpdate:e=>this.setState({showUpdateDialog:!1,showDialog:!1},()=>this.update(e)),isStable:this.props.context.repository._repoInfo.stable,onIgnore:this.state.installRepositoryVersion?void 0:e=>this.setState({showUpdateDialog:!1,showDialog:!1},()=>void this.ignoreVersion(e)),onClose:()=>this.setState({showUpdateDialog:!1,showDialog:!1}),instances:this.props.context.compactInstances,theme:this.props.context.theme})}static formatNews(e){return(e||``).toString().split(`
|
|
4
|
-
`).map(e=>e.trim().replace(/^\*+/,``).replace(/^-/,``).replace(/\*+$/,``).replace(/\r/g,``).trim()).filter(e=>e).map((e,t)=>w(`div`,{style:{},children:[m(`span`,{children:`- `}),e]},t))}renderAdapterInstallVersion(){if(!this.state.showInstallVersion)return null;let t,n,r=this.props.context.repository._repoInfo;if(r!=null&&r.stable){var i,a;t=(i=this.props.context.repository[this.props.adapterName])==null?void 0:i.version,n=(a=this.props.context.repository[this.props.adapterName])==null?void 0:a.latestVersion}else{var o,s;t=(o=this.props.context.repository[this.props.adapterName])==null?void 0:o.stable,n=(s=this.props.context.repository[this.props.adapterName])==null?void 0:s.version}return m(Nt,{title:this.props.context.t(`Please select specific version of %s`,this.props.adapterName),applyButton:!1,onClose:()=>this.setState({showInstallVersion:!1,adapterInstallSpecificVersion:``,showDialog:!1}),theme:this.props.context.theme,toggleTranslation:this.props.context.toggleTranslation,noTranslation:this.props.noTranslation,children:w(`div`,{style:{height:`100%`,overflowY:`hidden`},children:[w(`div`,{style:this.styles.containerSpecificVersion,children:[w(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[m(B,{variant:`standard`,style:{flexGrow:1},label:this.props.context.t(`Enter version manually`),value:this.state.adapterInstallSpecificVersion,onChange:e=>this.setState({adapterInstallSpecificVersion:e.target.value}),slotProps:{input:{endAdornment:this.state.adapterInstallSpecificVersion?m(g,{position:`end`,children:m(F,{tabIndex:-1,size:`small`,onClick:()=>this.setState({adapterInstallSpecificVersion:``}),children:m(P,{})})}):null}}}),m(O,{color:`primary`,variant:`contained`,size:`small`,disabled:!this.state.adapterInstallSpecificVersion,onClick:()=>{this.state.adapterInstallSpecificVersion&&(this.update(this.state.adapterInstallSpecificVersion),this.setState({showInstallVersion:!1,adapterInstallSpecificVersion:``,showDialog:!1}))},children:this.props.context.t(`Install`)})]}),m(j,{title:this.props.context.t(`npmjs.com`),slotProps:{popper:{sx:this.styles.tooltip}},children:m(F,{size:`small`,onClick:()=>{var e;(e=window.open(`https://www.npmjs.com/package/iobroker.${this.props.adapterName}?activeTab=versions`,this.props.adapterName))==null||e.focus()},children:m(Oe,{})})})]}),m(D,{component:`div`,sx:this.styles.header,children:this.props.context.t(`Or select from the list`)}),m(`div`,{style:{...this.styles.containerVersion,height:`calc(100% - 122px)`,overflowY:`auto`},children:this.getNews(!0).map(({version:r,news:i})=>m(se,{variant:`outlined`,sx:this.styles.currentVersion,onClick:()=>{this.update(r),this.setState({showInstallVersion:!1,showDialog:!1})},children:w(Ge,{children:[w(k,{sx:f.getStyle(this.props.context.theme,this.installedVersion===r&&this.styles.currentVersionText,{fontSize:16,fontWeight:`bold`}),color:`text.secondary`,gutterBottom:!0,children:[r,this.installedVersion===r?m(D,{component:`span`,sx:this.styles.currentVersionText,children:`(${this.props.context.t(`current`)})`}):null,n===r?m(D,{component:`span`,sx:this.styles.repoLatestVersionText,children:`(latest)`}):null,t===r?m(D,{component:`span`,sx:this.styles.repoStableVersionText,children:`(${this.props.context.t(`stable`)})`}):null]}),m(k,{variant:`body2`,style:{opacity:.7},children:e.formatNews(i)})]})},r))})]})})}renderSetRatingDialog(){return this.state.showSetRating?m(Xt,{t:this.props.context.t,lang:this.props.context.lang,version:this.state.showSetRating.version,adapter:this.props.adapterName,currentRating:this.state.showSetRating.rating,onClose:e=>{e&&this.props.context.updateRating(this.props.adapterName,e),this.setState({showSetRating:null,showDialog:!1})},uuid:this.props.context.uuid}):null}renderAdapterDeletionDialog(){return this.state.adapterDeletionDialog?m(Qt,{adapter:this.props.adapterName,socket:this.props.context.socket,t:this.props.context.t,onClick:e=>this.delete(e),onClose:()=>this.setState({adapterDeletionDialog:!1,showDialog:!1})}):null}openInfoDialog(){var e;let t=(e=this.props.context.repository[this.props.adapterName].docs)!=null&&e[this.props.context.lang]?this.props.context.lang:`en`;window.open(ht.getDocsLinkForAdapter({lang:t,adapterName:this.props.adapterName}),`help`)}getNews(e=!1){let t=this.props.context.repository[this.props.adapterName],n=this.props.context.installed[this.props.adapterName],r=[];return n&&t!=null&&t.news&&Object.keys(t.news).forEach(i=>{try{if(L.gt(i,n.version)||e){let e;e=typeof t.news[i]==`object`?this.props.noTranslation?t.news[i].en:t.news[i][this.props.context.lang]||t.news[i].en:t.news[i],r.push({version:i,news:e})}}catch{console.warn(`[ADAPTERS] Cannot compare "${i}" and "${n.version}" (${this.props.adapterName})`)}}),r}onUpload(){var e;let t=this.props.context.repository[this.props.adapterName],n=zt(t),r=((e=t.licenseInformation)==null?void 0:e.license)||t.license;r!==`MIT`&&r!==`Apache-2.0`&&r!==`ISC`&&r!==`BSD-3-Clause`&&r!==`BSD-2-Clause`&&r?this.setState({showLicenseDialog:{url:n,upload:!0,adapterName:this.props.adapterName,licenseType:r},showDialog:!0}):K.upload(this.props.adapterName,this.props.context)}delete(e){rn(this.props.adapterName)?window.alert(`Dieser Adapter ist ein geschütztes NexoWatt-EOS-Systemmodul und darf nicht gelöscht werden.`):this.props.context.executeCommand(`del ${this.props.adapterName}${e?` --custom`:``}${this.props.context.expertMode?` --debug`:``}`)}update(e){this.props.context.executeCommand(`upgrade ${this.props.adapterName}@${e}${this.props.context.expertMode?` --debug`:``}`)}rebuild(){this.props.context.executeCommand(`rebuild ${this.props.adapterName}${this.props.context.expertMode?` --debug`:``}`)}renderDialogs(){return this.state.showDialog?w(T,{children:[this.renderAddInstanceDialog(this.props.context),this.renderLicenseDialog(this.props.context),this.renderUpdateAdapterDialog(),this.renderAdapterInstallVersion(),this.renderSetRatingDialog(),this.renderAdapterDeletionDialog(),this.renderAutoUpdateDialog()]}):null}};c();var sn=`0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)`,cn={...an,type:{color:`tile`},root:e=>({position:`relative`,m:`10px`,width:300,minHeight:200,borderRadius:24,overflow:`hidden`,background:`linear-gradient(180deg, rgba(13, 36, 58, 0.90), rgba(7, 23, 39, 0.88))`,boxShadow:`0 14px 30px rgba(0,0,0,.24)`,display:`flex`,flexDirection:`column`,transition:`box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease`,"&:hover":{boxShadow:sn}}),imageBlock:e=>({background:`linear-gradient(135deg, rgba(0,255,136,.16), rgba(0,212,255,.11))`,borderBottom:`1px solid rgba(0,255,136,.20)`,minHeight:60,display:`flex`,padding:`0 10px 0 10px`,position:`relative`,justifyContent:`space-between`,color:`#eef7ff`}),img:{width:45,height:45,margin:`auto 0`,position:`relative`,"&:after":{content:`""`,position:`absolute`,zIndex:2,top:0,left:0,width:`100%`,height:`100%`,background:`url("img/no-image.svg") 100% 100% no-repeat`,backgroundSize:`cover`,backgroundColor:`#fff`}},installed:{background:`#77c7ff8c`},update:{background:`#10ff006b`},fab:{position:`absolute`,bottom:-20,width:40,height:40,right:20},greenText:e=>({color:e.palette.success.dark}),collapse:{height:`100%`,background:`linear-gradient(180deg, rgba(8, 29, 47, 0.985), rgba(4, 14, 25, 0.975))`,color:`#eef7ff`,border:`1px solid rgba(0, 255, 136, 0.34)`,borderRadius:24,position:`absolute`,width:`100%`,zIndex:1200,marginTop:`auto`,bottom:0,overflow:`hidden`,pointerEvents:`auto`,justifyContent:`space-between`,display:`flex`,flexDirection:`column`},close:{display:`flex`,ml:`auto`,mt:`-4px`,color:`#eaf9ff`},footerBlock:e=>({background:`rgba(2, 9, 20, 0.90)`,borderTop:`1px solid rgba(0,255,136,.22)`,position:`relative`,zIndex:40,pointerEvents:`auto`,p:`10px`,display:`flex`,justifyContent:`space-between`}),versionDate:{alignSelf:`center`},adapter:e=>({width:`100%`,fontWeight:`bold`,fontSize:16,verticalAlign:`middle`,pl:1,pt:2,color:(e.palette.mode,`#333`)}),adapterWithAgo:{width:`calc(100% - 145px)`},description:e=>({display:`block`,color:`rgba(238, 247, 255, 0.94)`,fontSize:13.5,lineHeight:1.48,whiteSpace:`normal`,overflowWrap:`anywhere`}),cardContent:{overflow:`auto`},cardContentDiv:{position:`sticky`,right:0,top:0,background:`linear-gradient(135deg, rgba(0,255,136,.16), rgba(0,212,255,.09))`,borderBottom:`1px solid rgba(0,255,136,.22)`,zIndex:2},cardContentFlex:{display:`flex`},cardContentFlexBetween:{display:`flex`,justifyContent:`space-between`},cardContent2:{height:`100%`,display:`flex`,flexDirection:`column`,justifyContent:`space-between`},cardMargin10:{marginTop:10},availableVersion:{display:`flex`,justifyContent:`space-between`},curdContentFlexCenter:{display:`flex`,alignItems:`center`},versionWarn:{color:h[500],marginRight:5},rating:{marginTop:20}},ln=class extends on{constructor(e){super(e),C(this,`styles`,cn),Object.assign(this.state,{openCollapse:!1})}renderInfoCard(){return w(`div`,{className:`eos-adapter-info-card`,style:this.styles.collapse,children:[w(Ge,{style:this.styles.cardContent,children:[m(`div`,{style:this.styles.cardContentDiv,children:m(F,{size:`small`,sx:this.styles.close,onClick:()=>this.setState({openCollapse:!this.state.openCollapse}),children:m(P,{})})}),m(k,{gutterBottom:!0,component:`span`,variant:`body2`,sx:this.styles.description,children:this.props.cached.desc})]}),w(D,{component:`div`,sx:this.styles.footerBlock,children:[this.renderAddInstanceButton(),w(`div`,{style:this.styles.cardContentFlex,children:[this.renderAutoUpgradeButton(),this.renderReadmeButton(),this.renderUploadButton(),this.renderDeleteButton(),this.renderInstallSpecificVersionButton()]})]})]})}renderCardMedia(){let e=this.props.context.repository[this.props.adapterName],t=e==null?void 0:e.version;return w(D,{component:`div`,sx:f.getStyle(this.props.context.theme,this.styles.imageBlock,this.installedVersion&&this.styles.installed,this.installedVersion&&t&&this.installedVersion!==t&&this.props.cached.updateAvailable&&this.styles.update),children:[m(ce,{sx:this.styles.img,component:e=>on.renderImage(e),src:this.props.cached.image||`img/no-image.svg`,image:this.props.cached.image||`img/no-image.svg`}),m(D,{component:`div`,sx:f.getStyle(this.props.context.theme,this.styles.adapter,(e.stat||this.props.context.sortRecentlyUpdated||this.props.context.sortRecentlyCreated)&&this.styles.adapterWithAgo),children:this.props.adapterName}),this.props.context.sortPopularFirst?m(`div`,{style:this.styles.versionDate,children:e.stat}):null,this.props.context.sortRecentlyUpdated?m(`div`,{style:this.styles.versionDate,children:this.props.cached.daysAgoText}):null,this.props.context.sortRecentlyCreated?m(`div`,{style:this.styles.versionDate,children:this.props.cached.createdDaysAgoText}):null,!this.props.context.sortPopularFirst&&!this.props.context.sortRecentlyUpdated&&!this.props.context.sortRecentlyCreated?this.renderRating():null,this.state.openCollapse?null:m(j,{title:this.props.context.t(`Info`),slotProps:{popper:{sx:{pointerEvents:`none`}}},children:m(Ke,{onClick:()=>this.setState({openCollapse:!this.state.openCollapse}),style:this.styles.fab,color:`primary`,"aria-label":`add`,children:m(ze,{})})})]})}renderCardContent(){let e=!this.props.context.repository[this.props.adapterName]||this.props.context.repository[this.props.adapterName].allowAdapterUpdate,t=this.props.context.installed[this.props.adapterName];return w(Ge,{style:this.styles.cardContent2,children:[m(k,{gutterBottom:!0,variant:`h5`,component:`h5`,children:this.props.cached.title}),w(`div`,{style:this.styles.cardContentFlex,children:[this.renderConnectionType(),this.renderDataSource(),m(`div`,{children:this.renderLicenseInfo()}),this.renderSentryInfo()]}),w(`div`,{style:this.styles.cardMargin10,children:[t!=null&&t.count?w(k,{component:`span`,style:this.styles.cardContentFlexBetween,children:[w(`div`,{children:[this.props.context.t(`Installed instances`),`:`]}),m(`div`,{children:t.count})]}):null,m(V,{value:e,children:w(k,{component:`span`,style:this.styles.availableVersion,children:[m(`div`,{children:this.props.context.t(`Available version:`)}),m(D,{component:`div`,sx:f.getStyle(this.props.context.theme,this.props.cached.updateAvailable&&this.styles.greenText,this.styles.curdContentFlexCenter),children:this.renderVersion()})]})}),this.renderInstalledVersion()]})]})}render(){var e;return this.installedVersion=(e=this.props.context.installed[this.props.adapterName])==null?void 0:e.version,w(se,{sx:this.styles.root,children:[this.state.openCollapse?this.renderInfoCard():null,this.renderCardMedia(),this.renderCardContent(),this.renderDialogs()]})}};c();var un={...an,type:{color:`line`},smallAvatar:{width:32,height:32,marginLeft:4},paddingNone:{padding:`0 !important`},name:{flexWrap:`nowrap`,width:300,marginTop:0},flex:{display:`flex`},nameCell:{paddingTop:`0 !important`,paddingBottom:`0 !important`}},dn=class extends on{constructor(...e){super(...e),C(this,`styles`,un)}render(){var e,t;let n=this.props.context.repository[this.props.adapterName],r=!n||n.allowAdapterRating;return this.installedVersion=(e=this.props.context.installed[this.props.adapterName])==null?void 0:e.version,w(N,{hover:!0,children:[m(M,{}),m(M,{children:w(d,{container:!0,spacing:1,style:this.styles.name,sx:{alignItems:`center`},children:[m(j,{title:this.props.adapterName,slotProps:{popper:{sx:this.styles.tooltip}},children:m(d,{style:this.styles.paddingNone,children:m(we,{variant:`square`,alt:this.props.cached.title,src:this.props.cached.image,style:this.styles.smallAvatar})})}),r===!1?m(d,{children:this.props.cached.title}):w(d,{style:this.styles.nameCell,children:[m(`div`,{children:this.props.cached.title}),this.renderRating()]})]})}),!this.props.context.descHidden&&m(M,{title:this.props.cached.desc,style:{width:20,wordWrap:`break-word`},children:this.props.cached.desc}),m(M,{children:w(`div`,{style:this.styles.flex,children:[this.renderConnectionType()||m(`div`,{style:{width:24,height:24}}),this.renderDataSource()||m(`div`,{style:{marginLeft:5,width:24,height:24}}),this.renderSentryInfo()||m(`div`,{style:{marginLeft:5,width:24,height:24}}),this.renderLicenseInfo(!0)]})}),m(M,{children:this.renderInstalledVersion(!0)}),m(M,{children:m(d,{container:!0,sx:{alignItems:`center`},children:this.renderVersion()})}),m(M,{style:{fontSize:`smaller`},children:(n==null||(t=n.licenseInformation)==null?void 0:t.license)||(n==null?void 0:n.license)}),w(M,{children:[this.renderAddInstanceButton(),this.renderAutoUpgradeButton(),this.renderReadmeButton(),this.renderUploadButton(),this.renderDeleteButton(),this.renderInstallSpecificVersionButton(),this.renderRebuildButton()]}),this.renderDialogs()]})}};c();var fn=246,Y={emptyBlock:50,name:300,connectionType:120,installed:120,available:120,update:40,license:80,install:fn},pn=Object.keys(Y).reduce((e,t)=>e+Y[t],0),X={container:{height:`100%`,width:`100%`},containerNotFullHeight:{height:`calc(100% - 50px)`},containerFullHeight:{height:`100%`},table:{width:`100%`,tableLayout:`fixed`,minWidth:960,"& td":{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,pt:`2px`,pb:`2px`,pr:`4px`,pl:`4px`},"& th":{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,pt:`2px`,pb:`2px`,pr:`4px`,pl:`4px`}},name:{flexWrap:`nowrap`,width:Y.name},emptyBlock:{flexWrap:`nowrap`,width:Y.emptyBlock},description:{width:`calc(100% - ${pn+2}px)`},connectionType:{width:Y.connectionType},installed:{width:Y.installed},available:{width:Y.available,paddingRight:6},update:{width:Y.update,padding:0},license:{width:Y.license},install:{width:Y.install},viewModeDiv:{display:`flex`,flexFlow:`wrap`,overflow:`auto`,justifyContent:`center`}},mn=class extends z{constructor(e){super(e),C(this,`lastRenderCounter`,-1),this.state={descWidth:e.descWidth,repoName:e.repoName,systemConfig:!!e.systemConfig,tableViewMode:e.tableViewMode,oneListView:e.oneListView,categoriesExpanded:JSON.stringify(e.categoriesExpanded),cachedAdapters:e.cachedAdapters?Object.keys(e.cachedAdapters).length:0,update:e.update,sortByName:e.sortByName,sortPopularFirst:e.sortPopularFirst,sortRecentlyUpdated:e.sortRecentlyUpdated,sortRecentlyCreated:e.sortRecentlyCreated,renderCounter:0,listOfVisibleAdapter:JSON.stringify(e.listOfVisibleAdapter),expertMode:e.context.expertMode,commandRunning:e.commandRunning,noTranslation:e.noTranslation}}getRow(e,t){var n;let r=(n=this.props.cachedAdapters)==null?void 0:n[e];return r?m(dn,{context:t,adapterName:e,cached:r,commandRunning:this.state.commandRunning,noTranslation:this.state.noTranslation},`adapter-${e}`):null}getRows(e){if(!this.props.listOfVisibleAdapter)return m(N,{children:m(M,{colSpan:8,children:m(E,{})})});let t=0,n=[];if(this.props.oneListView){for(let t=0;t<this.props.listOfVisibleAdapter.length;t++){var r;let i=this.props.listOfVisibleAdapter[t];if(n.length>50&&!((r=this.props.context.installed[i])!=null&&r.version))continue;let a=this.getRow(i,e);a&&n.push(a)}if(t=n.length,t&&this.props.listOfVisibleAdapter.length>n.length){let e=this.props.listOfVisibleAdapter.length-n.length,t=e===1?this.props.context.t(`Filter adapters to see others. There is %s more`,1):this.props.context.t(`Filter adapters to see others. There are %s more`,e);n.push(m(N,{children:m(M,{colSpan:8,style:{fontSize:20,padding:20,textAlign:`center`},children:t})},`more`))}}else n=this.props.categories.map(n=>{if(!n.adapters.find(e=>{var t;return(t=this.props.listOfVisibleAdapter)==null?void 0:t.includes(e)}))return null;let r=n.name,i=this.props.categoriesExpanded[r];return t++,w(Ne,{children:[m(Jt,{categoryName:r,count:n.count,expanded:i,installedCount:n.installed,name:n.translation,descHidden:e.descHidden,onToggle:()=>this.props.toggleCategory(r),t:this.props.context.t},`category-${r}1`),i&&n.adapters.map(n=>{let r=this.getRow(n,e);return r&&t++,r})]},`category-${r} ${n.adapters.length}`)});return t?n:this.props.update?null:m(`tr`,{children:w(`td`,{colSpan:8,style:{textAlign:`center`},children:[this.props.searchFilter||this.props.installedListFilter?m(O,{variant:`outlined`,title:this.props.context.t(`Click to clear all filters`),onClick:()=>this.props.clearAllFilters(),children:this.props.context.t(`all items are filtered out`)}):null,this.props.updateListFilter&&(this.props.searchFilter||this.props.installedListFilter)?m(`br`,{}):null,this.props.updateListFilter?m(O,{style:{marginTop:16},variant:`outlined`,onClick:()=>this.props.clearAllFilters(!0),startIcon:m(Tt,{}),children:this.props.context.t(`Remove filter for updatable adapters`)}):null]})})}getTiles(e){if(!this.props.listOfVisibleAdapter)return m(E,{});if(!this.props.listOfVisibleAdapter.length)return this.props.update?null:w(`div`,{style:{width:`100%`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,gap:16},children:[this.props.searchFilter||this.props.installedListFilter?m(j,{title:this.props.context.t(`Click to clear all filters`),slotProps:{popper:{sx:{pointerEvents:`none`}}},children:m(O,{variant:`outlined`,onClick:()=>this.props.clearAllFilters(),children:this.props.context.t(`all items are filtered out`)})}):null,this.props.updateListFilter?m(O,{variant:`outlined`,onClick:()=>this.props.clearAllFilters(!0),startIcon:m(Tt,{}),children:this.props.context.t(`Remove filter for updatable adapters`)}):null]});let t=[];for(let i=0;i<this.props.listOfVisibleAdapter.length;i++){var n,r;let a=this.props.listOfVisibleAdapter[i],o=(n=this.props.cachedAdapters)==null?void 0:n[a];t.length>50&&!((r=this.props.context.installed[a])!=null&&r.version)||o&&t.push(m(ln,{context:e,adapterName:a,cached:o,commandRunning:this.state.commandRunning,noTranslation:this.state.noTranslation},`adapter-${a}`))}return this.props.listOfVisibleAdapter.length>t.length&&(t.push(m(`div`,{style:{flexBasis:`100%`,height:0}},`newLine`)),t.push(m(`div`,{style:{fontSize:20,margin:20},children:this.props.context.t(`Filter adapters to see others. There is %s more`,this.props.listOfVisibleAdapter.length-t.length)},`more`))),t}shouldShowRepositoryWarning(e,t){return!e&&String(t||``).toLowerCase()!==`nexowatt`}renderTileView(e,t,n){return w(T,{children:[this.shouldShowRepositoryWarning(e,t)?m(D,{sx:{marginX:2,marginTop:1,width:`calc(100% - 32px)`},children:m(r,{type:`warning`,children:this.props.context.t(`Active repo is "%s"`,t)})}):null,m(`div`,{style:X.viewModeDiv,children:this.getTiles(n)})]})}renderTableView(e,t,n){return w(qe,{children:[this.shouldShowRepositoryWarning(e,t)?m(D,{sx:{marginX:2,marginTop:1,width:`calc(100% - 32px)`},children:m(r,{type:`warning`,children:this.props.context.t(`Active repo is "%s"`,t)})}):null,m(Ie,{style:{...X.container,...e?X.containerFullHeight:X.containerNotFullHeight},children:w(xe,{stickyHeader:!0,size:`small`,sx:X.table,children:[m(Te,{children:w(N,{children:[m(M,{style:X.emptyBlock}),m(M,{style:X.name,children:m(k,{children:this.props.context.t(`Name`)})}),!n.descHidden&&m(M,{style:{...X.description,width:this.props.descWidth},children:m(k,{children:this.props.context.t(`Description`)})}),m(M,{style:X.connectionType}),m(M,{style:X.installed,children:m(k,{children:this.props.context.t(`Installed`)})}),m(M,{style:X.available,children:m(k,{children:this.props.context.t(`Available`)})}),m(M,{style:X.license,children:m(k,{children:this.props.context.t(`License`)})}),m(M,{style:{...X.install,width:this.state.expertMode?fn:178},children:m(k,{children:this.props.context.t(`Install`)})})]})}),m(Be,{children:this.getRows(n)})]})})]})}static getDerivedStateFromProps(e,t){let n=!1;e.descWidth!==t.descWidth&&(console.log(`Render because of descWidth`),n=!0),e.repoName!==t.repoName&&(console.log(`Render because of repoName`),n=!0),!!e.systemConfig!==t.systemConfig&&(console.log(`Render because of systemConfig`),n=!0),e.tableViewMode!==t.tableViewMode&&(console.log(`Render because of tableViewMode`),n=!0),e.oneListView!==t.oneListView&&(console.log(`Render because of oneListView`),n=!0);let r=JSON.stringify(e.categoriesExpanded);r!==t.categoriesExpanded&&(console.log(`Render because of categoriesExpanded`),n=!0);let i=e.cachedAdapters?Object.keys(e.cachedAdapters).length:0;i!==t.cachedAdapters&&(console.log(`Render because of cachedAdapters ${i} <> ${t.cachedAdapters}`),n=!0),e.update!==t.update&&(console.log(`Render because of update`),n=!0),e.sortByName!==t.sortByName&&(console.log(`Render because of sortByName`),n=!0),e.sortPopularFirst!==t.sortPopularFirst&&(console.log(`Render because of sortPopularFirst`),n=!0),e.sortRecentlyUpdated!==t.sortRecentlyUpdated&&(console.log(`Render because of sortRecentlyUpdated`),n=!0),e.sortRecentlyCreated!==t.sortRecentlyCreated&&(console.log(`Render because of sortRecentlyCreated`),n=!0),e.context.expertMode!==t.expertMode&&(console.log(`Render because of expertMode`),n=!0);let a=JSON.stringify(e.listOfVisibleAdapter);return a!==t.listOfVisibleAdapter&&(console.log(`Render because of listOfVisibleAdapter`),n=!0),e.commandRunning!==t.commandRunning&&(console.log(`Render because of commandRunning`),n=!0),e.noTranslation!==t.noTranslation&&(console.log(`Render because of commandRunning`),n=!0),n?{descWidth:e.descWidth,repoName:e.repoName,systemConfig:!!e.systemConfig,tableViewMode:e.tableViewMode,oneListView:e.oneListView,categoriesExpanded:r,cachedAdapters:i,update:e.update,sortByName:e.sortByName,sortPopularFirst:e.sortPopularFirst,sortRecentlyUpdated:e.sortRecentlyUpdated,sortRecentlyCreated:e.sortRecentlyCreated,listOfVisibleAdapter:a,renderCounter:t.renderCounter+1,expertMode:e.context.expertMode,commandRunning:e.commandRunning,noTranslation:e.noTranslation}:null}shouldComponentUpdate(e,t){return this.lastRenderCounter!==t.renderCounter&&(this.lastRenderCounter=t.renderCounter,!0)}render(){var e;return(e=this.props.systemConfig)!=null&&(e=e.common)!=null&&e.activeRepo?this.props.tableViewMode?this.renderTableView(this.props.stableRepo,this.props.repoName,this.props.context):this.renderTileView(this.props.stableRepo,this.props.repoName,this.props.context):m(E,{})}};c();var hn=class extends z{constructor(e){super(e),C(this,`updating`,void 0),C(this,`interval`,null),C(this,`startTimeout`,null),C(this,`textareaRef`,void 0),C(this,`link`,void 0),C(this,`oldVersion`,void 0),this.state={response:null,error:null,starting:!0,upAgain:!1},this.updating=!1,this.textareaRef=I.createRef(),this.link=`${window.location.protocol}//${window.location.host}/`}setUpdating(e){this.updating!==e&&(this.updating=e,this.props.onUpdating(e))}async getWebserverParams(){let e=await this.props.socket.getObject(`system.adapter.${this.props.adminInstance}`);return{useHttps:e==null?void 0:e.native.secure,port:e==null?void 0:e.native.port,certPrivateName:e==null?void 0:e.native.certPrivate,certPublicName:e==null?void 0:e.native.certPublic}}async componentDidMount(){let{certPrivateName:e,certPublicName:t,port:n,useHttps:r}=await this.getWebserverParams();this.oldVersion=this.props.currentAdminVersion,await this.props.socket.upgradeAdapterWithWebserver(this.props.host,{version:this.props.version,adapterName:`eos-admin`,port:n,useHttps:r,certPublicName:t,certPrivateName:e}),this.setUpdating(!0),this.interval=setInterval(()=>this.checkStatus(),1e3),this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.setState({starting:!1})},1e4)}componentWillUnmount(){this.interval&&=(clearInterval(this.interval),null),this.startTimeout&&=(clearTimeout(this.startTimeout),null)}async checkVersion(){try{let e=await(await fetch(`./version`)).text();return e&&e.length<20&&e!==this.oldVersion?(this.interval&&=(clearInterval(this.interval),null),this.setState({response:{running:!1,success:!0,stderr:[],stdout:[S.t(`Version updated to %s`,e)]},upAgain:!0,error:null},()=>this.setUpdating(!1)),!0):e===this.oldVersion}catch{return!1}}async checkStatus(){console.log(`Request update status from: ${this.link}`);try{let e=await(await fetch(this.link)).text();if(console.log(`Received status: ${e}`),e.startsWith(`{`)&&e.endsWith(`}`))try{let t=JSON.parse(e);t!=null&&t.stderr&&(t.stderr=t.stderr.filter(e=>e.trim())),t&&!t.running&&t.success&&t.stdout?(t.stdout.push(``),t.stdout.push(`---------------------------------------------------`),t.stdout.push(S.t(`%s was successfully updated to %s`,`eos-admin`,this.props.version))):t!=null&&t.stdout&&(t.stdout.unshift(``),t.stdout.unshift(`---------------------------------------------------`),t.stdout.unshift(S.t(`updating %s to %s...`,`eos-admin`,this.props.version))),this.setState({response:t,error:null},()=>{t&&!t.running?(this.interval&&=(clearInterval(this.interval),null),this.waitForAdapterStart()):t!=null&&t.running&&this.setUpdating(!0),this.textareaRef.current&&setTimeout(()=>this.textareaRef.current&&(this.textareaRef.current.scrollTop=this.textareaRef.current.scrollHeight),100)})}catch(t){console.error(`Cannot parse response: ${t}`),this.setState({error:e},()=>this.setUpdating(!1))}else await this.checkVersion()||console.error(`Response is not JSON: ${e}`)}catch(e){this.state.starting||this.setState({error:e.toString()},()=>this.setUpdating(!1))}}waitForAdapterStart(){this.interval=setInterval(async()=>{try{await fetch(this.link),this.interval&&clearInterval(this.interval),this.interval=null,this.setState({upAgain:!0})}catch{}},1e3)}render(){var e,t,n,r,i,a,o;return w(A,{onClose:(e,t)=>{t!==`escapeKeyDown`&&t!==`backdropClick`&&this.props.onClose()},open:!0,maxWidth:`lg`,fullWidth:!0,children:[m(l,{children:S.t(`Updating %s...`,`eos-admin`)}),w(b,{style:{height:400,padding:`0 20px`,overflow:`hidden`},children:[(!this.state.response||this.state.response.running)&&!this.state.error?m(E,{}):null,this.state.response||this.state.error?m(`textarea`,{ref:this.textareaRef,style:{width:`100%`,height:`100%`,resize:`none`,background:this.props.themeType===`dark`?`#000`:`#fff`,color:this.props.themeType===`dark`?`#EEE`:`#111`,boxSizing:`border-box`,fontFamily:`Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace`,border:(e=this.state.response)!=null&&e.success?`2px solid green`:this.state.error||this.state.response&&!this.state.response.running&&!this.state.response.success?`2px solid red`:void 0},value:this.state.error?this.state.error:(t=this.state.response)!=null&&(t=t.stderr)!=null&&t.length?this.state.response.stderr.join(`
|
|
5
|
-
`):(n=this.state.response)==null||(n=n.stdout)==null?void 0:n.join(`
|
|
6
|
-
`),readOnly:!0}):null]}),m(y,{children:m(O,{variant:`contained`,disabled:this.state.starting||!this.state.error&&!this.state.upAgain,onClick:()=>{var e;(e=this.state.response)!=null&&e.success&&window.location.reload(),this.props.onClose()},color:(r=this.state.response)!=null&&r.success?`primary`:`grey`,startIcon:(i=this.state.response)!=null&&i.success?m(ye,{}):m(P,{}),children:(a=this.state.response)!=null&&a.success&&!this.state.upAgain?m(x,{}):(o=this.state.response)!=null&&o.success?S.t(`Reload`):S.t(`Close`)})})]})}};c();var gn=864e5,_n=5e3,vn=gn/10,Z={grow:{flexGrow:1},counters:{mr:`10px`,minWidth:120,display:`flex`,"& div":{ml:`3px`}},infoAdapters:e=>({fontSize:10,color:e.palette.mode===`dark`?`#9c9c9c`:`#333`,cursor:`pointer`}),greenText:{color:`#00a005d1`},tooltip:{pointerEvents:`none`}},Q=`Description A-Z`,$=`Name A-Z`,yn=`Popular first`,bn=`Recently updated`,xn=`Recently created`,Sn=[{name:Q},{name:$},{name:yn,notByList:!0},{name:bn,notByList:!0},{name:xn,notByList:!0}],Cn=class e extends K{static isTransientConnectionError(e){return/notconnected|not connected|connectionerror|close_abnormal|closed_no_status|websocket|timeout|networkerror/i.test(e instanceof Error?e.message:typeof e==`string`?e:``)}scheduleInitializationRetry(){if(this.unmounted||this.initializationRetryTimer)return;let e=[250,500,1e3,2e3,4e3,8e3,12e3,15e3],t=e[Math.min(this.initializationRetryAttempt,e.length-1)];this.initializationRetryAttempt++,this.initializationRetryTimer=setTimeout(()=>{this.initializationRetryTimer=null,this.initializeAdapters()},t)}async initializeAdapters(){if(!(this.unmounted||this.initialized||this.initializing||!this.props.ready)){this.initializing=!0;try{if(!this.hostAdapterWorker||this.hostAdapterWorker.getHost()!==this.props.currentHost){var t;(t=this.hostAdapterWorker)==null||t.destroy(),this.hostAdapterWorker=new Lt(this.props.socket,this.props.currentHost),this.hostAdapterWorker.registerHandler(this.onHostAdapterChanged)}if(!await this.hostAdapterWorker.getObjects())throw Error(`Host adapter data are not available yet`);if(await this.updateAll(),this.unmounted)return;this.state.search&&this.filterAdapters(),this.workerHandlersRegistered||=(this.props.adaptersWorker.registerHandler(this.onAdaptersChanged),this.props.instancesWorker.registerHandler(this.onAdaptersChanged),!0),this.initialized=!0,this.initializationRetryAttempt=0}catch(t){this.unmounted||(e.isTransientConnectionError(t)||console.error(`Cannot initialize adapter list: ${t}`),this.scheduleInitializationRetry())}finally{this.initializing=!1}}}constructor(e){super(e),C(this,`inputRef`,void 0),C(this,`countRef`,void 0),C(this,`t`,void 0),C(this,`wordCache`,{}),C(this,`cache`,{listOfVisibleAdapter:null,adapters:null}),C(this,`listOfVisibleAdapterLength`,0),C(this,`allAdapters`,0),C(this,`installedAdapters`,0),C(this,`recentUpdatedAdapters`,0),C(this,`recentCreatedAdapters`,0),C(this,`uuid`,``),C(this,`buildCacheTimer`,null),C(this,`updateTimeout`,null),C(this,`typingTimer`,null),C(this,`hostsTimer`,null),C(this,`onHostAdapterTimer`,null),C(this,`tempAdapters`,null),C(this,`tempInstalled`,null),C(this,`tempInstances`,null),C(this,`hostAdapterWorker`,null),C(this,`initializing`,!1),C(this,`initialized`,!1),C(this,`unmounted`,!1),C(this,`initializationRetryTimer`,null),C(this,`initializationRetryAttempt`,0),C(this,`workerHandlersRegistered`,!1),C(this,`installedOfHosts`,{}),C(this,`installedReadId`,0),C(this,`installedShownId`,0),C(this,`installedPending`,!1),C(this,`translate`,(e,t,n)=>t===void 0?(this.wordCache[e]||=this.props.t(e),this.wordCache[e]):n===void 0?this.props.t(e,t):this.props.t(e,t,n)),C(this,`onAdaptersChanged`,e=>{this.tempAdapters||=JSON.parse(JSON.stringify(this.state.adapters||{})),this.tempInstalled||=JSON.parse(JSON.stringify(this.state.installed||{})),this.tempInstances||=JSON.parse(JSON.stringify(this.state.compactInstances||{}));let t=this.tempAdapters,n=this.tempInstalled,r=this.tempInstances;e.forEach(e=>{if(e.id.match(/\.\d+$/))e.type===`deleted`||!e.obj?delete r[e.id]:r[e.id]={enabled:e.obj.common.enabled,icon:e.obj.common.icon,name:e.obj.common.name,adminTab:e.obj.common.adminTab,version:e.obj.common.version};else if(e.type===`deleted`||!e.obj){let r=e.id.split(`.`);delete n[r[2]],delete t[e.id]}else{let r=e.obj.common.name;n[r]?Object.keys(n[r]).forEach(t=>{e.obj.common[t]!==void 0&&t!==`installedFrom`&&(n[r][t]=e.obj.common[t])}):n[e.id.split(`.`).pop()||``]=JSON.parse(JSON.stringify(e.obj.common)),t[e.id]=e.obj}}),this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=null;let e=this.tempAdapters;this.tempAdapters=null;let t=this.tempInstalled;this.tempInstalled=null;let n=this.tempInstances;this.tempInstances=null,this.analyseInstalled({adapters:e||{},installedLocal:t||{},cb:()=>this.calculateInfo(n||{})})},300)}),C(this,`rightDependencies`,e=>K.getDependencies(e,this.state).every(e=>e.rightVersion)),C(this,`onHostAdapterChanged`,e=>{this.onHostAdapterTimer&&clearTimeout(this.onHostAdapterTimer),this.onHostAdapterTimer=setTimeout(()=>{this.onHostAdapterTimer=null,this.cache.listOfVisibleAdapter=null,this.forceUpdate()},200)}),C(this,`setAdminUpgradeTo`,e=>this.setState({adminUpgradeTo:e})),this.state={...this.state||{},lastUpdate:0,repository:{},installed:{},installedGlobal:{},installedGlobalHosts:{},adapters:{},compactInstances:{},categories:[],hostData:null,compactRepositories:null,hostOs:``,nodeJsVersion:``,init:!1,update:!1,filterConnectionType:!1,search:(window._localStorage||window.localStorage).getItem(`Adapter.search`)||``,oneListView:!1,tableViewMode:!1,updateList:!1,installedList:0,categoriesTiles:`All`,filterTiles:Q,gitHubInstallDialog:!1,updateAvailable:[],filteredList:null,showUpdater:!1,descWidth:300,showStatistics:!1,readTimeoutMs:wt.getReadTimeoutMs(),showSlowConnectionWarning:!1,currentHost:e.currentHost,forceUpdateAdapters:e.forceUpdateAdapters,triggerUpdate:e.triggerUpdate,ratings:null,categoriesExpanded:{},adminUpgradeTo:``},this.inputRef=ie(),this.countRef=ie(),this.t=this.translate}renderSlowConnectionWarning(){return this.state.showSlowConnectionWarning?m(wt,{readTimeoutMs:this.state.readTimeoutMs,t:this.t,onClose:e=>{e?this.setState({showSlowConnectionWarning:!1,readTimeoutMs:e},()=>this.updateAll()):this.setState({showSlowConnectionWarning:!1})}}):null}componentDidMount(){this.unmounted=!1,this.initializeAdapters()}async updateAll(e,t,n){let r=this.state.currentHost?this.readAdaptersInfo(e):null,i=++this.installedReadId,a=this.readInstalled(e,i),{repository:o,allInstalled:s}=await this.getAdapters(a,e,t,n);r&&await this.getAdaptersInfo(r,n),!s&&i===this.installedReadId&&(this.installedShownId=i,a.then(async()=>{i===this.installedReadId&&(await this.readMissingNews(o),this.showInstalled(o))})),i===this.installedReadId&&this.props.adaptersWorker.isForceUpdate()&&await this.updateAll(!0)}componentDidUpdate(e){!this.props.ready||e.ready&&this.initialized||this.initializeAdapters();let t=this.getDescWidth();this.state.descWidth!==t&&this.setState({descWidth:t}),this.countRef.current&&(this.countRef.current.innerHTML=this.listOfVisibleAdapterLength.toString())}componentWillUnmount(){var e;this.unmounted=!0,this.initializationRetryTimer&&=(clearTimeout(this.initializationRetryTimer),null),this.updateTimeout&&=(clearTimeout(this.updateTimeout),null),this.buildCacheTimer&&=(clearTimeout(this.buildCacheTimer),null),this.typingTimer&&=(clearTimeout(this.typingTimer),null),this.hostsTimer&&=(clearTimeout(this.hostsTimer),null),this.onHostAdapterTimer&&=(clearTimeout(this.onHostAdapterTimer),null),this.installedReadId++,this.workerHandlersRegistered&&=(this.props.adaptersWorker.unregisterHandler(this.onAdaptersChanged),this.props.instancesWorker.unregisterHandler(this.onAdaptersChanged),!1),(e=this.hostAdapterWorker)==null||e.destroy(),this.hostAdapterWorker=null}analyseInstalled(e){let{adapters:t,repository:n}=e,{cb:r,installedLocal:i}=e,{installedGlobal:a,installedGlobalHosts:o}=e;t||=this.state.adapters;let s=i||this.state.installed;a||=this.state.installedGlobal,o||=this.state.installedGlobalHosts,n||=this.state.repository;let c=[];Object.keys(s).forEach(e=>{if(s[e]){let t=s[e].version,r=n[e];r&&r.version!==t&&ht.updateAvailable(t,r.version,`adapter "${e}"`)&&!c.includes(e)&&c.push(e)}}),this.cache.listOfVisibleAdapter=null,this.setState({adapters:t,updateAvailable:c,installed:s,repository:n,installedGlobal:a,installedGlobalHosts:o},()=>r&&r())}async readInstalled(e,t){this.installedPending=!0;let n=[];try{n=await this.props.socket.getHosts(e),Object.keys(this.installedOfHosts).forEach(e=>{n.find(t=>t._id===e)||delete this.installedOfHosts[e]})}catch(e){window.alert(`Cannot read hosts: ${e}`)}let r=n.length;await Promise.all(n.map(async n=>{let i=null;try{let t=await this.props.socket.getState(`${n._id}.alive`);t!=null&&t.val&&(i=await this.props.socket.getInstalled(n._id,e,this.state.readTimeoutMs))}catch(e){window.alert(`Cannot getInstalled from "${n._id}" (timeout ${this.state.readTimeoutMs}ms): ${e}`),e.toString().includes(`timeout`)&&this.setState({showSlowConnectionWarning:!0})}t===this.installedReadId&&(i?this.installedOfHosts[n._id]=i:delete this.installedOfHosts[n._id],r--,r&&this.installedShownId===t&&this.showInstalled())})),t===this.installedReadId&&(this.installedPending=!1)}mergeInstalled(){let e={},t={},n={};return Object.keys(this.installedOfHosts).sort().forEach(r=>{let i=this.installedOfHosts[r];r===this.state.currentHost&&(e=i);let a=r.replace(/^system\.host\./,``);for(let e of Object.keys(i)){var o;e!==`hosts`&&(o=i[e])!=null&&o.version&&(n[e]||={},n[e][a]=i[e].version)}t={...t,...i}}),{installedLocal:e,installedGlobal:t,installedGlobalHosts:n}}showInstalled(e){this.analyseInstalled({adapters:this.state.adapters,repository:e,...this.mergeInstalled(),cb:()=>void this.calculateInfo(this.state.compactInstances||{})})}async readMissingNews(e){try{await gt(this.props.socket,this.state.currentHost,e,Object.keys(this.mergeInstalled().installedGlobal),{repo:this.props.systemConfig.common.activeRepo,lang:this.props.lang},this.state.readTimeoutMs)}catch(e){console.warn(`Cannot read the news of the installed adapters: ${e}`)}}async getAdapters(e,t,n,r){console.log(`[ADAPTERS] getAdapters`);let i=this.state.currentHost;t||=this.props.adaptersWorker.isForceUpdate(),!this.state.update&&(t||r)&&this.setState({update:!0});let[a,o]=await Promise.all([this.props.adaptersWorker.getObjects(t).then(e=>e||{}).catch(e=>(window.alert(`Cannot getAdapters: ${e}`),{})),Ct(this.props.socket,i,{repo:this.props.systemConfig.common.activeRepo,update:n||r,lang:this.props.lang},t,this.state.readTimeoutMs).then(e=>e).catch(e=>(window.alert(`Cannot getRepository: ${e}`),e.toString().includes(`timeout`)&&this.setState({showSlowConnectionWarning:!0}),{}))]);if(this.installedPending){let t;await Promise.race([e,new Promise(e=>t=setTimeout(e,_n))]),clearTimeout(t)}let s=!this.installedPending;return s&&await this.readMissingNews(o),await new Promise(e=>this.analyseInstalled({adapters:a,repository:o,...this.mergeInstalled(),cb:e})),{repository:o,allInstalled:s}}getWordVotes(e){if(e===1)return this.t(`vote`);if(e>=2&&e<=4)return this.t(`votes2`);if(e>=5&&e<=20)return this.t(`votes`);let t=e%10;return t===1?this.t(`vote21`):t>=2&&t<=4?this.t(`votes2`):this.t(`votes`)}static getAdapterTitle(e,t,n){if(!t[e])return e;let r=t[e].titleLang||t[e].title||``,i;return i=typeof r==`object`?r[n]||r.en:r,i=((i||``).toString()||``).replace(`ioBroker Visualisation - `,``),i.toLowerCase()}static sortAdapters(t,n,r,i,a,o,s,c,l){let u={};t.sort((t,d)=>{if(o){var f,p,m,h;return((f=i[d])==null?void 0:f.stat)===((p=i[t])==null?void 0:p.stat)?(u[t]||=e.getAdapterTitle(t,i,n),u[d]||=e.getAdapterTitle(d,i,n),u[t]>u[d]?1:u[t]<u[d]?-1:0):(((m=i[d])==null?void 0:m.stat)??0)-(((h=i[t])==null?void 0:h.stat)??0)}if(s){if(!i[t])return-1;if(!i[d])return 1;let r=i[t].daysAgo,a=i[d].daysAgo,o=Number.isFinite(r)?r:1/0,s=Number.isFinite(a)?a:1/0;return o===s?(u[t]||=e.getAdapterTitle(t,i,n),u[d]||=e.getAdapterTitle(d,i,n),u[t]>u[d]?1:u[t]<u[d]?-1:0):o-s}if(c){if(!i[t])return-1;if(!i[d])return 1;let r=i[t].createdDaysAgo,a=i[d].createdDaysAgo,o=Number.isFinite(r)?r:1/0,s=Number.isFinite(a)?a:1/0;return o===s?(u[t]||=e.getAdapterTitle(t,i,n),u[d]||=e.getAdapterTitle(d,i,n),u[t]>u[d]?1:u[t]<u[d]?-1:0):o-s}if(l){if(l[t].exact&&!l[d].exact)return-1;if(!l[t].exact&&l[d].exact)return 1}return r[t]&&r[d]?a?t>d?1:t<d?-1:0:(u[t]||=e.getAdapterTitle(t,i,n),u[d]||=e.getAdapterTitle(d,i,n),u[t]>u[d]?1:u[t]<u[d]?-1:0):r[t]?-1:r[d]?1:a?t>d?1:t<d?-1:0:(u[t]||=e.getAdapterTitle(t,i,n),u[d]||=e.getAdapterTitle(d,i,n),u[t]>u[d]?1:u[t]<u[d]?-1:0)})}calculateInfo(t,n,r,i){r||=this.state.hostData,n||=this.state.ratings,t||=this.state.compactInstances,i!=null&&i._id||(i=this.state.compactRepositories);let a=this.state.adapters,o=JSON.parse(JSON.stringify(this.state.installed)),s=JSON.parse(JSON.stringify(this.state.repository)),c=((r==null?void 0:r[`Node.js`])||``).replace(`v`,``),l=(r==null?void 0:r.os)||``,u={},d=[],f={};try{f=JSON.parse((window._localStorage||window.localStorage).getItem(`Adapters.expandedCategories`)||`null`)||{}}catch{}Object.keys(o).forEach(e=>{var t;let n=o[e];(t=a[e])!=null&&(t=t.common)!=null&&t.ignoreVersion&&(n.ignoreVersion=a[e].common.ignoreVersion),n.controller||e===`hosts`||s[e]||(s[e]=JSON.parse(JSON.stringify(n)),s[e].version=``),n.count=0,n.enabled=0}),Object.keys(t).forEach(e=>{let n=t[e].name;o[n]&&o[n].count++});let p=Date.now();this.recentUpdatedAdapters=0,this.installedAdapters=0,Object.keys(s).forEach(e=>{var t;if(e===`hosts`||e.startsWith(`_`))return;let r=s[e];if(typeof r!=`object`){console.error(`[${e}] ${e} is not an object.`);return}r.keywords&&=r.keywords.map(e=>e.toLowerCase());let i=o[e];if(r.rating=n==null?void 0:n[e],(t=r.rating)!=null&&t.rating){var a,c,l;r.rating.title=[`${this.t(`Total rating:`)} ${r.rating.rating.r} (${r.rating.rating.c} ${this.getWordVotes(r.rating.rating.c)})`,i!=null&&i.version&&r.rating[i.version]?`${this.t(`Rating for`)} v${i.version}: ${(a=r.rating[i.version])==null?void 0:a.r} (${(c=r.rating[i.version])==null?void 0:c.c} ${this.getWordVotes(((l=r.rating.rating)==null?void 0:l.c)??0)})`:``].filter(e=>e).join(`
|
|
7
|
-
`)}else r.rating={title:this.t(`No rating or too few data`)};if(!r.controller){let t=r.type||``,n=o[e],i=Math.round((p-new Date(r.versionDate||0).getTime())/gn),a=Math.round((p-new Date(r.published||0).getTime())/gn);i<=31&&this.recentUpdatedAdapters++,a<=31&&this.recentCreatedAdapters++,o[e]&&this.installedAdapters++,u[t]?(u[t].count++,u[t].adapters.push(e),n&&u[t].installed++):u[t]={name:t,translation:this.t(`${t}_group`),count:1,installed:+!!n,adapters:[e]}}}),Object.keys(u).sort((e,t)=>e===`general`&&t!==`general`?-1:e!==`general`&&t===`general`||u[e].translation>u[t].translation?1:u[e].translation<u[t].translation?-1:0).forEach(e=>d.push(u[e]));let m=this.state.filterTiles===$;Object.keys(u).forEach(t=>e.sortAdapters(u[t].adapters,this.props.lang,o,s,m));let h=0;try{h=JSON.parse((window._localStorage||window.localStorage).getItem(`Adapters.installedList`)||`0`),h===!1&&(h=0)}catch{}let g=(window._localStorage||window.localStorage).getItem(`Adapters.list`)===`true`,_=(window._localStorage||window.localStorage).getItem(`Adapters.viewMode`)===`true`,v=(window._localStorage||window.localStorage).getItem(`Adapters.updateList`)===`true`,y=(window._localStorage||window.localStorage).getItem(`Adapters.categoriesTiles`)||`All`,ee=(window._localStorage||window.localStorage).getItem(`Adapters.filterTiles`)||Q;return ee===`A-Z`&&(ee=Q),this.allAdapters=Object.keys(s).length-1,this.cache.listOfVisibleAdapter=null,new Promise(e=>{this.setState({repository:s,installed:o,ratings:n,filterTiles:ee,categoriesTiles:y,compactRepositories:i,installedList:h,compactInstances:t,updateList:v,tableViewMode:_,oneListView:g,lastUpdate:Date.now(),hostData:r,hostOs:l,nodeJsVersion:c,categories:d,categoriesExpanded:f,init:!0,update:this.installedPending},()=>e())})}readAdaptersInfo(e){var t;let n=this.state.currentHost,r=((t=this.props.adminGuiConfig.admin)==null||(t=t.adapters)==null?void 0:t.allowAdapterRating)!==!1;return Promise.all([this.props.socket.getHostInfoShort(n,e,this.state.readTimeoutMs).catch(e=>{window.alert(`Cannot getHostInfo for "${n}": ${e}`),e.toString().includes(`timeout`)&&this.setState({showSlowConnectionWarning:!0})}),r?this.props.socket.getRatings(e).catch(e=>(window.alert(`Cannot read ratings: ${e}`),null)):Promise.resolve(null),this.props.socket.getCompactInstances(e).catch(e=>(window.alert(`Cannot read countsOfInstances: ${e}`),{})),this.props.socket.getCompactSystemRepositories(e).catch(e=>(window.alert(`Cannot read getCompactSystemRepositories: ${e}`),{}))]).then(([e,t,n,i])=>(r&&(this.uuid=(t==null?void 0:t.uuid)||``),{hostData:e,ratings:t,compactInstances:n||{},compactRepositories:i}))}async getAdaptersInfo(e,t){if(this.state.currentHost&&Date.now()-this.state.lastUpdate>1e3){console.log(`[ADAPTERS] getAdaptersInfo`);try{(!this.state.update||t)&&await new Promise(e=>{this.setState({update:!0},()=>e())});let{hostData:n,ratings:r,compactInstances:i,compactRepositories:a}=await e;await this.calculateInfo(i,r,n,a)}catch(e){window.alert(`Cannot get adapters info: ${e}`)}}}toggleCategory(e){this.setState(t=>{let n=t.categoriesExpanded;return n[e]=!n[e],(window._localStorage||window.localStorage).setItem(`Adapters.expandedCategories`,JSON.stringify(n)),{categoriesExpanded:n}})}rightOs(e){let t=this.state.repository[e];return t!=null&&t.os?Array.isArray(t.os)?!!t.os.find(e=>this.state.hostOs===e):this.state.hostOs===t.os:!0}handleFilterChange(e){this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(e=>{(window._localStorage||window.localStorage).setItem(`Adapter.search`,e||``),this.typingTimer=null,this.filterAdapters(e)},300,e.target.value)}expandAll(){this.setState(e=>{let t=e.categories,n=e.categoriesExpanded;return t.forEach(e=>n[e.name]=!0),(window._localStorage||window.localStorage).setItem(`Adapters.expandedCategories`,JSON.stringify(n)),{categoriesExpanded:n}})}collapseAll(){let e={};(window._localStorage||window.localStorage).setItem(`Adapters.expandedCategories`,JSON.stringify(e)),this.setState({categoriesExpanded:e})}listTable(){let e=!this.state.oneListView;e&&this.expandAll(),(window._localStorage||window.localStorage).setItem(`Adapters.list`,e?`true`:`false`),this.setState({oneListView:e})}changeViewMode(){this.cache.listOfVisibleAdapter=null;let e=!this.state.tableViewMode,t=this.state.filterTiles;e&&t!==Q&&t!==$&&(t=Q,(window._localStorage||window.localStorage).setItem(`Adapters.filterTiles`,t)),(window._localStorage||window.localStorage).setItem(`Adapters.viewMode`,e?`true`:`false`),this.setState({tableViewMode:e,filterTiles:t})}changeUpdateList(){this.cache.listOfVisibleAdapter=null;let e=!this.state.updateList;(window._localStorage||window.localStorage).setItem(`Adapters.updateList`,e?`true`:`false`),this.setState({updateList:e})}changeInstalledList(e){this.cache.listOfVisibleAdapter=null;let t=this.state.installedList?this.state.installedList<2?2:0:1;!t&&e&&(t=1),(window._localStorage||window.localStorage).setItem(`Adapters.installedList`,JSON.stringify(t)),this.setState({installedList:t})}changeFilterTiles(e){this.cache.listOfVisibleAdapter=null,(window._localStorage||window.localStorage).setItem(`Adapters.filterTiles`,e),this.setState({filterTiles:e})}changeCategoriesTiles(e){this.cache.listOfVisibleAdapter=null,(window._localStorage||window.localStorage).setItem(`Adapters.categoriesTiles`,e),this.setState({categoriesTiles:e})}filterAdapters(e){e=e===void 0?this.state.search:e,e=(e||``).toLowerCase().trim();let t=null;if(e){let n={};this.state.categories.forEach(t=>t.adapters.forEach(t=>{var r;let i=this.state.repository[t];if(!i)return;let a,o,s=i.titleLang||i.title;a=typeof s==`object`?s[this.props.lang]||s.en:s,a=((a||``).toString()||``).replace(`ioBroker Visualisation - `,``),o=i.desc?typeof i.desc==`string`?i.desc:i.desc[this.props.lang]||i.desc.en||``:``,t.includes(e)?n[t]={exact:t===e,type:`name`,start:t.startsWith(e)}:a&&typeof a==`string`&&a.toLowerCase().includes(e)?n[t]={exact:!1,type:`title`}:o&&typeof o==`string`&&o.toLowerCase().includes(e)?n[t]={exact:!1,type:`desc`}:(r=i.keywords)!=null&&r.find(t=>t.includes(e))&&(n[t]={exact:!1,type:`keywords`})})),t=n}this.setState({filteredList:t,search:e},()=>{this.cache.listOfVisibleAdapter=null,this.forceUpdate()})}clearAllFilters(e){e?((window._localStorage||window.localStorage).removeItem(`Adapters.updateList`),this.setState({updateList:!1},()=>this.filterAdapters())):((window._localStorage||window.localStorage).removeItem(`Adapter.search`),(window._localStorage||window.localStorage).removeItem(`Adapters.installedList`),(window._localStorage||window.localStorage).removeItem(`Adapters.updateList`),this.inputRef.current&&(this.inputRef.current.value=``),this.setState({filteredList:null,updateList:!1,filterConnectionType:!1,installedList:0,search:``},()=>this.filterAdapters()))}getContext(e){return{expertMode:this.props.expertMode,t:this.t,socket:this.props.socket,removeUpdateAvailable:e=>{let t=[...this.state.updateAvailable],n=t.indexOf(e);n!==-1&&(t.splice(n,1),this.setState({updateAvailable:t}))},toggleTranslation:this.props.toggleTranslation,rightDependenciesFunc:this.rightDependencies,lang:this.props.lang,uuid:this.uuid,themeType:this.props.themeType,theme:this.props.theme,onUpdating:this.props.onUpdating,repository:this.state.repository,installed:this.state.installed,installedGlobal:this.state.installedGlobal,installedGlobalHosts:this.state.installedGlobalHosts,compactInstances:this.state.compactInstances||{},adapters:this.state.adapters,nodeJsVersion:this.state.nodeJsVersion,currentHost:this.state.currentHost,adminHost:this.props.adminHost,adminInstance:this.props.adminInstance,instancesWorker:this.props.instancesWorker,hostsWorker:this.props.hostsWorker,executeCommand:this.props.executeCommand,categories:this.state.categories,descHidden:e,sortPopularFirst:!this.state.tableViewMode&&this.state.filterTiles===yn,sortRecentlyUpdated:!this.state.tableViewMode&&this.state.filterTiles===bn,sortRecentlyCreated:!this.state.tableViewMode&&this.state.filterTiles===xn,isTileView:!this.state.tableViewMode,updateRating:(e,t)=>{let n=JSON.parse(JSON.stringify(this.state.repository));Object.assign(n[e].rating||{},t),this.setState({repository:n})},setAdminUpgradeTo:this.setAdminUpgradeTo,hostAdapterWorker:this.hostAdapterWorker}}buildCache(t){this.cache.listOfVisibleAdapter=[],this.cache.adapters={};let n=Date.now(),r=this.t(`0 %d days ago`),i=this.t(`1 %d days ago`),a=this.t(`2 %d days ago`),o=this.t(`5 %d days ago`);this.state.categories.filter(e=>this.state.tableViewMode||!this.state.categoriesTiles||this.state.categoriesTiles===`All`||e.name===this.state.categoriesTiles).forEach(e=>e.adapters.forEach(e=>{let t=this.state.repository[e];if(t&&!t.controller){let l=t.connectionType?t.connectionType:`-`,u=this.state.updateAvailable.includes(e),d=this.state.installed[e],f=!this.state.filteredList||!!this.state.filteredList[e];if(f&&this.state.filterConnectionType&&(f=l===`local`),f&&this.state.updateList&&(f=u),f&&this.state.installedList&&(f=this.state.installedList<2?!!(d&&d.version):!!(d&&d.version&&!d.count)),f){var s,c;(s=this.cache.listOfVisibleAdapter)==null||s.push(e);let l=Math.round((n-new Date(t.versionDate||0).getTime())/vn),u=Math.round(l/10),f=Math.round((n-new Date(t.published||0).getTime())/vn),p=Math.round(f/10),m=t.titleLang||t.title,h;h=m&&typeof m==`object`?m[this.props.lang]||m.en:m||e,h=((h||``).toString()||``).replace(`ioBroker Visualisation - `,``);let g;g=t.desc?typeof t.desc==`string`?t.desc:t.desc[this.props.lang]||t.desc.en||``:``;let _=u%100<=10||u%100>=20?u%10:5,v=p%100<=10||p%100>=20?p%10:5;this.cache.adapters[e]={title:h,desc:g,image:d!=null&&d.localIcon&&this.state.adapters[`system.adapter.${e}`]?`.${d.localIcon}`:t.extIcon||``,connectionType:t.connectionType?t.connectionType:`-`,updateAvailable:this.state.updateAvailable.includes(e),rightDependencies:this.rightDependencies(e),rightOs:this.rightOs(e),sentry:!!((c=t.plugins)!=null&&c.sentry),daysAgo:l,createdDaysAgo:f,stat:t.stat||0,daysAgoText:u||u===0?u===0?r:_===1?i.replace(`%d`,u.toString()):_===2||_===3||_===4?a.replace(`%d`,u.toString()):o.replace(`%d`,u.toString()):``,createdDaysAgoText:p||p===0?p===0?r:v===1?i.replace(`%d`,p.toString()):v===2||v===3||v===4?a.replace(`%d`,p.toString()):o.replace(`%d`,p.toString()):``}}}})),this.listOfVisibleAdapterLength=this.cache.listOfVisibleAdapter.length;let s=this.state.filterTiles===$;this.state.tableViewMode&&this.state.categories.forEach(t=>e.sortAdapters(t.adapters,this.props.lang,this.state.installed,this.cache.adapters||{},s)),e.sortAdapters(this.cache.listOfVisibleAdapter,this.props.lang,this.state.installed,this.cache.adapters,s,t.sortPopularFirst,t.sortRecentlyUpdated,t.sortRecentlyCreated,this.state.filteredList),this.forceUpdate()}getUpdater(){return this.state.showUpdater?m(Ft,{theme:this.props.theme,onSetCommandRunning:e=>this.props.onSetCommandRunning(e),t:this.props.t,currentHost:this.state.currentHost,lang:this.props.lang,installed:this.state.installed,repository:this.state.repository,toggleTranslation:this.props.toggleTranslation,noTranslation:this.props.noTranslation,onClose:e=>this.setState({showUpdater:!1},()=>e&&this.updateAll(!0,!1)),socket:this.props.socket,rightDependenciesFunc:this.rightDependencies,ready:this.props.ready}):null}getDescWidth(){return this.props.menuOpened?document.body.scrollWidth-pn-180+13:this.props.menuClosed?document.body.scrollWidth-pn:document.body.scrollWidth-pn-50+13}getStatistics(){return this.state.showStatistics?w(A,{open:!0,onClose:()=>this.setState({showStatistics:!1}),children:[m(l,{children:this.t(`Statistics`)}),w(b,{style:{fontSize:16},children:[w(D,{component:`div`,sx:Z.counters,children:[this.t(`Total adapters`),`:`,` `,m(`span`,{style:{paddingLeft:6,fontWeight:`bold`},children:this.allAdapters})]}),w(D,{component:`div`,sx:Z.counters,children:[this.t(`Installed adapters`),`:`,` `,m(`span`,{style:{paddingLeft:6,fontWeight:`bold`},children:this.installedAdapters})]}),w(D,{component:`div`,sx:Z.counters,children:[this.t(`Last month updated adapters`),`:`,` `,m(`span`,{style:{paddingLeft:6,fontWeight:`bold`},children:this.recentUpdatedAdapters})]}),w(D,{component:`div`,sx:Z.counters,children:[this.t(`Last month created adapters`),`:`,` `,m(`span`,{style:{paddingLeft:6,fontWeight:`bold`},children:this.recentCreatedAdapters})]})]}),m(y,{children:m(O,{variant:`contained`,onClick:()=>this.setState({showStatistics:!1}),color:`primary`,autoFocus:!0,startIcon:m(P,{}),children:this.props.t(`Close`)})})]}):null}renderGitHubInstallDialog(e){return this.state.gitHubInstallDialog?m(Kt,{t:this.t,categories:this.state.categories,installed:this.state.installedGlobal,socket:e.socket,currentHost:e.currentHost,hostsWorker:e.hostsWorker,expertMode:e.expertMode,themeType:e.themeType,commandRunning:this.props.commandRunning,upload:e=>new Promise(t=>this.props.executeCommand(`upload ${e}${this.props.expertMode?` --debug`:``}`,void 0,()=>t())),createInstance:(t,n)=>K.createInstanceIfNotExists({adapterName:t,context:e,host:n}),installFromUrl:(t,n,r,i)=>this.addInstance({adapterName:t,debug:n,customUrl:r,context:e,host:i==null?void 0:i.host,files:i==null?void 0:i.files}),repository:this.state.repository,onClose:()=>{this.setState({gitHubInstallDialog:!1})}}):null}renderRepositoryTimestamp(){var e;let t=(e=this.state.compactRepositories)==null||(e=e.native)==null?void 0:e.repositories;if(!t)return null;let n=null,r=null,i=[];if(typeof this.props.systemConfig.common.activeRepo==`string`){var a;let e=(a=t[this.props.systemConfig.common.activeRepo])==null||(a=a.json)==null?void 0:a._repoInfo;if(e){n=e.repoTime||null,r=e.repoReadTime||null;let t=this.getRepositoryName(e);t&&i.push(t)}}else if(Array.isArray(this.props.systemConfig.common.activeRepo)){let e=null,a=null;this.props.systemConfig.common.activeRepo.forEach(n=>{var r;let o=(r=t[n])==null||(r=r.json)==null?void 0:r._repoInfo;if(o){let t=this.getRepositoryName(o);t&&i.push(t),o.repoTime&&(!e||new Date(o.repoTime)<new Date(e))&&(e=o.repoTime),o.repoReadTime&&(!a||new Date(o.repoReadTime)<new Date(a))&&(a=o.repoReadTime)}}),n=e,r=a}let o=r||n;if(!o)return null;let s=this.formatRepositoryTimestamp(o),c=``;return c=i.length>1?this.t(`Repository timestamps (oldest from %s):`,i.join(`, `)):this.t(`Repository timestamps:`),n&&(c+=`\n${this.t(`Generated: %s`,this.formatRepositoryTimestamp(n))}`),r&&(c+=`\n${this.t(`Last read: %s`,this.formatRepositoryTimestamp(r))}`),m(j,{title:c,slotProps:{popper:{sx:Z.tooltip}},children:m(D,{component:`div`,sx:{display:`flex`,alignItems:`center`,marginLeft:1,fontSize:`0.75rem`,color:`text.secondary`,cursor:`help`,whiteSpace:`nowrap`},children:s})})}getRepositoryName(e){return e!=null&&e.name?typeof e.name==`object`?e.name[this.props.lang]||e.name.en:e.name:null}formatRepositoryTimestamp(e){try{let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4),i=Math.floor(r/60),a=Math.floor(i/24);return r<60?this.t(`%s minutes ago`,r.toString()):i<24?this.t(`%s hours ago`,i.toString()):a<30?this.t(`%s days ago`,a.toString()):t.toLocaleDateString(this.props.lang||`en`)}catch{return e}}renderHeader(){var e;let t=!this.props.commandRunning&&!!this.props.ready&&!!this.state.updateList&&this.state.updateAvailable.length>1;return t&&this.state.updateAvailable.length===2&&this.state.updateAvailable.includes(`admin`)&&(t=!1),w(i,{children:[this.props.menuButtonSpace?m(D,{sx:{width:40,flexShrink:0}}):null,m(j,{title:this.t(`Change view mode`),slotProps:{popper:{sx:Z.tooltip}},children:m(F,{size:`large`,onClick:()=>this.changeViewMode(),children:this.state.tableViewMode?m(_e,{}):m(dt,{})})}),m(j,{title:this.t(`Check adapter for updates`),slotProps:{popper:{sx:Z.tooltip}},children:m(F,{size:`large`,onClick:()=>this.updateAll(!0,!0),children:m(ye,{})})}),this.renderRepositoryTimestamp(),this.state.tableViewMode&&!this.state.oneListView&&m(j,{title:this.t(`expand all`),slotProps:{popper:{sx:Z.tooltip}},children:m(F,{size:`large`,onClick:()=>this.expandAll(),children:m(he,{})})}),this.state.tableViewMode&&!this.state.oneListView&&m(j,{title:this.t(`collapse all`),slotProps:{popper:{sx:Z.tooltip}},children:m(F,{size:`large`,onClick:()=>this.collapseAll(),children:m(ct,{})})}),this.state.tableViewMode&&m(j,{title:this.t(`list`),slotProps:{popper:{sx:Z.tooltip}},children:m(F,{size:`large`,onClick:()=>this.listTable(),children:m(je,{color:this.state.oneListView?`primary`:`inherit`})})}),this.state.updateList?m(F,{size:`large`,onClick:()=>this.changeInstalledList(!0),children:m(ot,{color:`primary`,style:{opacity:.3,color:this.state.installedList===2?`red`:void 0}})}):m(j,{slotProps:{popper:{sx:Z.tooltip}},title:this.t(this.state.installedList?this.state.installedList===1?`Showed only installed adapters`:`Showed only installed adapters without instance.`:`Show only installed`),children:m(F,{size:`large`,onClick:()=>this.changeInstalledList(),children:m(ot,{style:this.state.installedList===2?{color:`red`}:void 0,color:this.state.installedList===1?`primary`:`inherit`})})}),m(V,{config:this.props.adminGuiConfig.admin,name:`admin.adapters.filterUpdates`,children:m(j,{title:this.t(`Filter adapter with updates`),slotProps:{popper:{sx:Z.tooltip}},children:m(F,{size:`large`,onClick:()=>this.changeUpdateList(),children:m(Tt,{color:this.state.updateList?`primary`:`inherit`})})})}),t&&m(j,{title:this.t(`Update all adapters`),slotProps:{popper:{sx:Z.tooltip}},children:m(F,{size:`large`,onClick:()=>this.setState({showUpdater:!0}),children:m(It,{})})}),this.props.expertMode&&((e=this.props.adminGuiConfig.admin)==null||(e=e.adapters)==null?void 0:e.gitHubInstall)!==!1&&m(j,{title:this.t(`Install from custom URL`),slotProps:{popper:{sx:Z.tooltip}},children:m(F,{size:`large`,onClick:()=>this.setState({gitHubInstallDialog:!0}),children:m(ue,{})})}),m(`div`,{style:Z.grow}),m(B,{variant:`standard`,inputRef:this.inputRef,label:this.t(`Filter by name`),defaultValue:this.state.search,onChange:e=>this.handleFilterChange(e),slotProps:{input:{endAdornment:this.state.search?m(g,{position:`end`,children:m(F,{tabIndex:-1,size:`small`,onClick:()=>{(window._localStorage||window.localStorage).removeItem(`Adapter.search`),this.inputRef.current&&(this.inputRef.current.value=``),this.setState({search:``},()=>this.filterAdapters())},children:m(P,{})})}):null}}}),!this.state.tableViewMode&&m(Et,{t:this.t,icons:!0,contained:this.state.categoriesTiles!==`All`,translateSuffix:`_group`,arrayItem:[{name:`All`},...this.state.categories],onClick:e=>this.changeCategoriesTiles(e),value:this.state.categoriesTiles}),m(Et,{title:this.t(`Sort by`),t:this.t,buttonIcon:m(tt,{style:{marginRight:4}}),arrayItem:this.state.tableViewMode?Sn.filter(e=>!e.notByList):Sn,onClick:e=>this.changeFilterTiles(e),value:this.state.filterTiles}),m(`div`,{style:Z.grow}),m(V,{config:this.props.adminGuiConfig.admin,name:`admin.adapters.statistics`,children:w(D,{component:`div`,sx:f.getStyle(this.props.theme,Z.infoAdapters,{display:{xs:`none`,md:`inline-block`}}),onClick:()=>this.setState({showStatistics:!0}),children:[w(D,{component:`div`,sx:{...Z.counters,...Z.greenText},children:[this.t(`Selected adapters`),m(`div`,{ref:this.countRef})]}),w(D,{component:`div`,sx:Z.counters,children:[this.t(`Total adapters`),`:`,m(`div`,{children:this.allAdapters})]}),w(D,{component:`div`,sx:Z.counters,children:[this.t(`Installed adapters`),`:`,m(`div`,{children:this.installedAdapters})]}),w(D,{component:`div`,sx:Z.counters,children:[this.t(`Last month updated adapters`),`:`,m(`div`,{children:this.recentUpdatedAdapters})]})]})}),m(D,{sx:{ml:`auto`,pl:1},children:this.props.hostSelector})]})}renderWebserverUpgrade(){return this.state.adminUpgradeTo?m(hn,{socket:this.props.socket,themeType:this.props.themeType,host:this.props.adminHost,onClose:()=>{console.log(`Close dialog`),this.setState({adminUpgradeTo:``,showDialog:!1})},version:this.state.adminUpgradeTo,adminInstance:this.props.adminInstance,onUpdating:e=>{this.props.onUpdating(e)},currentAdminVersion:this.props.currentAdminVersion}):null}render(){var e;if(!this.state.init)return m(E,{});this.state.triggerUpdate!==this.props.triggerUpdate&&setTimeout(()=>{this.setState({triggerUpdate:this.props.triggerUpdate},()=>this.updateAll(!0))},100),(this.props.currentHost!==this.state.currentHost||this.props.forceUpdateAdapters!==this.state.forceUpdateAdapters)&&(this.hostsTimer=this.hostsTimer||setTimeout(()=>{this.hostsTimer=null,this.setState({currentHost:this.props.currentHost,forceUpdateAdapters:this.props.forceUpdateAdapters},async()=>{var e;if(((e=this.hostAdapterWorker)==null?void 0:e.getHost())!==this.props.currentHost){var t;(t=this.hostAdapterWorker)==null||t.destroy(),this.hostAdapterWorker=new Lt(this.props.socket,this.props.currentHost),this.hostAdapterWorker.registerHandler(this.onHostAdapterChanged,!0),await this.hostAdapterWorker.getObjects()}await this.updateAll(!1,!1,!0)})},200));let t=f.isStableRepository(this.props.systemConfig.common.activeRepo),n=((e=this.state.compactRepositories)==null||(e=e.native)==null?void 0:e.repositories)||{};if(n&&this.props.systemConfig.common.activeRepo){if(Array.isArray(this.props.systemConfig.common.activeRepo))t=this.props.systemConfig.common.activeRepo.every(e=>{var t;return e.toLowerCase().startsWith(`stable`)||((t=n[e])==null||(t=t.json)==null||(t=t._repoInfo)==null?void 0:t.stable)});else if(typeof this.props.systemConfig.common.activeRepo==`string`){var r;t=this.props.systemConfig.common.activeRepo.toLowerCase().startsWith(`stable`)||((r=n[this.props.systemConfig.common.activeRepo])==null||(r=r.json)==null||(r=r._repoInfo)==null?void 0:r.stable)}}let i=``;if(!t){if(i=Array.isArray(this.props.systemConfig.common.activeRepo)?this.props.systemConfig.common.activeRepo.join(`, `):this.props.systemConfig.common.activeRepo,typeof this.props.systemConfig.common.activeRepo==`string`){var a;let e=n&&((a=n[this.props.systemConfig.common.activeRepo])==null||(a=a.json)==null?void 0:a._repoInfo);e!=null&&e.name&&(i=e.name&&typeof e.name==`object`?e.name[this.props.lang]||e.name.en:e.name)}else this.props.systemConfig.common.activeRepo&&typeof this.props.systemConfig.common.activeRepo!=`string`&&(i=this.props.systemConfig.common.activeRepo.map(e=>{var t;let r=n&&((t=n[e])==null||(t=t.json)==null?void 0:t._repoInfo);return r!=null&&r.name?r.name&&typeof r.name==`object`?r.name[this.props.lang]||r.name.en:r.name:e}).join(`, `))}let o=this.getContext(this.state.descWidth<50);return this.cache.listOfVisibleAdapter||(this.buildCacheTimer=this.buildCacheTimer||setTimeout(()=>{this.buildCacheTimer=null,this.buildCache(o)},0)),w(ae,{children:[this.state.update&&m(d,{children:m(E,{})}),this.renderHeader(),m(mn,{stableRepo:t,repoName:i,context:o,noTranslation:this.props.noTranslation,systemConfig:this.props.systemConfig,tableViewMode:this.state.tableViewMode,oneListView:this.state.oneListView,update:this.state.update,updateListFilter:this.state.updateList,searchFilter:this.state.search,installedListFilter:this.state.installedList,cachedAdapters:this.cache.adapters,categories:this.state.categories,categoriesExpanded:this.state.categoriesExpanded,listOfVisibleAdapter:this.cache.listOfVisibleAdapter,toggleCategory:e=>this.toggleCategory(e),clearAllFilters:e=>this.clearAllFilters(e),descWidth:this.state.descWidth,sortByName:this.state.filterTiles===$,sortPopularFirst:o.sortPopularFirst,sortRecentlyUpdated:o.sortRecentlyUpdated,sortRecentlyCreated:o.sortRecentlyCreated,commandRunning:this.props.commandRunning}),this.getUpdater(),this.getStatistics(),this.renderSlowConnectionWarning(),this.renderGitHubInstallDialog(o),this.renderWebserverUpgrade(),this.renderDialogs(o)]})}};export{Cn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Hs as e,Oo as t,So as n,To as r,Ur as i,Us as a,as as o,ka as s,po as c,qo as l,tc as u,us as d}from"./loadShare-eager-CRNcc8D7.js";import{t as f}from"./Config-BZDUILCW.js";var p=`0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)`,m=`0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)`,h={root:e=>({position:`relative`,m:`10px`,width:300,minHeight:200,background:e.palette.background.default,boxShadow:p,display:`flex`,transition:`box-shadow 0.5s`,cursor:`pointer`,"&:hover":{boxShadow:m}}),imageBlock:{background:`silver`,minHeight:60,display:`flex`,padding:`0 10px 0 10px`,position:`relative`,justifyContent:`space-between`,transition:`background 0.5s`},img:{width:60,height:60,marginTop:20,position:`relative`,"&:after":{content:`""`,position:`absolute`,zIndex:2,top:0,left:0,width:`100%`,height:`100%`,background:`url("img/no-image.svg") 100% 100% no-repeat`,backgroundSize:`cover`,backgroundColor:`#fff`}},adapter:{width:`100%`,fontWeight:`bold`,fontSize:15,verticalAlign:`middle`,marginTop:`auto`,borderTop:`1px solid silver`,padding:`20px 4px`,textAlign:`center`,textTransform:`uppercase`,textOverflow:`ellipsis`,overflow:`hidden`,color:`#ffab40`},instanceStateNotAlive1:{backgroundColor:`rgba(192, 192, 192, 0.4)`},wrapperDesc:{display:`flex`,flexDirection:`column`,width:`100%`,overflow:`hidden`},desc:{padding:20,fontSize:15}};function g(e,t){return e&&typeof e==`object`?e[t]||e.en||``:e||``}var _=({icon:t,id:i,desc:o,lang:s,navigate:c})=>a(n,{onClick:c,sx:h.root,children:[e(`div`,{style:{...h.imageBlock,...h.instanceStateNotAlive1},children:e(r,{sx:h.img,component:`img`,image:`adapter/${i.split(`.`)[0]}/${t}`})}),a(`div`,{style:h.wrapperDesc,children:[e(`div`,{style:h.desc,children:g(o,s)}),e(`div`,{style:h.adapter,children:i})]})]}),v={appBar:e=>({transition:e.transitions.create([`margin`,`width`],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})}),wrapperEasyMode:{height:`100%`,borderRadius:0},wrapperCard:{padding:`80px 20px 20px`,height:`100%`,overflowY:`auto`},controlHeight:{display:`flex`,flexFlow:`wrap`,justifyContent:`center`},img:{width:60,height:60,position:`relative`,borderRadius:60},logoWhite:{background:`white`},wrapperHeader:{display:`flex`,alignItems:`center`},headerName:{fontSize:24,marginLeft:10},toolBar:{justifyContent:`space-between`,margin:`5px 0`},paper:{height:`100%`,paddingTop:80},iframe:{height:`100%`,width:`100%`,background:`#FFF`,color:`#000`,borderRadius:5,border:`1px solid #888`},IconButtons:{display:`flex`},logoPointer:{cursor:`pointer`}},y=class extends u{constructor(e){super(e),this.state={configs:this.props.configs||[],strictMode:!this.props.configs}}componentDidMount(){this.props.configs||this.props.socket.getEasyMode().then(e=>this.setState({configs:e.configs}))}render(){let{t:n,themeName:u,toggleTheme:p,navigate:m,location:h,socket:g,themeType:y,theme:b,width:x,isFloatComma:S,dateFormat:C,configStored:w,getLocation:T,adminInstance:E}=this.props,{configs:D,strictMode:O}=this.state;if(!D)return e(t,{});let k=h.id,A=D.find(({id:e})=>e===k);return a(d,{style:v.wrapperEasyMode,children:[e(o,{color:`default`,position:`fixed`,sx:v.appBar,children:a(c,{style:v.toolBar,children:[a(`div`,{style:v.wrapperHeader,children:[e(r,{onClick:O&&!T().dialog||A!=null&&A.tab?()=>m(A!=null&&A.tab?`easy`:`tab-intro`):void 0,style:{...v.img,...u===`colored`?v.logoWhite:void 0,...O&&!T().dialog||A!=null&&A.tab?v.logoPointer:void 0},component:`img`,image:`img/no-image.svg`}),e(`div`,{style:v.headerName,children:n(`Easy Admin`)})]}),a(`div`,{style:v.IconButtons,children:[(O&&!T().dialog||(A==null?void 0:A.tab))&&e(l,{size:`large`,onClick:()=>m(A!=null&&A.tab?`easy`:`tab-intro`),children:e(s,{})}),e(i,{t:n,toggleTheme:p,themeName:u,size:`large`})]})]})}),A?e(d,{style:v.paper,children:e(f,{expertMode:!0,style:v.iframe,adapter:A.id.split(`.`)[0],instance:parseInt(A.id.split(`.`)[1],10),jsonConfig:A.jsonConfig,materialize:A.materialize,tab:A==null?void 0:A.tab,socket:g,easyMode:!0,themeName:u,themeType:y,theme:b,width:x,t:n,lang:this.props.lang,icon:A.icon,adminInstance:E,configStored:w,dateFormat:C,isFloatComma:S,onRegisterIframeRef:e=>this.props.onRegisterIframeRef(e),onUnregisterIframeRef:e=>this.props.onUnregisterIframeRef(e),handleNavigation:this.props.handleNavigation})}):e(`div`,{style:v.wrapperCard,children:e(`div`,{style:v.controlHeight,children:D.sort((e,t)=>e.id<t.id?-1:+(e.id>t.id)).map(t=>e(_,{lang:this.props.lang,navigate:()=>m(null,`config`,t.id),...t},t.id))})})]})}};export{y as default};
|