@64mb/freelens-power 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/THIRD_PARTY_LICENSES +1707 -0
- package/out/main/ai.js +63 -23
- package/out/main/ai.js.map +1 -1
- package/out/main/cluster-icons-catalog.js +28 -0
- package/out/main/cluster-icons-catalog.js.map +1 -0
- package/out/main/cluster-icons.js +125 -0
- package/out/main/cluster-icons.js.map +1 -0
- package/out/main/common/ai-terminal-context.js +51 -0
- package/out/main/common/ai-terminal-context.js.map +1 -0
- package/out/main/common/ai.js.map +1 -1
- package/out/main/common/cluster-icon-ipc.js +6 -0
- package/out/main/common/cluster-icon-ipc.js.map +1 -0
- package/out/main/common/cluster-icons.js +121 -0
- package/out/main/common/cluster-icons.js.map +1 -0
- package/out/main/common/dashboard.js +2 -1
- package/out/main/common/dashboard.js.map +1 -1
- package/out/main/common/settings-export.js +4 -2
- package/out/main/common/settings-export.js.map +1 -1
- package/out/main/common/store/cluster-icons-store.js +32 -0
- package/out/main/common/store/cluster-icons-store.js.map +1 -0
- package/out/main/common/store/dashboard-preferences-store.js +2 -1
- package/out/main/common/store/dashboard-preferences-store.js.map +1 -1
- package/out/main/common/store/monitoring-preferences-store.js +5 -0
- package/out/main/common/store/monitoring-preferences-store.js.map +1 -1
- package/out/main/dashboard-views.js +20 -10
- package/out/main/dashboard-views.js.map +1 -1
- package/out/main/diagnostics-menu-order.js +57 -0
- package/out/main/diagnostics-menu-order.js.map +1 -0
- package/out/main/index.js +9 -1
- package/out/main/index.js.map +1 -1
- package/out/main/monitoring-history.js +13 -3
- package/out/main/monitoring-history.js.map +1 -1
- package/out/renderer/_virtual/_global-external_react-dom.js +2 -1
- package/out/renderer/_virtual/_global-external_react.js +10 -5
- package/out/renderer/_virtual/_rolldown/runtime.js +22 -0
- package/out/renderer/ai-terminal-context.js +200 -0
- package/out/renderer/ai-terminal-context.js.map +1 -0
- package/out/renderer/ai.js +90 -9
- package/out/renderer/ai.js.map +1 -1
- package/out/renderer/appearance.js +1 -0
- package/out/renderer/appearance.js.map +1 -1
- package/out/renderer/cluster-icon-colors.js +188 -0
- package/out/renderer/cluster-icon-colors.js.map +1 -0
- package/out/renderer/cluster-icons.js +304 -0
- package/out/renderer/cluster-icons.js.map +1 -0
- package/out/renderer/dashboard.js +51 -14
- package/out/renderer/dashboard.js.map +1 -1
- package/out/renderer/details/secret-certificate-details.js +9 -2
- package/out/renderer/details/secret-certificate-details.js.map +1 -1
- package/out/renderer/diagnostics.css.js +39 -0
- package/out/renderer/diagnostics.css.js.map +1 -0
- package/out/renderer/diagnostics.js +796 -343
- package/out/renderer/diagnostics.js.map +1 -1
- package/out/renderer/index.js +9 -4
- package/out/renderer/index.js.map +1 -1
- package/out/renderer/monitoring-details-chart.js +42 -0
- package/out/renderer/monitoring-details-chart.js.map +1 -0
- package/out/renderer/monitoring-history-collection.js +2 -18
- package/out/renderer/monitoring-history-collection.js.map +1 -1
- package/out/renderer/monitoring-history-view.js +111 -34
- package/out/renderer/monitoring-history-view.js.map +1 -1
- package/out/renderer/monitoring.js +68 -27
- package/out/renderer/monitoring.js.map +1 -1
- package/out/renderer/node-monitoring.js +23 -12
- package/out/renderer/node-monitoring.js.map +1 -1
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +10 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +8 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +9 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +9 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +8 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/classCallCheck.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createClass.js +15 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createClass.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createSuper.js +19 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/createSuper.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/defineProperty.js +14 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/defineProperty.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js +19 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +15 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inherits.js +14 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inherits.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +18 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +8 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArray.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +26 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +8 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +8 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +27 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectSpread2.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +15 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +14 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +12 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +15 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +12 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/slicedToArray.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +8 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +12 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +16 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +11 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/typeof.js +18 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/typeof.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +13 -0
- package/out/renderer/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js +237 -0
- package/out/renderer/node_modules/.pnpm/@emotion_cache@11.14.0/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js +25 -0
- package/out/renderer/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +12 -0
- package/out/renderer/node_modules/.pnpm/@emotion_memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_react@11.14.0_@types_react@17.0.93_react@17.0.2/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js +58 -0
- package/out/renderer/node_modules/.pnpm/@emotion_react@11.14.0_@types_react@17.0.93_react@17.0.2/node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_react@11.14.0_@types_react@17.0.93_react@17.0.2/node_modules/@emotion/react/dist/emotion-react.browser.esm.js +54 -0
- package/out/renderer/node_modules/.pnpm/@emotion_react@11.14.0_@types_react@17.0.93_react@17.0.2/node_modules/@emotion/react/dist/emotion-react.browser.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +133 -0
- package/out/renderer/node_modules/.pnpm/@emotion_serialize@1.3.3/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js +65 -0
- package/out/renderer/node_modules/.pnpm/@emotion_sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +54 -0
- package/out/renderer/node_modules/.pnpm/@emotion_unitless@0.10.0/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_use-insertion-effect-with-fallbacks@1.2.0_react@17.0.2/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js +12 -0
- package/out/renderer/node_modules/.pnpm/@emotion_use-insertion-effect-with-fallbacks@1.2.0_react@17.0.2/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@emotion_utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js +30 -0
- package/out/renderer/node_modules/.pnpm/@emotion_utils@1.4.2/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +211 -0
- package/out/renderer/node_modules/.pnpm/@floating-ui_dom@1.7.2/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +97 -0
- package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +31 -0
- package/out/renderer/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +93 -0
- package/out/renderer/node_modules/.pnpm/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/memoize-one@6.0.0/node_modules/memoize-one/dist/memoize-one.esm.js +38 -0
- package/out/renderer/node_modules/.pnpm/memoize-one@6.0.0/node_modules/memoize-one/dist/memoize-one.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +159 -0
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +103 -0
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +18 -0
- package/out/renderer/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/Select-ef7c0426.esm.js +2200 -0
- package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/Select-ef7c0426.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/index-641ee5b8.esm.js +992 -0
- package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/index-641ee5b8.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/react-select.esm.js +14 -0
- package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/react-select.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js +56 -0
- package/out/renderer/node_modules/.pnpm/react-select@5.10.2_@types_react@17.0.93_react-dom@17.0.2_react@17.0.2__react@17.0.2/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js +22 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js +30 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js +164 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js +37 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js +245 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js +120 -0
- package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js.map +1 -0
- package/out/renderer/node_modules/.pnpm/use-isomorphic-layout-effect@1.2.1_@types_react@17.0.93_react@17.0.2/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js +6 -0
- package/out/renderer/node_modules/.pnpm/use-isomorphic-layout-effect@1.2.1_@types_react@17.0.93_react@17.0.2/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js.map +1 -0
- package/out/renderer/pod-monitoring.js +15 -19
- package/out/renderer/pod-monitoring.js.map +1 -1
- package/out/renderer/preferences/ai-shortcuts-preferences.js +12 -4
- package/out/renderer/preferences/ai-shortcuts-preferences.js.map +1 -1
- package/out/renderer/preferences/dashboard-preferences.js +37 -6
- package/out/renderer/preferences/dashboard-preferences.js.map +1 -1
- package/out/renderer/preferences/monitoring-preferences.js +131 -44
- package/out/renderer/preferences/monitoring-preferences.js.map +1 -1
- package/out/renderer/preferences/preferences.js +31 -7
- package/out/renderer/preferences/preferences.js.map +1 -1
- package/out/renderer/read-only.js +2 -2
- package/out/renderer/read-only.js.map +1 -1
- package/out/renderer/src/common/ai-terminal-context.js +51 -0
- package/out/renderer/src/common/ai-terminal-context.js.map +1 -0
- package/out/renderer/src/common/ai.js.map +1 -1
- package/out/renderer/src/common/cluster-icon-ipc.js +6 -0
- package/out/renderer/src/common/cluster-icon-ipc.js.map +1 -0
- package/out/renderer/src/common/cluster-icons.js +133 -0
- package/out/renderer/src/common/cluster-icons.js.map +1 -0
- package/out/renderer/src/common/dashboard.js +2 -1
- package/out/renderer/src/common/dashboard.js.map +1 -1
- package/out/renderer/src/common/date-time.js +11 -0
- package/out/renderer/src/common/date-time.js.map +1 -0
- package/out/renderer/src/common/monitoring-history.js +2 -0
- package/out/renderer/src/common/monitoring-history.js.map +1 -1
- package/out/renderer/src/common/resource-diagnostics.js.map +1 -1
- package/out/renderer/src/common/settings-export.js.map +1 -1
- package/out/renderer/src/common/store/dashboard-preferences-store.js +2 -1
- package/out/renderer/src/common/store/dashboard-preferences-store.js.map +1 -1
- package/out/renderer/src/common/store/monitoring-preferences-store.js +5 -0
- package/out/renderer/src/common/store/monitoring-preferences-store.js.map +1 -1
- package/out/renderer/welcome.js +28 -6
- package/out/renderer/welcome.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.js","names":[],"sources":["../../../src/common/ai.ts"],"sourcesContent":["import type { AiResourceReference } from \"./ai-extras\";\n\nexport type AiProvider = \"codex\" | \"claude\";\n\nexport interface AiReadActivity {\n method: \"pods\" | \"nodes\" | \"resources\" | \"logs\";\n status: \"ok\" | \"unavailable\";\n}\n\nexport interface AiChatMessage {\n role: \"user\" | \"assistant\";\n text: string;\n}\n\nexport interface AiChatRequest {\n provider?: AiProvider;\n requestId?: string;\n messages: AiChatMessage[];\n context: {\n clusterId?: string;\n screen?: string;\n resource?: { kind?: string; namespace?: string; name?: string };\n };\n systemPrompt?: string;\n reasoningEffort?: string;\n model: string;\n speed: \"default\" | \"fast\";\n}\n\nexport interface AiChatResponse {\n references?: AiResourceReference[];\n provider?: AiProvider;\n text: string;\n reads?: AiReadActivity[];\n}\n\nexport const AI_CHAT_CHANNEL = \"freelens-power:ai-chat\";\n\nexport type AiFailureCode =\n | \"CLI_FAILURE\"\n | \"INVALID_REPLY\"\n | \"READ_LIMIT\"\n | \"TIMEOUT\"\n | \"CANCELLED\"\n | \"INPUT_LIMIT\"\n | \"UNAVAILABLE\"\n | \"UNSAFE_POLICY\";\n\nexport interface AiReadActivityEvent {\n requestId: string;\n method: AiReadActivity[\"method\"];\n status: \"reading\" | \"ok\" | \"unavailable\";\n}\n\nexport const AI_READ_ACTIVITY_CHANNEL = \"freelens-power:ai-read-activity\";\n\nexport function validAiRequestId(value: unknown): value is string {\n return typeof value === \"string\" && /^[a-zA-Z0-9_-]{1,100}$/.test(value);\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"ai.js","names":[],"sources":["../../../src/common/ai.ts"],"sourcesContent":["import type { AiResourceReference } from \"./ai-extras\";\n\nexport type AiProvider = \"codex\" | \"claude\";\n\nexport interface AiReadActivity {\n method: \"pods\" | \"nodes\" | \"resources\" | \"logs\";\n status: \"ok\" | \"unavailable\";\n}\n\nexport interface AiChatMessage {\n role: \"user\" | \"assistant\";\n text: string;\n}\n\nexport interface AiChatRequest {\n provider?: AiProvider;\n terminalSnapshot?: import(\"./ai-terminal-context\").AiTerminalSnapshot;\n requestId?: string;\n messages: AiChatMessage[];\n context: {\n clusterId?: string;\n screen?: string;\n resource?: { kind?: string; namespace?: string; name?: string };\n };\n systemPrompt?: string;\n reasoningEffort?: string;\n model: string;\n speed: \"default\" | \"fast\";\n}\n\nexport interface AiChatResponse {\n references?: AiResourceReference[];\n provider?: AiProvider;\n text: string;\n reads?: AiReadActivity[];\n}\n\nexport const AI_CHAT_CHANNEL = \"freelens-power:ai-chat\";\n\nexport type AiFailureCode =\n | \"CLI_FAILURE\"\n | \"INVALID_REPLY\"\n | \"READ_LIMIT\"\n | \"TIMEOUT\"\n | \"CANCELLED\"\n | \"INPUT_LIMIT\"\n | \"UNAVAILABLE\"\n | \"UNSAFE_POLICY\";\n\nexport interface AiReadActivityEvent {\n requestId: string;\n method: AiReadActivity[\"method\"];\n status: \"reading\" | \"ok\" | \"unavailable\";\n}\n\nexport const AI_READ_ACTIVITY_CHANNEL = \"freelens-power:ai-read-activity\";\n\nexport function validAiRequestId(value: unknown): value is string {\n return typeof value === \"string\" && /^[a-zA-Z0-9_-]{1,100}$/.test(value);\n}\n"],"mappings":";AAqCA,IAAa,kBAAkB;AAkB/B,IAAa,2BAA2B;AAExC,SAAgB,iBAAiB,OAAiC;CAChE,OAAO,OAAO,UAAU,YAAY,yBAAyB,KAAK,KAAK;AACzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster-icon-ipc.js","names":[],"sources":["../../../src/common/cluster-icon-ipc.ts"],"sourcesContent":["import type { ClusterIconDesign } from \"./cluster-icons\";\n\nexport const CLUSTER_ICONS_CHANNEL = \"freelens-power:cluster-icons\";\n\nexport interface ClusterIconEntry {\n id: string;\n name: string;\n icon?: string;\n design?: ClusterIconDesign;\n customized: boolean;\n}\n\nexport type ClusterIconRequest = { operation: \"list\" } | { operation: \"apply\"; id: string; design: ClusterIconDesign };\n"],"mappings":";AAEA,IAAa,wBAAwB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
//#region src/common/cluster-icons.ts
|
|
2
|
+
var GLYPHS = Object.freeze([
|
|
3
|
+
Object.freeze({
|
|
4
|
+
id: "window",
|
|
5
|
+
label: "Window",
|
|
6
|
+
body: "<g transform=\"translate(32 11.4) scale(1.168000000) translate(-32 -14)\" stroke-width=\"2.397260274\"><rect x=\"16\" y=\"14\" width=\"32\" height=\"25\" rx=\"4\"/><path d=\"M16 22h32M23 18h.1M28 18h.1M24 28l-4 3 4 3M35 28h7M35 34h5\"/></g>"
|
|
7
|
+
}),
|
|
8
|
+
Object.freeze({
|
|
9
|
+
id: "server",
|
|
10
|
+
label: "Server",
|
|
11
|
+
body: "<g transform=\"translate(32 11.4) scale(1.006896552) translate(-32 -13)\" stroke-width=\"2.780821917\"><rect x=\"17\" y=\"13\" width=\"30\" height=\"12\" rx=\"4\"/><rect x=\"17\" y=\"30\" width=\"30\" height=\"12\" rx=\"4\"/><path d=\"M23 19h.1M23 36h.1M32 19h8M32 36h8\"/></g>"
|
|
12
|
+
}),
|
|
13
|
+
Object.freeze({
|
|
14
|
+
id: "database",
|
|
15
|
+
label: "Database",
|
|
16
|
+
body: "<g transform=\"translate(32 11.4) scale(0.941935484) translate(-32 -11)\" stroke-width=\"2.972602739\"><ellipse cx=\"32\" cy=\"17\" rx=\"15\" ry=\"6\"/><path d=\"M17 17v19c0 8 30 8 30 0V17M17 26c0 8 30 8 30 0\"/></g>"
|
|
17
|
+
}),
|
|
18
|
+
Object.freeze({
|
|
19
|
+
id: "briefcase",
|
|
20
|
+
label: "Briefcase",
|
|
21
|
+
body: "<g transform=\"translate(32 11.4) scale(0.973333333) translate(-32 -13)\" stroke-width=\"2.876712330\"><rect x=\"14\" y=\"20\" width=\"36\" height=\"23\" rx=\"4\"/><path d=\"M25 20v-5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v5M14 28c10 7 26 7 36 0\"/><rect x=\"29\" y=\"29\" width=\"6\" height=\"7\" rx=\"1.5\" fill=\"#292d38\"/></g>"
|
|
22
|
+
}),
|
|
23
|
+
Object.freeze({
|
|
24
|
+
id: "sailboat",
|
|
25
|
+
label: "Sailboat",
|
|
26
|
+
body: "<g transform=\"translate(32 11.4) scale(0.834285714) translate(-32 -11)\" stroke-width=\"3.356164385\"><path d=\"M31 11v23H17zM36 18l11 16H36zM13 39h38l-7 7H21z\"/></g>"
|
|
27
|
+
}),
|
|
28
|
+
Object.freeze({
|
|
29
|
+
id: "network",
|
|
30
|
+
label: "Network",
|
|
31
|
+
body: "<g transform=\"translate(32 11.4) scale(0.768421053) translate(-32 -7)\" stroke-width=\"3.643835615\"><circle cx=\"32\" cy=\"26\" r=\"7\"/><path d=\"M32 13v6M32 33v6M19 26h6M39 26h6\"/><circle cx=\"32\" cy=\"10\" r=\"3\"/><circle cx=\"32\" cy=\"42\" r=\"3\"/><circle cx=\"16\" cy=\"26\" r=\"3\"/><circle cx=\"48\" cy=\"26\" r=\"3\"/></g>"
|
|
32
|
+
}),
|
|
33
|
+
Object.freeze({
|
|
34
|
+
id: "box",
|
|
35
|
+
label: "Box",
|
|
36
|
+
body: "<g transform=\"translate(32 11.4) scale(0.834285714) translate(-32 -11)\" stroke-width=\"3.356164385\"><path d=\"M32 11l17 10v17L32 46 15 38V21zM15 21l17 9 17-9M32 30v16\"/></g>"
|
|
37
|
+
}),
|
|
38
|
+
Object.freeze({
|
|
39
|
+
id: "blocks",
|
|
40
|
+
label: "Blocks",
|
|
41
|
+
body: "<rect x=\"17\" y=\"11.4\" width=\"10\" height=\"9\" rx=\"1.6\"/><rect x=\"37\" y=\"11.4\" width=\"10\" height=\"9\" rx=\"1.6\"/><rect x=\"27\" y=\"31.6\" width=\"10\" height=\"9\" rx=\"1.6\"/><path d=\"M22 20.4V26h20v-5.6M32 26v5.6\"/>"
|
|
42
|
+
}),
|
|
43
|
+
Object.freeze({
|
|
44
|
+
id: "git-branch",
|
|
45
|
+
label: "Git branch",
|
|
46
|
+
body: "<g transform=\"translate(32 11.4) scale(0.973333333) translate(-32 -12)\" stroke-width=\"2.876712330\"><circle cx=\"22\" cy=\"16\" r=\"4\"/><circle cx=\"42\" cy=\"16\" r=\"4\"/><circle cx=\"22\" cy=\"38\" r=\"4\"/><path d=\"M22 20v14M42 20c0 10-20 3-20 13\"/></g>"
|
|
47
|
+
}),
|
|
48
|
+
Object.freeze({
|
|
49
|
+
id: "cloud",
|
|
50
|
+
label: "Cloud",
|
|
51
|
+
body: "<path d=\"M22 40.6c-6 0-10-4-10-10 0-5 3-9 8-10 0-5 5-9.2 12-9.2s12 5 12 12c5 0 8 4 8 9 0 5-4 8.2-9 8.2z\"/>"
|
|
52
|
+
}),
|
|
53
|
+
Object.freeze({
|
|
54
|
+
id: "cpu",
|
|
55
|
+
label: "CPU",
|
|
56
|
+
body: "<rect x=\"21\" y=\"15\" width=\"22\" height=\"22\" rx=\"4\"/><rect x=\"27\" y=\"21\" width=\"10\" height=\"10\" rx=\"1\"/><path d=\"M26 11.4V15M32 11.4V15M38 11.4V15M26 37v3.6M32 37v3.6M38 37v3.6M17.4 20H21M17.4 26H21M17.4 32H21M43 20h3.6M43 26h3.6M43 32h3.6\"/>"
|
|
57
|
+
}),
|
|
58
|
+
Object.freeze({
|
|
59
|
+
id: "shield",
|
|
60
|
+
label: "Shield",
|
|
61
|
+
body: "<path d=\"M32 11.4l13 5v10c0 7-6 12-13 14.2C25 38.4 19 33.4 19 26.4v-10zM25 26l5 5 9-10\"/>"
|
|
62
|
+
}),
|
|
63
|
+
Object.freeze({
|
|
64
|
+
id: "globe",
|
|
65
|
+
label: "Globe",
|
|
66
|
+
body: "<circle cx=\"32\" cy=\"26\" r=\"14.6\"/><ellipse cx=\"32\" cy=\"26\" rx=\"6.5\" ry=\"14.6\"/><path d=\"M17.4 26h29.2M20.2 17.5h23.6M20.2 34.5h23.6\"/>"
|
|
67
|
+
}),
|
|
68
|
+
Object.freeze({
|
|
69
|
+
id: "key",
|
|
70
|
+
label: "Key",
|
|
71
|
+
body: "<g transform=\"translate(32 11.4) scale(1.39047619) translate(-12.5 -1)\" stroke-width=\"2.01369863\"><path d=\"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z\"/><circle cx=\"16.5\" cy=\"7.5\" r=\".5\" stroke-width=\"1\"/></g>"
|
|
72
|
+
}),
|
|
73
|
+
Object.freeze({
|
|
74
|
+
id: "rocket",
|
|
75
|
+
label: "Rocket",
|
|
76
|
+
body: "<g transform=\"translate(32 11.4) scale(1.497435897) translate(-12.25 -2)\" stroke-width=\"1.869863014\"><path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2zM9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\"/></g>"
|
|
77
|
+
})
|
|
78
|
+
]);
|
|
79
|
+
var COLOR = /^#[\da-f]{6}$/i;
|
|
80
|
+
var LABEL = /^[\p{L}\p{N}\p{M}\p{P}\p{S} ]*$/u;
|
|
81
|
+
function normalizeClusterIconDesign(input) {
|
|
82
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) throw new Error("Invalid cluster icon design");
|
|
83
|
+
const value = input;
|
|
84
|
+
if (typeof value.label !== "string" || !LABEL.test(value.label)) throw new Error("Use up to three visible characters for the label");
|
|
85
|
+
const label = value.label.normalize("NFC").trim();
|
|
86
|
+
if (Array.from(label).length > 3) throw new Error("Use up to three visible characters for the label");
|
|
87
|
+
if (typeof value.glyph !== "string" || !GLYPHS.some((glyph) => glyph.id === value.glyph)) throw new Error("Choose an available cluster icon");
|
|
88
|
+
for (const key of [
|
|
89
|
+
"outlineColor",
|
|
90
|
+
"labelColor",
|
|
91
|
+
"iconColor"
|
|
92
|
+
]) if (typeof value[key] !== "string" || !COLOR.test(value[key])) throw new Error("Use a six-digit hexadecimal color");
|
|
93
|
+
return {
|
|
94
|
+
label,
|
|
95
|
+
glyph: value.glyph,
|
|
96
|
+
outlineColor: value.outlineColor.toLowerCase(),
|
|
97
|
+
labelColor: value.labelColor.toLowerCase(),
|
|
98
|
+
iconColor: value.iconColor.toLowerCase()
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function escapeXml(text) {
|
|
102
|
+
return text.replace(/[&<>"']/g, (character) => ({
|
|
103
|
+
"&": "&",
|
|
104
|
+
"<": "<",
|
|
105
|
+
">": ">",
|
|
106
|
+
"\"": """,
|
|
107
|
+
"'": "'"
|
|
108
|
+
})[character]);
|
|
109
|
+
}
|
|
110
|
+
function clusterIconDataUrl(input) {
|
|
111
|
+
const design = normalizeClusterIconDesign(input);
|
|
112
|
+
const glyph = GLYPHS.find((candidate) => candidate.id === design.glyph);
|
|
113
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 64 64"><rect x="2" y="2" width="60" height="60" rx="15" fill="#292d38" stroke="${design.outlineColor}" stroke-width="3"/><g fill="none" stroke="${design.iconColor}" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round">${glyph.body}</g><rect x="15" y="46" width="34" height="12" rx="6" fill="${design.labelColor}"/><text x="32" y="55.2" text-anchor="middle" font-family="Helvetica,Arial,sans-serif" font-size="9.5" font-weight="800" fill="#292d38">${escapeXml(design.label)}</text></svg>`;
|
|
114
|
+
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
exports.GLYPHS = GLYPHS;
|
|
118
|
+
exports.clusterIconDataUrl = clusterIconDataUrl;
|
|
119
|
+
exports.normalizeClusterIconDesign = normalizeClusterIconDesign;
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=cluster-icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster-icons.js","names":[],"sources":["../../../src/common/cluster-icons.ts"],"sourcesContent":["export interface ClusterIconDesign {\n label: string;\n outlineColor: string;\n labelColor: string;\n glyph: string;\n iconColor: string;\n}\n\n// glyphs share the reference fitting, with Lucide contours for [key] and [rocket]\nexport const GLYPHS = Object.freeze([\n Object.freeze({\n id: \"window\",\n label: \"Window\",\n body: '<g transform=\"translate(32 11.4) scale(1.168000000) translate(-32 -14)\" stroke-width=\"2.397260274\"><rect x=\"16\" y=\"14\" width=\"32\" height=\"25\" rx=\"4\"/><path d=\"M16 22h32M23 18h.1M28 18h.1M24 28l-4 3 4 3M35 28h7M35 34h5\"/></g>',\n }),\n Object.freeze({\n id: \"server\",\n label: \"Server\",\n body: '<g transform=\"translate(32 11.4) scale(1.006896552) translate(-32 -13)\" stroke-width=\"2.780821917\"><rect x=\"17\" y=\"13\" width=\"30\" height=\"12\" rx=\"4\"/><rect x=\"17\" y=\"30\" width=\"30\" height=\"12\" rx=\"4\"/><path d=\"M23 19h.1M23 36h.1M32 19h8M32 36h8\"/></g>',\n }),\n Object.freeze({\n id: \"database\",\n label: \"Database\",\n body: '<g transform=\"translate(32 11.4) scale(0.941935484) translate(-32 -11)\" stroke-width=\"2.972602739\"><ellipse cx=\"32\" cy=\"17\" rx=\"15\" ry=\"6\"/><path d=\"M17 17v19c0 8 30 8 30 0V17M17 26c0 8 30 8 30 0\"/></g>',\n }),\n Object.freeze({\n id: \"briefcase\",\n label: \"Briefcase\",\n body: '<g transform=\"translate(32 11.4) scale(0.973333333) translate(-32 -13)\" stroke-width=\"2.876712330\"><rect x=\"14\" y=\"20\" width=\"36\" height=\"23\" rx=\"4\"/><path d=\"M25 20v-5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v5M14 28c10 7 26 7 36 0\"/><rect x=\"29\" y=\"29\" width=\"6\" height=\"7\" rx=\"1.5\" fill=\"#292d38\"/></g>',\n }),\n Object.freeze({\n id: \"sailboat\",\n label: \"Sailboat\",\n body: '<g transform=\"translate(32 11.4) scale(0.834285714) translate(-32 -11)\" stroke-width=\"3.356164385\"><path d=\"M31 11v23H17zM36 18l11 16H36zM13 39h38l-7 7H21z\"/></g>',\n }),\n Object.freeze({\n id: \"network\",\n label: \"Network\",\n body: '<g transform=\"translate(32 11.4) scale(0.768421053) translate(-32 -7)\" stroke-width=\"3.643835615\"><circle cx=\"32\" cy=\"26\" r=\"7\"/><path d=\"M32 13v6M32 33v6M19 26h6M39 26h6\"/><circle cx=\"32\" cy=\"10\" r=\"3\"/><circle cx=\"32\" cy=\"42\" r=\"3\"/><circle cx=\"16\" cy=\"26\" r=\"3\"/><circle cx=\"48\" cy=\"26\" r=\"3\"/></g>',\n }),\n Object.freeze({\n id: \"box\",\n label: \"Box\",\n body: '<g transform=\"translate(32 11.4) scale(0.834285714) translate(-32 -11)\" stroke-width=\"3.356164385\"><path d=\"M32 11l17 10v17L32 46 15 38V21zM15 21l17 9 17-9M32 30v16\"/></g>',\n }),\n Object.freeze({\n id: \"blocks\",\n label: \"Blocks\",\n body: '<rect x=\"17\" y=\"11.4\" width=\"10\" height=\"9\" rx=\"1.6\"/><rect x=\"37\" y=\"11.4\" width=\"10\" height=\"9\" rx=\"1.6\"/><rect x=\"27\" y=\"31.6\" width=\"10\" height=\"9\" rx=\"1.6\"/><path d=\"M22 20.4V26h20v-5.6M32 26v5.6\"/>',\n }),\n Object.freeze({\n id: \"git-branch\",\n label: \"Git branch\",\n body: '<g transform=\"translate(32 11.4) scale(0.973333333) translate(-32 -12)\" stroke-width=\"2.876712330\"><circle cx=\"22\" cy=\"16\" r=\"4\"/><circle cx=\"42\" cy=\"16\" r=\"4\"/><circle cx=\"22\" cy=\"38\" r=\"4\"/><path d=\"M22 20v14M42 20c0 10-20 3-20 13\"/></g>',\n }),\n Object.freeze({\n id: \"cloud\",\n label: \"Cloud\",\n body: '<path d=\"M22 40.6c-6 0-10-4-10-10 0-5 3-9 8-10 0-5 5-9.2 12-9.2s12 5 12 12c5 0 8 4 8 9 0 5-4 8.2-9 8.2z\"/>',\n }),\n Object.freeze({\n id: \"cpu\",\n label: \"CPU\",\n body: '<rect x=\"21\" y=\"15\" width=\"22\" height=\"22\" rx=\"4\"/><rect x=\"27\" y=\"21\" width=\"10\" height=\"10\" rx=\"1\"/><path d=\"M26 11.4V15M32 11.4V15M38 11.4V15M26 37v3.6M32 37v3.6M38 37v3.6M17.4 20H21M17.4 26H21M17.4 32H21M43 20h3.6M43 26h3.6M43 32h3.6\"/>',\n }),\n Object.freeze({\n id: \"shield\",\n label: \"Shield\",\n body: '<path d=\"M32 11.4l13 5v10c0 7-6 12-13 14.2C25 38.4 19 33.4 19 26.4v-10zM25 26l5 5 9-10\"/>',\n }),\n Object.freeze({\n id: \"globe\",\n label: \"Globe\",\n body: '<circle cx=\"32\" cy=\"26\" r=\"14.6\"/><ellipse cx=\"32\" cy=\"26\" rx=\"6.5\" ry=\"14.6\"/><path d=\"M17.4 26h29.2M20.2 17.5h23.6M20.2 34.5h23.6\"/>',\n }),\n Object.freeze({\n id: \"key\",\n label: \"Key\",\n body: '<g transform=\"translate(32 11.4) scale(1.39047619) translate(-12.5 -1)\" stroke-width=\"2.01369863\"><path d=\"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z\"/><circle cx=\"16.5\" cy=\"7.5\" r=\".5\" stroke-width=\"1\"/></g>',\n }),\n Object.freeze({\n id: \"rocket\",\n label: \"Rocket\",\n body: '<g transform=\"translate(32 11.4) scale(1.497435897) translate(-12.25 -2)\" stroke-width=\"1.869863014\"><path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2zM9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\"/></g>',\n }),\n]);\nconst COLOR = /^#[\\da-f]{6}$/i;\nconst LABEL = /^[\\p{L}\\p{N}\\p{M}\\p{P}\\p{S} ]*$/u;\n\nexport function normalizeClusterIconDesign(input: unknown): ClusterIconDesign {\n if (!input || typeof input !== \"object\" || Array.isArray(input)) {\n throw new Error(\"Invalid cluster icon design\");\n }\n const value = input as Record<string, unknown>;\n if (typeof value.label !== \"string\" || !LABEL.test(value.label)) {\n throw new Error(\"Use up to three visible characters for the label\");\n }\n const label = value.label.normalize(\"NFC\").trim();\n if (Array.from(label).length > 3) {\n throw new Error(\"Use up to three visible characters for the label\");\n }\n if (typeof value.glyph !== \"string\" || !GLYPHS.some((glyph) => glyph.id === value.glyph)) {\n throw new Error(\"Choose an available cluster icon\");\n }\n const colors = [\"outlineColor\", \"labelColor\", \"iconColor\"] as const;\n for (const key of colors) {\n if (typeof value[key] !== \"string\" || !COLOR.test(value[key] as string)) {\n throw new Error(\"Use a six-digit hexadecimal color\");\n }\n }\n return {\n label,\n glyph: value.glyph,\n outlineColor: (value.outlineColor as string).toLowerCase(),\n labelColor: (value.labelColor as string).toLowerCase(),\n iconColor: (value.iconColor as string).toLowerCase(),\n };\n}\n\nexport function defaultClusterIconDesign(name: string): ClusterIconDesign {\n const words = name.normalize(\"NFC\").match(/[\\p{L}\\p{N}][\\p{L}\\p{N}\\p{M}]*/gu) ?? [];\n const abbreviation = words.length > 1 ? words.map((word) => Array.from(word)[0]).join(\"\") : (words[0] ?? \"K8S\");\n return {\n label: Array.from(abbreviation.toUpperCase()).slice(0, 3).join(\"\"),\n outlineColor: \"#b49aff\",\n labelColor: \"#b49aff\",\n glyph: \"network\",\n iconColor: \"#b49aff\",\n };\n}\n\nfunction escapeXml(text: string): string {\n return text.replace(\n /[&<>\"']/g,\n (character) => ({ \"&\": \"&\", \"<\": \"<\", \">\": \">\", '\"': \""\", \"'\": \"'\" })[character]!,\n );\n}\n\nexport function clusterIconDataUrl(input: ClusterIconDesign): string {\n const design = normalizeClusterIconDesign(input);\n const glyph = GLYPHS.find((candidate) => candidate.id === design.glyph)!;\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"256\" height=\"256\" viewBox=\"0 0 64 64\"><rect x=\"2\" y=\"2\" width=\"60\" height=\"60\" rx=\"15\" fill=\"#292d38\" stroke=\"${design.outlineColor}\" stroke-width=\"3\"/><g fill=\"none\" stroke=\"${design.iconColor}\" stroke-width=\"2.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${glyph.body}</g><rect x=\"15\" y=\"46\" width=\"34\" height=\"12\" rx=\"6\" fill=\"${design.labelColor}\"/><text x=\"32\" y=\"55.2\" text-anchor=\"middle\" font-family=\"Helvetica,Arial,sans-serif\" font-size=\"9.5\" font-weight=\"800\" fill=\"#292d38\">${escapeXml(design.label)}</text></svg>`;\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;\n}\n"],"mappings":";AASA,IAAa,SAAS,OAAO,OAAO;CAClC,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;CACD,OAAO,OAAO;EACZ,IAAI;EACJ,OAAO;EACP,MAAM;CACR,CAAC;AACH,CAAC;AACD,IAAM,QAAQ;AACd,IAAM,QAAQ;AAEd,SAAgB,2BAA2B,OAAmC;CAC5E,IAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAC5D,MAAM,IAAI,MAAM,6BAA6B;CAE/C,MAAM,QAAQ;CACd,IAAI,OAAO,MAAM,UAAU,YAAY,CAAC,MAAM,KAAK,MAAM,KAAK,GAC5D,MAAM,IAAI,MAAM,kDAAkD;CAEpE,MAAM,QAAQ,MAAM,MAAM,UAAU,KAAK,CAAC,CAAC,KAAK;CAChD,IAAI,MAAM,KAAK,KAAK,CAAC,CAAC,SAAS,GAC7B,MAAM,IAAI,MAAM,kDAAkD;CAEpE,IAAI,OAAO,MAAM,UAAU,YAAY,CAAC,OAAO,MAAM,UAAU,MAAM,OAAO,MAAM,KAAK,GACrF,MAAM,IAAI,MAAM,kCAAkC;CAGpD,KAAK,MAAM,OAAO;EADF;EAAgB;EAAc;CAC5B,GAChB,IAAI,OAAO,MAAM,SAAS,YAAY,CAAC,MAAM,KAAK,MAAM,IAAc,GACpE,MAAM,IAAI,MAAM,mCAAmC;CAGvD,OAAO;EACL;EACA,OAAO,MAAM;EACb,cAAe,MAAM,aAAwB,YAAY;EACzD,YAAa,MAAM,WAAsB,YAAY;EACrD,WAAY,MAAM,UAAqB,YAAY;CACrD;AACF;AAcA,SAAS,UAAU,MAAsB;CACvC,OAAO,KAAK,QACV,aACC,eAAe;EAAE,KAAK;EAAS,KAAK;EAAQ,KAAK;EAAQ,MAAK;EAAU,KAAK;CAAS,EAAA,CAAG,UAC5F;AACF;AAEA,SAAgB,mBAAmB,OAAkC;CACnE,MAAM,SAAS,2BAA2B,KAAK;CAC/C,MAAM,QAAQ,OAAO,MAAM,cAAc,UAAU,OAAO,OAAO,KAAK;CACtE,MAAM,MAAM,gKAAgK,OAAO,aAAa,6CAA6C,OAAO,UAAU,sEAAsE,MAAM,KAAK,8DAA8D,OAAO,WAAW,0IAA0I,UAAU,OAAO,KAAK,EAAE;CACjkB,OAAO,oCAAoC,mBAAmB,GAAG;AACnE"}
|
|
@@ -25,8 +25,9 @@ function sanitizeDashboardCards(value) {
|
|
|
25
25
|
id,
|
|
26
26
|
title: typeof card.title === "string" && card.title.trim() ? card.title.trim() : new URL(url).hostname,
|
|
27
27
|
url,
|
|
28
|
-
size: card.size === "s" || card.size === "l" ? card.size : "m",
|
|
28
|
+
size: card.size === "xs" || card.size === "s" || card.size === "l" || card.size === "xl" ? card.size : "m",
|
|
29
29
|
autoRefresh: card.autoRefresh === true,
|
|
30
|
+
...card.refreshEvery10Seconds === true ? { refreshEvery10Seconds: true } : {},
|
|
30
31
|
...require_dashboard_selector.normalizeDashboardSelector(card.selector) ? { selector: require_dashboard_selector.normalizeDashboardSelector(card.selector) } : {}
|
|
31
32
|
}];
|
|
32
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","names":[],"sources":["../../../src/common/dashboard.ts"],"sourcesContent":["import { normalizeDashboardSelector } from \"./dashboard-selector\";\n\nexport type DashboardCardSize = \"s\" | \"m\" | \"l\";\n\nexport interface DashboardCard {\n id: string;\n title: string;\n url: string;\n size: DashboardCardSize;\n autoRefresh?: boolean;\n selector?: string;\n}\n\nexport function normalizeDashboardUrl(value: string): string | undefined {\n try {\n const url = new URL(value.trim());\n if ((url.protocol !== \"http:\" && url.protocol !== \"https:\") || !url.hostname) return undefined;\n return url.href;\n } catch {\n return undefined;\n }\n}\n\nexport function sanitizeDashboardCards(value: unknown): DashboardCard[] {\n if (!Array.isArray(value)) return [];\n const ids = new Set<string>();\n return value.flatMap((entry: unknown) => {\n if (!entry || typeof entry !== \"object\") return [];\n const card = entry as Partial<DashboardCard>;\n const url = typeof card.url === \"string\" ? normalizeDashboardUrl(card.url) : undefined;\n if (!url) return [];\n const preferredId = typeof card.id === \"string\" ? card.id.trim() : \"\";\n let id = preferredId || `card-${encodeURIComponent(url)}`;\n for (let suffix = 2; ids.has(id); suffix++) id = `${preferredId || `card-${encodeURIComponent(url)}`}-${suffix}`;\n ids.add(id);\n return [\n {\n id,\n title: typeof card.title === \"string\" && card.title.trim() ? card.title.trim() : new URL(url).hostname,\n url,\n size: card.size === \"s\" || card.size === \"l\" ? card.size : \"m\",\n autoRefresh: card.autoRefresh === true,\n ...(normalizeDashboardSelector(card.selector) ? { selector: normalizeDashboardSelector(card.selector) } : {}),\n } satisfies DashboardCard,\n ];\n });\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"dashboard.js","names":[],"sources":["../../../src/common/dashboard.ts"],"sourcesContent":["import { normalizeDashboardSelector } from \"./dashboard-selector\";\n\nexport type DashboardCardSize = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\n\nexport interface DashboardCard {\n id: string;\n title: string;\n url: string;\n size: DashboardCardSize;\n autoRefresh?: boolean;\n refreshEvery10Seconds?: boolean;\n selector?: string;\n}\n\nexport function normalizeDashboardUrl(value: string): string | undefined {\n try {\n const url = new URL(value.trim());\n if ((url.protocol !== \"http:\" && url.protocol !== \"https:\") || !url.hostname) return undefined;\n return url.href;\n } catch {\n return undefined;\n }\n}\n\nexport function sanitizeDashboardCards(value: unknown): DashboardCard[] {\n if (!Array.isArray(value)) return [];\n const ids = new Set<string>();\n return value.flatMap((entry: unknown) => {\n if (!entry || typeof entry !== \"object\") return [];\n const card = entry as Partial<DashboardCard>;\n const url = typeof card.url === \"string\" ? normalizeDashboardUrl(card.url) : undefined;\n if (!url) return [];\n const preferredId = typeof card.id === \"string\" ? card.id.trim() : \"\";\n let id = preferredId || `card-${encodeURIComponent(url)}`;\n for (let suffix = 2; ids.has(id); suffix++) id = `${preferredId || `card-${encodeURIComponent(url)}`}-${suffix}`;\n ids.add(id);\n return [\n {\n id,\n title: typeof card.title === \"string\" && card.title.trim() ? card.title.trim() : new URL(url).hostname,\n url,\n size: card.size === \"xs\" || card.size === \"s\" || card.size === \"l\" || card.size === \"xl\" ? card.size : \"m\",\n autoRefresh: card.autoRefresh === true,\n ...(card.refreshEvery10Seconds === true ? { refreshEvery10Seconds: true } : {}),\n ...(normalizeDashboardSelector(card.selector) ? { selector: normalizeDashboardSelector(card.selector) } : {}),\n } satisfies DashboardCard,\n ];\n });\n}\n"],"mappings":";;AAcA,SAAgB,sBAAsB,OAAmC;CACvE,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,MAAM,KAAK,CAAC;EAChC,IAAK,IAAI,aAAa,WAAW,IAAI,aAAa,YAAa,CAAC,IAAI,UAAU,OAAO,KAAA;EACrF,OAAO,IAAI;CACb,QAAQ;EACN;CACF;AACF;AAEA,SAAgB,uBAAuB,OAAiC;CACtE,IAAI,CAAC,MAAM,QAAQ,KAAK,GAAG,OAAO,CAAC;CACnC,MAAM,sBAAM,IAAI,IAAY;CAC5B,OAAO,MAAM,SAAS,UAAmB;EACvC,IAAI,CAAC,SAAS,OAAO,UAAU,UAAU,OAAO,CAAC;EACjD,MAAM,OAAO;EACb,MAAM,MAAM,OAAO,KAAK,QAAQ,WAAW,sBAAsB,KAAK,GAAG,IAAI,KAAA;EAC7E,IAAI,CAAC,KAAK,OAAO,CAAC;EAClB,MAAM,cAAc,OAAO,KAAK,OAAO,WAAW,KAAK,GAAG,KAAK,IAAI;EACnE,IAAI,KAAK,eAAe,QAAQ,mBAAmB,GAAG;EACtD,KAAK,IAAI,SAAS,GAAG,IAAI,IAAI,EAAE,GAAG,UAAU,KAAK,GAAG,eAAe,QAAQ,mBAAmB,GAAG,IAAI,GAAG;EACxG,IAAI,IAAI,EAAE;EACV,OAAO,CACL;GACE;GACA,OAAO,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,KAAK,IAAI,KAAK,MAAM,KAAK,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC;GAC9F;GACA,MAAM,KAAK,SAAS,QAAQ,KAAK,SAAS,OAAO,KAAK,SAAS,OAAO,KAAK,SAAS,OAAO,KAAK,OAAO;GACvG,aAAa,KAAK,gBAAgB;GAClC,GAAI,KAAK,0BAA0B,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;GAC7E,GAAI,2BAAA,2BAA2B,KAAK,QAAQ,IAAI,EAAE,UAAU,2BAAA,2BAA2B,KAAK,QAAQ,EAAE,IAAI,CAAC;EAC7G,CACF;CACF,CAAC;AACH"}
|
|
@@ -18,10 +18,12 @@ function parseSettingsImport(value) {
|
|
|
18
18
|
const ids = /* @__PURE__ */ new Set();
|
|
19
19
|
for (const card of cards) {
|
|
20
20
|
if (!card || typeof card !== "object" || typeof card.id !== "string" || !card.id.trim() || ids.has(card.id) || typeof card.title !== "string" || !card.title.trim() || typeof card.url !== "string" || ![
|
|
21
|
+
"xs",
|
|
21
22
|
"s",
|
|
22
23
|
"m",
|
|
23
|
-
"l"
|
|
24
|
-
|
|
24
|
+
"l",
|
|
25
|
+
"xl"
|
|
26
|
+
].includes(card.size) || card.autoRefresh !== void 0 && typeof card.autoRefresh !== "boolean" || card.refreshEvery10Seconds !== void 0 && typeof card.refreshEvery10Seconds !== "boolean" || card.selector !== void 0 && (typeof card.selector !== "string" || card.selector.trim() && !require_dashboard_selector.normalizeDashboardSelector(card.selector))) return fail();
|
|
25
27
|
ids.add(card.id);
|
|
26
28
|
}
|
|
27
29
|
if (require_dashboard.sanitizeDashboardCards(cards).length !== cards.length || require_ai_shortcuts.sanitizeAiShortcuts(shortcuts).length !== shortcuts.length) return fail();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-export.js","names":[],"sources":["../../../src/common/settings-export.ts"],"sourcesContent":["import { sanitizeAiShortcuts } from \"./ai-shortcuts\";\nimport { sanitizeDashboardCards } from \"./dashboard\";\nimport { normalizeDashboardSelector } from \"./dashboard-selector\";\n\nexport const SETTINGS_EXPORT = \"freelens-power:settings:export\";\nexport type SettingsExportResult = \"saved\" | \"canceled\" | \"error\";\nexport const SETTINGS_IMPORT = \"freelens-power:settings:import\";\nexport type SettingsImportResult = \"restored\" | \"canceled\" | \"error\";\nexport const SETTINGS_BACKUP_MAX_BYTES = 1024 * 1024;\n\nexport function parseSettingsImport(value: unknown) {\n const fail = () => {\n throw new Error(\"Invalid settings backup\");\n };\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return fail();\n const backup = value as {\n format?: unknown;\n version?: unknown;\n dashboard?: { cards?: unknown };\n ai?: { shortcuts?: unknown };\n };\n if (backup.format !== \"freelens-power-settings\" || backup.version !== 1) return fail();\n const cards = backup.dashboard?.cards;\n const shortcuts = backup.ai?.shortcuts;\n if (!Array.isArray(cards) || !Array.isArray(shortcuts)) return fail();\n const ids = new Set<string>();\n for (const card of cards) {\n if (\n !card ||\n typeof card !== \"object\" ||\n typeof card.id !== \"string\" ||\n !card.id.trim() ||\n ids.has(card.id) ||\n typeof card.title !== \"string\" ||\n !card.title.trim() ||\n typeof card.url !== \"string\" ||\n ![\"s\", \"m\", \"l\"].includes(card.size) ||\n (card.autoRefresh !== undefined && typeof card.autoRefresh !== \"boolean\") ||\n (card.selector !== undefined &&\n (typeof card.selector !== \"string\" || (card.selector.trim() && !normalizeDashboardSelector(card.selector))))\n )\n return fail();\n ids.add(card.id);\n }\n if (\n sanitizeDashboardCards(cards).length !== cards.length ||\n sanitizeAiShortcuts(shortcuts).length !== shortcuts.length\n )\n return fail();\n return createSettingsExport(cards, shortcuts);\n}\n\nfunction credentialKey(value: string): boolean {\n const key = value.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n return (\n /(?:token|password|passwd|secret|credential|authorization|signature|apikey|session)/.test(key) ||\n [\"auth\", \"key\", \"sig\", \"code\", \"jwt\", \"assertion\", \"ticket\", \"samlresponse\"].includes(key)\n );\n}\n\nfunction exportUrl(value: string): string {\n const url = new URL(value);\n url.username = \"\";\n url.password = \"\";\n for (const key of [...url.searchParams.keys()]) {\n if (credentialKey(key)) url.searchParams.delete(key);\n }\n // preserve SPA routes unless the fragment contains credential parameters\n const fragment = url.hash.slice(1);\n const parameters = new URLSearchParams(fragment.includes(\"?\") ? fragment.slice(fragment.indexOf(\"?\") + 1) : fragment);\n if ([...parameters.keys()].some(credentialKey)) url.hash = \"\";\n return url.href;\n}\n\nexport function createSettingsExport(cards: unknown, shortcuts: unknown) {\n const backup = {\n format: \"freelens-power-settings\",\n version: 1,\n dashboard: {\n cards: sanitizeDashboardCards(cards).map((card, index, all) => {\n const url = exportUrl(card.url);\n let id = card.id;\n if (/^card-https?%3a%2f%2f/i.test(id)) {\n id = `export-card-${index + 1}`;\n while (all.some((entry) => entry.id === id)) id += \"-\";\n }\n return { ...card, url, id };\n }),\n },\n ai: { shortcuts: sanitizeAiShortcuts(shortcuts) },\n };\n if (new TextEncoder().encode(`${JSON.stringify(backup, null, 2)}\\n`).byteLength > SETTINGS_BACKUP_MAX_BYTES)\n throw new Error(\"Settings backup is too large\");\n return backup;\n}\n"],"mappings":";;;;AAIA,IAAa,kBAAkB;AAE/B,IAAa,kBAAkB;AAE/B,IAAa,4BAA4B,OAAO;AAEhD,SAAgB,oBAAoB,OAAgB;CAClD,MAAM,aAAa;EACjB,MAAM,IAAI,MAAM,yBAAyB;CAC3C;CACA,IAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG,OAAO,KAAK;CAC7E,MAAM,SAAS;CAMf,IAAI,OAAO,WAAW,6BAA6B,OAAO,YAAY,GAAG,OAAO,KAAK;CACrF,MAAM,QAAQ,OAAO,WAAW;CAChC,MAAM,YAAY,OAAO,IAAI;CAC7B,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,CAAC,MAAM,QAAQ,SAAS,GAAG,OAAO,KAAK;CACpE,MAAM,sBAAM,IAAI,IAAY;CAC5B,KAAK,MAAM,QAAQ,OAAO;EACxB,IACE,CAAC,QACD,OAAO,SAAS,YAChB,OAAO,KAAK,OAAO,YACnB,CAAC,KAAK,GAAG,KAAK,KACd,IAAI,IAAI,KAAK,EAAE,KACf,OAAO,KAAK,UAAU,YACtB,CAAC,KAAK,MAAM,KAAK,KACjB,OAAO,KAAK,QAAQ,YACpB,CAAC;GAAC;GAAK;GAAK;
|
|
1
|
+
{"version":3,"file":"settings-export.js","names":[],"sources":["../../../src/common/settings-export.ts"],"sourcesContent":["import { sanitizeAiShortcuts } from \"./ai-shortcuts\";\nimport { sanitizeDashboardCards } from \"./dashboard\";\nimport { normalizeDashboardSelector } from \"./dashboard-selector\";\n\nexport const SETTINGS_EXPORT = \"freelens-power:settings:export\";\nexport type SettingsExportResult = \"saved\" | \"canceled\" | \"error\";\nexport const SETTINGS_IMPORT = \"freelens-power:settings:import\";\nexport type SettingsImportResult = \"restored\" | \"canceled\" | \"error\";\nexport const SETTINGS_BACKUP_MAX_BYTES = 1024 * 1024;\n\nexport function parseSettingsImport(value: unknown) {\n const fail = () => {\n throw new Error(\"Invalid settings backup\");\n };\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return fail();\n const backup = value as {\n format?: unknown;\n version?: unknown;\n dashboard?: { cards?: unknown };\n ai?: { shortcuts?: unknown };\n };\n if (backup.format !== \"freelens-power-settings\" || backup.version !== 1) return fail();\n const cards = backup.dashboard?.cards;\n const shortcuts = backup.ai?.shortcuts;\n if (!Array.isArray(cards) || !Array.isArray(shortcuts)) return fail();\n const ids = new Set<string>();\n for (const card of cards) {\n if (\n !card ||\n typeof card !== \"object\" ||\n typeof card.id !== \"string\" ||\n !card.id.trim() ||\n ids.has(card.id) ||\n typeof card.title !== \"string\" ||\n !card.title.trim() ||\n typeof card.url !== \"string\" ||\n ![\"xs\", \"s\", \"m\", \"l\", \"xl\"].includes(card.size) ||\n (card.autoRefresh !== undefined && typeof card.autoRefresh !== \"boolean\") ||\n (card.refreshEvery10Seconds !== undefined && typeof card.refreshEvery10Seconds !== \"boolean\") ||\n (card.selector !== undefined &&\n (typeof card.selector !== \"string\" || (card.selector.trim() && !normalizeDashboardSelector(card.selector))))\n )\n return fail();\n ids.add(card.id);\n }\n if (\n sanitizeDashboardCards(cards).length !== cards.length ||\n sanitizeAiShortcuts(shortcuts).length !== shortcuts.length\n )\n return fail();\n return createSettingsExport(cards, shortcuts);\n}\n\nfunction credentialKey(value: string): boolean {\n const key = value.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n return (\n /(?:token|password|passwd|secret|credential|authorization|signature|apikey|session)/.test(key) ||\n [\"auth\", \"key\", \"sig\", \"code\", \"jwt\", \"assertion\", \"ticket\", \"samlresponse\"].includes(key)\n );\n}\n\nfunction exportUrl(value: string): string {\n const url = new URL(value);\n url.username = \"\";\n url.password = \"\";\n for (const key of [...url.searchParams.keys()]) {\n if (credentialKey(key)) url.searchParams.delete(key);\n }\n // preserve SPA routes unless the fragment contains credential parameters\n const fragment = url.hash.slice(1);\n const parameters = new URLSearchParams(fragment.includes(\"?\") ? fragment.slice(fragment.indexOf(\"?\") + 1) : fragment);\n if ([...parameters.keys()].some(credentialKey)) url.hash = \"\";\n return url.href;\n}\n\nexport function createSettingsExport(cards: unknown, shortcuts: unknown) {\n const backup = {\n format: \"freelens-power-settings\",\n version: 1,\n dashboard: {\n cards: sanitizeDashboardCards(cards).map((card, index, all) => {\n const url = exportUrl(card.url);\n let id = card.id;\n if (/^card-https?%3a%2f%2f/i.test(id)) {\n id = `export-card-${index + 1}`;\n while (all.some((entry) => entry.id === id)) id += \"-\";\n }\n return { ...card, url, id };\n }),\n },\n ai: { shortcuts: sanitizeAiShortcuts(shortcuts) },\n };\n if (new TextEncoder().encode(`${JSON.stringify(backup, null, 2)}\\n`).byteLength > SETTINGS_BACKUP_MAX_BYTES)\n throw new Error(\"Settings backup is too large\");\n return backup;\n}\n"],"mappings":";;;;AAIA,IAAa,kBAAkB;AAE/B,IAAa,kBAAkB;AAE/B,IAAa,4BAA4B,OAAO;AAEhD,SAAgB,oBAAoB,OAAgB;CAClD,MAAM,aAAa;EACjB,MAAM,IAAI,MAAM,yBAAyB;CAC3C;CACA,IAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG,OAAO,KAAK;CAC7E,MAAM,SAAS;CAMf,IAAI,OAAO,WAAW,6BAA6B,OAAO,YAAY,GAAG,OAAO,KAAK;CACrF,MAAM,QAAQ,OAAO,WAAW;CAChC,MAAM,YAAY,OAAO,IAAI;CAC7B,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,CAAC,MAAM,QAAQ,SAAS,GAAG,OAAO,KAAK;CACpE,MAAM,sBAAM,IAAI,IAAY;CAC5B,KAAK,MAAM,QAAQ,OAAO;EACxB,IACE,CAAC,QACD,OAAO,SAAS,YAChB,OAAO,KAAK,OAAO,YACnB,CAAC,KAAK,GAAG,KAAK,KACd,IAAI,IAAI,KAAK,EAAE,KACf,OAAO,KAAK,UAAU,YACtB,CAAC,KAAK,MAAM,KAAK,KACjB,OAAO,KAAK,QAAQ,YACpB,CAAC;GAAC;GAAM;GAAK;GAAK;GAAK;EAAI,CAAC,CAAC,SAAS,KAAK,IAAI,KAC9C,KAAK,gBAAgB,KAAA,KAAa,OAAO,KAAK,gBAAgB,aAC9D,KAAK,0BAA0B,KAAA,KAAa,OAAO,KAAK,0BAA0B,aAClF,KAAK,aAAa,KAAA,MAChB,OAAO,KAAK,aAAa,YAAa,KAAK,SAAS,KAAK,KAAK,CAAC,2BAAA,2BAA2B,KAAK,QAAQ,IAE1G,OAAO,KAAK;EACd,IAAI,IAAI,KAAK,EAAE;CACjB;CACA,IACE,kBAAA,uBAAuB,KAAK,CAAC,CAAC,WAAW,MAAM,UAC/C,qBAAA,oBAAoB,SAAS,CAAC,CAAC,WAAW,UAAU,QAEpD,OAAO,KAAK;CACd,OAAO,qBAAqB,OAAO,SAAS;AAC9C;AAEA,SAAS,cAAc,OAAwB;CAC7C,MAAM,MAAM,MAAM,YAAY,CAAC,CAAC,QAAQ,cAAc,EAAE;CACxD,OACE,qFAAqF,KAAK,GAAG,KAC7F;EAAC;EAAQ;EAAO;EAAO;EAAQ;EAAO;EAAa;EAAU;CAAc,CAAC,CAAC,SAAS,GAAG;AAE7F;AAEA,SAAS,UAAU,OAAuB;CACxC,MAAM,MAAM,IAAI,IAAI,KAAK;CACzB,IAAI,WAAW;CACf,IAAI,WAAW;CACf,KAAK,MAAM,OAAO,CAAC,GAAG,IAAI,aAAa,KAAK,CAAC,GAC3C,IAAI,cAAc,GAAG,GAAG,IAAI,aAAa,OAAO,GAAG;CAGrD,MAAM,WAAW,IAAI,KAAK,MAAM,CAAC;CAEjC,IAAI,CAAC,GAAG,IADe,gBAAgB,SAAS,SAAS,GAAG,IAAI,SAAS,MAAM,SAAS,QAAQ,GAAG,IAAI,CAAC,IAAI,QACpG,CAAA,CAAW,KAAK,CAAC,CAAC,CAAC,KAAK,aAAa,GAAG,IAAI,OAAO;CAC3D,OAAO,IAAI;AACb;AAEA,SAAgB,qBAAqB,OAAgB,WAAoB;CACvE,MAAM,SAAS;EACb,QAAQ;EACR,SAAS;EACT,WAAW,EACT,OAAO,kBAAA,uBAAuB,KAAK,CAAC,CAAC,KAAK,MAAM,OAAO,QAAQ;GAC7D,MAAM,MAAM,UAAU,KAAK,GAAG;GAC9B,IAAI,KAAK,KAAK;GACd,IAAI,yBAAyB,KAAK,EAAE,GAAG;IACrC,KAAK,eAAe,QAAQ;IAC5B,OAAO,IAAI,MAAM,UAAU,MAAM,OAAO,EAAE,GAAG,MAAM;GACrD;GACA,OAAO;IAAE,GAAG;IAAM;IAAK;GAAG;EAC5B,CAAC,EACH;EACA,IAAI,EAAE,WAAW,qBAAA,oBAAoB,SAAS,EAAE;CAClD;CACA,IAAI,IAAI,YAAY,CAAC,CAAC,OAAO,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,aAAA,SACnE,MAAM,IAAI,MAAM,8BAA8B;CAChD,OAAO;AACT"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const require_extensions = require("../../_virtual/_global-external_@freelensapp/extensions.js");
|
|
2
|
+
const require__global_external_mobx = require("../../_virtual/_global-external_mobx.js");
|
|
3
|
+
const require_cluster_icons = require("../cluster-icons.js");
|
|
4
|
+
//#region src/common/store/cluster-icons-store.ts
|
|
5
|
+
var ClusterIconsStore = class extends require_extensions.Common.Store.ExtensionStore {
|
|
6
|
+
icons = {};
|
|
7
|
+
constructor() {
|
|
8
|
+
super({
|
|
9
|
+
configName: "cluster-icons",
|
|
10
|
+
defaults: { icons: {} },
|
|
11
|
+
syncOptions: { fireImmediately: true }
|
|
12
|
+
});
|
|
13
|
+
require__global_external_mobx.makeObservable(this, { icons: require__global_external_mobx.observable });
|
|
14
|
+
}
|
|
15
|
+
fromStore(data) {
|
|
16
|
+
const entries = [];
|
|
17
|
+
if (data.icons && typeof data.icons === "object" && !Array.isArray(data.icons)) for (const [id, entry] of Object.entries(data.icons)) {
|
|
18
|
+
if (!id || !entry) continue;
|
|
19
|
+
try {
|
|
20
|
+
entries.push([id, { design: require_cluster_icons.normalizeClusterIconDesign(entry.design) }]);
|
|
21
|
+
} catch {}
|
|
22
|
+
}
|
|
23
|
+
this.icons = Object.fromEntries(entries);
|
|
24
|
+
}
|
|
25
|
+
toJSON() {
|
|
26
|
+
return { icons: Object.fromEntries(Object.entries(this.icons).map(([id, value]) => [id, { design: { ...value.design } }])) };
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.ClusterIconsStore = ClusterIconsStore;
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=cluster-icons-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cluster-icons-store.js","names":[],"sources":["../../../../src/common/store/cluster-icons-store.ts"],"sourcesContent":["import { Common } from \"@freelensapp/extensions\";\nimport { makeObservable, observable } from \"mobx\";\nimport { type ClusterIconDesign, normalizeClusterIconDesign } from \"../cluster-icons\";\n\nexport interface SavedClusterIcon {\n design: ClusterIconDesign;\n}\n\nexport interface ClusterIconsModel {\n icons: Record<string, SavedClusterIcon>;\n}\n\nexport class ClusterIconsStore extends Common.Store.ExtensionStore<ClusterIconsModel> {\n icons: Record<string, SavedClusterIcon> = {};\n\n constructor() {\n super({ configName: \"cluster-icons\", defaults: { icons: {} }, syncOptions: { fireImmediately: true } });\n makeObservable(this, { icons: observable });\n }\n\n fromStore(data: Partial<ClusterIconsModel>): void {\n const entries: [string, SavedClusterIcon][] = [];\n if (data.icons && typeof data.icons === \"object\" && !Array.isArray(data.icons)) {\n for (const [id, entry] of Object.entries(data.icons)) {\n if (!id || !entry) continue;\n try {\n entries.push([id, { design: normalizeClusterIconDesign(entry.design) }]);\n } catch {\n // ignore invalid saved designs without discarding other clusters\n }\n }\n }\n this.icons = Object.fromEntries(entries);\n }\n\n toJSON(): ClusterIconsModel {\n return {\n icons: Object.fromEntries(Object.entries(this.icons).map(([id, value]) => [id, { design: { ...value.design } }])),\n };\n }\n}\n"],"mappings":";;;;AAYA,IAAa,oBAAb,cAAuC,mBAAA,OAAO,MAAM,eAAkC;CACpF,QAA0C,CAAC;CAE3C,cAAc;EACZ,MAAM;GAAE,YAAY;GAAiB,UAAU,EAAE,OAAO,CAAC,EAAE;GAAG,aAAa,EAAE,iBAAiB,KAAK;EAAE,CAAC;EACtG,8BAAA,eAAe,MAAM,EAAE,OAAO,8BAAA,WAAW,CAAC;CAC5C;CAEA,UAAU,MAAwC;EAChD,MAAM,UAAwC,CAAC;EAC/C,IAAI,KAAK,SAAS,OAAO,KAAK,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,KAAK,GAC3E,KAAK,MAAM,CAAC,IAAI,UAAU,OAAO,QAAQ,KAAK,KAAK,GAAG;GACpD,IAAI,CAAC,MAAM,CAAC,OAAO;GACnB,IAAI;IACF,QAAQ,KAAK,CAAC,IAAI,EAAE,QAAQ,sBAAA,2BAA2B,MAAM,MAAM,EAAE,CAAC,CAAC;GACzE,QAAQ,CAER;EACF;EAEF,KAAK,QAAQ,OAAO,YAAY,OAAO;CACzC;CAEA,SAA4B;EAC1B,OAAO,EACL,OAAO,OAAO,YAAY,OAAO,QAAQ,KAAK,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC,EAClH;CACF;AACF"}
|
|
@@ -39,12 +39,13 @@ var DashboardPreferencesStore = class extends require_extensions.Common.Store.Ex
|
|
|
39
39
|
this.cards.splice(destination, 0, card);
|
|
40
40
|
}
|
|
41
41
|
toJSON() {
|
|
42
|
-
return { cards: this.cards.map(({ id, title, url, size, autoRefresh, selector }) => ({
|
|
42
|
+
return { cards: this.cards.map(({ id, title, url, size, autoRefresh, refreshEvery10Seconds, selector }) => ({
|
|
43
43
|
id,
|
|
44
44
|
title,
|
|
45
45
|
url,
|
|
46
46
|
size,
|
|
47
47
|
autoRefresh: autoRefresh === true,
|
|
48
|
+
...refreshEvery10Seconds === true ? { refreshEvery10Seconds: true } : {},
|
|
48
49
|
...selector ? { selector } : {}
|
|
49
50
|
})) };
|
|
50
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-preferences-store.js","names":[],"sources":["../../../../src/common/store/dashboard-preferences-store.ts"],"sourcesContent":["import { Common } from \"@freelensapp/extensions\";\nimport { action, makeObservable, observable } from \"mobx\";\nimport { type DashboardCard, sanitizeDashboardCards } from \"../dashboard\";\n\nexport interface DashboardPreferencesModel {\n cards: DashboardCard[];\n}\n\nexport class DashboardPreferencesStore extends Common.Store.ExtensionStore<DashboardPreferencesModel> {\n cards: DashboardCard[] = [];\n\n constructor() {\n super({ configName: \"dashboard-preferences\", defaults: { cards: [] } });\n makeObservable(this, {\n cards: observable,\n fromStore: action,\n upsertCard: action,\n removeCard: action,\n moveCard: action,\n });\n }\n\n fromStore(data: Partial<DashboardPreferencesModel>): void {\n this.cards = sanitizeDashboardCards(data?.cards);\n }\n\n upsertCard(card: DashboardCard): void {\n const normalized = sanitizeDashboardCards([card])[0];\n if (!normalized) return;\n const index = this.cards.findIndex((entry) => entry.id === normalized.id);\n if (index < 0) this.cards.push(normalized);\n else this.cards[index] = normalized;\n }\n\n removeCard(id: string): void {\n this.cards = this.cards.filter((card) => card.id !== id);\n }\n\n moveCard(id: string, targetIndex: number): void {\n const index = this.cards.findIndex((card) => card.id === id);\n if (index < 0 || !Number.isFinite(targetIndex)) return;\n const destination = Math.max(0, Math.min(this.cards.length - 1, Math.trunc(targetIndex)));\n if (index === destination) return;\n const [card] = this.cards.splice(index, 1);\n this.cards.splice(destination, 0, card);\n }\n\n toJSON(): DashboardPreferencesModel {\n return {\n cards: this.cards.map(({ id, title, url, size, autoRefresh, selector }) => ({\n id,\n title,\n url,\n size,\n autoRefresh: autoRefresh === true,\n ...(selector ? { selector } : {}),\n })),\n };\n }\n}\n"],"mappings":";;;;AAQA,IAAa,4BAAb,cAA+C,mBAAA,OAAO,MAAM,eAA0C;CACpG,QAAyB,CAAC;CAE1B,cAAc;EACZ,MAAM;GAAE,YAAY;GAAyB,UAAU,EAAE,OAAO,CAAC,EAAE;EAAE,CAAC;EACtE,8BAAA,eAAe,MAAM;GACnB,OAAO,8BAAA;GACP,WAAW,8BAAA;GACX,YAAY,8BAAA;GACZ,YAAY,8BAAA;GACZ,UAAU,8BAAA;EACZ,CAAC;CACH;CAEA,UAAU,MAAgD;EACxD,KAAK,QAAQ,kBAAA,uBAAuB,MAAM,KAAK;CACjD;CAEA,WAAW,MAA2B;EACpC,MAAM,aAAa,kBAAA,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC;EAClD,IAAI,CAAC,YAAY;EACjB,MAAM,QAAQ,KAAK,MAAM,WAAW,UAAU,MAAM,OAAO,WAAW,EAAE;EACxE,IAAI,QAAQ,GAAG,KAAK,MAAM,KAAK,UAAU;OACpC,KAAK,MAAM,SAAS;CAC3B;CAEA,WAAW,IAAkB;EAC3B,KAAK,QAAQ,KAAK,MAAM,QAAQ,SAAS,KAAK,OAAO,EAAE;CACzD;CAEA,SAAS,IAAY,aAA2B;EAC9C,MAAM,QAAQ,KAAK,MAAM,WAAW,SAAS,KAAK,OAAO,EAAE;EAC3D,IAAI,QAAQ,KAAK,CAAC,OAAO,SAAS,WAAW,GAAG;EAChD,MAAM,cAAc,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,MAAM,SAAS,GAAG,KAAK,MAAM,WAAW,CAAC,CAAC;EACxF,IAAI,UAAU,aAAa;EAC3B,MAAM,CAAC,QAAQ,KAAK,MAAM,OAAO,OAAO,CAAC;EACzC,KAAK,MAAM,OAAO,aAAa,GAAG,IAAI;CACxC;CAEA,SAAoC;EAClC,OAAO,EACL,OAAO,KAAK,MAAM,KAAK,EAAE,IAAI,OAAO,KAAK,MAAM,aAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"dashboard-preferences-store.js","names":[],"sources":["../../../../src/common/store/dashboard-preferences-store.ts"],"sourcesContent":["import { Common } from \"@freelensapp/extensions\";\nimport { action, makeObservable, observable } from \"mobx\";\nimport { type DashboardCard, sanitizeDashboardCards } from \"../dashboard\";\n\nexport interface DashboardPreferencesModel {\n cards: DashboardCard[];\n}\n\nexport class DashboardPreferencesStore extends Common.Store.ExtensionStore<DashboardPreferencesModel> {\n cards: DashboardCard[] = [];\n\n constructor() {\n super({ configName: \"dashboard-preferences\", defaults: { cards: [] } });\n makeObservable(this, {\n cards: observable,\n fromStore: action,\n upsertCard: action,\n removeCard: action,\n moveCard: action,\n });\n }\n\n fromStore(data: Partial<DashboardPreferencesModel>): void {\n this.cards = sanitizeDashboardCards(data?.cards);\n }\n\n upsertCard(card: DashboardCard): void {\n const normalized = sanitizeDashboardCards([card])[0];\n if (!normalized) return;\n const index = this.cards.findIndex((entry) => entry.id === normalized.id);\n if (index < 0) this.cards.push(normalized);\n else this.cards[index] = normalized;\n }\n\n removeCard(id: string): void {\n this.cards = this.cards.filter((card) => card.id !== id);\n }\n\n moveCard(id: string, targetIndex: number): void {\n const index = this.cards.findIndex((card) => card.id === id);\n if (index < 0 || !Number.isFinite(targetIndex)) return;\n const destination = Math.max(0, Math.min(this.cards.length - 1, Math.trunc(targetIndex)));\n if (index === destination) return;\n const [card] = this.cards.splice(index, 1);\n this.cards.splice(destination, 0, card);\n }\n\n toJSON(): DashboardPreferencesModel {\n return {\n cards: this.cards.map(({ id, title, url, size, autoRefresh, refreshEvery10Seconds, selector }) => ({\n id,\n title,\n url,\n size,\n autoRefresh: autoRefresh === true,\n ...(refreshEvery10Seconds === true ? { refreshEvery10Seconds: true } : {}),\n ...(selector ? { selector } : {}),\n })),\n };\n }\n}\n"],"mappings":";;;;AAQA,IAAa,4BAAb,cAA+C,mBAAA,OAAO,MAAM,eAA0C;CACpG,QAAyB,CAAC;CAE1B,cAAc;EACZ,MAAM;GAAE,YAAY;GAAyB,UAAU,EAAE,OAAO,CAAC,EAAE;EAAE,CAAC;EACtE,8BAAA,eAAe,MAAM;GACnB,OAAO,8BAAA;GACP,WAAW,8BAAA;GACX,YAAY,8BAAA;GACZ,YAAY,8BAAA;GACZ,UAAU,8BAAA;EACZ,CAAC;CACH;CAEA,UAAU,MAAgD;EACxD,KAAK,QAAQ,kBAAA,uBAAuB,MAAM,KAAK;CACjD;CAEA,WAAW,MAA2B;EACpC,MAAM,aAAa,kBAAA,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC;EAClD,IAAI,CAAC,YAAY;EACjB,MAAM,QAAQ,KAAK,MAAM,WAAW,UAAU,MAAM,OAAO,WAAW,EAAE;EACxE,IAAI,QAAQ,GAAG,KAAK,MAAM,KAAK,UAAU;OACpC,KAAK,MAAM,SAAS;CAC3B;CAEA,WAAW,IAAkB;EAC3B,KAAK,QAAQ,KAAK,MAAM,QAAQ,SAAS,KAAK,OAAO,EAAE;CACzD;CAEA,SAAS,IAAY,aAA2B;EAC9C,MAAM,QAAQ,KAAK,MAAM,WAAW,SAAS,KAAK,OAAO,EAAE;EAC3D,IAAI,QAAQ,KAAK,CAAC,OAAO,SAAS,WAAW,GAAG;EAChD,MAAM,cAAc,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,MAAM,SAAS,GAAG,KAAK,MAAM,WAAW,CAAC,CAAC;EACxF,IAAI,UAAU,aAAa;EAC3B,MAAM,CAAC,QAAQ,KAAK,MAAM,OAAO,OAAO,CAAC;EACzC,KAAK,MAAM,OAAO,aAAa,GAAG,IAAI;CACxC;CAEA,SAAoC;EAClC,OAAO,EACL,OAAO,KAAK,MAAM,KAAK,EAAE,IAAI,OAAO,KAAK,MAAM,aAAa,uBAAuB,gBAAgB;GACjG;GACA;GACA;GACA;GACA,aAAa,gBAAgB;GAC7B,GAAI,0BAA0B,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;GACxE,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;EACjC,EAAE,EACJ;CACF;AACF"}
|
|
@@ -4,6 +4,7 @@ const require_monitoring_history = require("../monitoring-history.js");
|
|
|
4
4
|
//#region src/common/store/monitoring-preferences-store.ts
|
|
5
5
|
var MonitoringPreferencesStore = class extends require_extensions.Common.Store.ExtensionStore {
|
|
6
6
|
enabled = false;
|
|
7
|
+
diagnosticsVisible = true;
|
|
7
8
|
historyEnabled = false;
|
|
8
9
|
trackedHistory = [];
|
|
9
10
|
constructor() {
|
|
@@ -11,12 +12,14 @@ var MonitoringPreferencesStore = class extends require_extensions.Common.Store.E
|
|
|
11
12
|
configName: "monitoring-preferences",
|
|
12
13
|
defaults: {
|
|
13
14
|
enabled: false,
|
|
15
|
+
diagnosticsVisible: true,
|
|
14
16
|
historyEnabled: false,
|
|
15
17
|
trackedHistory: []
|
|
16
18
|
}
|
|
17
19
|
});
|
|
18
20
|
require__global_external_mobx.makeObservable(this, {
|
|
19
21
|
enabled: require__global_external_mobx.observable,
|
|
22
|
+
diagnosticsVisible: require__global_external_mobx.observable,
|
|
20
23
|
historyEnabled: require__global_external_mobx.observable,
|
|
21
24
|
trackedHistory: require__global_external_mobx.observable,
|
|
22
25
|
fromStore: require__global_external_mobx.action
|
|
@@ -24,6 +27,7 @@ var MonitoringPreferencesStore = class extends require_extensions.Common.Store.E
|
|
|
24
27
|
}
|
|
25
28
|
fromStore(data) {
|
|
26
29
|
this.enabled = data?.enabled === true;
|
|
30
|
+
this.diagnosticsVisible = data?.diagnosticsVisible !== false;
|
|
27
31
|
this.historyEnabled = data?.historyEnabled === true;
|
|
28
32
|
this.trackedHistory = Array.isArray(data?.trackedHistory) ? data.trackedHistory.filter(require_monitoring_history.validHistoryIdentity).slice(0, 100).map(({ clusterId, scope, uid }) => ({
|
|
29
33
|
clusterId,
|
|
@@ -34,6 +38,7 @@ var MonitoringPreferencesStore = class extends require_extensions.Common.Store.E
|
|
|
34
38
|
toJSON() {
|
|
35
39
|
return {
|
|
36
40
|
enabled: this.enabled,
|
|
41
|
+
diagnosticsVisible: this.diagnosticsVisible,
|
|
37
42
|
historyEnabled: this.historyEnabled,
|
|
38
43
|
trackedHistory: this.trackedHistory.map(({ clusterId, scope, uid }) => ({
|
|
39
44
|
clusterId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitoring-preferences-store.js","names":[],"sources":["../../../../src/common/store/monitoring-preferences-store.ts"],"sourcesContent":["import { Common } from \"@freelensapp/extensions\";\nimport { action, makeObservable, observable } from \"mobx\";\nimport { type HistoryIdentity, validHistoryIdentity } from \"../monitoring-history\";\n\nexport class MonitoringPreferencesStore extends Common.Store.ExtensionStore<{\n enabled: boolean;\n historyEnabled: boolean;\n trackedHistory: HistoryIdentity[];\n}> {\n enabled = false;\n historyEnabled = false;\n trackedHistory: HistoryIdentity[] = [];\n\n constructor() {\n super({\n configName: \"monitoring-preferences\",\n defaults: { enabled: false, historyEnabled: false, trackedHistory: [] },\n });\n makeObservable(this, {\n enabled: observable,\n historyEnabled: observable,\n trackedHistory: observable,\n fromStore: action,\n });\n }\n\n fromStore(data: {
|
|
1
|
+
{"version":3,"file":"monitoring-preferences-store.js","names":[],"sources":["../../../../src/common/store/monitoring-preferences-store.ts"],"sourcesContent":["import { Common } from \"@freelensapp/extensions\";\nimport { action, makeObservable, observable } from \"mobx\";\nimport { type HistoryIdentity, validHistoryIdentity } from \"../monitoring-history\";\n\nexport class MonitoringPreferencesStore extends Common.Store.ExtensionStore<{\n enabled: boolean;\n diagnosticsVisible: boolean;\n historyEnabled: boolean;\n trackedHistory: HistoryIdentity[];\n}> {\n enabled = false;\n diagnosticsVisible = true;\n historyEnabled = false;\n trackedHistory: HistoryIdentity[] = [];\n\n constructor() {\n super({\n configName: \"monitoring-preferences\",\n defaults: { enabled: false, diagnosticsVisible: true, historyEnabled: false, trackedHistory: [] },\n });\n makeObservable(this, {\n enabled: observable,\n diagnosticsVisible: observable,\n historyEnabled: observable,\n trackedHistory: observable,\n fromStore: action,\n });\n }\n\n fromStore(data: {\n enabled?: boolean;\n diagnosticsVisible?: boolean;\n historyEnabled?: boolean;\n trackedHistory?: HistoryIdentity[];\n }): void {\n this.enabled = data?.enabled === true;\n this.diagnosticsVisible = data?.diagnosticsVisible !== false;\n this.historyEnabled = data?.historyEnabled === true;\n this.trackedHistory = Array.isArray(data?.trackedHistory)\n ? data.trackedHistory\n .filter(validHistoryIdentity)\n .slice(0, 100)\n .map(({ clusterId, scope, uid }) => ({ clusterId, scope, uid }))\n : [];\n }\n\n toJSON(): {\n enabled: boolean;\n diagnosticsVisible: boolean;\n historyEnabled: boolean;\n trackedHistory: HistoryIdentity[];\n } {\n return {\n enabled: this.enabled,\n diagnosticsVisible: this.diagnosticsVisible,\n historyEnabled: this.historyEnabled,\n trackedHistory: this.trackedHistory.map(({ clusterId, scope, uid }) => ({ clusterId, scope, uid })),\n };\n }\n}\n"],"mappings":";;;;AAIA,IAAa,6BAAb,cAAgD,mBAAA,OAAO,MAAM,eAK1D;CACD,UAAU;CACV,qBAAqB;CACrB,iBAAiB;CACjB,iBAAoC,CAAC;CAErC,cAAc;EACZ,MAAM;GACJ,YAAY;GACZ,UAAU;IAAE,SAAS;IAAO,oBAAoB;IAAM,gBAAgB;IAAO,gBAAgB,CAAC;GAAE;EAClG,CAAC;EACD,8BAAA,eAAe,MAAM;GACnB,SAAS,8BAAA;GACT,oBAAoB,8BAAA;GACpB,gBAAgB,8BAAA;GAChB,gBAAgB,8BAAA;GAChB,WAAW,8BAAA;EACb,CAAC;CACH;CAEA,UAAU,MAKD;EACP,KAAK,UAAU,MAAM,YAAY;EACjC,KAAK,qBAAqB,MAAM,uBAAuB;EACvD,KAAK,iBAAiB,MAAM,mBAAmB;EAC/C,KAAK,iBAAiB,MAAM,QAAQ,MAAM,cAAc,IACpD,KAAK,eACF,OAAO,2BAAA,oBAAoB,CAAC,CAC5B,MAAM,GAAG,GAAG,CAAC,CACb,KAAK,EAAE,WAAW,OAAO,WAAW;GAAE;GAAW;GAAO;EAAI,EAAE,IACjE,CAAC;CACP;CAEA,SAKE;EACA,OAAO;GACL,SAAS,KAAK;GACd,oBAAoB,KAAK;GACzB,gBAAgB,KAAK;GACrB,gBAAgB,KAAK,eAAe,KAAK,EAAE,WAAW,OAAO,WAAW;IAAE;IAAW;IAAO;GAAI,EAAE;EACpG;CACF;AACF"}
|
|
@@ -207,24 +207,30 @@ function startDashboardViews() {
|
|
|
207
207
|
card.floatingPreparation?.selectorChanged();
|
|
208
208
|
}
|
|
209
209
|
if (card.floating && !card.floating.isDestroyed()) card.floating.setTitle(setting.title);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
if (
|
|
210
|
+
const interval = setting.refreshEvery10Seconds ? 1e4 : setting.autoRefresh ? 6e5 : void 0;
|
|
211
|
+
if (card.refreshInterval === interval) continue;
|
|
212
|
+
clearInterval(card.refreshTimer);
|
|
213
|
+
card.refreshTimer = void 0;
|
|
214
|
+
card.refreshInterval = interval;
|
|
215
|
+
if (!interval) continue;
|
|
216
216
|
card.refreshTimer = setInterval(() => {
|
|
217
217
|
const latest = configuredCards().find((item) => item.id === id);
|
|
218
|
-
if (owners.get(sender) !== owner ||
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
if (owners.get(sender) !== owner || owner.cards.get(id) !== card || !latest || latest.url !== card.url || (latest.refreshEvery10Seconds ? 1e4 : latest.autoRefresh ? 6e5 : void 0) !== interval || card.view.webContents.isDestroyed() || card.loading || card.view.webContents.isLoading()) return;
|
|
219
|
+
if (latest.refreshEvery10Seconds) {
|
|
220
|
+
if (card.floating) {
|
|
221
|
+
if (card.floating.isDestroyed() || card.floating.webContents.isLoading() || card.floatingPreparation?.isPreparing()) return;
|
|
222
|
+
Promise.all([reload(card, latest.url), card.floatingPreparation?.refresh()]);
|
|
223
|
+
} else if (card.visible && dashboardUrl(sender.getURL())) reload(card, latest.url);
|
|
224
|
+
} else if (!card.floating && !dashboardUrl(sender.getURL())) reload(card, latest.url);
|
|
225
|
+
}, interval);
|
|
221
226
|
}
|
|
222
227
|
};
|
|
223
|
-
const stopSettingsReaction = require__global_external_mobx.reaction(() => JSON.stringify(configuredCards().map(({ id, title, url, autoRefresh, selector }) => ({
|
|
228
|
+
const stopSettingsReaction = require__global_external_mobx.reaction(() => JSON.stringify(configuredCards().map(({ id, title, url, autoRefresh, refreshEvery10Seconds, selector }) => ({
|
|
224
229
|
id,
|
|
225
230
|
title,
|
|
226
231
|
url,
|
|
227
232
|
autoRefresh,
|
|
233
|
+
refreshEvery10Seconds,
|
|
228
234
|
selector
|
|
229
235
|
}))), refreshTimers);
|
|
230
236
|
const trusted = (event) => event.senderFrame === event.sender.mainFrame && dashboardUrl(event.senderFrame?.url ?? "") && dashboardUrl(event.sender.getURL());
|
|
@@ -536,10 +542,12 @@ function startDashboardViews() {
|
|
|
536
542
|
floating.on("resize", layoutSkeleton);
|
|
537
543
|
layoutSkeleton();
|
|
538
544
|
let generation = 0;
|
|
545
|
+
let floatingPreparing = false;
|
|
539
546
|
let stopPreparation = () => {};
|
|
540
547
|
let finishLoad;
|
|
541
548
|
const begin = () => {
|
|
542
549
|
stopPreparation();
|
|
550
|
+
floatingPreparing = true;
|
|
543
551
|
const token = ++generation;
|
|
544
552
|
const backgroundThrottling = contents.getBackgroundThrottling();
|
|
545
553
|
if (backgroundThrottling) contents.setBackgroundThrottling(false);
|
|
@@ -551,6 +559,7 @@ function startDashboardViews() {
|
|
|
551
559
|
stopPreparation = () => {
|
|
552
560
|
if (!active) return;
|
|
553
561
|
active = false;
|
|
562
|
+
floatingPreparing = false;
|
|
554
563
|
network.dispose();
|
|
555
564
|
if (!contents.isDestroyed() && backgroundThrottling) contents.setBackgroundThrottling(true);
|
|
556
565
|
};
|
|
@@ -586,6 +595,7 @@ function startDashboardViews() {
|
|
|
586
595
|
};
|
|
587
596
|
card.floatingPreparation = {
|
|
588
597
|
refresh,
|
|
598
|
+
isPreparing: () => floatingPreparing,
|
|
589
599
|
selectorChanged: () => {
|
|
590
600
|
const preparation = begin();
|
|
591
601
|
if (!contents.isLoading()) preparation.finish();
|