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.
Files changed (267) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +7 -6
  2. package/NEXOWATT_EOS_PREBUILT_MANIFEST.json +195 -107
  3. package/START_HERE_8.0.1.md +36 -0
  4. package/START_HERE_8.0.2.md +41 -0
  5. package/adminWww/.vite/manifest.json +278 -278
  6. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +333 -329
  7. package/adminWww/assets/{AccessTime-Dpa6PKHY.js → AccessTime-5f47qrw7.js} +1 -1
  8. package/adminWww/assets/{AceEditor-DTzNaeVy.js → AceEditor-CJ-_Ev2E.js} +1 -1
  9. package/adminWww/assets/{AdapterUpdateDialog-B3y8RL_5.js → AdapterUpdateDialog-QwlPbETd.js} +3 -3
  10. package/adminWww/assets/Adapters-gKngfaOu.js +7 -0
  11. package/adminWww/assets/{AdminUtils-DDT_kD8H.js → AdminUtils-CopxRJZ2.js} +1 -1
  12. package/adminWww/assets/{Apps-C8LE9l6Z.js → Apps-BKnx1gzD.js} +1 -1
  13. package/adminWww/assets/{Book-QmHxDaHb.js → Book-DrhneQH0.js} +1 -1
  14. package/adminWww/assets/{Cached-f77QQBQD.js → Cached-XJmxLN4E.js} +1 -1
  15. package/adminWww/assets/{Computer-DFIUq-fL.js → Computer-DDMBRY5r.js} +1 -1
  16. package/adminWww/assets/{Config-BZDUILCW.js → Config-BwTa1LdH.js} +1 -1
  17. package/adminWww/assets/{ConfigManager-CFuOc_kb.js → ConfigManager-DYwC4yq9.js} +1 -1
  18. package/adminWww/assets/{CustomModal-B8vdCRn1.js → CustomModal-DjI4oCb8.js} +1 -1
  19. package/adminWww/assets/{CustomTab-DSPqif6P.js → CustomTab-_HYUrXsZ.js} +1 -1
  20. package/adminWww/assets/{DeleteForever-BnEM-6_v.js → DeleteForever-Caoe64_y.js} +1 -1
  21. package/adminWww/assets/EasyMode-CCRqFtQq.js +1 -0
  22. package/adminWww/assets/Enums-BTurn3-x.js +92 -0
  23. package/adminWww/assets/{Extension-DU1jqvic.js → Extension-D-tNJv4S.js} +1 -1
  24. package/adminWww/assets/{Fields-DnckPMA8.js → Fields-C2Bn4V04.js} +1 -1
  25. package/adminWww/assets/{Files-CwUHx0pF.js → Files-XdmhxGOR.js} +1 -1
  26. package/adminWww/assets/Hosts-DiTMe9fw.js +120 -0
  27. package/adminWww/assets/{InfoOutlined-l86Si1qa.js → InfoOutlined-DIGDQvu6.js} +1 -1
  28. package/adminWww/assets/Instances-DA6FIgRs.js +4 -0
  29. package/adminWww/assets/Intro-CJpwLg8Q.js +2 -0
  30. package/adminWww/assets/{KeyboardArrowRight-zZUJhG9e.js → KeyboardArrowRight-DVPBjTKi.js} +1 -1
  31. package/adminWww/assets/Logs-CA0mEMlO.js +2 -0
  32. package/adminWww/assets/{MoreHoriz-CR2kD-dc.js → MoreHoriz-BYaCptH0.js} +1 -1
  33. package/adminWww/assets/Objects-B2IC3Bce.js +301 -0
  34. package/adminWww/assets/{Overview-WwP6FjK-.js → Overview-HG8fAMFM.js} +2 -2
  35. package/adminWww/assets/{Pageview-DBITLOzI.js → Pageview-DFHddrKX.js} +1 -1
  36. package/adminWww/assets/{PersonOff-ANdO5Nu4.js → PersonOff-BwYQLD1M.js} +1 -1
  37. package/adminWww/assets/{PushPinOutlined-DvxsqPHo.js → PushPinOutlined-CEBeTmNm.js} +1 -1
  38. package/adminWww/assets/Remove-BPxvNccW.js +1 -0
  39. package/adminWww/assets/{Schedule-BMMrgd7j.js → Schedule-BQlh1nhQ.js} +1 -1
  40. package/adminWww/assets/{Star-DNdm064z.js → Star-ChMjBwLn.js} +1 -1
  41. package/adminWww/assets/State-UGfoS6qW.js +1 -0
  42. package/adminWww/assets/Storage-DrC3j-wf.js +1 -0
  43. package/adminWww/assets/{TextSnippet-Bywi1YuG.js → TextSnippet-BQ4TSmvS.js} +1 -1
  44. package/adminWww/assets/{Timeline-IQCnSLiw.js → Timeline-CEyldmz2.js} +1 -1
  45. package/adminWww/assets/{Timer-Be9yF62g.js → Timer-I0twtyWh.js} +1 -1
  46. package/adminWww/assets/{UnfoldMore-Du7-8wYn.js → UnfoldMore-_DDSfPKk.js} +1 -1
  47. package/adminWww/assets/{Usb-Ca47vqRv.js → Usb-Dwk7qdYu.js} +1 -1
  48. package/adminWww/assets/{UsedResources-CMTzFOX3.js → UsedResources-B6HWeXGX.js} +2 -2
  49. package/adminWww/assets/Users-DFeYuC5y.js +1 -0
  50. package/adminWww/assets/{ViewCompact-C3SC0jFF.js → ViewCompact-BbfomOIi.js} +1 -1
  51. package/adminWww/assets/ViewList-1pB5VinA.js +1 -0
  52. package/adminWww/assets/{ViewSidebar-kHvah-XS.js → ViewSidebar-DdedDirX.js} +1 -1
  53. package/adminWww/assets/{VpnKey-iMA7KrB-.js → VpnKey-o8QeqmnU.js} +1 -1
  54. package/adminWww/assets/{WifiTethering-Da8nW7Do.js → WifiTethering-Cp63fmkC.js} +1 -1
  55. 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
  56. package/adminWww/assets/{bootstrap-Bs4TZ7iA.js → bootstrap-DSDOwKWU.js} +33 -33
  57. package/adminWww/assets/{date-fns-Bpgjk9P-.js → date-fns-ukillHs-.js} +1 -1
  58. package/adminWww/assets/helpers-CDcY0YJ-.js +1 -0
  59. package/adminWww/assets/{hostInit-2xIZYDSq.js → hostInit-Cd61hJHh.js} +1 -1
  60. package/adminWww/assets/{icons-material-BLgrEUSv.js → icons-material-Dms1APQk.js} +1 -1
  61. package/adminWww/assets/{index-BZifaJHi.js → index-D6uhIclX.js} +2 -2
  62. package/adminWww/assets/{installSVGRenderer-Pe6-VnD2.js → installSVGRenderer-BR-zIijZ.js} +1 -1
  63. package/adminWww/assets/{lib-CE1B3iHH.js → lib-BZRGBDoe.js} +2 -2
  64. package/adminWww/assets/{loadShare-eager-CRNcc8D7.js → loadShare-eager-BpwDZfDr.js} +93 -93
  65. package/adminWww/assets/{mf-entry-bootstrap-0-a6a54377.js → mf-entry-bootstrap-0-2d631020.js} +3 -3
  66. package/adminWww/assets/{pendingShares-CuQbFsaK.js → pendingShares-D1Vr_qYv.js} +2 -2
  67. package/adminWww/assets/{sentry-B4uGc7ut.js → sentry-BFzW-2KQ.js} +1 -1
  68. package/adminWww/assets/{setYear-DurmWw03.js → setYear-DhVdgUBF.js} +1 -1
  69. package/adminWww/css/nexowatt-native-shell.css +72 -0
  70. package/adminWww/index.html +21 -21
  71. package/adminWww/js/eos-license-link.js +9 -16
  72. package/adminWww/js/nexowatt-native-shell.js +2 -2
  73. package/adminWww/mf-manifest.json +1 -1
  74. package/adminWww/mf-stats.json +1 -1
  75. package/adminWww/{remoteEntry-eos-8.0.0.js → remoteEntry-eos-8.0.2.js} +2 -2
  76. package/adminWww/remoteEntry.js +1 -1
  77. package/build/lib/eosSessionSecurity.js +12 -4
  78. package/build/lib/eosSessionSecurity.js.map +1 -1
  79. package/build/lib/vendor/webserver/LICENSE +21 -0
  80. package/build/lib/vendor/webserver/README.md +506 -0
  81. package/build/lib/vendor/webserver/build/index.d.ts +9 -0
  82. package/build/lib/vendor/webserver/build/index.js +42 -0
  83. package/build/lib/vendor/webserver/build/index.js.map +1 -0
  84. package/build/lib/vendor/webserver/build/lib/acmeChallenge.d.ts +65 -0
  85. package/build/lib/vendor/webserver/build/lib/acmeChallenge.js +149 -0
  86. package/build/lib/vendor/webserver/build/lib/acmeChallenge.js.map +1 -0
  87. package/build/lib/vendor/webserver/build/lib/certificateManager.d.ts +60 -0
  88. package/build/lib/vendor/webserver/build/lib/certificateManager.js +128 -0
  89. package/build/lib/vendor/webserver/build/lib/certificateManager.js.map +1 -0
  90. package/build/lib/vendor/webserver/build/lib/http2Compat.d.ts +21 -0
  91. package/build/lib/vendor/webserver/build/lib/http2Compat.js +109 -0
  92. package/build/lib/vendor/webserver/build/lib/http2Compat.js.map +1 -0
  93. package/build/lib/vendor/webserver/build/lib/oauth2-authcode.d.ts +167 -0
  94. package/build/lib/vendor/webserver/build/lib/oauth2-authcode.js +619 -0
  95. package/build/lib/vendor/webserver/build/lib/oauth2-authcode.js.map +1 -0
  96. package/build/lib/vendor/webserver/build/lib/oauth2-clients.d.ts +92 -0
  97. package/build/lib/vendor/webserver/build/lib/oauth2-clients.js +230 -0
  98. package/build/lib/vendor/webserver/build/lib/oauth2-clients.js.map +1 -0
  99. package/build/lib/vendor/webserver/build/lib/oauth2-model.d.ts +84 -0
  100. package/build/lib/vendor/webserver/build/lib/oauth2-model.js +388 -0
  101. package/build/lib/vendor/webserver/build/lib/oauth2-model.js.map +1 -0
  102. package/build/lib/vendor/webserver/build/lib/oauth2.d.ts +75 -0
  103. package/build/lib/vendor/webserver/build/lib/oauth2.js +625 -0
  104. package/build/lib/vendor/webserver/build/lib/oauth2.js.map +1 -0
  105. package/build/lib/vendor/webserver/build/lib/securityChecker.d.ts +6 -0
  106. package/build/lib/vendor/webserver/build/lib/securityChecker.js +96 -0
  107. package/build/lib/vendor/webserver/build/lib/securityChecker.js.map +1 -0
  108. package/build/lib/vendor/webserver/build/lib/usedResources.d.ts +62 -0
  109. package/build/lib/vendor/webserver/build/lib/usedResources.js +231 -0
  110. package/build/lib/vendor/webserver/build/lib/usedResources.js.map +1 -0
  111. package/build/lib/vendor/webserver/build/lib/utils.d.ts +35 -0
  112. package/build/lib/vendor/webserver/build/lib/utils.js +110 -0
  113. package/build/lib/vendor/webserver/build/lib/utils.js.map +1 -0
  114. package/build/lib/vendor/webserver/build/lib/webServer.d.ts +164 -0
  115. package/build/lib/vendor/webserver/build/lib/webServer.js +454 -0
  116. package/build/lib/vendor/webserver/build/lib/webServer.js.map +1 -0
  117. package/build/lib/vendor/webserver/package.json +63 -0
  118. package/build/lib/web.js +26 -6
  119. package/build/lib/web.js.map +1 -1
  120. package/docs/ADMIN8_MIGRATION_8.0.0_DE.md +4 -0
  121. package/docs/cra/CRA_IEC_GAP_ANALYSIS_2026-09-30.md +10 -0
  122. package/docs/security/admin8-2026-11-04/development-1.log +4 -4
  123. package/docs/security/admin8-2026-11-04/development-2.log +275 -233
  124. package/docs/security/admin8-2026-11-05/copy-update/evidence-sha256.json +0 -5
  125. package/docs/security/admin8-2026-11-05/login-fix/BACKEND_DIAGNOSE_DE.md +48 -0
  126. package/docs/security/admin8-2026-11-05/login-fix/REPORT_DE.md +47 -0
  127. package/docs/security/admin8-2026-11-05/login-fix/REVIEW_DE.md +7 -0
  128. package/docs/security/admin8-2026-11-05/login-fix/controller-adapter-api.ts.txt +122 -0
  129. package/docs/security/admin8-2026-11-05/login-fix/controller-file-view.ts.txt +75 -0
  130. package/docs/security/admin8-2026-11-05/login-fix/controller-redis-view.ts.txt +471 -0
  131. package/docs/security/admin8-2026-11-05/login-fix/dependency/LICENSE-webserver-3.4.0 +21 -0
  132. package/docs/security/admin8-2026-11-05/login-fix/dependency/REPORT_DE.md +41 -0
  133. package/docs/security/admin8-2026-11-05/login-fix/dependency/evidence-sha256.json +116 -0
  134. package/docs/security/admin8-2026-11-05/login-fix/dependency/http-consumer-check.cjs +58 -0
  135. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/README_DE.md +9 -0
  136. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/REJECTED-webserver-3.4.0-eos-oauth.provenance.json +263 -0
  137. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/REJECTED-webserver-3.4.0-eos-oauth.tgz +0 -0
  138. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/admission.log +16 -0
  139. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-audit-stderr.log +1 -0
  140. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-audit.json +22 -0
  141. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-fixture-1.0.0.tgz +0 -0
  142. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-fixture-package.json +11 -0
  143. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-npm10-package-lock.json +387 -0
  144. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-npm11-package-lock.json +387 -0
  145. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/evidence-sha256.json +85 -0
  146. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/http-consumer-npm10-node22.json +11 -0
  147. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/http-consumer-npm11-node24.json +11 -0
  148. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/local-tests.json +38 -0
  149. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/tests-node22.log +168 -0
  150. package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/tests-node24.log +36 -0
  151. package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests-node22.log +224 -0
  152. package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests-node24.log +42 -0
  153. package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests.json +31 -0
  154. package/docs/security/admin8-2026-11-05/login-fix/dependency/webserver-3.4.0-upstream.tgz +0 -0
  155. package/docs/security/admin8-2026-11-05/login-fix/eos-session-8.0.0.js.txt +385 -0
  156. package/docs/security/admin8-2026-11-05/login-fix/evidence-sha256.json +59 -0
  157. package/docs/security/admin8-2026-11-05/login-fix/path-budget.json +6 -0
  158. package/docs/security/admin8-2026-11-05/login-fix/provenance.json +51 -0
  159. package/docs/security/admin8-2026-11-05/login-fix/release/admission.log +21 -0
  160. package/docs/security/admin8-2026-11-05/login-fix/release/archive-scan.json +13 -0
  161. package/docs/security/admin8-2026-11-05/login-fix/release/artifacts.log +6 -0
  162. package/docs/security/admin8-2026-11-05/login-fix/release/backend-build.log +5 -0
  163. package/docs/security/admin8-2026-11-05/login-fix/release/consumer-package-lock.json +3258 -0
  164. package/docs/security/admin8-2026-11-05/login-fix/release/copy-update-journal.json +165 -0
  165. package/docs/security/admin8-2026-11-05/login-fix/release/development.log +365 -0
  166. package/docs/security/admin8-2026-11-05/login-fix/release/frontend-build.log +149 -0
  167. package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-audit.json +22 -0
  168. package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-audit.stderr +2 -0
  169. package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-final-install-node22.log +9 -0
  170. package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node22.json +15 -0
  171. package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node22.stderr +2 -0
  172. package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node24.json +15 -0
  173. package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node24.stderr +0 -0
  174. package/docs/security/admin8-2026-11-05/login-fix/release/inventory.log +8 -0
  175. package/docs/security/admin8-2026-11-05/login-fix/release/npm-pack-final.json +7809 -0
  176. package/docs/security/admin8-2026-11-05/login-fix/release/npm-pack-final.stderr +6 -0
  177. package/docs/security/admin8-2026-11-05/login-fix/release/overlay-final-publish-node22.json +10213 -0
  178. package/docs/security/admin8-2026-11-05/login-fix/release/overlay-final-publish-node22.stderr +282 -0
  179. package/docs/security/admin8-2026-11-05/login-fix/release/pipeline.json +72 -0
  180. package/docs/security/admin8-2026-11-05/login-fix/release/seal.log +6 -0
  181. package/docs/security/admin8-2026-11-05/login-fix/release/vendor-final-review-node24.log +18 -0
  182. package/docs/security/admin8-2026-11-05/login-fix/reproduce.cjs +79 -0
  183. package/docs/security/admin8-2026-11-05/login-fix/reproduction.json +80 -0
  184. package/docs/security/admin8-2026-11-05/login-fix/upstream-LICENSE.txt +22 -0
  185. package/docs/security/admin8-2026-11-05/login-fix/validation.json +85 -0
  186. package/docs/security/admin8-2026-11-05/system-fix/BACKEND_ROLE_REVIEW_DE.md +79 -0
  187. package/docs/security/admin8-2026-11-05/system-fix/NAVIGATION_DE.md +30 -0
  188. package/docs/security/admin8-2026-11-05/system-fix/REPORT_DE.md +51 -0
  189. package/docs/security/admin8-2026-11-05/system-fix/REVIEW_DE.md +65 -0
  190. package/docs/security/admin8-2026-11-05/system-fix/SCOPE_DE.md +21 -0
  191. package/docs/security/admin8-2026-11-05/system-fix/SYSTEM_DE.md +44 -0
  192. package/docs/security/admin8-2026-11-05/system-fix/archive-scan.json +12 -0
  193. package/docs/security/admin8-2026-11-05/system-fix/browser/README.md +46 -0
  194. package/docs/security/admin8-2026-11-05/system-fix/browser/integrity.json +16 -0
  195. package/docs/security/admin8-2026-11-05/system-fix/browser/system-browser-result.json +3607 -0
  196. package/docs/security/admin8-2026-11-05/system-fix/browser/system-browser.cjs +221 -0
  197. package/docs/security/admin8-2026-11-05/system-fix/browser/system-fixture.cjs +60 -0
  198. package/docs/security/admin8-2026-11-05/system-fix/evidence-sha256.json +49 -0
  199. package/docs/security/admin8-2026-11-05/system-fix/license-ui-tests-node22.log +80 -0
  200. package/docs/security/admin8-2026-11-05/system-fix/license-ui-tests-node24.log +19 -0
  201. package/docs/security/admin8-2026-11-05/system-fix/navigation/lint.log +0 -0
  202. package/docs/security/admin8-2026-11-05/system-fix/navigation/node22-tests.log +56 -0
  203. package/docs/security/admin8-2026-11-05/system-fix/navigation/node24-tests.log +15 -0
  204. package/docs/security/admin8-2026-11-05/system-fix/navigation/source-sha256.json +11 -0
  205. package/docs/security/admin8-2026-11-05/system-fix/path-budget.json +7 -0
  206. package/docs/security/admin8-2026-11-05/system-fix/release/artifacts.log +6 -0
  207. package/docs/security/admin8-2026-11-05/system-fix/release/audit-root.json +22 -0
  208. package/docs/security/admin8-2026-11-05/system-fix/release/audit-root.stderr +1 -0
  209. package/docs/security/admin8-2026-11-05/system-fix/release/backend-build.log +5 -0
  210. package/docs/security/admin8-2026-11-05/system-fix/release/clean.log +6 -0
  211. package/docs/security/admin8-2026-11-05/system-fix/release/consumer-audit.json +22 -0
  212. package/docs/security/admin8-2026-11-05/system-fix/release/consumer-audit.stderr +2 -0
  213. package/docs/security/admin8-2026-11-05/system-fix/release/consumer-install.log +4 -0
  214. package/docs/security/admin8-2026-11-05/system-fix/release/consumer-package-lock.json +3258 -0
  215. package/docs/security/admin8-2026-11-05/system-fix/release/development.log +392 -0
  216. package/docs/security/admin8-2026-11-05/system-fix/release/frontend-build.log +149 -0
  217. package/docs/security/admin8-2026-11-05/system-fix/release/http-node22.json +15 -0
  218. package/docs/security/admin8-2026-11-05/system-fix/release/http-node24.json +15 -0
  219. package/docs/security/admin8-2026-11-05/system-fix/release/inventory.log +8 -0
  220. package/docs/security/admin8-2026-11-05/system-fix/release/overlay-journal.json +452 -0
  221. package/docs/security/admin8-2026-11-05/system-fix/release/overlay-publish.log +10790 -0
  222. package/docs/security/admin8-2026-11-05/system-fix/release/overlay-validation.json +12 -0
  223. package/docs/security/admin8-2026-11-05/system-fix/release/pack.json +8104 -0
  224. package/docs/security/admin8-2026-11-05/system-fix/release/pack.stderr +6 -0
  225. package/docs/security/admin8-2026-11-05/system-fix/release/retired-801.json +68 -0
  226. package/docs/security/admin8-2026-11-05/system-fix/release/seal.log +6 -0
  227. package/docs/security/admin8-2026-11-05/system-fix/review-tests.log +30 -0
  228. package/docs/security/admin8-2026-11-05/system-fix/role-context-before.log +86 -0
  229. package/docs/security/admin8-2026-11-05/system-fix/role-context-lint.log +0 -0
  230. package/docs/security/admin8-2026-11-05/system-fix/role-context-node22.log +44 -0
  231. package/docs/security/admin8-2026-11-05/system-fix/role-context-test.log +13 -0
  232. package/docs/security/admin8-2026-11-05/system-fix/validation.json +90 -0
  233. package/docs/third-party/admin8/NOTICE-PROVENANCE.json +3 -3
  234. package/io-package.json +13 -15
  235. package/package.json +10 -4
  236. package/release-manifests/admin8-development-validation.json +136 -43
  237. package/reports/security/artifact-inventory.json +822 -587
  238. package/reports/security/inventory-summary.json +39 -17
  239. package/reports/security/sbom-backend-lock.cdx.json +108 -111
  240. package/reports/security/sbom-frontend-lock.cdx.json +5 -5
  241. package/reports/security/source-runtime-manifest.json +553 -163
  242. package/tools/nexowatt-admin8-development-check.cjs +8 -1
  243. package/tools/nexowatt-artifact-inventory.cjs +8 -1
  244. package/tools/nexowatt-installer-ems-selftest.cjs +1 -1
  245. package/tools/nexowatt-lock-provenance-check.cjs +8 -3
  246. package/tools/nexowatt-repair-lock-metadata.cjs +3 -3
  247. package/tools/nexowatt-role-security-selftest.cjs +2 -2
  248. package/tools/nexowatt-security-inventory.cjs +22 -1
  249. package/tools/nexowatt-user-area-selftest.cjs +1 -1
  250. package/tools/nexowatt-v7109-clean-core-selftest.cjs +1 -1
  251. package/tools/nexowatt-vendored-webserver.cjs +69 -0
  252. package/tools/vendor/eos-retired-release-files.json +268 -1
  253. package/tools/vendor/webserver-3.4.0-source.provenance.json +244 -0
  254. package/adminWww/assets/Adapters-BDxfhfGe.js +0 -7
  255. package/adminWww/assets/EasyMode-TwIN5yxu.js +0 -1
  256. package/adminWww/assets/Enums-CSzSzWm7.js +0 -92
  257. package/adminWww/assets/Hosts-QkyuASJy.js +0 -120
  258. package/adminWww/assets/Instances-BaWBemTT.js +0 -4
  259. package/adminWww/assets/Intro-DsfrPrWv.js +0 -2
  260. package/adminWww/assets/Logs-Cngy2Opt.js +0 -2
  261. package/adminWww/assets/Objects-DY8KS7zK.js +0 -301
  262. package/adminWww/assets/Remove-DplJatnC.js +0 -1
  263. package/adminWww/assets/State-vP1o2BCL.js +0 -1
  264. package/adminWww/assets/Storage-COo2RkS1.js +0 -1
  265. package/adminWww/assets/Users-BjTGOjzL.js +0 -1
  266. package/adminWww/assets/ViewList-DuKCnBnc.js +0 -1
  267. package/adminWww/assets/helpers-DBoACUHw.js +0 -1
@@ -1,120 +0,0 @@
1
- import{a as e,t}from"./rolldown-runtime-sJBDdmOt.js";import{$a as n,An as r,Ar as i,Br as a,Ci as o,Eo as s,Es as c,Fi as l,Fo as u,Ga as d,Go as f,Gr as p,Ho as m,Hs as h,Ii as ee,Is as te,Ja as g,Jo as ne,Lo as re,Ls as ie,Mo as ae,No as oe,Ps as se,Qa as ce,Qs as le,Rr as ue,Rs as de,Sa as fe,So as pe,To as me,Tr as _,Ts as v,Ua as y,Uo as he,Us as b,Vo as x,Vs as S,Wo as C,Wr as ge,Yo as w,Zn as _e,Zo as ve,_i as ye,_o as T,as as be,bo as E,ca as xe,co as Se,da as Ce,er as D,ga as we,gs as Te,ho as O,hs as k,ja as Ee,jo as De,jr as A,ko as j,lo as Oe,mo as M,ms as N,pc as ke,po as Ae,qa as P,qo as F,qs as I,r as je,sc as Me,si as Ne,sr as Pe,ss as L,ta as Fe,tc as R,tn as Ie,uo as z,us as Le,wi as Re,wo as ze,xa as Be,zo as Ve,zr as He,zs as Ue}from"./loadShare-eager-CRNcc8D7.js";import{i as We}from"./Usb-Ca47vqRv.js";import{t as Ge}from"./Cached-f77QQBQD.js";import{t as Ke}from"./Computer-DFIUq-fL.js";import{t as qe}from"./ViewList-DuKCnBnc.js";import{i as Je,t as B}from"./AdminUtils-DDT_kD8H.js";import{M as Ye,a as Xe,j as Ze,n as Qe}from"./bootstrap-Bs4TZ7iA.js";import{t as $e}from"./AdapterUpdateDialog-B3y8RL_5.js";import{t as et}from"./CustomModal-B8vdCRn1.js";import{t as tt}from"./UsedResources-CMTzFOX3.js";var nt=e(t(((e,t,n)=>{(function(e){let n=`(0?\\d+|0x[a-f0-9]+)`,r={fourOctet:RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,`i`),threeOctet:RegExp(`^${n}\\.${n}\\.${n}$`,`i`),twoOctet:RegExp(`^${n}\\.${n}$`,`i`),longValue:RegExp(`^${n}$`,`i`)},i=RegExp(`^0[0-7]+$`,`i`),a=RegExp(`^0x[a-f0-9]+$`,`i`),o=`%[0-9a-z]{1,}`,s=`(?:[0-9a-f]+::?)+`,c={zoneIndex:RegExp(o,`i`),native:RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${o})?$`,`i`),deprecatedTransitional:RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${o})?)$`,`i`),transitional:RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${o})?$`,`i`)};function l(e,t){if(e.indexOf(`::`)!==e.lastIndexOf(`::`))return null;let n=0,r=-1,i=(e.match(c.zoneIndex)||[])[0],a,o;for(i&&(i=i.substring(1),e=e.replace(/%.+$/,``));(r=e.indexOf(`:`,r+1))>=0;)n++;if(e.substr(0,2)===`::`&&n--,e.substr(-2,2)===`::`&&n--,n>=t)return null;for(o=t-n,a=`:`;o--;)a+=`0:`;return e=e.replace(`::`,a),e[0]===`:`&&(e=e.slice(1)),e[e.length-1]===`:`&&(e=e.slice(0,-1)),t=(function(){let t=e.split(`:`),n=[];for(let e=0;e<t.length;e++)n.push(t[e].length>4?NaN:parseInt(t[e],16));return n})(),{parts:t,zoneId:i}}function u(e,t,n,r){if(e.length!==t.length)throw Error(`ipaddr: cannot match CIDR for objects with different lengths`);let i=0,a;for(;r>0;){if(a=n-r,a<0&&(a=0),e[i]>>a!==t[i]>>a)return!1;r-=n,i+=1}return!0}function d(e){if(a.test(e))return parseInt(e,16);if(e[0]===`0`&&!isNaN(parseInt(e[1],10))){if(i.test(e))return parseInt(e,8);throw Error(`ipaddr: cannot parse ${e} as octal`)}return parseInt(e,10)}function f(e,t){for(;e.length<t;)e=`0${e}`;return e}let p={};p.IPv4=(function(){function e(e){if(e.length!==4)throw Error(`ipaddr: ipv4 octet count should be 4`);let t,n;for(t=0;t<e.length;t++)if(n=e[t],!(0<=n&&n<=255))throw Error(`ipaddr: ipv4 octet should fit in 8 bits`);this.octets=e}return e.prototype.SpecialRanges={unspecified:[[new e([0,0,0,0]),8]],broadcast:[[new e([255,255,255,255]),32]],multicast:[[new e([224,0,0,0]),4]],linkLocal:[[new e([169,254,0,0]),16]],loopback:[[new e([127,0,0,0]),8]],carrierGradeNat:[[new e([100,64,0,0]),10]],private:[[new e([10,0,0,0]),8],[new e([172,16,0,0]),12],[new e([192,168,0,0]),16]],reserved:[[new e([192,0,0,0]),24],[new e([192,0,2,0]),24],[new e([192,88,99,0]),24],[new e([198,18,0,0]),15],[new e([198,51,100,0]),24],[new e([203,0,113,0]),24],[new e([240,0,0,0]),4]],as112:[[new e([192,175,48,0]),24],[new e([192,31,196,0]),24]],amt:[[new e([192,52,193,0]),24]]},e.prototype.kind=function(){return`ipv4`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv4`)throw Error(`ipaddr: cannot match ipv4 address with non-ipv4 one`);return u(this.octets,e.octets,8,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r,i,a;for(r=3;r>=0;--r)if(i=this.octets[r],i in n){if(a=n[i],t&&a!==0)return null;a!==8&&(t=!0),e+=a}else return null;return 32-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){return this.octets.slice(0)},e.prototype.toIPv4MappedAddress=function(){return p.IPv6.parse(`::ffff:${this.toString()}`)},e.prototype.toNormalizedString=function(){return this.toString()},e.prototype.toString=function(){return this.octets.join(`.`)},e})(),p.IPv4.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<4;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv4 CIDR format`,{cause:e})}},p.IPv4.isIPv4=function(e){return this.parser(e)!==null},p.IPv4.isValid=function(e){try{return new this(this.parser(e)),!0}catch{return!1}},p.IPv4.isValidCIDR=function(e){try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv4.isValidFourPartDecimal=function(e){return!!(p.IPv4.isValid(e)&&e.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},p.IPv4.isValidCIDRFourPartDecimal=function(e){let t=e.match(/^(.+)\/(\d+)$/);return!p.IPv4.isValidCIDR(e)||!t?!1:p.IPv4.isValidFourPartDecimal(t[1])},p.IPv4.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<4;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv4 CIDR format`,{cause:e})}},p.IPv4.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv4 Address`);return new this(t)},p.IPv4.parseCIDR=function(e){let t;if(t=e.match(/^(.+)\/(\d+)$/)){let e=parseInt(t[2]);if(e>=0&&e<=32){let n=[this.parse(t[1]),e];return Object.defineProperty(n,"toString",{value:function(){return this.join(`/`)}}),n}}throw Error(`ipaddr: string is not formatted like an IPv4 CIDR range`)},p.IPv4.parser=function(e){let t,n,i;if(t=e.match(r.fourOctet))return(function(){let e=t.slice(1,6),r=[];for(let t=0;t<e.length;t++)n=e[t],r.push(d(n));return r})();if(t=e.match(r.longValue)){if(i=d(t[1]),i>4294967295||i<0)throw Error(`ipaddr: address outside defined range`);return(function(){let e=[],t=0;for(;t<=24;t+=8)e.push(i>>t&255);return e})().reverse()}return(t=e.match(r.twoOctet))?(function(){let e=t.slice(1,4),n=[];if(i=d(e[1]),i>16777215||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(i>>16&255),n.push(i>>8&255),n.push(i&255),n})():(t=e.match(r.threeOctet))?(function(){let e=t.slice(1,5),n=[];if(i=d(e[2]),i>65535||i<0)throw Error(`ipaddr: address outside defined range`);return n.push(d(e[0])),n.push(d(e[1])),n.push(i>>8&255),n.push(i&255),n})():null},p.IPv4.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),Number.isNaN(e)||e<0||e>32)throw Error(`ipaddr: invalid IPv4 prefix length`);let t=[0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<4&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.IPv6=(function(){function e(e,t){let n,r;if(e.length===16)for(this.parts=[],n=0;n<=14;n+=2)this.parts.push(e[n]<<8|e[n+1]);else if(e.length===8)this.parts=e;else throw Error(`ipaddr: ipv6 part count should be 8 or 16`);for(n=0;n<this.parts.length;n++)if(r=this.parts[n],!(0<=r&&r<=65535))throw Error(`ipaddr: ipv6 part should fit in 16 bits`);t&&(this.zoneId=t)}return e.prototype.SpecialRanges={unspecified:[new e([0,0,0,0,0,0,0,0]),128],linkLocal:[new e([65152,0,0,0,0,0,0,0]),10],multicast:[new e([65280,0,0,0,0,0,0,0]),8],loopback:[new e([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new e([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new e([0,0,0,0,0,65535,0,0]),96],deprecatedSiteLocal:[new e([65216,0,0,0,0,0,0,0]),10],discard:[new e([256,0,0,0,0,0,0,0]),64],rfc6145:[new e([0,0,0,0,65535,0,0,0]),96],rfc6052:[[new e([100,65435,0,0,0,0,0,0]),96],[new e([100,65435,1,0,0,0,0,0]),48]],"6to4":[new e([8194,0,0,0,0,0,0,0]),16],teredo:[new e([8193,0,0,0,0,0,0,0]),32],benchmarking:[new e([8193,2,0,0,0,0,0,0]),48],amt:[new e([8193,3,0,0,0,0,0,0]),32],as112v6:[[new e([8193,4,274,0,0,0,0,0]),48],[new e([9760,79,32768,0,0,0,0,0]),48]],deprecatedOrchid:[new e([8193,16,0,0,0,0,0,0]),28],orchid2:[new e([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new e([8193,48,0,0,0,0,0,0]),28],segmentRouting:[new e([24320,0,0,0,0,0,0,0]),16],reserved:[[new e([8193,0,0,0,0,0,0,0]),23],[new e([8193,3512,0,0,0,0,0,0]),32],[new e([16383,0,0,0,0,0,0,0]),20]]},e.prototype.isIPv4MappedAddress=function(){return this.range()===`ipv4Mapped`},e.prototype.kind=function(){return`ipv6`},e.prototype.match=function(e,t){let n;if(t===void 0&&(n=e,e=n[0],t=n[1]),e.kind()!==`ipv6`)throw Error(`ipaddr: cannot match ipv6 address with non-ipv6 one`);return u(this.parts,e.parts,16,t)},e.prototype.prefixLengthFromSubnetMask=function(){let e=0,t=!1,n={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},r,i;for(let a=7;a>=0;--a)if(r=this.parts[a],r in n){if(i=n[r],t&&i!==0)return null;i!==16&&(t=!0),e+=i}else return null;return 128-e},e.prototype.range=function(){return p.subnetMatch(this,this.SpecialRanges)},e.prototype.toByteArray=function(){let e,t=[],n=this.parts;for(let r=0;r<n.length;r++)e=n[r],t.push(e>>8),t.push(e&255);return t},e.prototype.toFixedLengthString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(f(this.parts[t].toString(16),4));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw Error(`ipaddr: trying to convert a generic ipv6 address to ipv4`);let e=this.parts.slice(-2),t=e[0],n=e[1];return new p.IPv4([t>>8,t&255,n>>8,n&255])},e.prototype.toNormalizedString=function(){let e=(function(){let e=[];for(let t=0;t<this.parts.length;t++)e.push(this.parts[t].toString(16));return e}).call(this).join(`:`),t=``;return this.zoneId&&(t=`%${this.zoneId}`),e+t},e.prototype.toRFC5952String=function(){let e=/((^|:)(0(:|$)){2,})/g,t=``;this.zoneId&&(t=`%${this.zoneId}`);let n=this.toNormalizedString(),r=n.slice(0,n.length-t.length),i=0,a=-1,o=-1,s;for(;s=e.exec(r);){let e=(s[0].match(/0/g)||[]).length;e>o&&(o=e,i=s.index,a=s[0].length)}return a<0?r+t:`${r.substring(0,i)}::${r.substring(i+a)}${t}`},e.prototype.toString=function(){return this.toRFC5952String()},e})(),p.IPv6.broadcastAddressFromCIDR=function(e){try{let t=this.parseCIDR(e),n=t[0].toByteArray(),r=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],a=0;for(;a<16;)i.push(parseInt(n[a],10)|parseInt(r[a],10)^255),a++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format`,{cause:e})}},p.IPv6.isIPv6=function(e){return this.parser(e)!==null},p.IPv6.isValid=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{let t=this.parser(e);return new this(t.parts,t.zoneId),!0}catch{return!1}},p.IPv6.isValidCIDR=function(e){if(typeof e==`string`&&e.indexOf(`:`)===-1)return!1;try{return this.parseCIDR(e),!0}catch{return!1}},p.IPv6.networkAddressFromCIDR=function(e){let t,n,r,i,a;try{for(t=this.parseCIDR(e),r=t[0].toByteArray(),a=this.subnetMaskFromPrefixLength(t[1]).toByteArray(),i=[],n=0;n<16;)i.push(parseInt(r[n],10)&parseInt(a[n],10)),n++;return new this(i)}catch(e){throw Error(`ipaddr: the address does not have IPv6 CIDR format`,{cause:e})}},p.IPv6.parse=function(e){let t=this.parser(e);if(t===null)throw Error(`ipaddr: string is not formatted like an IPv6 Address`);return new this(t.parts,t.zoneId)},p.IPv6.parseCIDR=function(e){let t,n,r;if((n=e.match(/^(.+)\/(\d+)$/))&&(t=parseInt(n[2]),t>=0&&t<=128))return r=[this.parse(n[1]),t],Object.defineProperty(r,"toString",{value:function(){return this.join(`/`)}}),r;throw Error(`ipaddr: string is not formatted like an IPv6 CIDR range`)},p.IPv6.parser=function(e){let t,n,r,i,a,o;if(r=e.match(c.deprecatedTransitional))return this.parser(`::ffff:${r[1]}`);if(c.native.test(e))return l(e,8);if((r=e.match(c.transitional))&&(o=r[6]||``,t=r[1],r[1].endsWith(`::`)||(t=t.slice(0,-1)),t=l(t+o,6),t&&t.parts)){for(a=[parseInt(r[2]),parseInt(r[3]),parseInt(r[4]),parseInt(r[5])],n=0;n<a.length;n++)if(i=a[n],!(0<=i&&i<=255))return null;return t.parts.push(a[0]<<8|a[1]),t.parts.push(a[2]<<8|a[3]),{parts:t.parts,zoneId:t.zoneId}}return null},p.IPv6.subnetMaskFromPrefixLength=function(e){if(e=parseInt(e),Number.isNaN(e)||e<0||e>128)throw Error(`ipaddr: invalid IPv6 prefix length`);let t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0,r=Math.floor(e/8);for(;n<r;)t[n]=255,n++;return r<16&&(t[r]=2**(e%8)-1<<8-e%8),new this(t)},p.fromByteArray=function(e){let t=e.length;if(t===4)return new p.IPv4(e);if(t===16)return new p.IPv6(e);throw Error(`ipaddr: the binary input is neither an IPv6 nor IPv4 address`)},p.isValid=function(e){return p.IPv6.isValid(e)||p.IPv4.isValid(e)},p.isValidCIDR=function(e){return p.IPv6.isValidCIDR(e)||p.IPv4.isValidCIDR(e)},p.parse=function(e){if(p.IPv6.isValid(e))return p.IPv6.parse(e);if(p.IPv4.isValid(e))return p.IPv4.parse(e);throw Error(`ipaddr: the address has neither IPv6 nor IPv4 format`)},p.parseCIDR=function(e){try{return p.IPv6.parseCIDR(e)}catch{try{return p.IPv4.parseCIDR(e)}catch(e){throw Error(`ipaddr: the address has neither IPv6 nor IPv4 CIDR format`,{cause:e})}}},p.process=function(e){let t=this.parse(e);return t.kind()===`ipv6`&&t.isIPv4MappedAddress()?t.toIPv4Address():t},p.subnetMatch=function(e,t,n){let r,i,a,o;for(i in n??=`unicast`,t)if(Object.prototype.hasOwnProperty.call(t,i)){for(a=t[i],a[0]&&!(a[0]instanceof Array)&&(a=[a]),r=0;r<a.length;r++)if(o=a[r],e.kind()===o[0].kind()&&e.match.apply(e,o))return i}return n},t!==void 0&&t.exports?t.exports=p:e.ipaddr=p})(n)}))(),1);c();var rt=class extends R{constructor(e){super(e),v(this,`updating`,!1),v(this,`textareaRef`,I.createRef()),v(this,`link`,`${window.location.protocol}//${window.location.host}/`),v(this,`interval`,null),v(this,`startTimeout`,null),this.state={response:null,error:null,starting:!0}}setUpdating(e){this.updating!==e&&(this.updating=e,this.props.onUpdating(e))}async findIpAddress(){var e,t;if((await this.props.socket.getObject(`system.adapter.${this.props.adminInstance}`)).common.host===this.props.hostId)return;let n=await this.props.socket.getObject(this.props.hostId),r=await this.props.socket.readBaseSettings(this.props.hostId),i=(r==null||(e=r.config)==null||(e=e.objects)==null?void 0:e.host)||``;if(i&&i!==`localhost`&&(i=nt.default.parse(Array.isArray(i)?i[0]:i).toString(),n!=null&&(t=n.native)!=null&&(t=t.hardware)!=null&&t.networkInterfaces))for(let e of Object.values(n.native.hardware.networkInterfaces))e.find(e=>{try{let t=nt.default.parseCIDR(e.cidr).toString();e.internal===!1&&i.match(t)&&(this.link=`${window.location.protocol}//${e.family===`IPv6`?`[${e.address}]`:e.address}:${window.location.port}`)}catch{}return!1})}async componentDidMount(){try{await this.findIpAddress()}catch(e){console.error(`Cannot find ip address: ${e.message}`)}try{await this.props.socket.upgradeController(this.props.hostId,this.props.version,parseInt(this.props.adminInstance.split(`.`).pop()||``,10))}catch(e){console.error(`Cannot update controller: ${e.message}`),this.setState({error:_.t(`Not updatable`),starting:!1}),this.setUpdating(!1);return}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 checkStatus(){console.log(`Request update status from: ${this.link}`);try{let e=await(await fetch(this.link)).text();console.log(`Received status: ${e}`);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(_.t(`%s was successfully updated to %s`,`js-controller`,this.props.version))):t!=null&&t.stdout&&(t.stdout.unshift(``),t.stdout.unshift(`---------------------------------------------------`),t.stdout.unshift(_.t(`updating %s to %s...`,`js-controller`,this.props.version))),this.setState({response:t,error:null},()=>{t&&!t.running?(this.setUpdating(!1),this.interval&&=(clearInterval(this.interval),null)):t!=null&&t.running&&this.setUpdating(!0),this.textareaRef.current&&setTimeout(()=>this.textareaRef.current&&(this.textareaRef.current.scrollTop=this.textareaRef.current.scrollHeight),100)})}catch(e){this.state.starting||this.setState({error:e.toString()},()=>this.setUpdating(!1))}}render(){var e,t,n,r,i;return b(De,{onClose:(e,t)=>{t!==`escapeKeyDown`&&t!==`backdropClick`&&this.props.onClose()},open:!0,maxWidth:`lg`,fullWidth:!0,children:[h(u,{children:_.t(`Updating %s...`,`js-controller`)}),b(oe,{style:{height:400,padding:`0 20px`,overflow:`hidden`},children:[(!this.state.response||this.state.response.running)&&!this.state.error?h(ve,{}):null,this.state.response||this.state.error?h(`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:this.state.response.stderr&&this.state.response.stderr.length?this.state.response.stderr.join(`
2
- `):this.state.response.stdout.join(`
3
- `),readOnly:!0}):null]}),h(ae,{children:h(E,{id:`js-controller-updater-close`,variant:`contained`,disabled:this.state.starting||!this.state.error&&((t=this.state.response)==null?void 0:t.running),onClick:()=>{var e;(e=this.state.response)!=null&&e.success&&window.location.reload(),this.props.onClose()},color:(n=this.state.response)!=null&&n.success?`primary`:`grey`,startIcon:(r=this.state.response)!=null&&r.success?h(Ce,{}):h(P,{}),children:(i=this.state.response)!=null&&i.success?_.t(`Reload`):_.t(`Close`)})})]})}},V={root:{width:`100%`,height:`auto`,display:`flex`,flexDirection:`column`,overflow:`auto`,padding:10},paper:{maxWidth:1e3},overflowHidden:{display:`flex`,overflow:`hidden`},h1:{fontWeight:500,fontSize:35,margin:`10px 0`},h2:e=>({p:`10px 7px`,fontSize:25,fontWeight:300,borderRadius:`3px`,background:`#4dabf5`,color:e.palette.mode===`dark`?`black`:`white`}),h22:e=>({p:0,m:0,fontSize:25,fontWeight:300,borderRadius:`3px`,background:`#4dabf5`,color:e.palette.mode===`dark`?`black`:`white`}),standardText:{fontSize:15,margin:`10px 0`,"& > a":{textDecoration:`none`,color:`#1e88e5`}},standardTextSmall:{fontSize:12,color:`black`},standardTextSmall2:{fontSize:12},pre:{whiteSpace:`pre-wrap`,background:`#e4e3e3`,padding:10,borderRadius:3,position:`relative`},copyButton:{color:`black`,position:`absolute`,right:10,top:4},comment:{color:`#00000078`},accordionSummary:{background:`#4dabf5`,borderRadius:`3px`,"& .MuiAccordionSummary-content":{m:0}},accordionDetails:{display:`flex`,flexDirection:`column`},code:e=>({backgroundColor:e.palette.mode===`dark`?`#123456`:`#93bbe7`,p:`0 3px 0 3px`}),copyButtonSmall:{width:31,height:16}};function it(e,t,n){let r=e.split(`
4
- `),i=[],a=!1;for(let e=0;e<r.length;e++){let o=r[e].toLowerCase();o.startsWith(`##`)&&(a=o.includes(t.toLowerCase())&&(!n||!o.includes(n.toLowerCase()))),a||i.push(r[e])}return i.join(`
5
- `)}var at=({socket:e,hostId:t,version:n,onClose:i})=>{let[a,o]=ke(null),[s,c]=ke(``),[l,d]=ke(``),f=e=>{p.copyToClipboard(e),window.alert(_.t(`Copied`))};return Me(()=>{t&&typeof t==`string`||console.error(`Invalid hostId: "${t}" with type ${typeof t}`),s&&l||!t||typeof t!=`string`||e.getHostInfoShort(t).then(e=>{e.location&&e.location!==s&&c(e.location),e.os&&e.os!==l&&d(e.os),fetch(`https://raw.githubusercontent.com/ioBroker/ioBroker.docs/master/admin/${_.getLanguage()}/controller-upgrade.md`).then(e=>e.text()).then(t=>{let r=e.os||l,i=(e.location||s).replace(/\\/g,`/`);t=r===`win32`?it(t,`linux`,`windows`):it(t,`windows`,`linux`),t=t.replace(/cd \/opt\/iobroker/g,`cd ${i}`),t=t.replace(/cd C:\\iobroker/g,`cd ${i}`),t=t.replace(/x\.y\.z/g,n);let a=t.split(`<!-- copy`),c=[];a.forEach(e=>{if(e.includes(`-->`)){let t=e.split(`-->`),n=t[0],r=t[1],i=!1;n.startsWith(` small`)&&(n=n.replace(/^ {2}small /,``),i=!0),n=n.replace(/^\n\r/,``).replace(/^\n/,``),i?c.push(h(F,{onClick:()=>f(n),children:h(D,{})},`b${c.length}`)):c.push(h(E,{variant:`contained`,onClick:()=>f(n),startIcon:h(D,{}),children:_.t(`Copy to clipboard`)},`b${c.length}`)),c.push(r)}else c.push(e)}),o(c)})}).catch(e=>window.alert(`Cannot get information about host "${t}": ${e}`))},[s,l,e,n,t]),b(De,{onClose:()=>i(),open:!0,sx:{"& .MuiDialog-paper":V.paper},children:[h(u,{children:_.t(`js-controller upgrade instructions`)}),h(oe,{style:a?null:V.overflowHidden,dividers:!0,children:a?h(S,{children:a==null?void 0:a.map((e,t)=>typeof e==`object`?e:h(Xe,{components:{em:({...e})=>h(F,{style:V.copyButtonSmall,onClick:()=>f(e.children[0].toString()),children:h(D,{})}),a:({children:e,...t})=>h(`a`,{style:{color:`inherit`},...t,children:e}),code:({children:e,ref:t,...n})=>h(T,{component:`code`,sx:V.code,ref:t,...n,children:e})},children:e},`t_${t}`))}):b(pe,{style:V.root,children:[h(T,{component:`div`,sx:V.standardText,children:_.t(`Due to the different hardware and platforms under which ioBroker runs, the js-controller has to be updated manually. Further details can be found in the appropriate section.`)}),h(T,{component:`h2`,sx:V.h2,children:_.t(`General information for all platforms`)}),b(T,{component:`div`,sx:V.standardText,children:[_.t(`For an update from js-controller 1.x to 2.x please always read the information at`),` `,h(`a`,{href:`https://forum.iobroker.net/topic/26759/js-controller-2-jetzt-f%C3%BCr-alle-im-stable`,target:`_blank`,rel:`noreferrer`,children:`forum`}),`.`]}),h(T,{component:`div`,sx:V.standardText,children:_.t(`Otherwise please update the slaves first with an update of master-slave systems and the master last!`)}),l!==`win32`&&b(S,{children:[h(T,{component:`h2`,sx:V.h2,children:_.t(`Linux/macOS (new installer)`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`This is the recommended option`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`Please execute the following commands in an SSH shell (console):`)}),b(`pre`,{style:V.pre,children:[h(F,{size:`small`,onClick:()=>{window.alert(_.t(`Copied`)),f(`iob backup
6
- iob stop
7
- iob update
8
- iob upgrade self
9
- iob start`)},style:V.copyButton,children:h(D,{})}),h(`div`,{style:V.standardTextSmall,children:`iob backup`}),h(`div`,{style:V.standardTextSmall,children:`iob stop`}),h(`div`,{style:V.standardTextSmall,children:`iob update`}),h(`div`,{style:V.standardTextSmall,children:`iob fix`}),h(`div`,{style:V.standardTextSmall,children:`iob upgrade self`}),h(`div`,{style:V.standardTextSmall,children:`iob start`})]}),h(`div`,{style:V.standardTextSmall2,children:_.t(`or reboot server, then ioBroker should restart and you can be sure that all old processes were finished.`)}),h(`div`,{style:V.standardTextSmall2,children:_.t(`If the upgrade command displays Access Rights / Permission errors, then please use the install fixer`)}),b(`pre`,{style:V.pre,children:[h(F,{size:`small`,onClick:()=>{window.alert(_.t(`Copied`)),f(`curl -sL https://iobroker.net/fix.sh | bash -`)},style:V.copyButton,children:h(D,{})}),h(`div`,{style:V.standardTextSmall,children:`curl -sL https://iobroker.net/fix.sh | bash -`})]}),h(`div`,{style:V.standardTextSmall2,children:_.t(`to fix these issues and upgrade command run again.`)}),h(T,{component:`h2`,sx:V.h2,children:_.t(`Linux/macOS (manually installed)`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`A manual installation usually takes place under root as user and therefore a "sudo" is necessary before the commands.`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`Please execute the following commands in an SSH shell (console):`)}),b(`pre`,{style:V.pre,children:[h(F,{size:`small`,onClick:()=>{window.alert(_.t(`Copied`)),f(`cd ${s||`/opt/iobroker`}
10
- iob backup
11
- iob stop
12
- iob update
13
- iob fix
14
- iob upgrade self
15
- iob start
16
- `)},style:V.copyButton,children:h(D,{})}),b(`div`,{style:V.standardTextSmall,children:[`cd`,s||`/opt/iobroker`]}),h(`div`,{style:V.standardTextSmall,children:`iob backup`}),h(`div`,{style:V.standardTextSmall,children:`iob stop`}),h(`div`,{style:V.standardTextSmall,children:`iob fix`}),h(`div`,{style:V.standardTextSmall,children:`iob update`}),h(`div`,{style:V.standardTextSmall,children:`iob upgrade self`}),h(`div`,{style:V.standardTextSmall,children:`iob start`})]}),h(`div`,{style:V.standardTextSmall2,children:_.t(`or reboot server, then ioBroker should restart and you can be sure that all old processes were finished.`)}),h(`div`,{style:V.standardTextSmall2,children:_.t(`If the upgrade command displays permissions / permissions errors, fix them. Sometimes "sudo" is not enough and you have to run the installation as a real root (previously simply sudo su -).`)})]}),l===`win32`&&b(S,{children:[h(T,{component:`h2`,sx:V.h2,children:_.t(`Windows`)}),b(T,{component:`div`,sx:V.standardText,children:[_.t(`For updating ioBroker on Windows, download the appropriate installer with the desired js-controller version from the download page `),h(`a`,{rel:`noreferrer`,href:`https://www.iobroker.net/#en/download`,target:`_blank`,children:`https://www.iobroker.net/#en/download`}),_.t(` and make the update with it. With the Windows Installer, previously manually installed servers or installations from other operating systems can be migrated to Windows and updated.`)]}),h(T,{component:`h2`,sx:V.h2,children:_.t(`Windows (manually installed)`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`A manual installation is done with administrator rights. Please start a cmd.exe command line window as an administrator (right-click on cmd.exe and execute as administrator) and execute the following commands:`)}),b(`pre`,{style:V.pre,children:[h(F,{size:`small`,onClick:()=>{window.alert(_.t(`Copied`)),f(`cd ${(s||`C:\\iobroker`).replace(/\//g,`\\`)}
17
- iob backup
18
- iob stop
19
- iob status
20
- iob update
21
- iob upgrade self
22
- `)},style:V.copyButton,children:h(D,{})}),b(`div`,{style:V.standardTextSmall,children:[`cd`,(s||`C:\\iobroker`).replace(/\//g,`\\`),` `,s?null:_.t(`(or where ioBroker was installed)`)]}),h(`div`,{style:V.standardTextSmall,children:`iob backup`}),b(`div`,{style:V.standardTextSmall,children:[`iob stop`,_.t(`to stop the ioBroker service`)]}),b(`div`,{style:V.standardTextSmall,children:[`iob status`,_.t(`to check if ioBroker has finished`)]}),h(`div`,{style:V.standardTextSmall,children:`iob update`}),h(`div`,{style:V.standardTextSmall,children:`iob upgrade self`})]}),h(`div`,{style:V.standardTextSmall2,children:_.t(`Start ioBroker service or reboot computer, then ioBroker should restart and you can be sure that all the old processes were finished.`)})]}),b(g,{style:{paddingTop:14},children:[h(re,{sx:V.accordionSummary,expandIcon:h(r,{}),children:h(T,{component:`h2`,sx:V.h22,children:_.t(`Emergency Linux / macOS / Windows`)})}),b(j,{style:V.accordionDetails,children:[h(T,{component:`div`,sx:V.standardText,children:_.t(`(manual reinstallation, if somehow nothing works after the update)`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`On Windows first please call in the start menu under "ioBroker" the command line of the relevant ioBroker instance. The correct directory is then set automatically. On Linux or macOS please go to the ioBroker directory.`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`Run npm install iobroker.js-controller there. A specific version can be installed using npm install iobroker.js-controller@x.y.z (replace x.y.z with the desired version).`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`If there are problems with access rights when running on Linux the command has to be changed slightly:`)}),h(`div`,{style:V.standardTextSmall2,children:_.t(`For systems created with the new Linux installer:`)}),b(`pre`,{style:V.pre,children:[h(F,{size:`small`,onClick:()=>{window.alert(_.t(`Copied`)),f(`cd ${l===`win32`?(s||`C:\\iobroker`).replace(/\//g,`\\`):s||`/opt/iobroker`}
23
- sudo -u iobroker -H npm install iobroker.js-controller`)},style:V.copyButton,children:h(D,{})}),b(`div`,{style:V.standardTextSmall,children:[`cd`,l===`win32`?(s||`C:\\iobroker`).replace(/\//g,`\\`):s||`/opt/iobroker`]}),h(`div`,{style:V.standardTextSmall,children:`sudo -u iobroker -H npm install iobroker.js-controller`})]}),h(`div`,{style:V.standardTextSmall2,children:_.t(`For systems installed manually under Linux, prefix sudo or run as root.`)}),h(T,{component:`div`,sx:V.standardText,children:_.t(`This way is only necessary in very few cases and please consult the forum beforehand!`)})]})]})]})}),b(ae,{children:[h(E,{id:`js-controller-dialog-changelog`,variant:`contained`,onClick:()=>{window.open(Je,`_blank`)},color:`grey`,startIcon:h(fe,{}),children:_.t(`Show whole changelog`)}),h(E,{id:`js-controller-dialog-ok`,variant:`contained`,onClick:()=>i(),color:`primary`,startIcon:h(P,{}),children:_.t(`Ok`)})]})]})};c();var H={paper:{height:`100%`,maxHeight:`100%`,maxWidth:`100%`,overflow:`auto`,padding:8},controlItem:{width:`calc(100% - 16px)`,marginBottom:16,marginRight:8,marginLeft:8},RAM:{width:400,marginRight:8}},ot=class extends R{constructor(e){super(e),v(this,`focusRef`,void 0);let t=this.props.settings||{};this.state={memoryLimitMB:t.memoryLimitMB||0,hostname:t.hostname||``,statisticsInterval:t.statisticsInterval||15e3,checkDiskInterval:t.checkDiskInterval||3e5,instanceStartInterval:t.instanceStartInterval||2e3,compact:t.compact||!1,allowShellCommands:t.allowShellCommands||!1,memLimitWarn:t.memLimitWarn||100,memLimitError:t.memLimitError||50,noChmod:t.noChmod||!1},this.focusRef=le()}componentDidMount(){var e;(e=this.focusRef.current)==null||e.focus()}onChange(){this.props.onChange({memoryLimitMB:this.state.memoryLimitMB,hostname:this.state.hostname,statisticsInterval:this.state.statisticsInterval,checkDiskInterval:this.state.checkDiskInterval,noChmod:this.state.noChmod,instanceStartInterval:this.state.instanceStartInterval,compact:this.state.compact,allowShellCommands:this.state.allowShellCommands,memLimitWarn:this.state.memLimitWarn,memLimitError:this.state.memLimitError})}render(){return h(Le,{style:H.paper,children:h(f,{style:H.gridSettings,children:b(f,{container:!0,sx:{flexDirection:`column`},children:[h(f,{children:h(z,{variant:`standard`,label:this.props.t(`Host name`),style:H.controlItem,value:this.state.hostname||this.props.currentHost.replace(`system.host.`,``),onChange:e=>this.setState({hostname:e.target.value},()=>this.onChange()),helperText:this.props.t(`You can change the host name, but be aware, that all instances must be assigned anew`)})}),h(f,{children:h(z,{variant:`standard`,label:this.props.t(`Check disk space interval`),style:H.controlItem,value:this.state.checkDiskInterval,type:`number`,slotProps:{htmlInput:{min:1e3}},onChange:e=>this.setState({checkDiskInterval:parseInt(e.target.value,10)},()=>this.onChange()),helperText:this.props.t(`How oft the disk will be checked. Do not set it to low, because it can affect system performance. Value is in ms`)})}),h(f,{children:h(z,{variant:`standard`,label:this.props.t(`Instance statistics update interval`),style:H.controlItem,value:this.state.statisticsInterval,type:`number`,slotProps:{htmlInput:{min:5e3}},onChange:e=>this.setState({statisticsInterval:parseInt(e.target.value,10)},()=>this.onChange()),helperText:this.props.t(`How oft the instance statistics will be updated. Used RAM, CPU and so on. Value is in ms`)})}),b(f,{style:H.controlItem,children:[h(m,{control:h(s,{checked:this.state.compact,onChange:e=>this.setState({compact:e.target.checked},()=>this.onChange())}),label:this.props.t(`Compact mode`)}),h(`div`,{children:this.props.t(`When enabled adapter instances can run in one or few processes to save RAM usage.`)})]}),b(f,{style:H.controlItem,children:[h(m,{control:h(s,{checked:this.state.allowShellCommands,onChange:e=>this.setState({allowShellCommands:e.target.checked},()=>this.onChange())}),label:this.props.t(`Allow shell's commands`)}),h(`div`,{children:this.props.t(`Allow execution of sendToHost("shell", "cli command")`)})]}),h(f,{children:h(z,{variant:`standard`,label:this.props.t(`Limit RAM size for controller`),style:H.controlItem,value:this.state.memoryLimitMB,type:`number`,onChange:e=>this.setState({memoryLimitMB:parseInt(e.target.value,10)},()=>this.onChange()),helperText:this.props.t(`MB`)})}),h(f,{children:b(f,{container:!0,direction:`row`,style:H.controlItem,children:[h(f,{children:h(z,{variant:`standard`,label:this.props.t(`Show warning im log if RAM less than`),style:H.RAM,value:this.state.memLimitWarn,type:`number`,onChange:e=>this.setState({memLimitWarn:parseInt(e.target.value,10)},()=>this.onChange()),helperText:this.props.t(`MB`)})}),h(f,{children:h(z,{variant:`standard`,label:this.props.t(`Show error in log if RAM less than`),style:H.RAM,value:this.state.memLimitError,type:`number`,onChange:e=>this.setState({memLimitError:parseInt(e.target.value,10)},()=>this.onChange()),helperText:this.props.t(`MB`)})})]})})]})})})}};c();var st={paper:{height:`100%`,maxHeight:`100%`,maxWidth:`100%`,overflow:`auto`,padding:8},controlItem:{width:`calc(100% - 16px)`,marginBottom:16,marginRight:8,marginLeft:8},RAM:{width:400,marginRight:8}},ct=class extends R{constructor(e){super(e),v(this,`focusRef`,void 0);let t=this.props.settings||{};this.state={enabled:t.enabled||!1,secure:t.secure||!0,password:``},t.password&&this.props.socket.decrypt(t.password).then(e=>this.setState({password:e})),this.focusRef=le()}componentDidMount(){var e;(e=this.focusRef.current)==null||e.focus()}onChange(){let e={enabled:this.state.enabled,secure:this.state.secure};this.state.password?this.props.socket.encrypt(this.state.password).then(t=>{e.password=t,this.props.onChange(e)}):this.props.onChange(e)}render(){return h(Le,{style:st.paper,children:h(`form`,{style:st.form,noValidate:!0,autoComplete:`off`,onSubmit:e=>e.preventDefault(),children:h(f,{style:st.gridSettings,children:b(f,{container:!0,sx:{flexDirection:`column`},children:[b(f,{style:st.controlItem,children:[h(m,{control:h(s,{checked:this.state.enabled,onChange:e=>this.setState({enabled:e.target.checked},()=>this.onChange())}),label:this.props.t(`Allow slave connections`)}),h(`div`,{children:this.props.t(`When activated this host can be discovered by other iobroker installations in your network to become the master of a multihost system.`)})]}),b(f,{style:st.controlItem,children:[h(m,{control:h(s,{checked:this.state.secure,onChange:e=>this.setState({secure:e.target.checked},()=>this.onChange())}),label:this.props.t(`With password`)}),h(`div`,{children:this.props.t(`Ask password by connection establishment`)})]}),this.state.secure?h(f,{children:h(z,{variant:`standard`,label:this.props.t(`Multi-host password`),style:st.controlItem,value:this.state.password,type:`password`,slotProps:{input:{autoComplete:`new-password`},htmlInput:{autoComplete:`off`}},autoComplete:`off`,onChange:e=>this.setState({password:e.target.value},()=>this.onChange())})}):null]})})})})}};c();var U={paper:{height:`100%`,maxHeight:`100%`,maxWidth:`100%`,overflow:`auto`,padding:8},controlItem:{width:400,marginBottom:16,marginRight:8,marginLeft:8},dangerZone:{backgroundColor:`rgba(255, 165, 0, 0.05)`,border:`2px solid rgba(255, 165, 0)`,marginBottom:8},dangerZoneHeader:{background:`rgba(255, 165, 0)`,color:`#FFF`,paddingLeft:16,paddingTop:4,paddingBottom:4,marginTop:-1,marginLeft:-1},warning:e=>({p:1,fontSize:14,color:e.palette.mode===`dark`?`#ffa500`:`#b17200`})},lt=9001,ut={autoCompress:{sizeFactor:2,sizeFactorMinimumSize:25e3},throttleFS:{intervalMs:6e4,maxBufferedCommands:1e3}},dt=class e extends R{constructor(t){super(t),v(this,`focusRef`,void 0);let n=this.props.settings||{};n.options||={auth_pass:``,retry_max_delay:2e3,retry_max_count:19,db:0,family:0},n.backup||={disabled:!1,files:24,hours:48,period:120,path:``},n.jsonlOptions||=ut,n.jsonlOptions.autoCompress||=ut.autoCompress,n.jsonlOptions.throttleFS||=ut.throttleFS,this.state={type:n.type||`file`,host:Array.isArray(n.host)?n.host.join(`,`):n.host||`127.0.0.1`,port:n.port||lt,connectTimeout:n.connectTimeout||2e3,writeFileInterval:n.writeFileInterval||5e3,dataDir:n.dataDir||``,options_auth_pass:n.options.auth_pass||n.pass||``,options_retry_max_delay:n.options.retry_max_delay||2e3,options_retry_max_count:n.options.retry_max_count||19,options_db:n.options.db||0,options_family:n.options.family||0,backup_disabled:n.backup.disabled||!1,backup_files:n.backup.files||24,backup_hours:n.backup.hours||48,backup_period:n.backup.period||120,backup_path:n.backup.path||``,jsonlOptions_autoCompress_sizeFactor:n.jsonlOptions.autoCompress.sizeFactor||2,jsonlOptions_autoCompress_sizeFactorMinimumSize:n.jsonlOptions.autoCompress.sizeFactorMinimumSize||25e3,jsonlOptions_throttleFS_intervalMs:n.jsonlOptions.throttleFS.intervalMs||6e4,jsonlOptions_throttleFS_maxBufferedCommands:n.jsonlOptions.throttleFS.maxBufferedCommands||100,textIP:e.calculateTextIP(Array.isArray(n.host)?n.host.join(`,`):n.host||`127.0.0.1`),IPs:[`0.0.0.0`,`127.0.0.1`],loading:!0,showWarningDialog:!1,toConfirmType:``,originalDBType:n.type||`file`,noFileCache:n.noFileCache||!1},this.focusRef=le()}static calculateTextIP(e,t){return Array.isArray(e)||e.match(/[^.\d]/)||e.includes(`,`)?!0:t?!t.includes(e):!1}componentDidMount(){this.props.socket.getIpAddresses(this.props.currentHost).then(t=>{let n=[...t];n.includes(`0.0.0.0`)||n.push(`0.0.0.0`),n.includes(`127.0.0.1`)||n.push(`127.0.0.1`);let r=e.calculateTextIP(this.state.host,n);this.setState({IPs:n,loading:!1,textIP:r},()=>this.focusRef.current&&this.focusRef.current.focus())})}componentDidUpdate(t){if(t.settings!==this.props.settings){let t=this.props.settings||{},n=Array.isArray(t.host)?t.host.join(`,`):t.host||`127.0.0.1`;if(n!==this.state.host){let t=e.calculateTextIP(n,this.state.IPs);this.setState({host:n,textIP:t})}}}onChange(){let e={type:this.state.type,host:this.state.host,port:parseInt(this.state.port,10),noFileCache:this.state.noFileCache,connectTimeout:parseInt(this.state.connectTimeout,10),writeFileInterval:parseInt(this.state.writeFileInterval,10),dataDir:this.state.dataDir,options:{auth_pass:this.state.options_auth_pass||null,retry_max_delay:parseInt(this.state.options_retry_max_delay,10),retry_max_count:parseInt(this.state.options_retry_max_count,10),db:parseInt(this.state.options_db,10),family:parseInt(this.state.options_family,10)},backup:{disabled:this.state.backup_disabled,files:parseInt(this.state.backup_files,10),hours:parseInt(this.state.backup_hours,10),period:parseInt(this.state.backup_period,10),path:this.state.backup_path},jsonlOptions:{autoCompress:{sizeFactor:parseInt(this.state.jsonlOptions_autoCompress_sizeFactor,10),sizeFactorMinimumSize:parseInt(this.state.jsonlOptions_autoCompress_sizeFactorMinimumSize,10)},throttleFS:{intervalMs:parseInt(this.state.jsonlOptions_throttleFS_intervalMs,10),maxBufferedCommands:parseInt(this.state.jsonlOptions_throttleFS_maxBufferedCommands,10)}}};e.jsonlOptions.autoCompress.sizeFactor<2&&(e.jsonlOptions.autoCompress.sizeFactor=2),e.jsonlOptions.autoCompress.sizeFactorMinimumSize<0&&(e.jsonlOptions.autoCompress.sizeFactorMinimumSize=0),e.jsonlOptions.throttleFS.intervalMs<0&&(e.jsonlOptions.throttleFS.intervalMs=0),e.jsonlOptions.throttleFS.maxBufferedCommands<0&&(e.jsonlOptions.throttleFS.maxBufferedCommands=0),this.props.onChange(e)}renderWarning(){return this.state.showWarningDialog?h(Pe,{title:this.props.t(`Please confirm`),text:this.props.t(`switch_db_note`),onClose:e=>{if(e){let e;e=this.state.toConfirmType===`redis`?6379:lt,this.setState({type:this.state.toConfirmType||`file`,showWarningDialog:!1,port:e},()=>this.onChange())}else this.setState({showWarningDialog:!1})}}):null}render(){return b(Le,{style:U.paper,children:[this.state.loading?h(ve,{}):null,this.renderWarning(),b(f,{style:{...U.gridSettings,...U.dangerZone},children:[h(`h3`,{style:U.dangerZoneHeader,title:this.props.t(`Invalid settings in these fields could lead to dead host`),children:this.props.t(`Danger zone`)}),h(T,{component:`p`,sx:U.warning,children:this.props.t(`base_settings_hint`)}),b(f,{container:!0,sx:{flexDirection:`column`},children:[h(f,{children:h(M,{title:this.props.t(`switch_db_note`),slotProps:{popper:{sx:{pointerEvents:`none`}}},children:b(x,{style:U.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Type`)}),b(N,{variant:`standard`,value:this.state.type,onChange:e=>{if(e.target.value!==this.state.originalDBType)this.setState({toConfirmType:e.target.value,showWarningDialog:!0});else{let t;t=e.target.value===`redis`?6379:lt,this.setState({type:e.target.value,port:t},()=>this.onChange())}},children:[h(L,{value:`jsonl`,children:`JSON Lines`}),h(L,{value:`file`,children:this.props.t(`File`)}),h(L,{value:`redis`,children:`Redis`})]})]})})}),h(f,{style:{paddingLeft:8},children:h(m,{control:h(ce,{checked:this.state.textIP,onChange:e=>this.setState({textIP:e.target.checked},()=>this.onChange())}),label:this.props.t(`IP is domain or more than one address`)})}),h(f,{children:this.state.textIP?h(z,{variant:`standard`,style:U.controlItem,value:this.state.host,type:`text`,onChange:e=>this.setState({host:e.target.value},()=>this.onChange()),label:this.props.t(`Bind IP address`),helperText:this.props.t(`You can enter more than one address divided by comma`)}):b(x,{style:U.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Bind IP address`)}),h(N,{variant:`standard`,value:this.state.host,onChange:e=>this.setState({host:e.target.value},()=>this.onChange()),children:this.state.IPs.map(e=>h(L,{value:e,children:e===`0.0.0.0`?`0.0.0.0 [${this.props.t(`All addresses`)}]`:e},e))})]})}),h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.port,type:`number`,slotProps:{htmlInput:{min:1,max:65535}},onChange:e=>this.setState({port:e.target.value},()=>this.onChange()),label:this.props.t(`Port`)})}),this.state.type===`file`||this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.dataDir,helperText:this.props.t(`Optional. Always relative to iobroker.js-controller/`),onChange:e=>this.setState({dataDir:e.target.value},()=>this.onChange()),label:this.props.t(`Directory path`)})}):null,h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.options_auth_pass,type:`password`,helperText:this.props.t(`Optional`),slotProps:{input:{autoComplete:`new-password`},htmlInput:{autoComplete:`off`}},autoComplete:`off`,onChange:e=>this.setState({options_auth_pass:e.target.value},()=>this.onChange()),label:this.state.type===`redis`?this.props.t(`Redis password`):this.props.t(`Connection password`)})})]})]}),h(f,{style:U.gridSettings,children:b(f,{container:!0,sx:{flexDirection:`column`},children:[this.state.type===`file`||this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.connectTimeout,helperText:this.props.t(`ms`),type:`number`,slotProps:{htmlInput:{min:200}},onChange:e=>this.setState({connectTimeout:e.target.value},()=>this.onChange()),label:this.props.t(`Connect timeout`)})}):null,this.state.type===`file`||this.state.type===`jsonl`?h(f,{children:b(x,{component:`fieldset`,variant:`standard`,style:U.controlItem,children:[h(he,{children:h(m,{control:h(s,{checked:this.state.noFileCache,onChange:e=>this.setState({noFileCache:e.target.checked},()=>this.onChange())}),label:this.props.t(`No file cache`)})}),h(C,{children:this.props.t(`Always read files from disk and do not cache them in RAM. Used for debugging.`)})]})}):null,this.state.type===`file`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.writeFileInterval,helperText:this.props.t(`How often the data from RAM will be saved on disk in ms`),type:`number`,slotProps:{htmlInput:{min:200}},onChange:e=>this.setState({writeFileInterval:e.target.value},()=>this.onChange()),label:this.props.t(`Store file interval`)})}):null,this.state.type===`redis`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.options_retry_max_delay,type:`number`,helperText:this.props.t(`Maximum delay between connection attempts`),onChange:e=>this.setState({options_retry_max_delay:e.target.value},()=>this.onChange()),label:this.props.t(`Retry maximum delay`)})}):null,this.state.type===`redis`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.options_retry_max_count,type:`number`,helperText:this.props.t(`Maximum number of connection retries`),onChange:e=>this.setState({options_retry_max_count:e.target.value},()=>this.onChange()),label:this.props.t(`Retry maximum count`)})}):null,this.state.type===`redis`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.options_db,type:`number`,helperText:this.props.t(`Used for sentinels`),onChange:e=>this.setState({options_db:e.target.value},()=>this.onChange()),label:this.props.t(`DB number`)})}):null,this.state.type===`redis`?h(f,{children:b(x,{style:U.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Family number`)}),b(N,{variant:`standard`,value:this.state.options_family,onChange:e=>this.setState({options_family:e.target.value},()=>this.onChange()),children:[h(L,{value:0,children:`auto`}),h(L,{value:4,children:`IPv4`}),h(L,{value:6,children:`IPv6`})]}),h(C,{children:this.props.t(`Used for sentinels`)})]})}):null,this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.jsonlOptions_autoCompress_sizeFactor,type:`number`,slotProps:{htmlInput:{min:2}},helperText:this.props.t(`The JSONL DB is append-only and will contain unnecessary entries after a while.`),onChange:e=>this.setState({jsonlOptions_autoCompress_sizeFactor:e.target.value},()=>this.onChange()),label:this.props.t(`Auto-compress size factor`)})}):null,this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.jsonlOptions_autoCompress_sizeFactorMinimumSize,type:`number`,slotProps:{htmlInput:{min:0}},helperText:this.props.t(`It will be compressed when the uncompressed size is >= size * sizeFactor AND >= sizeFactorMinimumSize`),onChange:e=>this.setState({jsonlOptions_autoCompress_sizeFactorMinimumSize:e.target.value},()=>this.onChange()),label:this.props.t(`Auto-compress size factor minimum size`)})}):null,this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.jsonlOptions_throttleFS_intervalMs,type:`number`,slotProps:{htmlInput:{min:0}},helperText:this.props.t(`Write to the database file no more than every X milliseconds`),onChange:e=>this.setState({jsonlOptions_throttleFS_intervalMs:e.target.value},()=>this.onChange()),label:this.props.t(`Minimal write interval`)})}):null,this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.jsonlOptions_throttleFS_maxBufferedCommands,type:`number`,slotProps:{htmlInput:{min:0}},helperText:this.props.t(`Force writing after this many changes have been buffered. This reduces memory consumption and data loss in case of a crash`),onChange:e=>this.setState({jsonlOptions_throttleFS_maxBufferedCommands:e.target.value},()=>this.onChange()),label:this.props.t(`Maximum changes before write`)})}):null,this.state.type===`file`||this.state.type===`jsonl`?h(f,{children:b(x,{component:`fieldset`,style:U.controlItem,variant:`standard`,children:[h(he,{children:h(m,{control:h(s,{checked:this.state.backup_disabled,onChange:e=>this.setState({backup_disabled:e.target.checked},()=>this.onChange())}),label:this.props.t(`No on-the-fly backup`)})}),h(C,{children:this.props.t(`By every write the backup of object.json will be created.`)})]})}):null,(this.state.type===`file`||this.state.type===`jsonl`)&&!this.state.backup_disabled?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.backup_files,type:`number`,helperText:this.props.t(`Minimal number of backup files, after the deletion will be executed according to the backup time settings`),onChange:e=>this.setState({backup_files:e.target.value},()=>this.onChange()),label:this.props.t(`Number of files`)})}):null,(this.state.type===`file`||this.state.type===`jsonl`)&&!this.state.backup_disabled?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.backup_hours,type:`number`,helperText:this.props.t(`All backups older than these hours will be deleted, but only if the number of files is greater than of the files number`),onChange:e=>this.setState({backup_hours:e.target.value},()=>this.onChange()),label:this.props.t(`Backup hours`)})}):null,(this.state.type===`file`||this.state.type===`jsonl`)&&!this.state.backup_disabled?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.backup_period,type:`number`,helperText:this.props.t(`By default the backup is every 2 hours. Time is in minutes. To disable backup set the value to 0`),onChange:e=>this.setState({backup_period:e.target.value},()=>this.onChange()),label:this.props.t(`How often`)})}):null,(this.state.type===`file`||this.state.type===`jsonl`)&&!this.state.backup_disabled?h(f,{children:h(z,{variant:`standard`,style:U.controlItem,value:this.state.backup_path,helperText:this.props.t(`Absolute path to backup directory or empty to backup in data directory. Leave it empty for default storage place.`),onChange:e=>this.setState({backup_path:e.target.value},()=>this.onChange()),label:this.props.t(`Path`)})}):null]})})]})}};c();var W={paper:{height:`100%`,maxHeight:`100%`,maxWidth:`100%`,overflow:`auto`,padding:8},controlItem:{width:400,marginBottom:16,marginRight:8,marginLeft:8},dangerZone:{backgroundColor:`rgba(255, 165, 0, 0.05)`,border:`2px solid rgba(255, 165, 0)`,marginBottom:8},dangerZoneHeader:{background:`rgba(255, 165, 0)`,color:`#FFF`,paddingLeft:16,paddingTop:4,paddingBottom:4,marginTop:-1,marginLeft:-1},warning:e=>({p:1,fontSize:14,color:e.palette.mode===`dark`?`#ffa500`:`#b17200`})},ft=9e3,pt={autoCompress:{sizeFactor:2,sizeFactorMinimumSize:25e3},throttleFS:{intervalMs:6e4,maxBufferedCommands:1e3}},mt=class e extends R{constructor(t){super(t),v(this,`focusRef`,void 0);let n=this.props.settings||{};n.options||={auth_pass:``,retry_max_delay:2e3,retry_max_count:19,db:0,family:0},n.backup||={disabled:!1,files:24,hours:48,period:120,path:``},n.jsonlOptions||=pt,n.jsonlOptions.autoCompress||=pt.autoCompress,n.jsonlOptions.throttleFS||=pt.throttleFS,this.state={type:n.type||`file`,host:Array.isArray(n.host)?n.host.join(`,`):n.host||`127.0.0.1`,port:n.port||ft,connectTimeout:n.connectTimeout||2e3,writeFileInterval:n.writeFileInterval||5e3,dataDir:n.dataDir||``,options_auth_pass:n.options.auth_pass||n.pass||``,options_retry_max_delay:n.options.retry_max_delay||2e3,options_retry_max_count:n.options.retry_max_count||19,options_db:n.options.db||0,options_family:n.options.family||0,backup_disabled:n.backup.disabled||!1,backup_files:n.backup.files||24,backup_hours:n.backup.hours||48,backup_period:n.backup.period||120,backup_path:n.backup.path||``,jsonlOptions_autoCompress_sizeFactor:n.jsonlOptions.autoCompress.sizeFactor||2,jsonlOptions_autoCompress_sizeFactorMinimumSize:n.jsonlOptions.autoCompress.sizeFactorMinimumSize||25e3,jsonlOptions_throttleFS_intervalMs:n.jsonlOptions.throttleFS.intervalMs||6e4,jsonlOptions_throttleFS_maxBufferedCommands:n.jsonlOptions.throttleFS.maxBufferedCommands||100,textIP:e.calculateTextIP(Array.isArray(n.host)?n.host.join(`,`):n.host||`127.0.0.1`),IPs:[`0.0.0.0`,`127.0.0.1`],loading:!0,showWarningDialog:!1,toConfirmType:``,originalDBType:n.type||`file`,noFileCache:n.noFileCache||!1},this.focusRef=le()}static calculateTextIP(e,t){return Array.isArray(e)||e.match(/[^.\d]/)||e.includes(`,`)?!0:t?!t.includes(e):!1}componentDidMount(){this.props.socket.getIpAddresses(this.props.currentHost).then(t=>{let n=[...t];n.includes(`0.0.0.0`)||n.push(`0.0.0.0`),n.includes(`127.0.0.1`)||n.push(`127.0.0.1`);let r=e.calculateTextIP(Array.isArray(this.state.host)?this.state.host[0]:this.state.host,n);this.setState({IPs:n,loading:!1,textIP:r},()=>this.focusRef.current&&this.focusRef.current.focus())})}componentDidUpdate(t){if(t.settings!==this.props.settings){let t=this.props.settings||{},n=Array.isArray(t.host)?t.host.join(`,`):t.host||`127.0.0.1`;if(n!==this.state.host){let t=e.calculateTextIP(n,this.state.IPs);this.setState({host:n,textIP:t})}}}onChange(){let e={type:this.state.type,host:this.state.host,port:parseInt(this.state.port,10),noFileCache:this.state.noFileCache,connectTimeout:parseInt(this.state.connectTimeout,10),writeFileInterval:parseInt(this.state.writeFileInterval,10),dataDir:this.state.dataDir,options:{auth_pass:this.state.options_auth_pass||null,retry_max_delay:parseInt(this.state.options_retry_max_delay,10),retry_max_count:parseInt(this.state.options_retry_max_count,10),db:parseInt(this.state.options_db,10),family:parseInt(this.state.options_family,10)},backup:{disabled:this.state.backup_disabled,files:parseInt(this.state.backup_files,10),hours:parseInt(this.state.backup_hours,10),period:parseInt(this.state.backup_period,10),path:this.state.backup_path},jsonlOptions:{autoCompress:{sizeFactor:parseInt(this.state.jsonlOptions_autoCompress_sizeFactor,10),sizeFactorMinimumSize:parseInt(this.state.jsonlOptions_autoCompress_sizeFactorMinimumSize,10)},throttleFS:{intervalMs:parseInt(this.state.jsonlOptions_throttleFS_intervalMs,10),maxBufferedCommands:parseInt(this.state.jsonlOptions_throttleFS_maxBufferedCommands,10)}}};e.jsonlOptions.autoCompress.sizeFactor<2&&(e.jsonlOptions.autoCompress.sizeFactor=2),e.jsonlOptions.autoCompress.sizeFactorMinimumSize<0&&(e.jsonlOptions.autoCompress.sizeFactorMinimumSize=0),e.jsonlOptions.throttleFS.intervalMs<0&&(e.jsonlOptions.throttleFS.intervalMs=0),e.jsonlOptions.throttleFS.maxBufferedCommands<0&&(e.jsonlOptions.throttleFS.maxBufferedCommands=0),this.props.onChange(e)}renderWarning(){return this.state.showWarningDialog?h(Pe,{title:this.props.t(`Please confirm`),text:this.props.t(`switch_db_note`),onClose:e=>{if(e){let e;e=this.state.toConfirmType===`redis`?6379:ft,this.setState({type:this.state.toConfirmType||`file`,showWarningDialog:!1,port:e},()=>this.onChange())}else this.setState({showWarningDialog:!1})}}):null}render(){return b(Le,{style:W.paper,children:[this.state.loading?h(ve,{}):null,this.renderWarning(),b(f,{style:{...W.gridSettings,...W.dangerZone},children:[h(`h3`,{style:W.dangerZoneHeader,title:this.props.t(`Invalid settings in these fields could lead to dead host`),children:this.props.t(`Danger zone`)}),h(T,{component:`p`,sx:W.warning,children:this.props.t(`base_settings_hint`)}),b(f,{container:!0,sx:{flexDirection:`column`},children:[h(f,{children:h(M,{title:this.props.t(`switch_db_note`),slotProps:{popper:{sx:{pointerEvents:`none`}}},children:b(x,{style:W.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Type`)}),b(N,{variant:`standard`,value:this.state.type,onChange:e=>{if(e.target.value!==this.state.originalDBType)this.setState({toConfirmType:e.target.value,showWarningDialog:!0});else{let t;t=e.target.value===`redis`?6379:ft,this.setState({type:e.target.value,port:t},()=>this.onChange())}},children:[h(L,{value:`jsonl`,children:`JSON Lines`}),h(L,{value:`file`,children:this.props.t(`File`)}),h(L,{value:`redis`,children:`Redis`})]})]})})}),h(f,{style:{paddingLeft:8},children:h(m,{control:h(ce,{checked:this.state.textIP,onChange:e=>this.setState({textIP:e.target.checked},()=>this.onChange())}),label:this.props.t(`IP is domain or more than one address`)})}),h(f,{children:this.state.textIP?h(z,{variant:`standard`,style:W.controlItem,value:this.state.host,type:`text`,onChange:e=>this.setState({host:e.target.value},()=>this.onChange()),label:this.props.t(`Bind IP address`),helperText:this.props.t(`You can enter more than one address divided by comma`)}):b(x,{style:W.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Bind IP address`)}),h(N,{variant:`standard`,value:this.state.host,onChange:e=>this.setState({host:e.target.value},()=>this.onChange()),children:this.state.IPs.map(e=>h(L,{value:e,children:e===`0.0.0.0`?`0.0.0.0 [${this.props.t(`All addresses`)}]`:e},e))})]})}),h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.port,type:`number`,slotProps:{htmlInput:{min:1,max:65535}},onChange:e=>this.setState({port:e.target.value},()=>this.onChange()),label:this.props.t(`Port`)})}),this.state.type===`file`||this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.dataDir,helperText:this.props.t(`Optional. Always relative to iobroker.js-controller/`),onChange:e=>this.setState({dataDir:e.target.value},()=>this.onChange()),label:this.props.t(`Directory path`)})}):null,h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.options_auth_pass,type:`password`,helperText:this.props.t(`Optional`),slotProps:{input:{autoComplete:`new-password`},htmlInput:{autoComplete:`off`}},autoComplete:`off`,onChange:e=>this.setState({options_auth_pass:e.target.value},()=>this.onChange()),label:this.state.type===`redis`?this.props.t(`Redis password`):this.props.t(`Connection password`)})})]})]}),h(f,{style:W.gridSettings,children:b(f,{container:!0,sx:{flexDirection:`column`},children:[this.state.type===`file`||this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.connectTimeout,helperText:this.props.t(`ms`),type:`number`,slotProps:{htmlInput:{min:200}},onChange:e=>this.setState({connectTimeout:e.target.value},()=>this.onChange()),label:this.props.t(`Connect timeout`)})}):null,this.state.type===`file`||this.state.type===`jsonl`?h(f,{children:b(x,{component:`fieldset`,variant:`standard`,style:W.controlItem,children:[h(he,{children:h(m,{control:h(s,{checked:this.state.noFileCache,onChange:e=>this.setState({noFileCache:e.target.checked},()=>this.onChange())}),label:this.props.t(`No file cache`)})}),h(C,{children:this.props.t(`Always read files from disk and do not cache them in RAM. Used for debugging.`)})]})}):null,this.state.type===`file`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.writeFileInterval,helperText:this.props.t(`How often the data from RAM will be saved on disk in ms`),type:`number`,slotProps:{htmlInput:{min:200}},onChange:e=>this.setState({writeFileInterval:e.target.value},()=>this.onChange()),label:this.props.t(`Store file interval`)})}):null,this.state.type===`redis`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.options_retry_max_delay,type:`number`,helperText:this.props.t(`Maximum delay between connection attempts`),onChange:e=>this.setState({options_retry_max_delay:e.target.value},()=>this.onChange()),label:this.props.t(`Retry maximum delay`)})}):null,this.state.type===`redis`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.options_retry_max_count,type:`number`,helperText:this.props.t(`Maximum number of connection retries`),onChange:e=>this.setState({options_retry_max_count:e.target.value},()=>this.onChange()),label:this.props.t(`Retry maximum count`)})}):null,this.state.type===`redis`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.options_db,type:`number`,helperText:this.props.t(`Used for sentinels`),onChange:e=>this.setState({options_db:e.target.value},()=>this.onChange()),label:this.props.t(`DB number`)})}):null,this.state.type===`redis`?h(f,{children:b(x,{style:W.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Family number`)}),b(N,{variant:`standard`,value:this.state.options_family,onChange:e=>this.setState({options_family:e.target.value},()=>this.onChange()),children:[h(L,{value:0,children:`auto`}),h(L,{value:4,children:`IPv4`}),h(L,{value:6,children:`IPv6`})]}),h(C,{children:this.props.t(`Used for sentinels`)})]})}):null,this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.jsonlOptions_autoCompress_sizeFactor,type:`number`,slotProps:{htmlInput:{min:2}},helperText:this.props.t(`The JSONL DB is append-only and will contain unnecessary entries after a while.`),onChange:e=>this.setState({jsonlOptions_autoCompress_sizeFactor:e.target.value},()=>this.onChange()),label:this.props.t(`Auto-compress size factor`)})}):null,this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.jsonlOptions_autoCompress_sizeFactorMinimumSize,type:`number`,slotProps:{htmlInput:{min:0}},helperText:this.props.t(`It will be compressed when the uncompressed size is >= size * sizeFactor AND >= sizeFactorMinimumSize`),onChange:e=>this.setState({jsonlOptions_autoCompress_sizeFactorMinimumSize:e.target.value},()=>this.onChange()),label:this.props.t(`Auto-compress size factor minimum size`)})}):null,this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.jsonlOptions_throttleFS_intervalMs,type:`number`,slotProps:{htmlInput:{min:0}},helperText:this.props.t(`Write to the database file no more than every X milliseconds`),onChange:e=>this.setState({jsonlOptions_throttleFS_intervalMs:e.target.value},()=>this.onChange()),label:this.props.t(`Minimal write interval`)})}):null,this.state.type===`jsonl`?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.jsonlOptions_throttleFS_maxBufferedCommands,type:`number`,slotProps:{htmlInput:{min:0}},helperText:this.props.t(`Force writing after this many changes have been buffered. This reduces memory consumption and data loss in case of a crash`),onChange:e=>this.setState({jsonlOptions_throttleFS_maxBufferedCommands:e.target.value},()=>this.onChange()),label:this.props.t(`Maximum changes before write`)})}):null,this.state.type===`file`||this.state.type===`jsonl`?h(f,{children:b(x,{component:`fieldset`,style:W.controlItem,variant:`standard`,children:[h(he,{children:h(m,{control:h(s,{checked:this.state.backup_disabled,onChange:e=>this.setState({backup_disabled:e.target.checked},()=>this.onChange())}),label:this.props.t(`No on-the-fly backup`)})}),h(C,{children:this.props.t(`By every write the backup of object.json will be created.`)})]})}):null,(this.state.type===`file`||this.state.type===`jsonl`)&&!this.state.backup_disabled?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.backup_files,type:`number`,helperText:this.props.t(`Minimal number of backup files, after the deletion will be executed according to the backup time settings`),onChange:e=>this.setState({backup_files:e.target.value},()=>this.onChange()),label:this.props.t(`Number of files`)})}):null,(this.state.type===`file`||this.state.type===`jsonl`)&&!this.state.backup_disabled?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.backup_hours,type:`number`,helperText:this.props.t(`All backups older than these hours will be deleted, but only if the number of files is greater than of the files number`),onChange:e=>this.setState({backup_hours:e.target.value},()=>this.onChange()),label:this.props.t(`Backup hours`)})}):null,(this.state.type===`file`||this.state.type===`jsonl`)&&!this.state.backup_disabled?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.backup_period,type:`number`,helperText:this.props.t(`By default the backup is every 2 hours. Time is in minutes. To disable backup set the value to 0`),onChange:e=>this.setState({backup_period:e.target.value},()=>this.onChange()),label:this.props.t(`How often`)})}):null,(this.state.type===`file`||this.state.type===`jsonl`)&&!this.state.backup_disabled?h(f,{children:h(z,{variant:`standard`,style:W.controlItem,value:this.state.backup_path,helperText:this.props.t(`Absolute path to backup directory or empty to backup in data directory. Leave it empty for default storage place.`),onChange:e=>this.setState({backup_path:e.target.value},()=>this.onChange()),label:this.props.t(`Path`)})}):null]})})]})}},ht=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAbCAYAAADMIInqAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAiPSURBVFhH7Zd7UFTXGcDPvXffy8IusMsbQUEgoyiKD4pBnoKgVkoRX1WpNia2QZ2MzFTS2MykmlqiMzWJqSUxJq1KG0VrE0GxqSgSNVEx4SEaAeXNLrDsLvve2+/cvQusgIHWf2jymzns+b5zLvd+3/nOd75DoGEsWJDLaWvrXsXhcH/S3a0ODArynqfRDLRptfo6qVRcRdOGww8fftbGTv+/YNAB/v4ZsSrVQJHBYAunaVb5BBwOMri58farVI9eR+iejVVPakj8x8dn6cKWlv5zev3YxmMsFiRQqYyv8fleb+XnH2CenexQ2JCqqroLRiMKYHWIzyctLi680ujo4Aa93nDfbDZ72WxIYB/FQUMsbG5+VNHf/6DRrpu8kFeu3EnRaKzhrIxEIq5ZLhdHqdUXMior31+mVJ5fFhKiiBCLqXp2CrJaETKbyTxWnNSQtbWP5w4Pe3d30cWWln9+w4oMdXV/bw8K8tgLZoNkYZpeb5zLDE5yIJ7n7EZI8jtWRl5eLl91dn4azYqDxMZu4ldWVrqxaQMgIAnWK1lhkODgDLHNRuVqNIYMiJQ5Wq0JnCocsFjM/w4PD/ikqurop+zUUYHnY8xmIs9mIxI7O7V4QSDajJc8PEQfZ2fHXyguPhPa2KiLwXNJklLZbDf+wTw4Cr3rkUg8j5dDSYYOOyslRI8Ccs6FJP6J+XZizpz1+bduPf49M8pA0zKZ8N3U1NlvyeWuTYcOFTwlLToTGZmdcu9e9xGj0RZkzxXOEARtE4nIE/v2bdmVl7e+nVUzyGTpHKGQ+BCMXgOOG5FgKQr/tf4xPNxPUFPT8QKWeDzqlsn0rzEjsSMe+fCnCdtcFsG6DfscC0fwUZvPsp9PS3rbSoSHZ/k+eKBshAzPY8cZeDwSGnELHHJ51qyg6tWrUz5/+eW1j9jhESxevDn9xo3Gs3q9lcOqxkQm456fPj1g+fXrRyGbIHTsWAm1e/f7x1tbNauYCU+BJFE/JGRX3P9OByQgH/hpE8+XIEGE2K5kGRDKX3HL+foAWV9/qk0q5f8BDGWH7JhMNqTVWiGEbTsrKx9+uHPne80KRfrNmTPXrC0uLmXWw8HBg8dcqqtbPhgynrbKZLwTQUGibIR0yWFhnoVwqpjsYxCavaalarX6JVZE+/Z9tKS1td/JeD6f6AkOdi9FyPBmYKC0xh4BCDmMnwi6m1pk7hx8PYPQoNzfdSYujQ2MJCowUHQQPuJFCD+uXTc6sAJwUlAfgHO2InQZZ0SoI9JWt7frTzATwJEyGf/V3t6Lg3kFM2/ez1Lv3HlcajbbHe3pKap9553tkTk5aVZPz7RLSqU+kRkAKIq+BnljRXd3mQrLOEKOHy/PraioP6zXWwYjbLwRgPukkEL86SKnrUCI3S87bdTZs1dFNTX1boOhLEheMotl7O3v4cHfq1JdKMB9L6/0k52duhzcFwhI4+bNSTEkSTiVzFwuhywqKr/a32+aimU4blFUlL9XWFiQ9dSpqna12sA4nsslLYsXh0WXl79XjeXhBAdnHmps7PkVK07IAc6A2YSwhDM1ZpOTAxyUlFwSFxS8PVWpHIi3Wul4CO2EgQGLjB1mgPygjYz0nvbllye7CGJRBU1Tz2M9GA4RIGTmPEl/vxEyOrPtAfzb62XvSzuh0GZ6kO1rVKrzMxjhCcLCVkY0NPTU0rT9s/87B1CwqrzXBJk7C6V5ew2jlrOZmUm62tqSr7u6yg7BKmeFhMgVvr4SOCmGIgJyhItAIEjCfZp2GIX3KI3gTjFqGzIeg/8XlrHhQ+swZYqc7Y3Ez0+uFQqdcvXEILg6QiTP8v5c/wY2nlGtWZO/A380Bq8evOQvhYW7Rpzvu3Yd4BQVlTX39hp8WRVyc+Nvg4rxMIcTV2GxEEwEgAt0kHb+bO+PDZfLRb6+fr9pbm6AjYkjwJ7lpFJBTV9f2agREBW1NqK6urUWEiHDhCKA5tynvGf+VH7y9l1GduDvv0KPUBx4wN7k8uRUdsgJcADl4pLcAAcezMMtjl6wYAOTyYODV5506Pn8BGtW1o6ZzEPjIDd3j6tYnNzjeJ7LjTfHxm6cxQ474eGRCrdQx/sX0zxe4lfs0KhgB0CjO+Kos6r8nMG7znBIqNDO2EPQ3uC2V7h8+Q6nFcjKeoW4cuXuL3U6UyirgqsxaZNIRJW47+rK+8SxPaAIIq9evf9qQsJWp6MyJeVFF6Ew7ixCMfdwEwhi6yIjV8iOHn29381NeJudBtuE5lRWfvvuxo17IlgVKir6G7VkyUtbIA9B1ToBbIgmKOkBzozkHI/9xY9ZrRPEwoUb5l+/3nwN7gODHwz3fo1C4XpDpdLcNJstkLH5cZAIfwQJkZ2BjzHBZaWyLJ4VIXSTIXTNz+E+Ab6E2uJqQIDk47t3v33o7i71s9l4+X19RmYco1AIz3R1lWbifkzMhqVffNH0mSO5YSQSnkUs5pbDTbSZz+c/DxXic8Pfj/muLTAemDdGR6974/btlgJ8yxsfliaFQpIABjSxCuyAGSYTfRNWib02Pw1zvUQijtdoLsLet+Pnl36ktVX7C/aTxsWzcABzCqxbt2TP3LlTdkC1ph6e6Z8EanlIfLxrYrEoebjxmL6+8m9cXbmLoAgC/ej/Az/v4SG4A9Vd4nDjMf7+XtvCwhR/5XDwJWskoIdj0Ou0XO7Cap4NTu7Ozv61d0tLx4aamuZZUqlrUm+vjhmXSPidXC5V7evrfnrTprTzW7fmMEfIaCQnbxHX1bWt7OnRZXh6ypLUah0SiwUDRqPxWmCg/Nz8+aGnjxz5rXNdOgyIxpj2dvULcNOLV6sHRJ6erkip7CkJDQ06tX37j+/n5xc1dnRomLnPIgImFVASB3h7L4PwGt8pMB5GLYS+T/zgAPb3e8sPDmB/Jw34voKPREf730DoP5pKhvU07RMQAAAAAElFTkSuQmCC`;c();var G={paper:{height:`100%`,maxHeight:`100%`,maxWidth:`100%`,overflow:`hidden`,padding:8},gridSettings:e=>({height:`calc(100% - ${e.mixins.toolbar.minHeight}px)`,width:`100%`,overflow:`auto`}),controlItem:{width:400,marginBottom:16,marginRight:8,marginLeft:8},delButton:{position:`absolute`,top:2,right:48},addButton:{marginRight:8},buttonIcon:{height:24},headingIcon:{height:24,marginRight:8}},gt=class extends R{constructor(e){super(e),v(this,`focusRef`,void 0);let t=this.props.settings||{};t.transport||={},Object.keys(t.transport).forEach(e=>{var n;if((n=t.transport)!=null&&n[e]){if(t.transport[e].type===`file`){let n=t.transport[e].maxSize,r=typeof n==`string`?n.includes(`k`)?.1:n.includes(`g`)?10:1:1;t.transport[e].maxSize=(parseInt(t.transport[e].maxSize,10)||0)*r,t.transport[e].level=t.transport[e].level||``,t.transport[e].maxFiles=t.transport[e].maxFiles||0}else t.transport[e].type===`syslog`?(t.transport[e].level=t.transport[e].level||``,t.transport[e].host=t.transport[e].host||``,t.transport[e].port=t.transport[e].port||0,t.transport[e].path=t.transport[e].path||``,t.transport[e].facility=t.transport[e].facility||``,t.transport[e].sysLogType=t.transport[e].sysLogType||``,t.transport[e].app_name=t.transport[e].app_name||``,t.transport[e].eol=t.transport[e].eol||``):t.transport[e].type===`http`?(t.transport[e].level=t.transport[e].level||``,t.transport[e].host=t.transport[e].host||``,t.transport[e].port=t.transport[e].port||0,t.transport[e].path=t.transport[e].path||`/`,t.transport[e].auth=t.transport[e].auth||`None`,t.transport[e].ssl=t.transport[e].ssl||!1):t.transport[e].type===`stream`?(t.transport[e].stream=t.transport[e].stream||``,t.transport[e].level=t.transport[e].level||``,t.transport[e].silent=t.transport[e].silent||!1,t.transport[e].eol=t.transport[e].eol||``):t.transport[e].type===`seq`&&(t.transport[e].level=t.transport[e].level||``,t.transport[e].serverUrl=t.transport[e].serverUrl||``,t.transport[e].apiKey=t.transport[e].apiKey||``,t.transport[e].eol=t.transport[e].eol||``)}}),this.state={level:t.level||`info`,maxDays:t.maxDays||7,noStdout:t.noStdout||!0,transport:t.transport||{},expanded:[]},this.focusRef=le()}componentDidMount(){var e;(e=this.focusRef.current)==null||e.focus()}onChange(){let e={level:this.state.level,maxDays:parseInt(this.state.maxDays,10),noStdout:this.state.noStdout,transport:{}},t=e.transport;Object.keys(this.state.transport).forEach(e=>{if(t[e]=JSON.parse(JSON.stringify(this.state.transport[e])),this.state.transport[e].type===`file`){if(t[e].maxSize=parseInt(t[e].maxSize,10)||void 0,t[e].maxSize){var n;t[e].maxSize=`${(n=t[e].maxSize)==null?void 0:n.toString()}m`}t[e].maxFiles=parseInt(t[e].maxFiles,10)||void 0}else this.state.transport[e].type===`syslog`?(t[e].port||delete t[e].port,t[e].path||delete t[e].path,t[e].sysLogType||delete t[e].sysLogType,t[e].app_name||delete t[e].app_name,t[e].eol||delete t[e].eol):this.state.transport[e].type===`http`?(t[e].host=t[e].host||``,t[e].port=parseInt(t[e].port,10)||80,t[e].path=t[e].path||`/`,t[e].auth=t[e].auth||``,t[e].ssl=t[e].ssl||!1):this.state.transport[e].type===`stream`&&(t[e].stream=t[e].stream||``,t[e].level=t[e].level||`info`,t[e].silent=t[e].silent||!1,t[e].eol=t[e].eol||``)}),this.props.onChange(e)}onDelete(e){let t=JSON.parse(JSON.stringify(this.state.transport));delete t[e],this.setState({transport:t},()=>this.onChange())}renderEnabled(e){return h(f,{children:h(m,{style:G.controlItem,control:h(s,{checked:this.state.transport[e].enabled,onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].enabled=t.target.checked,this.setState({transport:n},()=>this.onChange())}}),label:this.props.t(`Enabled`)})})}renderLogLevel(e){return this.state.transport[e].enabled?h(f,{children:b(x,{style:G.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Level`)}),b(N,{variant:`standard`,value:this.state.transport[e].level||`_`,renderValue:()=>this.state.transport[e].level||this.props.t(`default`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].level=t.target.value===`_`?``:t.target.value,this.setState({transport:n},()=>this.onChange())},children:[h(L,{value:`_`,children:this.props.t(`default`)}),h(L,{value:`silly`,children:`silly`}),h(L,{value:`debug`,children:`debug`}),h(L,{value:`info`,children:`info`}),h(L,{value:`warn`,children:`warn`}),h(L,{value:`error`,children:`error`})]}),h(C,{children:this.props.t(`Level of messages that this transport should log (default: level set on parent logger)`)})]})}):null}renderSyslog(e){return b(g,{expanded:this.state.expanded.includes(e),onChange:()=>{let t=[...this.state.expanded],n=t.indexOf(e);n===-1?t.push(e):t.splice(n,1),this.setState({expanded:t})},children:[b(re,{expandIcon:h(r,{}),style:{position:`relative`,background:`rgba(128, 128, 128, 0.3)`},children:[h(Ke,{style:G.headingIcon}),h(O,{style:G.heading,children:e}),h(Ve,{size:`small`,style:G.delButton,onClick:()=>this.onDelete(e),children:h(y,{})})]}),h(j,{children:b(f,{container:!0,sx:{flexDirection:`column`},children:[this.renderEnabled(e),this.renderLogLevel(e),this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].host,helperText:this.props.t(`The host running syslogd, defaults to localhost`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].host=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`File name`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].port,type:`number`,helperText:this.props.t(`The port on the host that syslog is running on, defaults to syslogd's default port(514/UDP).`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].port=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Port`)})}):null,this.state.transport[e].enabled?h(f,{children:b(x,{style:G.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Protocol`)}),b(N,{variant:`standard`,value:this.state.transport[e].protocol,onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].protocol=t.target.value,this.setState({transport:n},()=>this.onChange())},children:[h(L,{value:`udp4`,children:`udp4`}),h(L,{value:`tcp4`,children:`tcp4`}),h(L,{value:`unix`,children:`unix`}),h(L,{value:`unix-connect`,children:`unix-connect`})]})]})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].path,helperText:this.props.t(`The path to the syslog dgram socket (i.e. /dev/log or /var/run/syslog for OS X).`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].path=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Path`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].facility,helperText:this.props.t(`Syslog facility to use (Default: local0).`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].facility=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Facility`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].localhost,helperText:this.props.t(`Host to indicate that log messages are coming from (Default: localhost).`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].localhost=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Log name`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].sysLogType,helperText:this.props.t(`The type of the syslog protocol to use (Default: BSD).`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].sysLogType=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`SysLog Type`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].app_name,helperText:this.props.t(`The name of the application (Default: process.title).`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].app_name=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Application name`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].eol,helperText:this.props.t(`The end of line character to be added to the end of the message (Default: Message without modifications).`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].eol=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`End of line char`)})}):null]})})]},e)}renderFile(e){return b(g,{expanded:this.state.expanded.includes(e),onChange:()=>{let t=[...this.state.expanded],n=t.indexOf(e);n===-1?t.push(e):t.splice(n,1),this.setState({expanded:t})},children:[b(re,{style:{background:`rgba(128, 128, 128, 0.3)`},expandIcon:h(r,{}),children:[h(we,{style:G.headingIcon}),h(O,{style:G.heading,children:e}),h(Ve,{size:`small`,style:G.delButton,onClick:()=>this.onDelete(e),children:h(y,{})})]}),h(j,{children:b(f,{container:!0,sx:{flexDirection:`column`},children:[this.renderEnabled(e),this.renderLogLevel(e),this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].filename,onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].filename=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`File name`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].fileext,onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].fileext=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`File extension`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].maxSize,type:`number`,helperText:this.props.t(`MB`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].maxSize=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Maximal size of one file`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].maxFiles,type:`number`,onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].maxFiles=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Maximal number of files`)})}):null]})})]},e)}renderHttp(e){return b(g,{expanded:this.state.expanded.includes(e),onChange:()=>{let t=[...this.state.expanded],n=t.indexOf(e);n===-1?t.push(e):t.splice(n,1),this.setState({expanded:t})},children:[b(re,{expandIcon:h(r,{}),style:{position:`relative`,background:`rgba(128, 128, 128, 0.3)`},children:[h(Ee,{style:G.headingIcon}),h(O,{style:G.heading,children:e}),h(Ve,{size:`small`,style:G.delButton,onClick:()=>this.onDelete(e),children:h(y,{})})]}),h(j,{children:b(f,{container:!0,sx:{flexDirection:`column`},children:[this.renderEnabled(e),this.renderLogLevel(e),this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].host,helperText:this.props.t(`Remote host of the HTTP logging endpoint`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].host=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Host`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].port,type:`number`,helperText:this.props.t(`Remote port of the HTTP logging endpoint`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].port=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Port`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].path,helperText:this.props.t(`Remote URI of the HTTP logging endpoint`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].path=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Path`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].auth,helperText:this.props.t(`An object representing the username and password for HTTP Basic Auth`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].auth=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Auth`)})}):null,this.state.transport[e].enabled?h(f,{children:h(m,{style:G.controlItem,control:h(s,{checked:this.state.transport[e].ssl,onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].ssl=t.target.checked,this.setState({transport:n},()=>this.onChange())}}),label:this.props.t(`SSL`)})}):null]})})]},e)}renderStream(e){return b(g,{expanded:this.state.expanded.includes(e),onChange:()=>{let t=[...this.state.expanded],n=t.indexOf(e);n===-1?t.push(e):t.splice(n,1),this.setState({expanded:t})},children:[b(re,{expandIcon:h(r,{}),style:{position:`relative`,background:`rgba(128, 128, 128, 0.3)`},children:[h(_e,{style:G.headingIcon}),h(O,{style:G.heading,children:e}),h(Ve,{size:`small`,style:G.delButton,onClick:()=>this.onDelete(e),children:h(y,{})})]}),h(j,{children:b(f,{container:!0,sx:{flexDirection:`column`},children:[this.renderEnabled(e),this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].stream,helperText:this.props.t(`any Node.js stream. If an objectMode stream is provided then the entire info object will be written. Otherwise info[MESSAGE] will be written`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].stream=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`File name`)})}):null,this.state.transport[e].enabled?h(f,{children:h(m,{style:G.controlItem,control:h(s,{checked:this.state.transport[e].silent,onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].silent=t.target.checked,this.setState({transport:n},()=>this.onChange())}}),label:this.props.t(`Silent`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].eol,helperText:this.props.t(`Line-ending character to use. (default: os.EOL).)`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].eol=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`EOL`)})}):null]})})]},e)}renderSEQ(e){return b(g,{expanded:this.state.expanded.includes(e),onChange:()=>{let t=[...this.state.expanded],n=t.indexOf(e);n===-1?t.push(e):t.splice(n,1),this.setState({expanded:t})},children:[b(re,{expandIcon:h(r,{}),style:{position:`relative`,background:`rgba(128, 128, 128, 0.3)`},children:[h(`img`,{style:G.headingIcon,src:ht,alt:`seq`}),h(O,{style:G.heading,children:e}),h(Ve,{size:`small`,style:G.delButton,onClick:()=>this.onDelete(e),children:h(y,{})})]}),h(j,{children:b(f,{container:!0,sx:{flexDirection:`column`},children:[this.renderEnabled(e),this.renderLogLevel(e),this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].serverUrl,helperText:this.props.t(`The http(s) URL including port of the seq server. If you use HTTPS a real certificate is needed; self signed certs are ot accepted.`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].serverUrl=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`Server URL`)})}):null,this.state.transport[e].enabled?h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.transport[e].apiKey,helperText:this.props.t(`The apiKey of the seq system`),onChange:t=>{let n=JSON.parse(JSON.stringify(this.state.transport));n[e].apiKey=t.target.value,this.setState({transport:n},()=>this.onChange())},label:this.props.t(`API key`)})}):null]})})]},e)}findFreeName(e){for(let t=1;;t++)if(!Object.keys(this.state.transport).find(n=>n===e+t))return e+t}add(e){if(e===`file`){let t=this.findFreeName(e),n=JSON.parse(JSON.stringify(this.state.transport));n[t]={type:e,enabled:!0,filename:`log/iobroker`,fileext:`.log`,maxSize:0,maxFiles:0},this.setState({transport:n},()=>this.onChange())}else if(e===`syslog`){let t=this.findFreeName(e),n=JSON.parse(JSON.stringify(this.state.transport));n[t]={type:e,enabled:!0,host:`127.0.0.1`,port:0,protocol:`udp4`,path:``,facility:``,localhost:`iobroker`,sysLogType:``,app_name:``,eol:``},this.setState({transport:n},()=>this.onChange())}else if(e===`http`){let t=this.findFreeName(e),n=JSON.parse(JSON.stringify(this.state.transport));n[t]={type:e,enabled:!0,host:`127.0.0.1`,port:80,path:`/`,auth:`None`,ssl:!1},this.setState({transport:n},()=>this.onChange())}else if(e===`stream`){let t=this.findFreeName(e),n=JSON.parse(JSON.stringify(this.state.transport));n[t]={type:e,enabled:!0,stream:`/dev/null`,level:`info`,silent:!1,eol:``},this.setState({transport:n},()=>this.onChange())}else if(e===`seq`){let t=this.findFreeName(e),n=JSON.parse(JSON.stringify(this.state.transport));n[t]={type:e,enabled:!0,level:`info`,serverUrl:`http://IP:PORT`,apiKey:``},this.setState({transport:n},()=>this.onChange())}}render(){return b(Le,{style:G.paper,children:[h(f,{sx:G.gridSettings,children:b(f,{container:!0,sx:{flexDirection:`column`},children:[h(f,{children:b(x,{style:G.controlItem,variant:`standard`,children:[h(w,{children:this.props.t(`Level`)}),b(N,{variant:`standard`,value:this.state.level,onChange:e=>this.setState({level:e.target.value},()=>this.onChange()),children:[h(L,{value:`silly`,children:`silly`}),h(L,{value:`debug`,children:`debug`}),h(L,{value:`info`,children:`info`}),h(L,{value:`warn`,children:`warn`}),h(L,{value:`error`,children:`error`})]})]})}),h(f,{children:h(z,{variant:`standard`,style:G.controlItem,value:this.state.maxDays,helperText:this.props.t(`Every day one file`),type:`number`,onChange:e=>this.setState({maxDays:e.target.value},()=>this.onChange()),label:this.props.t(`Maximum number of days`)})}),h(f,{children:h(m,{style:G.controlItem,control:h(s,{checked:this.state.noStdout,onChange:e=>this.setState({noStdout:e.target.checked},()=>this.onChange())}),label:this.props.t(`No stdout outputs`)})}),Object.keys(this.state.transport).map(e=>{switch(this.state.transport[e].type){case`syslog`:return this.renderSyslog(e);case`file`:return this.renderFile(e);case`http`:return this.renderHttp(e);case`stream`:return this.renderStream(e);case`seq`:return this.renderSEQ(e);default:return null}})]})}),b(Ae,{children:[b(E,{color:`grey`,style:G.addButton,variant:`contained`,onClick:()=>this.add(`file`),startIcon:h(Re,{}),children:[h(we,{style:G.buttonIcon}),this.props.t(`File log`)]}),b(E,{color:`grey`,style:G.addButton,variant:`contained`,onClick:()=>this.add(`syslog`),startIcon:h(Re,{}),children:[h(Ke,{style:G.buttonIcon}),this.props.t(`Syslog`)]}),b(E,{color:`grey`,style:G.addButton,variant:`contained`,onClick:()=>this.add(`http`),startIcon:h(Re,{}),children:[h(Ee,{style:G.buttonIcon}),this.props.t(`HTTP log`)]}),b(E,{color:`grey`,style:G.addButton,variant:`contained`,onClick:()=>this.add(`stream`),startIcon:h(Re,{}),children:[h(_e,{style:G.buttonIcon}),this.props.t(`Stream log`)]}),b(E,{color:`grey`,style:G.addButton,variant:`contained`,onClick:()=>this.add(`seq`),startIcon:h(Re,{}),children:[h(`img`,{src:ht,style:G.buttonIcon,alt:`seq`}),this.props.t(`SEQ log`)]})]})]})}},_t={paper:{height:`100%`,maxHeight:`100%`,maxWidth:`100%`,overflow:`auto`,padding:8},title:{width:`100%`,height:32},divWithoutTitle:{width:`100%`,height:`calc(100% - 32px)`,border:`2px solid #00000000`},error:{border:`2px solid #FF0000`}},vt=class extends R{constructor(e){super(e),this.state={settings:JSON.stringify(this.props.settings||{},null,2),error:!1}}onChange(e){let t={settings:e};try{let n=JSON.parse(e);this.state.error&&(t.error=!1),this.setState(t,()=>this.props.onChange(n))}catch{t.error=!0,this.setState(t)}}render(){return b(Le,{style:_t.paper,children:[h(`div`,{style:_t.title,children:this.props.t(`For future use`)}),h(`div`,{style:{..._t.divWithoutTitle,...this.state.error?_t.error:void 0},children:h(Ye,{themeType:this.props.themeType,value:this.state.settings,onChange:e=>this.onChange(e)})})]})}};c();var K={content:{height:500,overflow:`hidden`},tabPanel:e=>({width:`100%`,height:`calc(100% - ${e.mixins.toolbar.minHeight}px)`,overflow:`auto`}),selected:e=>({color:e.palette.mode===`dark`?`#FFF !important`:`#222 !important`})},yt=[`system`,`multihost`,`objects`,`states`,`log`,`plugins`],bt=class extends R{constructor(e){super(e),v(this,`originalSettings`,void 0);let t=A.getLocation(),n=t.tab===`tab-hosts`&&t.dialog===`base-settings`&&t.id===e.currentHost?yt.indexOf(t.arg):-1;this.state={currentTab:n>=0?n:0,hasChanges:[],currentHost:this.props.currentHost,loading:!0,confirmExit:!1,showRestart:!1,system:null,multihostService:null,objects:null,states:null,log:null,plugins:null,dnsResolution:`ipv4first`,dataDir:``,saving:!1}}isRouted(){let e=A.getLocation();return e.tab===`tab-hosts`&&e.dialog===`base-settings`&&e.id===this.props.currentHost}async componentDidMount(){await this.getSettings(this.state.currentHost),this.isRouted()&&A.getLocation().arg!==yt[this.state.currentTab]&&A.doNavigate(null,null,null,yt[this.state.currentTab])}renderDialogConfirm(){return this.state.confirmExit?h(Pe,{text:this.props.t(`Discard unsaved changes?`),onClose:e=>this.setState({confirmExit:!1},()=>e&&this.props.onClose())}):null}renderRestartDialog(){return this.state.showRestart?h(Pe,{title:this.props.t(`Please confirm`),text:b(S,{children:[h(`div`,{children:this.props.t(`Restart works only if controller started as system service.`)}),h(`div`,{children:this.props.t(`Would you like to restart the controller for your changes to take effect?`)})]}),ok:this.props.t(`Restart`),cancel:this.props.t(`No restart`),onClose:e=>this.setState({showRestart:!1},()=>{e&&this.props.socket.restartController(this.props.currentHost).then(()=>setTimeout(()=>window.location.reload(),500)).catch(e=>window.alert(`Cannot restart: ${e}`)),this.props.onClose()})}):null}async getSettings(e){let t=await this.props.socket.readBaseSettings(e||this.state.currentHost);t!=null&&t.config&&(this.originalSettings=B.clone(t.config),this.setState({loading:!1,system:t.config.system,multihostService:t.config.multihostService,objects:t.config.objects,states:t.config.states,log:t.config.log,plugins:t.config.plugins,dnsResolution:t.config.dnsResolution||`ipv4first`,dataDir:t.config.dataDir}))}onSave(e){let t={system:this.state.system,multihostService:this.state.multihostService,objects:this.state.objects,states:this.state.states,log:this.state.log,plugins:this.state.plugins},n={...this.originalSettings,...t};this.setState({saving:!0},()=>{this.props.socket.writeBaseSettings(e||this.state.currentHost,n).then(()=>{this.originalSettings=JSON.parse(JSON.stringify(t)),this.setState({hasChanges:[],showRestart:!0,saving:!1})}).catch(e=>{window.alert(`Cannot save settings: ${e}`),this.setState({saving:!1})})})}updateSettings(e,t){let n=[...this.state.hasChanges],r=JSON.stringify(this.originalSettings[e])!==JSON.stringify(t),i=n.indexOf(e);r&&i===-1?n.push(e):!r&&i!==-1&&n.splice(i,1),this.setState({[e]:t,hasChanges:n})}renderSystem(){let e=`system`;return h(ot,{settings:this.state[e]||{},t:this.props.t,currentHost:this.props.currentHost,onChange:t=>this.updateSettings(e,t)})}renderMultihost(){let e=`multihostService`;return h(ct,{settings:this.state[e]||{},t:this.props.t,socket:this.props.socket,onChange:t=>this.updateSettings(e,t)})}renderObjects(){let e=`objects`;return h(dt,{settings:this.state[e]||{},t:this.props.t,socket:this.props.socket,currentHost:this.props.currentHost,onChange:t=>this.updateSettings(e,t)})}renderStates(){let e=`states`;return h(mt,{settings:this.state[e]||{},t:this.props.t,socket:this.props.socket,currentHost:this.props.currentHost,onChange:t=>this.updateSettings(e,t)})}renderLog(){return h(gt,{settings:this.state.log||{},t:this.props.t,onChange:e=>this.updateSettings(`log`,e)})}renderPlugins(){let e=`plugins`;return h(vt,{settings:this.state[e]||{},t:this.props.t,themeType:this.props.themeType,onChange:t=>this.updateSettings(e,t)})}render(){return b(De,{style:K.dialog,open:!0,onClose:()=>!1,fullWidth:!0,maxWidth:`xl`,"aria-labelledby":`base-settings-dialog-title`,children:[b(u,{id:`base-settings-dialog-title`,children:[this.props.t(`Host Base Settings`),`: `,this.props.currentHostName||this.props.currentHost]}),b(oe,{style:K.content,children:[h(be,{position:`static`,children:b(Se,{value:this.state.currentTab,onChange:(e,t)=>{this.setState({currentTab:t}),this.isRouted()&&A.doNavigate(null,null,null,yt[t])},"aria-label":`system tabs`,indicatorColor:`secondary`,children:[h(n,{label:this.props.t(`System`),id:`system-tab`,"aria-controls":`simple-tabpanel-0`,sx:{"&.Mui-selected":K.selected}}),h(n,{label:this.props.t(`Multi-host`),id:`multihost-tab`,sx:{"&.Mui-selected":K.selected},"aria-controls":`simple-tabpanel-1`}),h(n,{label:this.props.t(`Objects`),id:`objects-tab`,"aria-controls":`simple-tabpanel-3`,sx:{"&.Mui-selected":K.selected}}),h(n,{label:this.props.t(`States`),id:`states-tab`,"aria-controls":`simple-tabpanel-4`,sx:{"&.Mui-selected":K.selected}}),h(n,{label:this.props.t(`Log`),id:`log-tab`,"aria-controls":`simple-tabpanel-5`,sx:{"&.Mui-selected":K.selected}}),h(n,{label:this.props.t(`Plugins`),id:`plugins-tab`,"aria-controls":`simple-tabpanel-6`,sx:{"&.Mui-selected":K.selected}})]})}),this.state.loading?h(ve,{}):null,!this.state.loading&&this.state.currentTab===0?h(T,{component:`div`,sx:K.tabPanel,children:this.renderSystem()}):null,!this.state.loading&&this.state.currentTab===1?h(T,{component:`div`,sx:K.tabPanel,children:this.renderMultihost()}):null,!this.state.loading&&this.state.currentTab===2?h(T,{component:`div`,sx:K.tabPanel,children:this.renderObjects()}):null,!this.state.loading&&this.state.currentTab===3?h(T,{component:`div`,sx:K.tabPanel,children:this.renderStates()}):null,!this.state.loading&&this.state.currentTab===4?h(T,{component:`div`,sx:K.tabPanel,children:this.renderLog()}):null,!this.state.loading&&this.state.currentTab===5?h(T,{component:`div`,sx:K.tabPanel,children:this.renderPlugins()}):null,this.renderDialogConfirm(),this.renderRestartDialog()]}),b(ae,{children:[h(E,{variant:`contained`,disabled:!this.state.hasChanges.length||this.state.saving,onClick:()=>this.onSave(),color:`primary`,startIcon:h(d,{}),children:this.props.t(`Save & Close`)}),h(E,{variant:`contained`,color:`grey`,disabled:this.state.saving,onClick:()=>this.state.hasChanges.length?this.setState({confirmExit:!0}):this.props.onClose(),startIcon:h(P,{}),children:this.state.hasChanges.length?this.props.t(`Cancel`):this.props.t(`Close`)})]})]})}};c();var q={error:{border:`2px solid #FF0000`},id:{fontStyle:`italic`},dialog:{height:`calc(100% - 64px)`},button:{marginTop:20,marginLeft:8},funcDivEdit:{width:`100%`},funcEditName:{display:`inline-block`,width:85},funcEdit:{width:400},marginTop:{marginTop:20},commonTabWrapper:{flexFlow:`wrap`,display:`flex`},commonWrapper:{width:500,minWidth:300},flexDrop:{width:`100%`,maxWidth:500,margin:`auto`,display:`flex`},marginBlock:{marginTop:20},buttonAdd:{minWidth:150},textField:{width:`100%`},flex:{display:`flex`},removeButton:{mt:`13px`,alignSelf:`flex-start`,flexShrink:0},color:{width:70},buttonRemoveWrapper:{position:`absolute`,zIndex:222,right:0},tabsPadding:{padding:`0px 24px`}},xt=class extends R{constructor(e){super(e),v(this,`originalObj`,void 0),this.state={text:JSON.stringify(this.props.obj,null,2),error:!1,changed:!1},this.originalObj=JSON.stringify(this.props.obj,null,2)}prepareObject(e){e||=this.state.text;try{let t=JSON.parse(e);return t._id=this.props.obj._id,t}catch{return null}}onChange(e){let t={text:e},n=this.prepareObject(e);n?(t.changed=this.originalObj!==JSON.stringify(n,null,2),this.state.error&&(t.error=!1)):t.error=!0,this.setState(t)}onUpdate(){try{let e=JSON.parse(this.state.text);e._id=this.props.obj._id,this.props.onClose(e)}catch{}}setCommonItem(e,t,n){e.common[t]=n,this.onChange(JSON.stringify(e,null,2))}removeCommonItem(e,t){delete e.common.common[t],this.onChange(JSON.stringify(e,null,2))}buttonAddKey(e,t){let{t:n}=this.props;return h(`div`,{style:q.marginBlock,children:h(E,{style:q.buttonAdd,variant:`contained`,color:`secondary`,onClick:t,startIcon:h(Re,{}),children:n(`Add ${e}`)})})}buttonRemoveKey(e,t){let{t:n}=this.props;return h(M,{title:n(`Remove ${e}`),slotProps:{popper:{sx:{pointerEvents:`none`}}},children:h(F,{size:`small`,sx:q.removeButton,onClick:t,children:h(P,{})})})}renderCommonEdit(){try{let e=JSON.parse(this.state.text),{t}=this.props;return b(`div`,{style:q.commonTabWrapper,children:[b(`div`,{style:q.commonWrapper,children:[e.common.title===void 0?this.buttonAddKey(`title`,()=>this.setCommonItem(e,`title`,``)):h(z,{variant:`standard`,disabled:!1,label:t(`title`),style:{...q.marginBlock,...q.textField},fullWidth:!0,value:e.common.title,onChange:t=>this.setCommonItem(e,`title`,t.target.value),slotProps:{input:{endAdornment:e.common.title?h(ne,{position:`end`,children:h(F,{tabIndex:-1,size:`small`,onClick:()=>this.setCommonItem(e,`title`,``),children:h(P,{})})}):null}}}),e.common.color===void 0?this.buttonAddKey(`color`,()=>this.setCommonItem(e,`color`,``)):b(`div`,{style:q.flex,children:[h(z,{variant:`standard`,disabled:!1,style:{...q.marginBlock,...q.color},label:t(`Color`),type:`color`,value:e.common.color,onChange:t=>this.setCommonItem(e,`color`,t.target.value),slotProps:{input:{endAdornment:e.common.color?h(ne,{position:`end`,children:h(F,{tabIndex:-1,size:`small`,onClick:()=>this.setCommonItem(e,`color`,``),children:h(P,{})})}):null}}}),this.buttonRemoveKey(`color`,()=>this.removeCommonItem(e,`color`))]})]}),e.common.icon===void 0?h(`div`,{style:q.flexDrop,children:this.buttonAddKey(`icon`,()=>this.setCommonItem(e,`icon`,``))}):b(`div`,{style:q.flexDrop,children:[h(ge,{disabled:!1,crop:!0,maxSize:262144,icon:e.common.icon,removeIconFunc:()=>this.setCommonItem(e,`icon`,``),onChange:t=>this.setCommonItem(e,`icon`,t)}),this.buttonRemoveKey(`icon`,()=>this.removeCommonItem(e,`icon`))]})]})}catch{return h(`div`,{children:this.props.t(`Cannot parse JSON!`)})}}render(){return b(De,{sx:{"& .MuiDialog-paper":q.dialog},open:!0,maxWidth:`lg`,fullWidth:!0,fullScreen:!1,onClose:()=>this.props.onClose(),"aria-labelledby":`edit-value-dialog-title`,"aria-describedby":`edit-value-dialog-description`,children:[b(u,{id:`edit-value-dialog-title`,children:[this.props.t(`Edit host settings`),`:`,h(`span`,{style:q.id,children:this.props.obj._id})]}),h(oe,{children:this.renderCommonEdit()}),b(ae,{children:[h(E,{variant:`contained`,disabled:this.state.error||!this.state.changed,onClick:()=>this.onUpdate(),color:`primary`,startIcon:h(d,{}),children:this.props.t(`Write`)}),h(E,{variant:`contained`,onClick:()=>this.props.onClose(),color:`grey`,startIcon:h(P,{}),children:this.props.t(`Cancel`)})]})]})}};c();var St=`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)`,Ct=`0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)`,wt=`
24
- @keyframes newValueAnimationHostDark {
25
- 0% {
26
- color: #00f900;
27
- }
28
- 80% {
29
- color: #008000;
30
- }
31
- 100% {
32
- color: #fff;
33
- }
34
- }
35
- @keyframes newValueAnimationHostLight {
36
- 0% {
37
- color: #00f900;
38
- }
39
- 80% {
40
- color: #008000;
41
- }
42
- 100% {
43
- color: #fff;
44
- }
45
- }
46
- .newValueHost-dark {
47
- animation: newValueAnimationHostDark 2s ease-in-out;
48
- }
49
- .newValueHost-light {
50
- animation: newValueAnimationHostLight 2s ease-in-out;
51
- }
52
- @keyframes colors {
53
- 0% {
54
- left: -51px;
55
- }
56
- 100% {
57
- left: 101%;
58
- }
59
- }
60
- @keyframes warning {
61
- 0% {
62
- opacity: 1;
63
- }
64
- 100% {
65
- opacity: 0.7;
66
- }
67
- }
68
- @keyframes red {
69
- 0% {
70
- opacity: 1;
71
- }
72
- 100% {
73
- opacity: 0.8;
74
- }
75
- }
76
- @keyframes onBlink-keys-dark {
77
- 0% {
78
- color: #264d72;
79
- }
80
- 80% {
81
- color: #3679be;
82
- }
83
- 100% {
84
- color: #fff;
85
- }
86
- }
87
- @keyframes onBlink-keys-light {
88
- 0% {
89
- color: #3679be;
90
- }
91
- 80% {
92
- color: #264d72;
93
- }
94
- 100% {
95
- color: #000;
96
- }
97
- }
98
- .onBlick-light {
99
- animation: onBlink-keys-light 2s ease-in-out;
100
- animation-iteration-count: 2;
101
- font-size: 12px;
102
- margin-left: 4px;
103
- }
104
- .onBlick-dark {
105
- animation: onBlink-keys-dark 2s ease-in-out;
106
- animation-iteration-count: 2;
107
- font-size: 12px;
108
- margin-left: 4px;
109
- }
110
- @keyframes height {
111
- 0% {
112
- height: 0;
113
- },
114
- 100% {
115
- height: 160px;
116
- }
117
- }
118
- `,J={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`}},collapseOff:{height:0},footerBlock:e=>({background:e.palette.background.default,p:`10px`,display:`flex`,justifyContent:`space-between`}),hidden:{display:`none`},emptyButton:{width:48},greenText:e=>({color:e.palette.success.dark}),wrapperAvailable:{display:`flex`,alignItems:`center`},buttonUpdate:{border:`1px solid ${ie[700]}`,padding:`2px 7px`,borderRadius:`5px`,display:`flex`,alignItems:`center`,cursor:`pointer`,transition:`background 0.5s`,"&:hover":{background:`#00800026`}},buttonUpdateIcon:{height:20,width:20,marginRight:10},debug:{backgroundColor:se[700]},info:{backgroundColor:de[700]},warn:{backgroundColor:te[700]},error:{backgroundColor:Ue[700]},smallAvatar:{width:24,height:24},formControl:{display:`flex`},baseSettingsButton:{transform:`rotate(45deg)`},tooltip:{pointerEvents:`none`}},Tt=[`silly`,`debug`,`info`,`warn`,`error`];function Et(e,t){let n=e.className.split(` `),r=n.indexOf(t);r!==-1&&(n.splice(r,1),e.className=n.join(` `)),n.push(t),setTimeout(t=>e.className=t,100,n.join(` `))}function Dt(e){return e===`debug`?h(We,{}):e===`info`?h(Fe,{}):e===`warn`?h(Ne,{}):e===`error`?h(ye,{}):null}var Y=class e extends R{constructor(t){super(t),v(this,`refEvents`,I.createRef()),v(this,`refWarning`,I.createRef()),v(this,`refCpu`,I.createRef()),v(this,`refMem`,I.createRef()),v(this,`refUptime`,I.createRef()),v(this,`outputCache`,`-`),v(this,`inputCache`,`-`),v(this,`cpuCache`,`- %`),v(this,`memCache`,`- %`),v(this,`uptimeCache`,`-`),v(this,`diskFreeCache`,1),v(this,`diskSizeCache`,1),v(this,`diskWarningCache`,1),v(this,`notificationHandler`,t=>{t!=null&&t[this.props.hostId]&&this.setState({hostNotifications:{notifications:t[this.props.hostId],...e.calculateWarning(t[this.props.hostId])}})}),v(this,`eventsInputFunc`,(e,t)=>{this.inputCache=t&&t.val!==null?`⇥${t.val}`:`-`,this.refEvents.current&&(this.refEvents.current.innerHTML=`${this.inputCache} / ${this.outputCache}`,Et(this.refEvents.current,`newValueHost-${this.props.themeType||`light`}`))}),v(this,`eventsOutputFunc`,(e,t)=>{this.outputCache=t&&t.val!==null?`↦${t.val}`:`-`,this.refEvents.current&&(this.refEvents.current.innerHTML=`${this.inputCache} / ${this.outputCache}`,Et(this.refEvents.current,`newValueHost-${this.props.themeType||`light`}`))}),v(this,`warningFunc`,(e,t)=>{e.endsWith(`diskFree`)?this.diskFreeCache=(t==null?void 0:t.val)||0:e.endsWith(`diskSize`)?this.diskSizeCache=(t==null?void 0:t.val)||0:e.endsWith(`diskWarning`)&&(this.diskWarningCache=(t==null?void 0:t.val)||0);let n=this.diskFreeCache/this.diskSizeCache*100<=this.diskWarningCache;this.refWarning.current&&(n?(this.refWarning.current.setAttribute(`title`,this.props.t(`Warning: Free space on disk is low`)),this.refWarning.current.classList.add(`warning`)):(this.refWarning.current.removeAttribute(`title`),this.refWarning.current.classList.remove(`warning`)))}),v(this,`cpuFunc`,(e,t)=>{this.cpuCache=this.formatValue(t,`%`),this.refCpu.current&&(this.refCpu.current.innerHTML=this.cpuCache,Et(this.refCpu.current,`newValueHost-${this.props.themeType||`light`}`))}),v(this,`memFunc`,(e,t)=>{this.memCache=this.formatValue(t,`%`),this.refMem.current&&(this.refMem.current.innerHTML=this.memCache,Et(this.refMem.current,`newValueHost-${this.props.themeType||`light`}`))}),v(this,`uptimeFunc`,(e,t)=>{if(t!=null&&t.val){let e=Math.floor(t.val/86400),n=Math.floor(t.val%86400/3600);this.uptimeCache=e?`${e}d${n}h`:`${n}h`}this.refUptime.current&&(this.refUptime.current.innerHTML=this.uptimeCache,Et(this.refUptime.current,`newValueHost-${this.props.themeType||`light`}`))}),v(this,`logLevelFunc`,(e,t)=>{t&&this.setState({logLevel:t.val,logLevelSelect:t.val})}),this.state={logLevel:``,logLevelSelect:``,hostNotifications:{notifications:null,warning:0,other:0},openDialogLogLevel:!1,hostUpdateDialog:!1,updateAvailable:!1,instructionDialog:!1,updateDialog:!1,baseSettingsDialog:!1,editDialog:!1,changeLog:null}}static getDerivedStateFromProps(e,t){let n=A.getLocation(),r=n.tab===`tab-hosts`&&n.id===e.hostId,i=r&&n.dialog===`settings`,a=r&&n.dialog===`base-settings`;return i!==t.editDialog||a!==t.baseSettingsDialog?{editDialog:i,baseSettingsDialog:a}:null}async getInitialDiskStates(){let e=await this.props.socket.getState(`${this.props.hostId}.diskWarning`);this.diskWarningCache=(e==null?void 0:e.val)??this.diskWarningCache;let t=await this.props.socket.getState(`${this.props.hostId}.diskFree`);this.diskFreeCache=(t==null?void 0:t.val)??this.diskFreeCache;let n=await this.props.socket.getState(`${this.props.hostId}.diskSize`);this.diskSizeCache=(n==null?void 0:n.val)??this.diskSizeCache}readChangeLog(){this.state.changeLog||fetch(Je.replace(`github.com`,`raw.githubusercontent.com`).replace(`/blob/`,`/`)).then(e=>e.text()).then(e=>this.setState({changeLog:e})).catch(e=>console.error(`Cannot read changelog: ${e}`))}componentDidMount(){this.props.hostsWorker.registerNotificationHandler(this.notificationHandler),this.props.hostsWorker.getNotifications(this.props.hostId).then(e=>this.notificationHandler(e)),this.props.socket.subscribeState(`${this.props.hostId}.inputCount`,this.eventsInputFunc),this.props.socket.subscribeState(`${this.props.hostId}.outputCount`,this.eventsOutputFunc),this.props.socket.subscribeState(`${this.props.hostId}.cpu`,this.cpuFunc),this.props.socket.subscribeState(`${this.props.hostId}.mem`,this.memFunc),this.props.socket.subscribeState(`${this.props.hostId}.uptime`,this.uptimeFunc),this.getInitialDiskStates().finally(async()=>{await this.props.socket.subscribeState(`${this.props.hostId}.diskFree`,this.warningFunc),await this.props.socket.subscribeState(`${this.props.hostId}.diskSize`,this.warningFunc),await this.props.socket.subscribeState(`${this.props.hostId}.diskWarning`,this.warningFunc)}),this.props.socket.subscribeState(`${this.props.hostId}.logLevel`,this.logLevelFunc)}componentWillUnmount(){this.props.hostsWorker.unregisterNotificationHandler(this.notificationHandler),this.props.socket.unsubscribeState(`${this.props.hostId}.inputCount`,this.eventsInputFunc),this.props.socket.unsubscribeState(`${this.props.hostId}.outputCount`,this.eventsOutputFunc),this.props.socket.unsubscribeState(`${this.props.hostId}.cpu`,this.cpuFunc),this.props.socket.unsubscribeState(`${this.props.hostId}.mem`,this.memFunc),this.props.socket.unsubscribeState(`${this.props.hostId}.uptime`,this.uptimeFunc),this.props.socket.unsubscribeState(`${this.props.hostId}.diskFree`,this.warningFunc),this.props.socket.unsubscribeState(`${this.props.hostId}.diskSize`,this.warningFunc),this.props.socket.unsubscribeState(`${this.props.hostId}.diskWarning`,this.warningFunc),this.props.socket.unsubscribeState(`${this.props.hostId}.logLevel`,this.logLevelFunc)}static calculateWarning(e){let t={warning:0,other:0};if(!e)return t;let{result:n}=e;if(!n||!n.system)return t;if(Object.keys(n.system.categories).length){let e=n.system.categories;for(let n of Object.values(e))Object.keys(n.instances).forEach(()=>n.severity===`alert`?t.warning++:t.other++)}return t}formatValue(e,t){return!e||e.val===null||e.val===void 0?`-${t?` ${t}`:``}`:this.props.systemConfig.common.isFloatComma?e.val.toString().replace(`.`,`,`)+(t?` ${t}`:``):e.val+(t?` ${t}`:``)}renderDialogLogLevel(){return this.state.openDialogLogLevel?b(et,{theme:this.props.theme,title:this.props.t(`Edit log level rule for %s`,this.props.host.common.name),onApply:()=>{this.props.socket.setState(`${this.props.hostId}.logLevel`,this.state.logLevelSelect).catch(e=>window.alert(`Cannot set log level: ${e}`)),this.setState({openDialogLogLevel:!1})},onClose:()=>this.setState({openDialogLogLevel:!1,logLevelSelect:this.state.logLevel}),children:[b(x,{style:{...J.formControl,marginTop:8},variant:`outlined`,children:[h(w,{children:this.props.t(`log level`)}),h(N,{variant:`standard`,value:this.state.logLevelSelect,fullWidth:!0,onChange:e=>this.setState({logLevelSelect:e.target.value}),children:Tt.map(e=>h(L,{value:e,children:this.props.t(e)},e))})]}),b(x,{style:J.formControl,variant:`outlined`,children:[h(C,{children:this.props.t(`Log level will be reset to the saved level after the restart of the controller`)}),b(C,{children:[this.props.t(`You can set the log level permanently in the base host settings`),h(o,{style:J.baseSettingsButton})]})]})]}):null}onCopy(){let t=[];if(this.refCpu.current&&t.push(`CPU: ${this.refCpu.current.innerHTML}`),this.refMem.current&&t.push(`RAM: ${this.refMem.current.innerHTML}`),this.refUptime.current&&t.push(`${this.props.t(`Uptime`)}: ${this.refUptime.current.innerHTML}`),t.push(`${this.props.t(`Available`)}: ${this.props.available}`),t.push(`${this.props.t(`Installed`)}: ${this.props.host.common.installedVersion}`),this.refEvents.current&&t.push(`${this.props.t(`Events`)}: ${this.refEvents.current.innerHTML}`),this.props.hostData&&typeof this.props.hostData==`object`){let n=this.props.hostData;Object.keys(n).map(r=>t.push(`${this.props.t(r)}: ${e.formatInfo[r]?e.formatInfo[r](n[r],this.props.t):n[r]||`--`}`))}p.copyToClipboard(t.join(`
119
- `)),window.alert(this.props.t(`Copied`))}renderUpdateButton(e,t){return e?h(M,{title:this.props.t(`Update`),slotProps:{popper:{sx:J.tooltip}},children:b(T,{component:`div`,onClick:e=>(e.stopPropagation(),this.openHostUpdateDialog()),sx:J.buttonUpdate,children:[h(F,{style:J.buttonUpdateIcon,size:`small`,children:h(Ce,{})}),h(`span`,{style:{color:ie[700]},children:this.props.available})]})}):h(`span`,{style:t,children:this.props.available})}renderHostBaseEdit(){return this.props.expertMode?h(M,{title:this.props.t(`Host Base Settings`),slotProps:{popper:{sx:J.tooltip}},children:h(`div`,{children:h(F,{size:`large`,disabled:!this.props.alive,onClick:e=>{e.stopPropagation(),A.doNavigate(`tab-hosts`,`base-settings`,this.props.hostId)},children:h(o,{style:J.baseSettingsButton})})})}):null}renderExtendButton(e){return h(M,{title:this.props.t(e?`collapse`:`Expand`),slotProps:{popper:{sx:J.tooltip}},children:h(`div`,{children:h(F,{size:`large`,children:h(e?ee:l,{})})})})}renderRestartButton(){return h(M,{title:this.props.t(`Restart host`),slotProps:{popper:{sx:J.tooltip}},children:h(`div`,{children:h(F,{size:`large`,disabled:!this.props.alive,onClick:e=>{e.stopPropagation(),this.props.socket.restartController(this.props.hostId).catch(e=>window.alert(`Cannot restart: ${e}`))},children:h(Ge,{})})})})}renderEditButton(){return h(F,{size:`large`,onClick:e=>{e.stopPropagation(),A.doNavigate(`tab-hosts`,`settings`,this.props.hostId)},children:h(Be,{})})}renderRemoveButton(){return!this.props.alive&&!this.props.isCurrentHost?h(M,{title:this.props.alive||this.props.isCurrentHost?this.props.t(`You cannot delete host, when it is alive`):this.props.t(`Remove`),slotProps:{popper:{sx:J.tooltip}},children:h(F,{size:`large`,onClick:e=>{e.stopPropagation(),this.props.executeCommandRemove()},children:h(y,{})})}):h(`div`,{style:J.emptyButton})}renderCopyButton(e){return h(M,{title:this.props.t(`Copy`),slotProps:{popper:{sx:J.tooltip}},children:h(F,{size:`large`,onClick:()=>this.onCopy(),style:e,children:h(D,{})})})}renderLogLevel(){return h(M,{title:`${this.props.t(`loglevel`)} ${this.state.logLevel}`,slotProps:{popper:{sx:J.tooltip}},children:h(F,{size:`large`,onClick:e=>{e.stopPropagation(),this.setState({openDialogLogLevel:!0})},children:h(Te,{style:{...J.smallAvatar,...J[this.state.logLevel]},children:Dt(this.state.logLevel)})})})}renderNotificationsBadge(e,t){return h(Oe,{sx:t?{right:-3,top:13,padding:`0 4px`,cursor:`pointer`}:{cursor:`pointer`},title:this.props.t(`Hosts notifications`),badgeContent:this.state.hostNotifications.warning+this.state.hostNotifications.other,style:J.badge,color:this.state.hostNotifications.warning>0?`error`:`secondary`,onClick:e=>{e.stopPropagation(),this.props.showAdaptersWarning({[this.props.hostId]:this.state.hostNotifications.notifications},this.props.hostId)},children:e})}async openHostUpdateDialog(){let e=await this.props.socket.checkFeatureSupported(`CONTROLLER_UI_UPGRADE`);this.setState({hostUpdateDialog:!0,updateAvailable:e}),this.readChangeLog()}renderHostUpdateDialog(){return this.state.hostUpdateDialog?h($e,{adapter:this.props.host.common.name,adapterObject:this.props.jsControllerInfo,t:this.props.t,textUpdate:this.state.updateAvailable?this.props.t(`Start update`):this.props.t(`Show instructions`),textInstruction:this.props.t(`Show whole changelog`),rightDependencies:!0,news:this.getNews(),toggleTranslation:this.props.toggleTranslation,noTranslation:this.props.noTranslation,onUpdate:()=>{this.state.updateAvailable?this.setState({hostUpdateDialog:!1,updateDialog:!0}):this.setState({hostUpdateDialog:!1,instructionDialog:!0})},theme:this.props.theme,installedVersion:this.props.host.common.installedVersion,onInstruction:()=>{window.open(Je,`_blank`)},onClose:()=>this.setState({hostUpdateDialog:!1})}):null}renderUpdateDialog(){return this.state.updateAvailable&&this.state.updateDialog?h(rt,{socket:this.props.socket,hostId:this.props.hostId,version:this.props.jsControllerInfo.version,onClose:()=>this.setState({updateDialog:!1}),adminInstance:this.props.adminInstance,onUpdating:e=>this.props.onUpdating(e),themeType:this.props.themeType}):this.state.instructionDialog?h(at,{socket:this.props.socket,hostId:this.props.hostId,version:this.props.jsControllerInfo.version,onClose:()=>this.setState({instructionDialog:!1})}):null}static extractNews(e,t){let n=e.split(`
120
- `),r=``,i=!1;for(let e=0;e<n.length;e++)if(n[e].startsWith(`## `)){if(i)break;n[e].startsWith(`## ${t}`)&&(i=!0)}else i&&(r+=`${n[e].replace(/^\*\s*/,``).replace(/^\(\w+\)\s*/,``)}\n`);return r}getNews(t){let n=this.props.jsControllerInfo,r=this.props.host.common.installedVersion,i=[],a=n==null?void 0:n.news;return r&&a&&Object.keys(a).forEach(n=>{try{if(je.gt(n,r)||t){let t=!1,r=this.props.noTranslation?a[n].en:a[n][this.props.lang]||a[n].en;if(a[n].en===`see CHANGELOG.md`&&this.state.changeLog){let i=e.extractNews(this.state.changeLog,n);i&&(r=i,t=!0)}i.push({version:n,news:r,downloaded:t})}}catch{console.warn(`Cannot compare "${n}" and "${r}" of js-controller on ${this.props.host._id}`)}}),i}baseSettingsSettingsDialog(){return this.state.baseSettingsDialog?h(bt,{currentHost:this.props.hostId,themeType:this.props.themeType,currentHostName:this.props.host.common.name,onClose:()=>A.doNavigate(`tab-hosts`),socket:this.props.socket,t:this.props.t},`base`):null}renderEditObjectDialog(){return this.state.editDialog?h(xt,{obj:this.props.host,t:this.props.t,onClose:e=>{A.doNavigate(`tab-hosts`),e&&this.props.socket.setObject(e._id,e).then(()=>this.forceUpdate()).catch(e=>alert(`Cannot write object: ${e}`))}}):null}renderDialogs(){return b(S,{children:[this.renderDialogLogLevel(),this.renderHostUpdateDialog(),this.renderUpdateDialog(),this.renderEditObjectDialog(),this.baseSettingsSettingsDialog()]})}};v(Y,`formatInfo`,{Uptime:B.formatSeconds,"System uptime":B.formatSeconds,RAM:B.formatRam,Speed:B.formatSpeed,"Disk size":B.formatBytes,"Disk free":B.formatBytes,time:e=>new Date(e).toLocaleString()});var X={...J,root:e=>({position:`relative`,m:`10px`,width:300,minHeight:200,background:e.palette.background.default,boxShadow:St,display:`flex`,flexDirection:`column`,transition:`box-shadow 0.5s`,"&:hover":{boxShadow:Ct},"& .warning":{backgroundColor:`#de0000 !important`,"&:before":{position:`absolute`,right:0,top:-5,content:`"⚠"`,fontSize:25,height:`30px`,width:`30px`,color:`black`},animation:`$warning 2.5s ease-in-out infinite alternate`}}),imageBlock:{minHeight:60,display:`flex`,padding:`0 10px 0 10px`,position:`relative`,justifyContent:`space-between`,transition:`background 0.5s`},fab:{position:`absolute`,bottom:-20,width:40,height:40,right:20},collapse:{height:`100%`,position:`absolute`,width:`100%`,zIndex:3,marginTop:`auto`,bottom:0,transition:`height 0.3s`,justifyContent:`space-between`,display:`flex`,flexDirection:`column`},collapseOff:{height:0},close:{display:`flex`,ml:`auto`,mt:`-4px`},onOffLine:{alignSelf:`center`,width:`100%`,height:4},adapter:e=>({width:`100%`,fontWeight:`bold`,fontSize:16,verticalAlign:`middle`,pl:1,pt:2,color:e.palette.mode===`dark`?`#333`:`#555`}),cardContentInfo:e=>({overflow:`auto`,paddingTop:0,backgroundColor:e.palette.background.paper,color:e.palette.mode===`dark`?`#EEE`:`#111`}),cardContentH5:{height:`100%`,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,paddingBottom:`10px !important`},marginTop10:{marginTop:10},displayFlex:{display:`flex`},marginLeft5:{marginLeft:5},enableButton:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},instanceStateNotAlive1:{backgroundColor:`rgba(192, 192, 192, 0.4)`},green:{background:`#00ce00`,position:`relative`},red:{background:`#da0000`},dotLine:{width:50,height:`100%`,background:`linear-gradient(90deg, rgba(0,206,0,0.7497373949579832) 0%, rgba(31,255,1,1) 50%, rgba(0,206,0,0.7805497198879552) 100%)`,zIndex:2,position:`absolute`,left:-11},versionDate:{alignSelf:`center`},cardContentDiv:{position:`sticky`,right:0,top:0,paddingTop:10},badge:{cursor:`pointer`},curdContentFlexCenter:{display:`flex`,alignItems:`center`,ml:`4px`},marginRight:{marginRight:`auto`},ul:{paddingTop:0,paddingBottom:0,paddingLeft:16,paddingRight:8},value:{marginLeft:5},label:{fontWeight:`bold`}},Ot=class extends Y{getHostDescriptionAll(){return this.props.hostData?typeof this.props.hostData==`string`?this.props.hostData:!this.props.hostData||typeof this.props.hostData!=`object`?h(`ul`,{style:X.ul,children:h(k,{})},`ul`):h(`ul`,{style:X.ul,children:Object.keys(this.props.hostData).map(e=>h(`li`,{children:b(`span`,{style:X.black,children:[b(`span`,{style:X.label,children:[this.props.t(e),`: `]}),h(`span`,{style:X.value,children:Y.formatInfo[e]?Y.formatInfo[e](this.props.hostData[e],this.props.t):this.props.hostData[e]||`--`})]})},e))},`ul`):h(k,{})}render(){let e=(this.props.isCurrentHost||this.props.alive)&&B.updateAvailable(this.props.host.common.installedVersion,this.props.available),t=this.getHostDescriptionAll();return b(pe,{sx:p.getStyle(this.props.theme,X.root,this.props.hidden&&X.hidden),children:[this.renderDialogs(),this.state.openCollapse&&b(`div`,{style:{...X.collapse,...this.state.openCollapse?void 0:X.collapseOff},children:[b(ze,{sx:X.cardContentInfo,children:[h(`div`,{style:X.cardContentDiv,onClick:()=>this.setState({openCollapse:!1}),children:h(F,{size:`small`,sx:X.close,onClick:()=>this.setState({openCollapse:!1}),children:h(P,{})})}),t,h(tt,{socket:this.props.socket,hostId:this.props.hostId,t:this.props.t})]}),h(T,{component:`div`,sx:X.footerBlock})]}),h(`div`,{style:{...X.onOffLine,...this.props.alive?X.green:X.red},children:this.props.alive&&h(`div`,{style:X.dotLine})}),b(`div`,{ref:this.refWarning,style:{...X.imageBlock,...this.props.alive?void 0:X.instanceStateNotAlive1,background:this.props.host.common.color||`inherit`},children:[h(me,{sx:X.img,component:`img`,image:this.props.host.common.icon||`img/no-image.svg`}),h(T,{component:`div`,style:p.getStyle(this.props.theme,X.adapter,{color:this.props.host.common.color&&p.invertColor(this.props.host.common.color,!0)||`inherit`}),children:this.renderNotificationsBadge(this.props.host.common.name,!0)}),this.state.openCollapse?null:h(Ve,{onClick:()=>this.setState({openCollapse:!0}),style:X.fab,color:`primary`,"aria-label":`add`,title:this.props.t(`Click for more`),children:h(Ie,{})})]}),b(ze,{style:X.cardContentH5,children:[h(O,{variant:`body2`,color:`textSecondary`,component:`div`,children:b(`div`,{style:X.displayFlex,children:[h(`span`,{style:X.label,children:`CPU:`}),h(`div`,{ref:this.refCpu,style:X.value,children:`- %`})]})}),h(O,{variant:`body2`,color:`textSecondary`,component:`div`,children:b(`div`,{style:X.displayFlex,children:[h(`span`,{style:X.label,children:`RAM:`}),h(`div`,{ref:this.refMem,style:X.value,children:`- %`})]})}),h(O,{variant:`body2`,color:`textSecondary`,component:`div`,children:b(`div`,{style:X.displayFlex,children:[b(`span`,{style:X.label,children:[this.props.t(`Uptime`),`:`]}),h(`div`,{ref:this.refUptime,style:X.value,children:`-d -h`})]})}),b(O,{variant:`body2`,color:`textSecondary`,component:`div`,style:X.wrapperAvailable,children:[b(`span`,{style:X.label,children:[this.props.t(`Available`),` js-controller:`]}),h(T,{component:`div`,sx:{...e?X.greenText:void 0,...X.curdContentFlexCenter},children:this.renderUpdateButton(e)})]}),b(O,{variant:`body2`,color:`textSecondary`,component:`p`,children:[b(`span`,{style:X.label,children:[this.props.t(`Installed`),` js-controller:`]}),h(`span`,{style:X.value,children:this.props.host.common.installedVersion})]}),h(O,{variant:`body2`,color:`textSecondary`,component:`div`,children:b(`div`,{style:X.displayFlex,children:[b(`span`,{style:X.label,children:[this.props.t(`Events`),`:`]}),h(`div`,{ref:this.refEvents,style:X.value,children:`- / -`})]})}),h(`div`,{style:X.marginTop10,children:b(O,{component:`span`,style:X.enableButton,children:[this.renderEditButton(),this.renderHostBaseEdit(),this.renderRestartButton(),this.props.expertMode&&this.state.logLevel&&this.renderLogLevel(),this.renderRemoveButton(),this.renderCopyButton()]})})]})]},this.props.hostId)}},Z={...J,root:e=>({position:`relative`,m:`7px`,background:e.palette.background.default,boxShadow:St,overflow:`hidden`,transition:`box-shadow 0.5s,height 0.3s`,"&:hover":{boxShadow:Ct}}),imageBlock:{marginRight:6,minHeight:60,width:`100%`,maxWidth:300,display:`flex`,padding:`0 10px 0 10px`,position:`relative`,justifyContent:`space-between`,transition:`background 0.5s`,alignItems:`baseline`},collapse:{height:`auto`,backgroundColor:`rgba(128, 128, 128, 0.1)`,width:`100%`,zIndex:3,marginTop:`auto`,bottom:0,justifyContent:`space-between`,display:`flex`,flexDirection:`column`},onOff:{alignSelf:`center`,width:4,height:`100%`},host:e=>({width:`100%`,fontWeight:`bold`,fontSize:16,paddingLeft:`8px`,alignSelf:`center`,color:e.palette.mode===`dark`?`#ddd`:`#222`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`}),cardContentH5:{height:`100%`,display:`flex`,width:`100%`,justifyContent:`space-between`,padding:`10px !important`,alignItems:`center`},marginTop10:{marginLeft:`auto`,display:`flex`},enableButton:{display:`flex`,justifyContent:`space-between`},green:{background:`#00ce00`,position:`relative`,overflow:`hidden`},dotLine:{width:10,height:20,background:`linear-gradient( rgba(0,206,0,0.7497373949579832) 0%, rgba(31,255,1,1) 50%, rgba(0,206,0,0.7805497198879552) 100%)`,zIndex:2,position:`absolute`,top:-21},red:{background:`#da0000`},flex:{flex:1,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},cardContentInfo:{overflow:`auto`,paddingTop:0,justifyContent:`center`,display:`flex`,height:`auto`,flexShrink:0,position:`relative`},cursorNoDrop:{cursor:`no-drop !important`},wrapperFlex:{display:`flex`,cursor:`pointer`,"& .warning":{backgroundColor:`#de0000 !important`,"&:before":{position:`absolute`,right:0,top:-5,content:`"⚠"`,fontSize:25,height:`30px`,width:`30px`,color:`black`},animation:`$warning 2.5s ease-in-out infinite alternate`},"@media screen and (max-width: 500px)":{flexDirection:`column`}},wrapperColor:{position:`relative`,overflow:`hidden`},hidden1100:{"@media screen and (max-width: 1100px)":{display:`none !important`}},hidden800:{"@media screen and (max-width: 800px)":{display:`none !important`}},hidden600:{"@media screen and (max-width: 600px)":{display:`none !important`}},badge:{top:14},curdContentFlexCenter:{display:`flex`,alignItems:`center`},wrapperInfo:{display:`flex`,flexFlow:`wrap`,width:`100%`,justifyContent:`space-around`},wrapperBlockItem:{display:`flex`,flexFlow:`nowrap`,whiteSpace:`nowrap`,margin:10},bold:{fontWeight:`bold`},nowrap:{display:`flex`,flexFlow:`nowrap`,flex:1,whiteSpace:`nowrap`,marginRight:5},cell:{}},kt=class extends Y{renderValue(e){return typeof this.props.hostData==`object`?b(`div`,{style:Z.wrapperBlockItem,children:[b(`span`,{style:{...Z.bold,...Z.nowrap},children:[this.props.t(e),`: `]}),Y.formatInfo[e]?Y.formatInfo[e](this.props.hostData[e],this.props.t):this.props.hostData[e]||`--`]},e):null}getHostDescriptionAll(){return this.props.hostData?typeof this.props.hostData==`string`?this.props.hostData:b(`div`,{style:Z.wrapperInfo,children:[h(`div`,{style:Z.marginRight,children:this.props.hostData&&typeof this.props.hostData==`object`?Object.keys(this.props.hostData).map((e,t)=>t<=5&&this.renderValue(e)):h(k,{})}),h(`div`,{style:Z.marginRight,children:this.props.hostData&&typeof this.props.hostData==`object`?Object.keys(this.props.hostData).map((e,t)=>t>5&&t<12&&this.renderValue(e)):h(k,{})}),h(`div`,{style:Z.marginRight,children:this.props.hostData&&typeof this.props.hostData==`object`?Object.keys(this.props.hostData).map((e,t)=>t>=12&&this.renderValue(e)):h(k,{})})]}):h(k,{})}render(){let e=(this.props.isCurrentHost||this.props.alive)&&B.updateAvailable(this.props.host.common.installedVersion,this.props.available),t=this.getHostDescriptionAll();return b(T,{component:`div`,sx:p.getStyle(this.props.theme,Z.root,this.props.hidden&&Z.hidden,{border:`2px solid ${this.props.host.common.color||`inherit`}`,borderRadius:`5px`}),children:[this.renderDialogs(),b(T,{component:`div`,sx:{...Z.wrapperFlex,...this.props.alive?void 0:Z.cursorNoDrop},onClick:this.state.openDialogLogLevel?void 0:()=>this.setState({openCollapse:!this.state.openCollapse}),children:[b(`div`,{style:Z.wrapperColor,children:[h(`div`,{style:{...Z.onOff,...this.props.alive?Z.green:Z.red}}),this.props.alive&&h(`div`,{style:Z.dotLine})]}),b(`div`,{ref:this.refWarning,style:{...Z.imageBlock,background:this.props.host.common.color||`inherit`},children:[this.renderNotificationsBadge(h(me,{sx:Z.img,component:`img`,image:this.props.host.common.icon||`img/no-image.svg`}),!0),h(`div`,{style:p.getStyle(this.props.theme,Z.host,{color:this.props.host.common.color&&p.invertColor(this.props.host.common.color,!0)||`inherit`}),children:this.props.host.common.name})]}),b(ze,{sx:{"&.MuiCardContent-root":Z.cardContentH5},children:[h(O,{sx:{...Z.flex,...Z.hidden800,...Z.cell},variant:`body2`,color:`textSecondary`,component:`div`,children:h(`div`,{ref:this.refCpu,children:`- %`})}),h(O,{sx:{...Z.flex,...Z.hidden800,...Z.cell},variant:`body2`,color:`textSecondary`,component:`div`,children:h(`div`,{ref:this.refMem,children:`- %`})}),h(O,{sx:{...Z.flex,...Z.hidden800,...Z.cell},variant:`body2`,color:`textSecondary`,component:`div`,children:h(`div`,{ref:this.refUptime,children:`-/-`})}),h(O,{sx:{...Z.flex,...Z.hidden1100},variant:`body2`,color:`textSecondary`,component:`p`,children:this.props.host.common.installedVersion}),h(O,{sx:{...Z.flex,...Z.hidden1100,...Z.cell},variant:`body2`,color:`textSecondary`,component:`div`,children:h(T,{component:`div`,sx:{...e?Z.greenText:void 0,...Z.curdContentFlexCenter},children:this.renderUpdateButton(e)})}),h(O,{sx:{...Z.flex,...Z.hidden600,...Z.cell},variant:`body2`,color:`textSecondary`,component:`div`,children:h(`div`,{ref:this.refEvents,children:`- / -`})}),h(`div`,{style:Z.marginTop10,children:b(O,{component:`span`,style:Z.enableButton,children:[this.renderEditButton(),this.renderHostBaseEdit(),this.renderRestartButton(),this.props.expertMode&&this.state.logLevel?this.renderLogLevel():h(`div`,{style:Z.emptyButton}),this.renderRemoveButton(),this.renderExtendButton(!!this.state.openCollapse)]})})]})]}),this.state.openCollapse?b(`div`,{style:Z.collapse,onClick:e=>e.stopPropagation(),children:[h(ze,{style:Z.cardContentInfo,children:typeof t==`object`?b(S,{children:[t,this.renderCopyButton({height:44,width:44})]}):h(O,{variant:`body2`,color:`textSecondary`,children:t})}),h(tt,{socket:this.props.socket,hostId:this.props.hostId,t:this.props.t}),h(T,{component:`div`,sx:Z.footerBlock})]}):null]},this.props.hostId)}};c();var Q={grow:{flexGrow:1},cards:{display:`flex`,flexFlow:`wrap`,justifyContent:`center`},tabHeaderWrapper:{height:30,display:`flex`,margin:7},tabHeaderFirstItem:{width:306,paddingLeft:30,fontSize:14,fontWeight:600,alignSelf:`center`},tabHeaderItem:{flex:1,fontSize:14,fontWeight:600,alignSelf:`center`},tabHeaderItemButton:{fontSize:14,fontWeight:600,alignSelf:`center`},widthButtons:{width:240},tabFlex:{display:`flex`,flex:1,padding:`0 10px`},bold:{fontWeight:`bold`},marginRight:{marginRight:`auto`},hidden1100:{"@media screen and (max-width: 1100px)":{display:`none !important`}},hidden800:{"@media screen and (max-width: 800px)":{display:`none !important`}},hidden600:{"@media screen and (max-width: 600px)":{display:`none !important`}},jsController:{fontSize:12,opacity:.4,display:`block`,whiteSpace:`nowrap`},tooltip:{pointerEvents:`none`}},$={};function At(e){var t;if((t=e.dockerInformation)!=null&&t.isDocker){let t=e.dockerInformation.isOfficial?`official image`:`unofficial image`;e.dockerInformation.isOfficial&&(t+=` - ${e.dockerInformation.officialVersion}`),e.Platform=`${e.Platform} (${t})`}delete e.dockerInformation}var jt=class extends R{constructor(e){super(e),v(this,`t`,(e,t,n)=>(t!==void 0&&n!==void 0&&!$[`${e} ${t} ${n}`]?$[`${e} ${t} ${n}`]=this.props.t(e,t,n):t!==void 0&&!$[`${e} ${t}`]?$[`${e} ${t}`]=this.props.t(e,t):$[e]||($[e]=this.props.t(e)),t!==void 0&&n!==void 0?$[`${e} ${t} ${n}`]:t===void 0?$[e]:$[`${e} ${t}`])),v(this,`updateHosts`,e=>{let t=JSON.parse(JSON.stringify(this.state.hosts)),n=JSON.parse(JSON.stringify(this.state.alive));Promise.all(e.map(async e=>{let r=t.findIndex(t=>t._id===e.id);if(r!==-1)e.obj?t[r]=e.obj:t.splice(r,1);else{let r=await this.props.socket.getState(`${e.id}.alive`);n[e.id]=!!(r!=null&&r.val),t.push(e.obj)}})).then(()=>{let e={hosts:t,alive:n};this.state.filterText&&t.length<=2&&(e.filterText=``),this.setState(e)})}),v(this,`updateHostsAlive`,e=>{let t=JSON.parse(JSON.stringify(this.state.alive)),n=!1;e.forEach(e=>{e.type===`deleted`?t[e.id]!==void 0&&(delete t[e.id],n=!0):!!t[e.id]!=!!e.alive&&(t[e.id]=e.alive,n=!0)}),n&&this.setState({alive:t})}),this.state={viewMode:(window._localStorage||window.localStorage).getItem(`Hosts.viewMode`)===`true`,alive:{},hosts:[],repository:{},hostsData:{},filterText:(window._localStorage||window.localStorage).getItem(`Hosts.filterText`)||``,showSlowConnectionWarning:!1,readTimeoutMs:Qe.getReadTimeoutMs()}}componentDidMount(){this.readInfo().then(()=>{this.props.hostsWorker.registerHandler(this.updateHosts),this.props.hostsWorker.registerAliveHandler(this.updateHostsAlive)})}componentWillUnmount(){this.props.hostsWorker.unregisterHandler(this.updateHosts),this.props.hostsWorker.unregisterAliveHandler(this.updateHostsAlive)}getHostsData(e,t){let n=[];for(let r=0;r<e.length;r++)if(t[e[r]._id]){let t=this.props.socket.getHostInfo(e[r]._id,void 0,this.state.readTimeoutMs).catch(t=>(console.error(`Cannot get getHostInfo: ${t}`),t.toString().includes(`timeout`)&&this.setState({showSlowConnectionWarning:!0}),{id:e[r]._id,data:t.toString()})).then(t=>(At(t),{id:e[r]._id,data:t}));n.push(t)}else n.push(Promise.resolve({id:e[r]._id,data:`offline`}));return Promise.all(n).then(e=>{let t={};return e.forEach(e=>t[e.id]=e.data),t})}async readInfo(){try{let e=await this.props.socket.getHosts(!0),t=await Ze(this.props.socket,this.props.currentHost,{update:!1,lang:this.props.lang,adapters:[`js-controller`]},!1,this.state.readTimeoutMs),n=JSON.parse(JSON.stringify(this.state.alive));for(let t=0;t<e.length;t++){let r=await this.props.socket.getState(`${e[t]._id}.alive`);n[e[t]._id]=r?!!r.val:!1}let r={alive:n,hosts:e,hostsData:await this.getHostsData(e,n),repository:t};this.state.filterText&&e.length<=2&&(r.filterText=``),this.setState(r)}catch(e){window.alert(`Cannot getRepository: ${e}`),e.toString().includes(`timeout`)&&this.setState({showSlowConnectionWarning:!0})}}getPanelsOrRows(){let e=this.renderHosts().filter(e=>e);return e.length?e:this.t(`All items are filtered out`)}renderSlowConnectionWarning(){return this.state.showSlowConnectionWarning?h(Qe,{readTimeoutMs:this.state.readTimeoutMs,t:this.t,onClose:async e=>{this.setState({showSlowConnectionWarning:!1}),e&&(this.setState({readTimeoutMs:e}),await this.readInfo())}}):null}renderHosts(){return this.state.hosts.map(e=>{var t;if(this.state.filterText&&!e.common.name.toLowerCase().includes(this.state.filterText.toLowerCase()))return null;let n=this.state.viewMode?Ot:kt;return h(n,{adminInstance:this.props.adminInstance,alive:this.state.alive[e._id],available:((t=this.state.repository[`js-controller`])==null?void 0:t.version)||`-`,executeCommandRemove:()=>this.props.executeCommand(`host remove ${e.common.name}`),expertMode:this.props.expertMode,host:e,hostData:this.state.hostsData[e._id],hostId:e._id,hostsWorker:this.props.hostsWorker,isCurrentHost:this.props.currentHost===e._id,jsControllerInfo:this.state.repository[`js-controller`],lang:this.props.lang,noTranslation:this.props.noTranslation,onUpdating:this.props.onUpdating,showAdaptersWarning:this.props.showAdaptersWarning,socket:this.props.socket,systemConfig:this.props.systemConfig,t:this.t,theme:this.props.theme,themeType:this.props.themeType,toggleTranslation:this.props.toggleTranslation},e._id)})}renderTableHeader(){let e=window.innerWidth<100?10:window.innerWidth<1200?12:14;return b(`div`,{style:Q.tabHeaderWrapper,children:[h(`div`,{style:Q.tabHeaderFirstItem,children:this.t(`Name:`)}),b(`div`,{style:Q.tabFlex,children:[h(T,{component:`div`,sx:p.getStyle(this.props.theme,Q.tabHeaderItem,Q.hidden800,{fontSize:e}),children:`CPU`}),h(T,{component:`div`,sx:p.getStyle(this.props.theme,Q.tabHeaderItem,Q.hidden800,{fontSize:e}),children:`RAM`}),h(T,{component:`div`,sx:p.getStyle(this.props.theme,Q.tabHeaderItem,Q.hidden800,{fontSize:e}),children:this.t(`Uptime`)}),b(T,{component:`div`,sx:p.getStyle(this.props.theme,Q.tabHeaderItem,Q.hidden1100,{fontSize:e}),children:[this.t(`Installed`),h(`div`,{style:Q.jsController,children:`js-controller`})]}),b(T,{component:`div`,sx:p.getStyle(this.props.theme,Q.tabHeaderItem,Q.hidden1100,{fontSize:e}),children:[this.t(`Available`),h(`div`,{style:Q.jsController,children:`js-controller`})]}),h(T,{component:`div`,sx:p.getStyle(this.props.theme,Q.tabHeaderItem,Q.hidden600,{fontSize:e}),children:this.t(`Events`)}),h(`div`,{style:{...Q.tabHeaderItemButton,width:this.props.expertMode?292:244}})]})]})}render(){return this.state.hosts.length?b(ue,{children:[h(`style`,{children:wt}),this.renderSlowConnectionWarning(),b(a,{children:[h(M,{title:this.t(`Show / hide List`),slotProps:{popper:{sx:Q.tooltip}},children:h(F,{size:`large`,onClick:()=>{(window._localStorage||window.localStorage).setItem(`Hosts.viewMode`,this.state.viewMode?`false`:`true`),this.setState({viewMode:!this.state.viewMode})},children:this.state.viewMode?h(xe,{}):h(qe,{})})}),h(M,{title:this.t(`Reload`),slotProps:{popper:{sx:Q.tooltip}},children:h(F,{size:`large`,onClick:()=>this.forceUpdate(),children:h(Ce,{})})}),h(`div`,{style:Q.grow}),this.state.hosts.length>2?h(z,{variant:`standard`,label:this.t(`Filter`),style:{margin:`5px 0`},value:this.state.filterText,onChange:e=>{(window._localStorage||window.localStorage).setItem(`Hosts.viewMode`,e.target.value),this.setState({filterText:e.target.value})},slotProps:{input:{endAdornment:this.state.filterText?h(ne,{position:`end`,children:h(F,{tabIndex:-1,size:`small`,onClick:()=>{(window._localStorage||window.localStorage).setItem(`Hosts.viewMode`,``),this.setState({filterText:``})},children:h(P,{})})}):null}}}):null,h(`div`,{style:Q.grow})]}),b(He,{overflow:`auto`,children:[!p.isStableRepository(this.props.systemConfig.common.activeRepo)&&String(this.props.systemConfig.common.activeRepo||``).toLowerCase()!==`nexowatt`?h(T,{sx:{marginX:2,width:`calc(100% - 32px)`,alignSelf:`center`},children:h(i,{type:`warning`,children:this.t(`Active repo is "%s"`,this.props.systemConfig.common.activeRepo)})}):null,b(`div`,{style:this.state.viewMode?Q.cards:void 0,children:[!this.state.viewMode&&this.renderTableHeader(),this.getPanelsOrRows()]})]})]}):h(ve,{})}};export{jt as default};