@64mb/freelens-power 1.1.0 → 1.2.0
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 +1 -1
- package/out/main/common/dashboard.js.map +1 -1
- package/out/main/common/settings-export.js +3 -1
- 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/monitoring-preferences-store.js +5 -0
- package/out/main/common/store/monitoring-preferences-store.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 +8 -5
- 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 +20 -4
- 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 +1 -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/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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const require_Enum = require("./Enum.js");
|
|
2
|
+
const require_Utility = require("./Utility.js");
|
|
3
|
+
//#region node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js
|
|
4
|
+
/**
|
|
5
|
+
* @param {object[]} children
|
|
6
|
+
* @param {function} callback
|
|
7
|
+
* @return {string}
|
|
8
|
+
*/
|
|
9
|
+
function serialize(children, callback) {
|
|
10
|
+
var output = "";
|
|
11
|
+
var length = require_Utility.sizeof(children);
|
|
12
|
+
for (var i = 0; i < length; i++) output += callback(children[i], i, children, callback) || "";
|
|
13
|
+
return output;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @param {object} element
|
|
17
|
+
* @param {number} index
|
|
18
|
+
* @param {object[]} children
|
|
19
|
+
* @param {function} callback
|
|
20
|
+
* @return {string}
|
|
21
|
+
*/
|
|
22
|
+
function stringify(element, index, children, callback) {
|
|
23
|
+
switch (element.type) {
|
|
24
|
+
case require_Enum.LAYER: if (element.children.length) break;
|
|
25
|
+
case require_Enum.IMPORT:
|
|
26
|
+
case require_Enum.DECLARATION: return element.return = element.return || element.value;
|
|
27
|
+
case require_Enum.COMMENT: return "";
|
|
28
|
+
case require_Enum.KEYFRAMES: return element.return = element.value + "{" + serialize(element.children, callback) + "}";
|
|
29
|
+
case require_Enum.RULESET: element.value = element.props.join(",");
|
|
30
|
+
}
|
|
31
|
+
return require_Utility.strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.serialize = serialize;
|
|
35
|
+
exports.stringify = stringify;
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=Serializer.js.map
|
package/out/renderer/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Serializer.js","names":["sizeof","LAYER","IMPORT","DECLARATION","COMMENT","KEYFRAMES","RULESET","strlen"],"sources":["../../../../../../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Serializer.js"],"sourcesContent":["import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AAQA,SAAgB,UAAW,UAAU,UAAU;CAC9C,IAAI,SAAS;CACb,IAAI,SAASA,gBAAAA,OAAO,QAAQ;CAE5B,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,KAC3B,UAAU,SAAS,SAAS,IAAI,GAAG,UAAU,QAAQ,KAAK;CAE3D,OAAO;AACR;;;;;;;;AASA,SAAgB,UAAW,SAAS,OAAO,UAAU,UAAU;CAC9D,QAAQ,QAAQ,MAAhB;EACC,KAAKC,aAAAA,OAAO,IAAI,QAAQ,SAAS,QAAQ;EACzC,KAAKC,aAAAA;EAAQ,KAAKC,aAAAA,aAAa,OAAO,QAAQ,SAAS,QAAQ,UAAU,QAAQ;EACjF,KAAKC,aAAAA,SAAS,OAAO;EACrB,KAAKC,aAAAA,WAAW,OAAO,QAAQ,SAAS,QAAQ,QAAQ,MAAM,UAAU,QAAQ,UAAU,QAAQ,IAAI;EACtG,KAAKC,aAAAA,SAAS,QAAQ,QAAQ,QAAQ,MAAM,KAAK,GAAG;CACrD;CAEA,OAAOC,gBAAAA,OAAO,WAAW,UAAU,QAAQ,UAAU,QAAQ,CAAC,IAAI,QAAQ,SAAS,QAAQ,QAAQ,MAAM,WAAW,MAAM;AAC3H"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
const require_Utility = require("./Utility.js");
|
|
2
|
+
//#region node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js
|
|
3
|
+
var line = 1;
|
|
4
|
+
var column = 1;
|
|
5
|
+
var length = 0;
|
|
6
|
+
var position = 0;
|
|
7
|
+
var character = 0;
|
|
8
|
+
var characters = "";
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} value
|
|
11
|
+
* @param {object | null} root
|
|
12
|
+
* @param {object | null} parent
|
|
13
|
+
* @param {string} type
|
|
14
|
+
* @param {string[] | string} props
|
|
15
|
+
* @param {object[] | string} children
|
|
16
|
+
* @param {number} length
|
|
17
|
+
*/
|
|
18
|
+
function node(value, root, parent, type, props, children, length) {
|
|
19
|
+
return {
|
|
20
|
+
value,
|
|
21
|
+
root,
|
|
22
|
+
parent,
|
|
23
|
+
type,
|
|
24
|
+
props,
|
|
25
|
+
children,
|
|
26
|
+
line,
|
|
27
|
+
column,
|
|
28
|
+
length,
|
|
29
|
+
return: ""
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @param {object} root
|
|
34
|
+
* @param {object} props
|
|
35
|
+
* @return {object}
|
|
36
|
+
*/
|
|
37
|
+
function copy(root, props) {
|
|
38
|
+
return require_Utility.assign(node("", null, null, "", null, null, 0), root, { length: -root.length }, props);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @return {number}
|
|
42
|
+
*/
|
|
43
|
+
function char() {
|
|
44
|
+
return character;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @return {number}
|
|
48
|
+
*/
|
|
49
|
+
function prev() {
|
|
50
|
+
character = position > 0 ? require_Utility.charat(characters, --position) : 0;
|
|
51
|
+
if (column--, character === 10) column = 1, line--;
|
|
52
|
+
return character;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @return {number}
|
|
56
|
+
*/
|
|
57
|
+
function next() {
|
|
58
|
+
character = position < length ? require_Utility.charat(characters, position++) : 0;
|
|
59
|
+
if (column++, character === 10) column = 1, line++;
|
|
60
|
+
return character;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @return {number}
|
|
64
|
+
*/
|
|
65
|
+
function peek() {
|
|
66
|
+
return require_Utility.charat(characters, position);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @return {number}
|
|
70
|
+
*/
|
|
71
|
+
function caret() {
|
|
72
|
+
return position;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @param {number} begin
|
|
76
|
+
* @param {number} end
|
|
77
|
+
* @return {string}
|
|
78
|
+
*/
|
|
79
|
+
function slice(begin, end) {
|
|
80
|
+
return require_Utility.substr(characters, begin, end);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @param {number} type
|
|
84
|
+
* @return {number}
|
|
85
|
+
*/
|
|
86
|
+
function token(type) {
|
|
87
|
+
switch (type) {
|
|
88
|
+
case 0:
|
|
89
|
+
case 9:
|
|
90
|
+
case 10:
|
|
91
|
+
case 13:
|
|
92
|
+
case 32: return 5;
|
|
93
|
+
case 33:
|
|
94
|
+
case 43:
|
|
95
|
+
case 44:
|
|
96
|
+
case 47:
|
|
97
|
+
case 62:
|
|
98
|
+
case 64:
|
|
99
|
+
case 126:
|
|
100
|
+
case 59:
|
|
101
|
+
case 123:
|
|
102
|
+
case 125: return 4;
|
|
103
|
+
case 58: return 3;
|
|
104
|
+
case 34:
|
|
105
|
+
case 39:
|
|
106
|
+
case 40:
|
|
107
|
+
case 91: return 2;
|
|
108
|
+
case 41:
|
|
109
|
+
case 93: return 1;
|
|
110
|
+
}
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @param {string} value
|
|
115
|
+
* @return {any[]}
|
|
116
|
+
*/
|
|
117
|
+
function alloc(value) {
|
|
118
|
+
return line = column = 1, length = require_Utility.strlen(characters = value), position = 0, [];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* @param {any} value
|
|
122
|
+
* @return {any}
|
|
123
|
+
*/
|
|
124
|
+
function dealloc(value) {
|
|
125
|
+
return characters = "", value;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @param {number} type
|
|
129
|
+
* @return {string}
|
|
130
|
+
*/
|
|
131
|
+
function delimit(type) {
|
|
132
|
+
return require_Utility.trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @param {number} type
|
|
136
|
+
* @return {string}
|
|
137
|
+
*/
|
|
138
|
+
function whitespace(type) {
|
|
139
|
+
while (character = peek()) if (character < 33) next();
|
|
140
|
+
else break;
|
|
141
|
+
return token(type) > 2 || token(character) > 3 ? "" : " ";
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @param {number} index
|
|
145
|
+
* @param {number} count
|
|
146
|
+
* @return {string}
|
|
147
|
+
*/
|
|
148
|
+
function escaping(index, count) {
|
|
149
|
+
while (--count && next()) if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) break;
|
|
150
|
+
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* @param {number} type
|
|
154
|
+
* @return {number}
|
|
155
|
+
*/
|
|
156
|
+
function delimiter(type) {
|
|
157
|
+
while (next()) switch (character) {
|
|
158
|
+
case type: return position;
|
|
159
|
+
case 34:
|
|
160
|
+
case 39:
|
|
161
|
+
if (type !== 34 && type !== 39) delimiter(character);
|
|
162
|
+
break;
|
|
163
|
+
case 40:
|
|
164
|
+
if (type === 41) delimiter(type);
|
|
165
|
+
break;
|
|
166
|
+
case 92:
|
|
167
|
+
next();
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
return position;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* @param {number} type
|
|
174
|
+
* @param {number} index
|
|
175
|
+
* @return {number}
|
|
176
|
+
*/
|
|
177
|
+
function commenter(type, index) {
|
|
178
|
+
while (next()) if (type + character === 57) break;
|
|
179
|
+
else if (type + character === 84 && peek() === 47) break;
|
|
180
|
+
return "/*" + slice(index, position - 1) + "*" + require_Utility.from(type === 47 ? type : next());
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* @param {number} index
|
|
184
|
+
* @return {string}
|
|
185
|
+
*/
|
|
186
|
+
function identifier(index) {
|
|
187
|
+
while (!token(peek())) next();
|
|
188
|
+
return slice(index, position);
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
exports.alloc = alloc;
|
|
192
|
+
exports.caret = caret;
|
|
193
|
+
exports.char = char;
|
|
194
|
+
Object.defineProperty(exports, "character", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function() {
|
|
197
|
+
return character;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
Object.defineProperty(exports, "characters", {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function() {
|
|
203
|
+
return characters;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
Object.defineProperty(exports, "column", {
|
|
207
|
+
enumerable: true,
|
|
208
|
+
get: function() {
|
|
209
|
+
return column;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
exports.commenter = commenter;
|
|
213
|
+
exports.copy = copy;
|
|
214
|
+
exports.dealloc = dealloc;
|
|
215
|
+
exports.delimit = delimit;
|
|
216
|
+
exports.delimiter = delimiter;
|
|
217
|
+
exports.escaping = escaping;
|
|
218
|
+
exports.identifier = identifier;
|
|
219
|
+
Object.defineProperty(exports, "length", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function() {
|
|
222
|
+
return length;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(exports, "line", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function() {
|
|
228
|
+
return line;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
exports.next = next;
|
|
232
|
+
exports.node = node;
|
|
233
|
+
exports.peek = peek;
|
|
234
|
+
Object.defineProperty(exports, "position", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function() {
|
|
237
|
+
return position;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
exports.prev = prev;
|
|
241
|
+
exports.slice = slice;
|
|
242
|
+
exports.token = token;
|
|
243
|
+
exports.whitespace = whitespace;
|
|
244
|
+
|
|
245
|
+
//# sourceMappingURL=Tokenizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tokenizer.js","names":["assign","charat","substr","strlen","trim","from"],"sources":["../../../../../../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js"],"sourcesContent":["import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n"],"x_google_ignoreList":[0],"mappings":";;AAEA,IAAW,OAAO;AAClB,IAAW,SAAS;AACpB,IAAW,SAAS;AACpB,IAAW,WAAW;AACtB,IAAW,YAAY;AACvB,IAAW,aAAa;;;;;;;;;;AAWxB,SAAgB,KAAM,OAAO,MAAM,QAAQ,MAAM,OAAO,UAAU,QAAQ;CACzE,OAAO;EAAQ;EAAa;EAAc;EAAc;EAAa;EAAiB;EAAgB;EAAc;EAAgB;EAAQ,QAAQ;CAAE;AACvJ;;;;;;AAOA,SAAgB,KAAM,MAAM,OAAO;CAClC,OAAOA,gBAAAA,OAAO,KAAK,IAAI,MAAM,MAAM,IAAI,MAAM,MAAM,CAAC,GAAG,MAAM,EAAC,QAAQ,CAAC,KAAK,OAAM,GAAG,KAAK;AAC3F;;;;AAKA,SAAgB,OAAQ;CACvB,OAAO;AACR;;;;AAKA,SAAgB,OAAQ;CACvB,YAAY,WAAW,IAAIC,gBAAAA,OAAO,YAAY,EAAE,QAAQ,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;CAEF,OAAO,MAAM,IAAI,IAAI,KAAK,MAAM,SAAS,IAAI,IAAI,KAAK;AACvD;;;;;;AAwBA,SAAgB,SAAU,OAAO,OAAO;CACvC,OAAO,EAAE,SAAS,KAAK,GAEtB,IAAI,YAAY,MAAM,YAAY,OAAQ,YAAY,MAAM,YAAY,MAAQ,YAAY,MAAM,YAAY,IAC7G;CAEF,OAAO,MAAM,OAAO,MAAM,KAAK,QAAQ,KAAK,KAAK,KAAK,MAAM,KAAK,KAAK,GAAG;AAC1E;;;;;AAMA,SAAgB,UAAW,MAAM;CAChC,OAAO,KAAK,GACX,QAAQ,WAAR;EAEC,KAAK,MACJ,OAAO;EAER,KAAK;EAAI,KAAK;GACb,IAAI,SAAS,MAAM,SAAS,IAC3B,UAAU,SAAS;GACpB;EAED,KAAK;GACJ,IAAI,SAAS,IACZ,UAAU,IAAI;GACf;EAED,KAAK;GACJ,KAAK;GACL;CACF;CAED,OAAO;AACR;;;;;;AAOA,SAAgB,UAAW,MAAM,OAAO;CACvC,OAAO,KAAK,GAEX,IAAI,OAAO,cAAc,IACxB;MAEI,IAAI,OAAO,cAAc,MAAW,KAAK,MAAM,IACnD;CAEF,OAAO,OAAO,MAAM,OAAO,WAAW,CAAC,IAAI,MAAMC,gBAAAA,KAAK,SAAS,KAAK,OAAO,KAAK,CAAC;AAClF;;;;;AAMA,SAAgB,WAAY,OAAO;CAClC,OAAO,CAAC,MAAM,KAAK,CAAC,GACnB,KAAK;CAEN,OAAO,MAAM,OAAO,QAAQ;AAC7B"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js
|
|
2
|
+
/**
|
|
3
|
+
* @param {number}
|
|
4
|
+
* @return {number}
|
|
5
|
+
*/
|
|
6
|
+
var abs = Math.abs;
|
|
7
|
+
/**
|
|
8
|
+
* @param {number}
|
|
9
|
+
* @return {string}
|
|
10
|
+
*/
|
|
11
|
+
var from = String.fromCharCode;
|
|
12
|
+
/**
|
|
13
|
+
* @param {object}
|
|
14
|
+
* @return {object}
|
|
15
|
+
*/
|
|
16
|
+
var assign = Object.assign;
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} value
|
|
19
|
+
* @param {number} length
|
|
20
|
+
* @return {number}
|
|
21
|
+
*/
|
|
22
|
+
function hash(value, length) {
|
|
23
|
+
return charat(value, 0) ^ 45 ? (((length << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @param {string} value
|
|
27
|
+
* @return {string}
|
|
28
|
+
*/
|
|
29
|
+
function trim(value) {
|
|
30
|
+
return value.trim();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @param {string} value
|
|
34
|
+
* @param {RegExp} pattern
|
|
35
|
+
* @return {string?}
|
|
36
|
+
*/
|
|
37
|
+
function match(value, pattern) {
|
|
38
|
+
return (value = pattern.exec(value)) ? value[0] : value;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @param {string} value
|
|
42
|
+
* @param {(string|RegExp)} pattern
|
|
43
|
+
* @param {string} replacement
|
|
44
|
+
* @return {string}
|
|
45
|
+
*/
|
|
46
|
+
function replace(value, pattern, replacement) {
|
|
47
|
+
return value.replace(pattern, replacement);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @param {string} value
|
|
51
|
+
* @param {string} search
|
|
52
|
+
* @return {number}
|
|
53
|
+
*/
|
|
54
|
+
function indexof(value, search) {
|
|
55
|
+
return value.indexOf(search);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} value
|
|
59
|
+
* @param {number} index
|
|
60
|
+
* @return {number}
|
|
61
|
+
*/
|
|
62
|
+
function charat(value, index) {
|
|
63
|
+
return value.charCodeAt(index) | 0;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @param {string} value
|
|
67
|
+
* @param {number} begin
|
|
68
|
+
* @param {number} end
|
|
69
|
+
* @return {string}
|
|
70
|
+
*/
|
|
71
|
+
function substr(value, begin, end) {
|
|
72
|
+
return value.slice(begin, end);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @param {string} value
|
|
76
|
+
* @return {number}
|
|
77
|
+
*/
|
|
78
|
+
function strlen(value) {
|
|
79
|
+
return value.length;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @param {any[]} value
|
|
83
|
+
* @return {number}
|
|
84
|
+
*/
|
|
85
|
+
function sizeof(value) {
|
|
86
|
+
return value.length;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @param {any} value
|
|
90
|
+
* @param {any[]} array
|
|
91
|
+
* @return {any}
|
|
92
|
+
*/
|
|
93
|
+
function append(value, array) {
|
|
94
|
+
return array.push(value), value;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @param {string[]} array
|
|
98
|
+
* @param {function} callback
|
|
99
|
+
* @return {string}
|
|
100
|
+
*/
|
|
101
|
+
function combine(array, callback) {
|
|
102
|
+
return array.map(callback).join("");
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
exports.abs = abs;
|
|
106
|
+
exports.append = append;
|
|
107
|
+
exports.assign = assign;
|
|
108
|
+
exports.charat = charat;
|
|
109
|
+
exports.combine = combine;
|
|
110
|
+
exports.from = from;
|
|
111
|
+
exports.hash = hash;
|
|
112
|
+
exports.indexof = indexof;
|
|
113
|
+
exports.match = match;
|
|
114
|
+
exports.replace = replace;
|
|
115
|
+
exports.sizeof = sizeof;
|
|
116
|
+
exports.strlen = strlen;
|
|
117
|
+
exports.substr = substr;
|
|
118
|
+
exports.trim = trim;
|
|
119
|
+
|
|
120
|
+
//# sourceMappingURL=Utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utility.js","names":[],"sources":["../../../../../../../../node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js"],"sourcesContent":["/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;AAIA,IAAW,MAAM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
|
2
|
+
var index = require("../../../../../../_virtual/_global-external_react.js").useLayoutEffect;
|
|
3
|
+
//#endregion
|
|
4
|
+
exports.default = index;
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=use-isomorphic-layout-effect.browser.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-isomorphic-layout-effect.browser.esm.js","names":["useLayoutEffect"],"sources":["../../../../../../../../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"],"sourcesContent":["import { useLayoutEffect } from 'react';\n\nvar index = useLayoutEffect ;\n\nexport { index as default };\n"],"x_google_ignoreList":[0],"mappings":";AAEA,IAAI,sEAAQA,CAAAA,CAAAA"}
|
|
@@ -6,7 +6,8 @@ const require_jsx_runtime = require("./_virtual/_global-external_react/jsx-runti
|
|
|
6
6
|
const require_monitoring_math = require("./src/common/monitoring-math.js");
|
|
7
7
|
const require_monitoring_collector = require("./monitoring-collector.js");
|
|
8
8
|
const require_monitoring_history_view = require("./monitoring-history-view.js");
|
|
9
|
-
|
|
9
|
+
require("./monitoring.js");
|
|
10
|
+
const require_monitoring_details_chart = require("./monitoring-details-chart.js");
|
|
10
11
|
//#region src/renderer/pod-monitoring.tsx
|
|
11
12
|
var INTERVAL = 3e4;
|
|
12
13
|
function aggregatePodMetrics(metrics, identity, now = Date.now()) {
|
|
@@ -35,22 +36,15 @@ function PodMonitoringChart({ clusterId, uid, samples, status, metric }) {
|
|
|
35
36
|
scope: "pod",
|
|
36
37
|
uid
|
|
37
38
|
} : void 0, samples);
|
|
38
|
-
return /* @__PURE__ */ require_jsx_runtime.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
history.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/* @__PURE__ */ require_jsx_runtime.jsx(require_monitoring.MetricChart, {
|
|
48
|
-
metric,
|
|
49
|
-
samples: history.samples,
|
|
50
|
-
status,
|
|
51
|
-
scope: "pod"
|
|
52
|
-
})
|
|
53
|
-
] });
|
|
39
|
+
return /* @__PURE__ */ require_jsx_runtime.jsx(require_monitoring_details_chart.MonitoringDetailsChart, {
|
|
40
|
+
metric,
|
|
41
|
+
samples: history.samples,
|
|
42
|
+
status,
|
|
43
|
+
scope: "pod",
|
|
44
|
+
range: history.range,
|
|
45
|
+
onRangeChange: history.setRange,
|
|
46
|
+
historyStatus: history.status
|
|
47
|
+
});
|
|
54
48
|
}
|
|
55
49
|
function selectedPod() {
|
|
56
50
|
const match = new URLSearchParams(window.location.search).get("kube-details")?.match(/^\/api\/v1\/namespaces\/([a-z0-9][a-z0-9.-]*)\/pods\/([a-z0-9][a-z0-9.-]*)$/);
|
|
@@ -87,8 +81,10 @@ function mountPodMonitoring() {
|
|
|
87
81
|
nativeSuppression.textContent = `
|
|
88
82
|
.KubeObjectDetails:has(:is(${controllers})) .ResourceMetrics,
|
|
89
83
|
.KubeObjectDetails:has(:is(${controllers})) [data-time-range]:has(+ .ResourceMetrics),
|
|
90
|
-
.KubeObjectDetails:has(.PodDetails) [data-time-range]:has(+ .ResourceMetrics
|
|
91
|
-
.KubeObjectDetails
|
|
84
|
+
.KubeObjectDetails:has(.PodDetails) [data-time-range]:has(+ .ResourceMetrics),
|
|
85
|
+
.KubeObjectDetails:has(.PodDetails) .ResourceMetrics > .graph,
|
|
86
|
+
.KubeObjectDetails:has(.PodDetails) .ResourceMetrics > .loader,
|
|
87
|
+
.KubeObjectDetails .PodDetails .ResourceMetrics {
|
|
92
88
|
display: none !important;
|
|
93
89
|
}
|
|
94
90
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pod-monitoring.js","names":[],"sources":["../../src/renderer/pod-monitoring.tsx"],"sourcesContent":["import { Renderer } from \"@freelensapp/extensions\";\nimport { reaction } from \"mobx\";\nimport ReactDOM from \"react-dom\";\nimport { MonitoringPreferencesStore } from \"../common/store/monitoring-preferences-store\";\nimport {\n effectivePodResource,\n MAX_SAMPLES,\n MetricChart,\n type MonitoringPod,\n type MonitoringSample,\n parseQuantity,\n} from \"./monitoring\";\nimport { getMonitoringSnapshot, retainMonitoringCollector } from \"./monitoring-collector\";\nimport { MonitoringHistoryRange, useMonitoringHistory } from \"./monitoring-history-view\";\n\ntype PodIdentity = { name: string; namespace: string };\ntype PodMetrics = {\n metadata: PodIdentity & { uid?: string };\n timestamp: string;\n containers: { name: string; usage: { cpu: string; memory: string } }[];\n};\nconst INTERVAL = 30_000;\n\nexport function aggregatePodMetrics(metrics: PodMetrics, identity: PodIdentity, now = Date.now()): MonitoringSample {\n if (metrics.metadata?.name !== identity.name || metrics.metadata?.namespace !== identity.namespace)\n throw new Error(\"Pod metrics identity changed\");\n const time = Date.parse(metrics.timestamp);\n if (!Number.isFinite(time) || now - time > 120_000 || time > now + 30_000) throw new Error(\"Pod metrics are stale\");\n if (!metrics.containers?.length) throw new Error(\"Missing container metrics\");\n const names = new Set<string>();\n let cpu = 0;\n let memory = 0;\n for (const container of metrics.containers) {\n if (!container.name || names.has(container.name)) throw new Error(\"Invalid container metrics\");\n names.add(container.name);\n cpu += parseQuantity(container.usage.cpu);\n memory += parseQuantity(container.usage.memory, true);\n }\n return { time, cpu, memory };\n}\n\nfunction PodMonitoringChart({\n clusterId,\n uid,\n samples,\n status,\n metric,\n}: {\n clusterId: string;\n uid?: string;\n samples: MonitoringSample[];\n status: string;\n metric: \"cpu\" | \"memory\";\n}) {\n const history = useMonitoringHistory(uid ? { clusterId, scope: \"pod\", uid } : undefined, samples);\n return (\n <>\n <MonitoringHistoryRange range={history.range} onChange={history.setRange} />\n {history.status && <small role=\"status\">{history.status}</small>}\n <MetricChart metric={metric} samples={history.samples} status={status} scope=\"pod\" />\n </>\n );\n}\n\nfunction selectedPod(): PodIdentity | undefined {\n const details = new URLSearchParams(window.location.search).get(\"kube-details\");\n const match = details?.match(/^\\/api\\/v1\\/namespaces\\/([a-z0-9][a-z0-9.-]*)\\/pods\\/([a-z0-9][a-z0-9.-]*)$/);\n if (match) return { namespace: match[1], name: match[2] };\n return;\n}\n\nfunction visible(element: HTMLElement): boolean {\n for (let node: HTMLElement | null = element; node; node = node.parentElement) {\n const style = getComputedStyle(node);\n if (\n node.hidden ||\n node.getAttribute(\"aria-hidden\") === \"true\" ||\n style.display === \"none\" ||\n style.visibility === \"hidden\"\n )\n return false;\n }\n return true;\n}\n\nexport function startPodMonitoring(): () => void {\n const release = retainMonitoringCollector();\n const preferences = MonitoringPreferencesStore.getInstanceOrCreate<MonitoringPreferencesStore>();\n let dispose: (() => void) | undefined;\n const stop = reaction(\n () => preferences.enabled,\n (enabled) => {\n dispose?.();\n dispose = enabled ? mountPodMonitoring() : undefined;\n },\n { fireImmediately: true },\n );\n return () => {\n stop();\n dispose?.();\n release();\n };\n}\n\nfunction mountPodMonitoring(): () => void {\n const nativeSuppression = document.createElement(\"style\");\n const controllers =\n \".DeploymentDetails, .ReplicaSetDetails, .DaemonSetDetails, .StatefulSetDetails, .JobDetails, .CronJobDetails, [class*=ReplicationControllerDetails]\";\n nativeSuppression.dataset.powerDetailMonitoring = \"\";\n nativeSuppression.textContent = `\n .KubeObjectDetails:has(:is(${controllers})) .ResourceMetrics,\n .KubeObjectDetails:has(:is(${controllers})) [data-time-range]:has(+ .ResourceMetrics),\n .KubeObjectDetails:has(.PodDetails) [data-time-range]:has(+ .ResourceMetrics > [data-power-pod-monitoring]),\n .KubeObjectDetails .ResourceMetrics:has(> [data-power-pod-monitoring]) > .loader {\n display: none !important;\n }\n `;\n document.head.append(nativeSuppression);\n let stopped = false;\n let generation = 0;\n let session = \"\";\n let samples: MonitoringSample[] = [];\n let status = \"\";\n let resourceUid: string | undefined;\n let nextRead = 0;\n let pending: number | undefined;\n let host: HTMLElement | undefined;\n let graph: HTMLElement | undefined;\n let originalStyle: string | null = null;\n let renderedSamples: MonitoringSample[] | undefined;\n let renderedStatus: string | undefined;\n let renderedMetric: string | undefined;\n const restore = () => {\n if (host) {\n ReactDOM.unmountComponentAtNode(host);\n host.remove();\n }\n host = undefined;\n if (graph) {\n if (originalStyle === null) graph.removeAttribute(\"style\");\n else graph.setAttribute(\"style\", originalStyle);\n }\n graph = undefined;\n renderedSamples = undefined;\n };\n let controlledMetrics: HTMLElement | undefined;\n const tabAttributes = new Map<HTMLElement, Map<string, string | null>>();\n const saveAttributes = (element: HTMLElement, names: string[]) => {\n if (!tabAttributes.has(element))\n tabAttributes.set(element, new Map(names.map((name) => [name, element.getAttribute(name)])));\n };\n const unsupportedTab = (target: EventTarget | null) => {\n const radio = target instanceof Element ? target.closest(\".Radio\") : null;\n return radio && [\"Network\", \"Filesystem\"].includes(radio.querySelector(\".label\")?.textContent ?? \"\");\n };\n const blockUnsupported = (event: Event) => {\n if (!unsupportedTab(event.target)) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n };\n const tabEvents = [\"click\", \"pointerdown\", \"mousedown\", \"keydown\", \"change\"];\n const restoreTabs = () => {\n for (const [element, attributes] of tabAttributes) {\n for (const [name, value] of attributes) {\n if (value === null) element.removeAttribute(name);\n else element.setAttribute(name, value);\n }\n }\n tabAttributes.clear();\n for (const event of tabEvents) controlledMetrics?.removeEventListener(event, blockUnsupported, true);\n controlledMetrics = undefined;\n };\n const restrictTabs = (metrics: HTMLElement) => {\n if (controlledMetrics !== metrics) {\n restoreTabs();\n controlledMetrics = metrics;\n for (const event of tabEvents) metrics.addEventListener(event, blockUnsupported, true);\n }\n for (const radio of metrics.querySelectorAll<HTMLElement>(\".Radio\")) {\n if (!unsupportedTab(radio)) continue;\n saveAttributes(radio, [\"style\", \"hidden\", \"aria-hidden\"]);\n if (radio.style.display !== \"none\") radio.style.display = \"none\";\n radio.hidden = true;\n radio.setAttribute(\"aria-hidden\", \"true\");\n const input = radio.querySelector<HTMLInputElement>(\"input\");\n if (input) {\n saveAttributes(input, [\"disabled\"]);\n input.disabled = true;\n }\n }\n if (unsupportedTab(metrics.querySelector(\".Radio.checked\"))) {\n const cpu = [...metrics.querySelectorAll<HTMLElement>(\".Radio\")].find(\n (radio) => radio.querySelector(\".label\")?.textContent === \"CPU\",\n );\n cpu?.click();\n }\n };\n const reset = () => {\n generation++;\n session = \"\";\n samples = [];\n resourceUid = undefined;\n status = \"\";\n nextRead = 0;\n restore();\n restoreTabs();\n };\n const update = async () => {\n if (stopped) return;\n const identity = selectedPod();\n const cluster = Renderer.Catalog.activeCluster.get()?.metadata.uid;\n const drawer = document.querySelector<HTMLElement>(\".KubeObjectDetails\");\n const title = drawer?.querySelector(\".drawer-title-text\");\n const titleText = title\n ? [...title.childNodes]\n .filter((node) => node.nodeType === Node.TEXT_NODE)\n .map((node) => node.textContent)\n .join(\"\")\n .trim()\n : \"\";\n if (\n !identity ||\n !cluster ||\n !drawer ||\n !visible(drawer) ||\n document.visibilityState === \"hidden\" ||\n titleText !== `Pod: ${identity.name}` ||\n !drawer.querySelector(\".PodDetails\")\n ) {\n if (session) reset();\n return;\n }\n const key = JSON.stringify([cluster, identity.namespace, identity.name]);\n if (session !== key) {\n reset();\n session = key;\n }\n const metrics = [...drawer.querySelectorAll<HTMLElement>(\".ResourceMetrics\")].find((element) =>\n [\"CPU\", \"Memory\", \"Network\", \"Filesystem\"].every((label) =>\n [...element.querySelectorAll(\".Radio .label\")].some((node) => node.textContent === label),\n ),\n );\n if (metrics && visible(metrics)) restrictTabs(metrics);\n else restoreTabs();\n const selected = metrics?.querySelector(\".Radio.checked .label\")?.textContent;\n const nativeGraph = metrics?.querySelector<HTMLElement>(\":scope > .graph\");\n if (!metrics || !visible(metrics) || !nativeGraph || (selected !== \"CPU\" && selected !== \"Memory\")) {\n restore();\n return;\n }\n const retained = samples.filter((sample) => sample.time >= Date.now() - 30 * 60_000);\n if (retained.length !== samples.length) samples = retained;\n const metric = selected === \"CPU\" ? \"cpu\" : \"memory\";\n if (graph !== nativeGraph || !host?.isConnected) {\n restore();\n graph = nativeGraph;\n originalStyle = graph.getAttribute(\"style\");\n graph.style.display = \"none\";\n host = document.createElement(\"div\");\n host.dataset.powerPodMonitoring = \"\";\n graph.after(host);\n }\n const render = () => {\n if (host && (renderedSamples !== samples || renderedStatus !== status || renderedMetric !== metric)) {\n ReactDOM.render(\n <PodMonitoringChart\n clusterId={cluster}\n uid={resourceUid}\n metric={metric}\n samples={samples}\n status={status}\n />,\n host,\n );\n renderedSamples = samples;\n renderedStatus = status;\n renderedMetric = metric;\n }\n };\n render();\n if (pending === generation || Date.now() < nextRead) return;\n const current = generation;\n pending = current;\n nextRead = Date.now() + INTERVAL;\n const isCurrent = () =>\n !stopped &&\n current === generation &&\n session === key &&\n drawer.isConnected &&\n visible(drawer) &&\n document.visibilityState !== \"hidden\" &&\n Renderer.Catalog.activeCluster.get()?.metadata.uid === cluster &&\n JSON.stringify(selectedPod()) === JSON.stringify(identity);\n try {\n const collected = await getMonitoringSnapshot();\n if (!isCurrent()) return;\n const [usage, pod] = await Promise.allSettled([\n collected.podMetrics !== undefined\n ? Promise.resolve(collected.podMetrics)\n : Promise.resolve().then(() =>\n Renderer.K8sApi.podsMetricsApi.list(\n { namespace: identity.namespace },\n { fieldSelector: `metadata.name=${identity.name}` },\n ),\n ),\n collected.pods !== undefined\n ? Promise.resolve(\n collected.pods.find(\n (item) => item.metadata.name === identity.name && item.metadata.namespace === identity.namespace,\n ),\n )\n : Promise.resolve().then(() => Renderer.K8sApi.podsApi.get(identity)),\n ]);\n if (!isCurrent()) return;\n const currentPod =\n pod.status === \"fulfilled\" &&\n pod.value?.metadata.name === identity.name &&\n pod.value.metadata.namespace === identity.namespace\n ? pod.value\n : undefined;\n if (currentPod) {\n const nextUid = currentPod.metadata.uid;\n if (nextUid && resourceUid && nextUid !== resourceUid) samples = [];\n if (nextUid) resourceUid = nextUid;\n }\n if (usage.status !== \"fulfilled\" || !Array.isArray(usage.value)) throw new Error(\"Metrics unavailable\");\n const matches = usage.value.filter(\n (item) => item.metadata?.name === identity.name && item.metadata.namespace === identity.namespace,\n );\n if (matches.length !== 1) throw new Error(\"Metrics unavailable\");\n const podMetrics = matches[0];\n const sample = aggregatePodMetrics(podMetrics, identity);\n if (currentPod) {\n const created = currentPod.metadata.creationTimestamp;\n if (created !== undefined) {\n const creationTime = Date.parse(created);\n if (!Number.isFinite(creationTime)) throw new Error(\"Invalid pod creation time\");\n samples = samples.filter((entry) => entry.time >= creationTime);\n if (sample.time < creationTime) throw new Error(\"Pod metrics predate the current pod\");\n }\n if (podMetrics.metadata.uid && resourceUid && podMetrics.metadata.uid !== resourceUid)\n throw new Error(\"Pod metrics identity changed\");\n try {\n const spec: MonitoringPod = currentPod;\n sample.resources = Object.fromEntries(\n ([\"cpu\", \"memory\"] as const).map((resource) => {\n const limits = effectivePodResource(spec, resource, \"limits\");\n return [\n resource,\n {\n requests: effectivePodResource(spec, resource, \"requests\"),\n limits: Number.isFinite(limits) ? limits : undefined,\n unbounded: limits === Infinity,\n },\n ];\n }),\n ) as MonitoringSample[\"resources\"];\n } catch {\n sample.resourceStatus = \"Pod requests unavailable: incomplete resource data\";\n }\n } else sample.resourceStatus = \"Pod requests unavailable or access denied\";\n samples = [\n ...samples.filter((entry) => entry.time !== sample.time && entry.time >= Date.now() - 30 * 60_000),\n sample,\n ]\n .sort((a, b) => a.time - b.time)\n .slice(-MAX_SAMPLES);\n status = \"\";\n } catch {\n if (!isCurrent()) return;\n status = \"Pod metrics unavailable, stale or access denied. Last collected samples remain visible.\";\n } finally {\n if (pending === current) pending = undefined;\n }\n if (isCurrent()) void update();\n };\n const timer = window.setInterval(() => {\n void update();\n }, 1000);\n void update();\n return () => {\n stopped = true;\n reset();\n window.clearInterval(timer);\n nativeSuppression.remove();\n };\n}\n"],"mappings":";;;;;;;;;;AAqBA,IAAM,WAAW;AAEjB,SAAgB,oBAAoB,SAAqB,UAAuB,MAAM,KAAK,IAAI,GAAqB;CAClH,IAAI,QAAQ,UAAU,SAAS,SAAS,QAAQ,QAAQ,UAAU,cAAc,SAAS,WAC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AAY;CACd,GAAG,GAAI;CACP,OAAY;CACZ,aAAa;EACX,UAAU;EACV,MAAM;EACN,OAAO,cAAc,KAAK;EAC1B,kBAAkB,OAAO;CAC3B;AACF"}
|
|
1
|
+
{"version":3,"file":"pod-monitoring.js","names":[],"sources":["../../src/renderer/pod-monitoring.tsx"],"sourcesContent":["import { Renderer } from \"@freelensapp/extensions\";\nimport { reaction } from \"mobx\";\nimport ReactDOM from \"react-dom\";\nimport { MonitoringPreferencesStore } from \"../common/store/monitoring-preferences-store\";\nimport {\n effectivePodResource,\n MAX_SAMPLES,\n type MonitoringPod,\n type MonitoringSample,\n parseQuantity,\n} from \"./monitoring\";\nimport { getMonitoringSnapshot, retainMonitoringCollector } from \"./monitoring-collector\";\nimport { MonitoringDetailsChart } from \"./monitoring-details-chart\";\nimport { useMonitoringHistory } from \"./monitoring-history-view\";\n\ntype PodIdentity = { name: string; namespace: string };\ntype PodMetrics = {\n metadata: PodIdentity & { uid?: string };\n timestamp: string;\n containers: { name: string; usage: { cpu: string; memory: string } }[];\n};\nconst INTERVAL = 30_000;\n\nexport function aggregatePodMetrics(metrics: PodMetrics, identity: PodIdentity, now = Date.now()): MonitoringSample {\n if (metrics.metadata?.name !== identity.name || metrics.metadata?.namespace !== identity.namespace)\n throw new Error(\"Pod metrics identity changed\");\n const time = Date.parse(metrics.timestamp);\n if (!Number.isFinite(time) || now - time > 120_000 || time > now + 30_000) throw new Error(\"Pod metrics are stale\");\n if (!metrics.containers?.length) throw new Error(\"Missing container metrics\");\n const names = new Set<string>();\n let cpu = 0;\n let memory = 0;\n for (const container of metrics.containers) {\n if (!container.name || names.has(container.name)) throw new Error(\"Invalid container metrics\");\n names.add(container.name);\n cpu += parseQuantity(container.usage.cpu);\n memory += parseQuantity(container.usage.memory, true);\n }\n return { time, cpu, memory };\n}\n\nfunction PodMonitoringChart({\n clusterId,\n uid,\n samples,\n status,\n metric,\n}: {\n clusterId: string;\n uid?: string;\n samples: MonitoringSample[];\n status: string;\n metric: \"cpu\" | \"memory\";\n}) {\n const history = useMonitoringHistory(uid ? { clusterId, scope: \"pod\", uid } : undefined, samples);\n return (\n <MonitoringDetailsChart\n metric={metric}\n samples={history.samples}\n status={status}\n scope=\"pod\"\n range={history.range}\n onRangeChange={history.setRange}\n historyStatus={history.status}\n />\n );\n}\n\nfunction selectedPod(): PodIdentity | undefined {\n const details = new URLSearchParams(window.location.search).get(\"kube-details\");\n const match = details?.match(/^\\/api\\/v1\\/namespaces\\/([a-z0-9][a-z0-9.-]*)\\/pods\\/([a-z0-9][a-z0-9.-]*)$/);\n if (match) return { namespace: match[1], name: match[2] };\n return;\n}\n\nfunction visible(element: HTMLElement): boolean {\n for (let node: HTMLElement | null = element; node; node = node.parentElement) {\n const style = getComputedStyle(node);\n if (\n node.hidden ||\n node.getAttribute(\"aria-hidden\") === \"true\" ||\n style.display === \"none\" ||\n style.visibility === \"hidden\"\n )\n return false;\n }\n return true;\n}\n\nexport function startPodMonitoring(): () => void {\n const release = retainMonitoringCollector();\n const preferences = MonitoringPreferencesStore.getInstanceOrCreate<MonitoringPreferencesStore>();\n let dispose: (() => void) | undefined;\n const stop = reaction(\n () => preferences.enabled,\n (enabled) => {\n dispose?.();\n dispose = enabled ? mountPodMonitoring() : undefined;\n },\n { fireImmediately: true },\n );\n return () => {\n stop();\n dispose?.();\n release();\n };\n}\n\nfunction mountPodMonitoring(): () => void {\n const nativeSuppression = document.createElement(\"style\");\n const controllers =\n \".DeploymentDetails, .ReplicaSetDetails, .DaemonSetDetails, .StatefulSetDetails, .JobDetails, .CronJobDetails, [class*=ReplicationControllerDetails]\";\n nativeSuppression.dataset.powerDetailMonitoring = \"\";\n nativeSuppression.textContent = `\n .KubeObjectDetails:has(:is(${controllers})) .ResourceMetrics,\n .KubeObjectDetails:has(:is(${controllers})) [data-time-range]:has(+ .ResourceMetrics),\n .KubeObjectDetails:has(.PodDetails) [data-time-range]:has(+ .ResourceMetrics),\n .KubeObjectDetails:has(.PodDetails) .ResourceMetrics > .graph,\n .KubeObjectDetails:has(.PodDetails) .ResourceMetrics > .loader,\n .KubeObjectDetails .PodDetails .ResourceMetrics {\n display: none !important;\n }\n `;\n document.head.append(nativeSuppression);\n let stopped = false;\n let generation = 0;\n let session = \"\";\n let samples: MonitoringSample[] = [];\n let status = \"\";\n let resourceUid: string | undefined;\n let nextRead = 0;\n let pending: number | undefined;\n let host: HTMLElement | undefined;\n let graph: HTMLElement | undefined;\n let originalStyle: string | null = null;\n let renderedSamples: MonitoringSample[] | undefined;\n let renderedStatus: string | undefined;\n let renderedMetric: string | undefined;\n const restore = () => {\n if (host) {\n ReactDOM.unmountComponentAtNode(host);\n host.remove();\n }\n host = undefined;\n if (graph) {\n if (originalStyle === null) graph.removeAttribute(\"style\");\n else graph.setAttribute(\"style\", originalStyle);\n }\n graph = undefined;\n renderedSamples = undefined;\n };\n let controlledMetrics: HTMLElement | undefined;\n const tabAttributes = new Map<HTMLElement, Map<string, string | null>>();\n const saveAttributes = (element: HTMLElement, names: string[]) => {\n if (!tabAttributes.has(element))\n tabAttributes.set(element, new Map(names.map((name) => [name, element.getAttribute(name)])));\n };\n const unsupportedTab = (target: EventTarget | null) => {\n const radio = target instanceof Element ? target.closest(\".Radio\") : null;\n return radio && [\"Network\", \"Filesystem\"].includes(radio.querySelector(\".label\")?.textContent ?? \"\");\n };\n const blockUnsupported = (event: Event) => {\n if (!unsupportedTab(event.target)) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n };\n const tabEvents = [\"click\", \"pointerdown\", \"mousedown\", \"keydown\", \"change\"];\n const restoreTabs = () => {\n for (const [element, attributes] of tabAttributes) {\n for (const [name, value] of attributes) {\n if (value === null) element.removeAttribute(name);\n else element.setAttribute(name, value);\n }\n }\n tabAttributes.clear();\n for (const event of tabEvents) controlledMetrics?.removeEventListener(event, blockUnsupported, true);\n controlledMetrics = undefined;\n };\n const restrictTabs = (metrics: HTMLElement) => {\n if (controlledMetrics !== metrics) {\n restoreTabs();\n controlledMetrics = metrics;\n for (const event of tabEvents) metrics.addEventListener(event, blockUnsupported, true);\n }\n for (const radio of metrics.querySelectorAll<HTMLElement>(\".Radio\")) {\n if (!unsupportedTab(radio)) continue;\n saveAttributes(radio, [\"style\", \"hidden\", \"aria-hidden\"]);\n if (radio.style.display !== \"none\") radio.style.display = \"none\";\n radio.hidden = true;\n radio.setAttribute(\"aria-hidden\", \"true\");\n const input = radio.querySelector<HTMLInputElement>(\"input\");\n if (input) {\n saveAttributes(input, [\"disabled\"]);\n input.disabled = true;\n }\n }\n if (unsupportedTab(metrics.querySelector(\".Radio.checked\"))) {\n const cpu = [...metrics.querySelectorAll<HTMLElement>(\".Radio\")].find(\n (radio) => radio.querySelector(\".label\")?.textContent === \"CPU\",\n );\n cpu?.click();\n }\n };\n const reset = () => {\n generation++;\n session = \"\";\n samples = [];\n resourceUid = undefined;\n status = \"\";\n nextRead = 0;\n restore();\n restoreTabs();\n };\n const update = async () => {\n if (stopped) return;\n const identity = selectedPod();\n const cluster = Renderer.Catalog.activeCluster.get()?.metadata.uid;\n const drawer = document.querySelector<HTMLElement>(\".KubeObjectDetails\");\n const title = drawer?.querySelector(\".drawer-title-text\");\n const titleText = title\n ? [...title.childNodes]\n .filter((node) => node.nodeType === Node.TEXT_NODE)\n .map((node) => node.textContent)\n .join(\"\")\n .trim()\n : \"\";\n if (\n !identity ||\n !cluster ||\n !drawer ||\n !visible(drawer) ||\n document.visibilityState === \"hidden\" ||\n titleText !== `Pod: ${identity.name}` ||\n !drawer.querySelector(\".PodDetails\")\n ) {\n if (session) reset();\n return;\n }\n const key = JSON.stringify([cluster, identity.namespace, identity.name]);\n if (session !== key) {\n reset();\n session = key;\n }\n const metrics = [...drawer.querySelectorAll<HTMLElement>(\".ResourceMetrics\")].find((element) =>\n [\"CPU\", \"Memory\", \"Network\", \"Filesystem\"].every((label) =>\n [...element.querySelectorAll(\".Radio .label\")].some((node) => node.textContent === label),\n ),\n );\n if (metrics && visible(metrics)) restrictTabs(metrics);\n else restoreTabs();\n const selected = metrics?.querySelector(\".Radio.checked .label\")?.textContent;\n const nativeGraph = metrics?.querySelector<HTMLElement>(\":scope > .graph\");\n if (!metrics || !visible(metrics) || !nativeGraph || (selected !== \"CPU\" && selected !== \"Memory\")) {\n restore();\n return;\n }\n const retained = samples.filter((sample) => sample.time >= Date.now() - 30 * 60_000);\n if (retained.length !== samples.length) samples = retained;\n const metric = selected === \"CPU\" ? \"cpu\" : \"memory\";\n if (graph !== nativeGraph || !host?.isConnected) {\n restore();\n graph = nativeGraph;\n originalStyle = graph.getAttribute(\"style\");\n graph.style.display = \"none\";\n host = document.createElement(\"div\");\n host.dataset.powerPodMonitoring = \"\";\n graph.after(host);\n }\n const render = () => {\n if (host && (renderedSamples !== samples || renderedStatus !== status || renderedMetric !== metric)) {\n ReactDOM.render(\n <PodMonitoringChart\n clusterId={cluster}\n uid={resourceUid}\n metric={metric}\n samples={samples}\n status={status}\n />,\n host,\n );\n renderedSamples = samples;\n renderedStatus = status;\n renderedMetric = metric;\n }\n };\n render();\n if (pending === generation || Date.now() < nextRead) return;\n const current = generation;\n pending = current;\n nextRead = Date.now() + INTERVAL;\n const isCurrent = () =>\n !stopped &&\n current === generation &&\n session === key &&\n drawer.isConnected &&\n visible(drawer) &&\n document.visibilityState !== \"hidden\" &&\n Renderer.Catalog.activeCluster.get()?.metadata.uid === cluster &&\n JSON.stringify(selectedPod()) === JSON.stringify(identity);\n try {\n const collected = await getMonitoringSnapshot();\n if (!isCurrent()) return;\n const [usage, pod] = await Promise.allSettled([\n collected.podMetrics !== undefined\n ? Promise.resolve(collected.podMetrics)\n : Promise.resolve().then(() =>\n Renderer.K8sApi.podsMetricsApi.list(\n { namespace: identity.namespace },\n { fieldSelector: `metadata.name=${identity.name}` },\n ),\n ),\n collected.pods !== undefined\n ? Promise.resolve(\n collected.pods.find(\n (item) => item.metadata.name === identity.name && item.metadata.namespace === identity.namespace,\n ),\n )\n : Promise.resolve().then(() => Renderer.K8sApi.podsApi.get(identity)),\n ]);\n if (!isCurrent()) return;\n const currentPod =\n pod.status === \"fulfilled\" &&\n pod.value?.metadata.name === identity.name &&\n pod.value.metadata.namespace === identity.namespace\n ? pod.value\n : undefined;\n if (currentPod) {\n const nextUid = currentPod.metadata.uid;\n if (nextUid && resourceUid && nextUid !== resourceUid) samples = [];\n if (nextUid) resourceUid = nextUid;\n }\n if (usage.status !== \"fulfilled\" || !Array.isArray(usage.value)) throw new Error(\"Metrics unavailable\");\n const matches = usage.value.filter(\n (item) => item.metadata?.name === identity.name && item.metadata.namespace === identity.namespace,\n );\n if (matches.length !== 1) throw new Error(\"Metrics unavailable\");\n const podMetrics = matches[0];\n const sample = aggregatePodMetrics(podMetrics, identity);\n if (currentPod) {\n const created = currentPod.metadata.creationTimestamp;\n if (created !== undefined) {\n const creationTime = Date.parse(created);\n if (!Number.isFinite(creationTime)) throw new Error(\"Invalid pod creation time\");\n samples = samples.filter((entry) => entry.time >= creationTime);\n if (sample.time < creationTime) throw new Error(\"Pod metrics predate the current pod\");\n }\n if (podMetrics.metadata.uid && resourceUid && podMetrics.metadata.uid !== resourceUid)\n throw new Error(\"Pod metrics identity changed\");\n try {\n const spec: MonitoringPod = currentPod;\n sample.resources = Object.fromEntries(\n ([\"cpu\", \"memory\"] as const).map((resource) => {\n const limits = effectivePodResource(spec, resource, \"limits\");\n return [\n resource,\n {\n requests: effectivePodResource(spec, resource, \"requests\"),\n limits: Number.isFinite(limits) ? limits : undefined,\n unbounded: limits === Infinity,\n },\n ];\n }),\n ) as MonitoringSample[\"resources\"];\n } catch {\n sample.resourceStatus = \"Pod requests unavailable: incomplete resource data\";\n }\n } else sample.resourceStatus = \"Pod requests unavailable or access denied\";\n samples = [\n ...samples.filter((entry) => entry.time !== sample.time && entry.time >= Date.now() - 30 * 60_000),\n sample,\n ]\n .sort((a, b) => a.time - b.time)\n .slice(-MAX_SAMPLES);\n status = \"\";\n } catch {\n if (!isCurrent()) return;\n status = \"Pod metrics unavailable, stale or access denied. Last collected samples remain visible.\";\n } finally {\n if (pending === current) pending = undefined;\n }\n if (isCurrent()) void update();\n };\n const timer = window.setInterval(() => {\n void update();\n }, 1000);\n void update();\n return () => {\n stopped = true;\n reset();\n window.clearInterval(timer);\n nativeSuppression.remove();\n };\n}\n"],"mappings":";;;;;;;;;;;AAqBA,IAAM,WAAW;AAEjB,SAAgB,oBAAoB,SAAqB,UAAuB,MAAM,KAAK,IAAI,GAAqB;CAClH,IAAI,QAAQ,UAAU,SAAS,SAAS,QAAQ,QAAQ,UAAU,cAAc,SAAS,WACvF,MAAM,IAAI,MAAM,8BAA8B;CAChD,MAAM,OAAO,KAAK,MAAM,QAAQ,SAAS;CACzC,IAAI,CAAC,OAAO,SAAS,IAAI,KAAK,MAAM,OAAO,QAAW,OAAO,MAAM,KAAQ,MAAM,IAAI,MAAM,uBAAuB;CAClH,IAAI,CAAC,QAAQ,YAAY,QAAQ,MAAM,IAAI,MAAM,2BAA2B;CAC5E,MAAM,wBAAQ,IAAI,IAAY;CAC9B,IAAI,MAAM;CACV,IAAI,SAAS;CACb,KAAK,MAAM,aAAa,QAAQ,YAAY;EAC1C,IAAI,CAAC,UAAU,QAAQ,MAAM,IAAI,UAAU,IAAI,GAAG,MAAM,IAAI,MAAM,2BAA2B;EAC7F,MAAM,IAAI,UAAU,IAAI;EACxB,OAAO,wBAAA,cAAc,UAAU,MAAM,GAAG;EACxC,UAAU,wBAAA,cAAc,UAAU,MAAM,QAAQ,IAAI;CACtD;CACA,OAAO;EAAE;EAAM;EAAK;CAAO;AAC7B;AAEA,SAAS,mBAAmB,EAC1B,WACA,KACA,SACA,QACA,UAOC;CACD,MAAM,UAAU,gCAAA,qBAAqB,MAAM;EAAE;EAAW,OAAO;EAAO;CAAI,IAAI,KAAA,GAAW,OAAO;CAChG,OACE,oCAAA,IAAC,iCAAA,wBAAD;EACU;EACR,SAAS,QAAQ;EACT;EACR,OAAM;EACN,OAAO,QAAQ;EACf,eAAe,QAAQ;EACvB,eAAe,QAAQ;CACxB,C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I,CAAC,UAAU,GAAG;GAClB,SAAS;EACX,UAAU;GACR,IAAI,YAAY,SAAS,UAAU,KAAA;EACrC;EACA,IAAI,UAAU,GAAG,OAAY;CAC/B;CACA,MAAM,QAAQ,OAAO,kBAAkB;EACrC,OAAY;CACd,GAAG,GAAI;CACP,OAAY;CACZ,aAAa;EACX,UAAU;EACV,MAAM;EACN,OAAO,cAAc,KAAK;EAC1B,kBAAkB,OAAO;CAC3B;AACF"}
|
|
@@ -3,8 +3,8 @@ const require__global_external_mobx_react = require("../_virtual/_global-externa
|
|
|
3
3
|
const require_ai_shortcuts_store = require("../src/common/store/ai-shortcuts-store.js");
|
|
4
4
|
const require__global_external_react = require("../_virtual/_global-external_react.js");
|
|
5
5
|
const require_jsx_runtime = require("../_virtual/_global-external_react/jsx-runtime.js");
|
|
6
|
-
const require_settings_icon_action = require("./settings-icon-action.js");
|
|
7
6
|
const require_settings_modal = require("./settings-modal.js");
|
|
7
|
+
const require_settings_icon_action = require("./settings-icon-action.js");
|
|
8
8
|
//#region src/renderer/preferences/ai-shortcuts-preferences.tsx
|
|
9
9
|
var { Button, Input } = require_extensions.Renderer.Component;
|
|
10
10
|
var AiShortcutsPreferences = require__global_external_mobx_react.observer(({ disabled = false }) => {
|
|
@@ -71,16 +71,24 @@ var AiShortcutsPreferences = require__global_external_mobx_react.observer(({ dis
|
|
|
71
71
|
justifyContent: "flex-end",
|
|
72
72
|
marginTop: 16
|
|
73
73
|
},
|
|
74
|
-
children: /* @__PURE__ */ require_jsx_runtime.
|
|
74
|
+
children: /* @__PURE__ */ require_jsx_runtime.jsxs(Button, {
|
|
75
75
|
primary: true,
|
|
76
|
-
|
|
76
|
+
style: {
|
|
77
|
+
display: "inline-flex",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
gap: 6
|
|
80
|
+
},
|
|
77
81
|
disabled,
|
|
78
82
|
onClick: () => edit({
|
|
79
83
|
id: globalThis.crypto.randomUUID(),
|
|
80
84
|
label: "",
|
|
81
85
|
command: "",
|
|
82
86
|
prompt: ""
|
|
83
|
-
})
|
|
87
|
+
}),
|
|
88
|
+
children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Icon, {
|
|
89
|
+
material: "add",
|
|
90
|
+
size: 16
|
|
91
|
+
}), /* @__PURE__ */ require_jsx_runtime.jsx("span", { children: "Add shortcut" })]
|
|
84
92
|
})
|
|
85
93
|
}),
|
|
86
94
|
editing && !disabled && /* @__PURE__ */ require_jsx_runtime.jsxs(require_settings_modal.SettingsModal, {
|