@64mb/freelens-power 1.2.2 → 1.3.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 +3 -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/renderer/ai-diagnostic-handoff.js +52 -0
- package/out/renderer/ai-diagnostic-handoff.js.map +1 -0
- package/out/renderer/ai-extras.js +40 -4
- package/out/renderer/ai-extras.js.map +1 -1
- package/out/renderer/ai.js +48 -56
- package/out/renderer/ai.js.map +1 -1
- package/out/renderer/details/hpa-diagnostics-details.js +46 -0
- package/out/renderer/details/hpa-diagnostics-details.js.map +1 -0
- package/out/renderer/details/namespace-health-details.js +91 -0
- package/out/renderer/details/namespace-health-details.js.map +1 -0
- package/out/renderer/details/resource-health-details.js +131 -0
- package/out/renderer/details/resource-health-details.js.map +1 -0
- package/out/renderer/details/service-diagnostics-details.js +163 -0
- package/out/renderer/details/service-diagnostics-details.js.map +1 -0
- package/out/renderer/diagnostic-explain-button.js +16 -0
- package/out/renderer/diagnostic-explain-button.js.map +1 -0
- package/out/renderer/diagnostics-state.js +51 -0
- package/out/renderer/diagnostics-state.js.map +1 -0
- package/out/renderer/diagnostics.css.js +9 -0
- package/out/renderer/diagnostics.css.js.map +1 -1
- package/out/renderer/diagnostics.js +369 -73
- package/out/renderer/diagnostics.js.map +1 -1
- package/out/renderer/incident-copy-button.js +50 -0
- package/out/renderer/incident-copy-button.js.map +1 -0
- package/out/renderer/index.js +91 -19
- package/out/renderer/index.js.map +1 -1
- package/out/renderer/monitoring-history-collection.js +1 -1
- package/out/renderer/preferences/monitoring-preferences.js +10 -0
- package/out/renderer/preferences/monitoring-preferences.js.map +1 -1
- package/out/renderer/preferences/preferences.js +88 -0
- package/out/renderer/preferences/preferences.js.map +1 -1
- package/out/renderer/resource-relationships.css.js +7 -0
- package/out/renderer/resource-relationships.css.js.map +1 -0
- package/out/renderer/resource-relationships.js +556 -0
- package/out/renderer/resource-relationships.js.map +1 -0
- package/out/renderer/resource-search-distance.js +24 -0
- package/out/renderer/resource-search-distance.js.map +1 -0
- package/out/renderer/resource-search-fields.js +55 -0
- package/out/renderer/resource-search-fields.js.map +1 -0
- package/out/renderer/resource-search-model.js +193 -0
- package/out/renderer/resource-search-model.js.map +1 -0
- package/out/renderer/resource-search.js +365 -0
- package/out/renderer/resource-search.js.map +1 -0
- package/out/renderer/src/common/hpa-diagnostics.js +24 -0
- package/out/renderer/src/common/hpa-diagnostics.js.map +1 -0
- package/out/renderer/src/common/incident-summary.js +73 -0
- package/out/renderer/src/common/incident-summary.js.map +1 -0
- package/out/renderer/src/common/resource-health.js +92 -0
- package/out/renderer/src/common/resource-health.js.map +1 -0
- package/out/renderer/src/common/resource-relationships.js +155 -0
- package/out/renderer/src/common/resource-relationships.js.map +1 -0
- package/out/renderer/src/common/service-diagnostics.js +50 -0
- package/out/renderer/src/common/service-diagnostics.js.map +1 -0
- 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/src/common/timeline-groups.js +36 -0
- package/out/renderer/src/common/timeline-groups.js.map +1 -0
- package/package.json +1 -1
package/out/renderer/index.js
CHANGED
|
@@ -20,8 +20,13 @@ const require_appearance = require("./appearance.js");
|
|
|
20
20
|
const require_button_styles = require("./button-styles.js");
|
|
21
21
|
const require_cluster_icons = require("./cluster-icons.js");
|
|
22
22
|
const require_dashboard = require("./dashboard.js");
|
|
23
|
-
const
|
|
23
|
+
const require_hpa_diagnostics_details = require("./details/hpa-diagnostics-details.js");
|
|
24
24
|
const require_monitoring_collector = require("./monitoring-collector.js");
|
|
25
|
+
const require_resource_health_details = require("./details/resource-health-details.js");
|
|
26
|
+
const require_namespace_health_details = require("./details/namespace-health-details.js");
|
|
27
|
+
const require_secret_certificate_details = require("./details/secret-certificate-details.js");
|
|
28
|
+
const require_service_diagnostics_details = require("./details/service-diagnostics-details.js");
|
|
29
|
+
const require_diagnostics_state = require("./diagnostics-state.js");
|
|
25
30
|
const require_diagnostics = require("./diagnostics.js");
|
|
26
31
|
const require_secure_node_shell_menu = require("./menus/secure-node-shell-menu.js");
|
|
27
32
|
const require_monitoring = require("./monitoring.js");
|
|
@@ -30,6 +35,8 @@ const require_node_monitoring = require("./node-monitoring.js");
|
|
|
30
35
|
const require_pod_monitoring = require("./pod-monitoring.js");
|
|
31
36
|
const require_preferences = require("./preferences/preferences.js");
|
|
32
37
|
const require_read_only = require("./read-only.js");
|
|
38
|
+
const require_resource_relationships = require("./resource-relationships.js");
|
|
39
|
+
const require_resource_search = require("./resource-search.js");
|
|
33
40
|
const require_welcome = require("./welcome.js");
|
|
34
41
|
//#region src/renderer/index.tsx
|
|
35
42
|
/**
|
|
@@ -37,6 +44,7 @@ const require_welcome = require("./welcome.js");
|
|
|
37
44
|
* Licensed under MIT License. See THIRD_PARTY_LICENSES for more information.
|
|
38
45
|
*/
|
|
39
46
|
var PowerEnabled = require__global_external_mobx_react.observer(({ children }) => require_power_preferences_store.PowerPreferencesStore.getInstanceOrCreate().enabled ? /* @__PURE__ */ require_jsx_runtime.jsx(require_jsx_runtime.Fragment, { children }) : null);
|
|
47
|
+
var RelationshipsPage = require__global_external_mobx_react.observer(() => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_resource_relationships.ResourceRelationshipsPage, { enabled: require_monitoring_preferences_store.MonitoringPreferencesStore.getInstanceOrCreate().relationshipsVisible }) }));
|
|
40
48
|
var FreelensPowerRenderer = class extends require_extensions.Renderer.LensExtension {
|
|
41
49
|
get name() {
|
|
42
50
|
return require_extension_info.EXTENSION_DISPLAY_NAME;
|
|
@@ -72,7 +80,8 @@ var FreelensPowerRenderer = class extends require_extensions.Renderer.LensExtens
|
|
|
72
80
|
require_button_styles.startPowerButtonStyles,
|
|
73
81
|
require_appearance.startAppearanceOverride,
|
|
74
82
|
require_welcome.startWelcomeOverride,
|
|
75
|
-
require_ai.startAiChat
|
|
83
|
+
require_ai.startAiChat,
|
|
84
|
+
require_resource_search.startResourceSearch
|
|
76
85
|
]) try {
|
|
77
86
|
disposers.push(start());
|
|
78
87
|
} catch {
|
|
@@ -105,6 +114,9 @@ var FreelensPowerRenderer = class extends require_extensions.Renderer.LensExtens
|
|
|
105
114
|
components: { Page: () => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_dashboard.DashboardPage, { onOpenPreferences: () => this.navigateToPreferences() }) }) }
|
|
106
115
|
}];
|
|
107
116
|
clusterPages = [{
|
|
117
|
+
id: "relationships",
|
|
118
|
+
components: { Page: () => /* @__PURE__ */ require_jsx_runtime.jsx(RelationshipsPage, {}) }
|
|
119
|
+
}, {
|
|
108
120
|
id: "diagnostics",
|
|
109
121
|
components: { Page: () => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_diagnostics.DiagnosticsPage, {}) }) }
|
|
110
122
|
}];
|
|
@@ -117,6 +129,16 @@ var FreelensPowerRenderer = class extends require_extensions.Renderer.LensExtens
|
|
|
117
129
|
material: "insights",
|
|
118
130
|
tooltip: "Resource diagnostics"
|
|
119
131
|
}) }
|
|
132
|
+
}, {
|
|
133
|
+
visible: require__global_external_mobx.computed(() => require_power_preferences_store.PowerPreferencesStore.getInstanceOrCreate().enabled && require_monitoring_preferences_store.MonitoringPreferencesStore.getInstanceOrCreate().relationshipsVisible),
|
|
134
|
+
id: "relationships",
|
|
135
|
+
target: { pageId: "relationships" },
|
|
136
|
+
title: "Relationships",
|
|
137
|
+
orderNumber: 6,
|
|
138
|
+
components: { Icon: () => /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Icon, {
|
|
139
|
+
material: "account_tree",
|
|
140
|
+
tooltip: "Resource relationships"
|
|
141
|
+
}) }
|
|
120
142
|
}];
|
|
121
143
|
topBarItems = [{ components: { Item: () => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Icon, {
|
|
122
144
|
material: "battery_charging_full",
|
|
@@ -124,23 +146,73 @@ var FreelensPowerRenderer = class extends require_extensions.Renderer.LensExtens
|
|
|
124
146
|
tooltip: "Freelens Power settings",
|
|
125
147
|
onClick: () => this.navigateToPreferences()
|
|
126
148
|
}) }) } }];
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
149
|
+
openDiagnostics = (namespace) => {
|
|
150
|
+
const clusterId = require_extensions.Renderer.Catalog.activeCluster.get()?.metadata.uid;
|
|
151
|
+
if (clusterId && namespace) require_diagnostics_state.focusDiagnosticsNamespace(clusterId, namespace);
|
|
152
|
+
this.navigate("diagnostics");
|
|
153
|
+
};
|
|
154
|
+
kubeObjectDetailItems = [
|
|
155
|
+
...[
|
|
156
|
+
"Pod",
|
|
157
|
+
"Deployment",
|
|
158
|
+
"StatefulSet",
|
|
159
|
+
"DaemonSet",
|
|
160
|
+
"Node"
|
|
161
|
+
].map((kind) => ({
|
|
162
|
+
kind,
|
|
163
|
+
apiVersions: kind === "Pod" || kind === "Node" ? ["v1"] : ["apps/v1"],
|
|
164
|
+
priority: 320,
|
|
165
|
+
components: { Details: (props) => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_resource_health_details.ResourceHealthDetails, {
|
|
166
|
+
...props,
|
|
167
|
+
onOpenDiagnostics: this.openDiagnostics
|
|
168
|
+
}) }) }
|
|
169
|
+
})),
|
|
170
|
+
{
|
|
171
|
+
kind: "Namespace",
|
|
172
|
+
apiVersions: ["v1"],
|
|
173
|
+
priority: 320,
|
|
174
|
+
components: { Details: (props) => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_namespace_health_details.NamespaceHealthDetails, {
|
|
175
|
+
...props,
|
|
176
|
+
onOpenDiagnostics: this.openDiagnostics
|
|
177
|
+
}) }) }
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
kind: "Service",
|
|
181
|
+
apiVersions: ["v1"],
|
|
182
|
+
priority: 320,
|
|
183
|
+
components: { Details: (props) => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_service_diagnostics_details.ServiceDiagnosticsDetails, {
|
|
184
|
+
...props,
|
|
185
|
+
object: props.object
|
|
186
|
+
}) }) }
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
kind: "HorizontalPodAutoscaler",
|
|
190
|
+
apiVersions: ["autoscaling/v1", "autoscaling/v2"],
|
|
191
|
+
priority: 320,
|
|
192
|
+
components: { Details: (props) => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_hpa_diagnostics_details.HpaDiagnosticsDetails, {
|
|
193
|
+
...props,
|
|
194
|
+
object: props.object
|
|
195
|
+
}) }) }
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
kind: "Node",
|
|
199
|
+
apiVersions: ["v1"],
|
|
200
|
+
priority: 310,
|
|
201
|
+
components: { Details: (props) => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_node_monitoring.NodeMonitoringDetails, {
|
|
202
|
+
...props,
|
|
203
|
+
object: props.object
|
|
204
|
+
}) }) }
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
kind: "Secret",
|
|
208
|
+
apiVersions: ["v1"],
|
|
209
|
+
priority: 10,
|
|
210
|
+
components: { Details: (props) => /* @__PURE__ */ require_jsx_runtime.jsx(PowerEnabled, { children: /* @__PURE__ */ require_jsx_runtime.jsx(require_secret_certificate_details.SecretCertificateDetails, {
|
|
211
|
+
...props,
|
|
212
|
+
object: props.object
|
|
213
|
+
}) }) }
|
|
214
|
+
}
|
|
215
|
+
];
|
|
144
216
|
kubeObjectMenuItems = [{
|
|
145
217
|
kind: "Node",
|
|
146
218
|
apiVersions: ["v1"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/renderer/index.tsx"],"sourcesContent":["/**\n * Copyright (c) Freelens Authors. All rights reserved.\n * Licensed under MIT License. See THIRD_PARTY_LICENSES for more information.\n */\n\nimport { Common, Renderer } from \"@freelensapp/extensions\";\nimport { computed, reaction } from \"mobx\";\nimport { observer } from \"mobx-react\";\nimport { EXTENSION_DISPLAY_NAME, EXTENSION_ID } from \"../common/extension-info\";\nimport { AiPreferencesStore } from \"../common/store/ai-preferences-store\";\nimport { AiShortcutsStore } from \"../common/store/ai-shortcuts-store\";\nimport { AppearancePreferencesStore } from \"../common/store/appearance-preferences-store\";\nimport { DashboardPreferencesStore } from \"../common/store/dashboard-preferences-store\";\nimport { MonitoringPreferencesStore } from \"../common/store/monitoring-preferences-store\";\nimport { NodeShellPreferencesStore } from \"../common/store/node-shell-preferences-store\";\nimport { PowerPreferencesStore } from \"../common/store/power-preferences-store\";\nimport { ReadOnlyPreferencesStore } from \"../common/store/read-only-preferences-store\";\nimport { startAiChat } from \"./ai\";\nimport { startAppearanceOverride } from \"./appearance\";\nimport { startPowerButtonStyles } from \"./button-styles\";\nimport { ClusterIconsPage } from \"./cluster-icons\";\nimport { DashboardPage } from \"./dashboard\";\nimport { SecretCertificateDetails } from \"./details/secret-certificate-details\";\nimport { DiagnosticsPage } from \"./diagnostics\";\nimport { SecureNodeShellMenu } from \"./menus/secure-node-shell-menu\";\nimport { startMonitoring } from \"./monitoring\";\nimport { startMonitoringCollector } from \"./monitoring-collector\";\nimport { startMonitoringHistoryCollection } from \"./monitoring-history-collection\";\nimport { NodeMonitoringDetails } from \"./node-monitoring\";\nimport { startPodMonitoring } from \"./pod-monitoring\";\nimport { PowerPreferences } from \"./preferences/preferences\";\nimport { startReadOnlyMode } from \"./read-only\";\nimport { startWelcomeOverride } from \"./welcome\";\n\nimport type { ReactNode } from \"react\";\n\nconst PowerEnabled = observer(({ children }: { children: ReactNode }) =>\n PowerPreferencesStore.getInstanceOrCreate<PowerPreferencesStore>().enabled ? <>{children}</> : null,\n);\n\nexport default class FreelensPowerRenderer extends Renderer.LensExtension {\n get name() {\n return EXTENSION_DISPLAY_NAME;\n }\n get sanitizedExtensionId() {\n return EXTENSION_ID;\n }\n get storeName() {\n return this.manifest.storeName || EXTENSION_ID;\n }\n\n private stopFeatures?: () => void;\n\n onActivate() {\n const power = PowerPreferencesStore.getInstanceOrCreate<PowerPreferencesStore>();\n power.loadExtension(this);\n AiPreferencesStore.getInstanceOrCreate().loadExtension(this);\n AiShortcutsStore.getInstanceOrCreate().loadExtension(this);\n ReadOnlyPreferencesStore.getInstanceOrCreate().loadExtension(this);\n NodeShellPreferencesStore.getInstanceOrCreate().loadExtension(this);\n MonitoringPreferencesStore.getInstanceOrCreate().loadExtension(this);\n AppearancePreferencesStore.getInstanceOrCreate().loadExtension(this);\n DashboardPreferencesStore.getInstanceOrCreate().loadExtension(this);\n this.stopFeatures?.();\n let disposers: (() => void)[] = [];\n const stop = reaction(\n () => power.enabled,\n (enabled) => {\n for (const dispose of disposers) dispose();\n disposers = [];\n if (enabled) {\n for (const start of [\n startReadOnlyMode,\n startMonitoringCollector,\n startMonitoringHistoryCollection,\n startMonitoring,\n startPodMonitoring,\n startPowerButtonStyles,\n startAppearanceOverride,\n startWelcomeOverride,\n startAiChat,\n ]) {\n try {\n disposers.push(start());\n } catch {\n Common.logger.warn(\"[Freelens Power] feature could not start\", { feature: start.name });\n }\n }\n }\n },\n { fireImmediately: true },\n );\n this.stopFeatures = () => {\n stop();\n for (const dispose of disposers) dispose();\n disposers = [];\n };\n }\n\n onDeactivate() {\n this.stopFeatures?.();\n this.stopFeatures = undefined;\n }\n\n appPreferences = [\n {\n id: \"freelens-power-settings\",\n title: \"\",\n components: { Input: PowerPreferences, Hint: () => null },\n },\n ];\n\n globalPages = [\n {\n id: \"cluster-icons\",\n components: {\n Page: () => (\n <PowerEnabled>\n <ClusterIconsPage />\n </PowerEnabled>\n ),\n },\n },\n {\n id: \"dashboard\",\n components: {\n Page: () => (\n <PowerEnabled>\n <DashboardPage onOpenPreferences={() => this.navigateToPreferences()} />\n </PowerEnabled>\n ),\n },\n },\n ];\n\n clusterPages = [\n {\n id: \"diagnostics\",\n components: {\n Page: () => (\n <PowerEnabled>\n <DiagnosticsPage />\n </PowerEnabled>\n ),\n },\n },\n ];\n\n clusterPageMenus = [\n {\n visible: computed(\n () =>\n PowerPreferencesStore.getInstanceOrCreate<PowerPreferencesStore>().enabled &&\n MonitoringPreferencesStore.getInstanceOrCreate<MonitoringPreferencesStore>().diagnosticsVisible,\n ),\n target: { pageId: \"diagnostics\" },\n title: \"Diagnostics\",\n orderNumber: 5,\n components: { Icon: () => <Renderer.Component.Icon material=\"insights\" tooltip=\"Resource diagnostics\" /> },\n },\n ];\n\n topBarItems = [\n {\n components: {\n Item: () => (\n <PowerEnabled>\n <Renderer.Component.Icon\n material=\"battery_charging_full\"\n className=\"freelens-power-settings-icon\"\n tooltip=\"Freelens Power settings\"\n onClick={() => this.navigateToPreferences()}\n />\n </PowerEnabled>\n ),\n },\n },\n ];\n\n kubeObjectDetailItems: Renderer.LensExtension[\"kubeObjectDetailItems\"] = [\n {\n kind: \"Node\",\n apiVersions: [\"v1\"],\n // host order is [300 - priority], before native metrics at [-1]\n priority: 310,\n components: {\n Details: (props) => (\n <PowerEnabled>\n <NodeMonitoringDetails {...props} object={props.object as Renderer.K8sApi.Node} />\n </PowerEnabled>\n ),\n },\n },\n {\n kind: \"Secret\",\n apiVersions: [\"v1\"],\n priority: 10,\n components: {\n Details: (props) => (\n <PowerEnabled>\n <SecretCertificateDetails {...props} object={props.object as Renderer.K8sApi.Secret} />\n </PowerEnabled>\n ),\n },\n },\n ];\n\n kubeObjectMenuItems = [\n {\n kind: \"Node\",\n apiVersions: [\"v1\"],\n components: {\n MenuItem: (props: Renderer.Component.KubeObjectMenuProps<Renderer.K8sApi.Node>) => (\n <PowerEnabled>\n <SecureNodeShellMenu {...props} />\n </PowerEnabled>\n ),\n },\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAM,eAAe,oCAAA,UAAU,EAAE,eAC/B,gCAAA,sBAAsB,oBAA2C,CAAC,CAAC,UAAU,oCAAA,IAAA,oBAAA,UAAA,EAAG,SAAW,CAAA,IAAI,IACjG;AAEA,IAAqB,wBAArB,cAAmD,mBAAA,SAAS,cAAc;CACxE,IAAI,OAAO;EACT,OAAO,uBAAA;CACT;CACA,IAAI,uBAAuB;EACzB,OAAO,uBAAA;CACT;CACA,IAAI,YAAY;EACd,OAAO,KAAK,SAAS,aAAA;CACvB;CAEA;CAEA,aAAa;EACX,MAAM,QAAQ,gCAAA,sBAAsB,oBAA2C;EAC/E,MAAM,cAAc,IAAI;EACxB,6BAAA,mBAAmB,oBAAoB,CAAC,CAAC,cAAc,IAAI;EAC3D,2BAAA,iBAAiB,oBAAoB,CAAC,CAAC,cAAc,IAAI;EACzD,oCAAA,yBAAyB,oBAAoB,CAAC,CAAC,cAAc,IAAI;EACjE,qCAAA,0BAA0B,oBAAoB,CAAC,CAAC,cAAc,IAAI;EAClE,qCAAA,2BAA2B,oBAAoB,CAAC,CAAC,cAAc,IAAI;EACnE,qCAAA,2BAA2B,oBAAoB,CAAC,CAAC,cAAc,IAAI;EACnE,oCAAA,0BAA0B,oBAAoB,CAAC,CAAC,cAAc,IAAI;EAClE,KAAK,eAAe;EACpB,IAAI,YAA4B,CAAC;EACjC,MA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,CAAC,kBACjF;EACA,QAAQ,EAAE,QAAQ,cAAc;EAChC,OAAO;EACP,aAAa;EACb,YAAY,EAAE,YAAY,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;GAAyB,UAAS;GAAW,SAAQ;EAAwB,CAAA,EAAE;CAC3G,CACF;CAEA,cAAc,CACZ,EACE,YAAY,EACV,YACE,oCAAA,IAAC,cAAD,EAAA,UACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;EACE,UAAS;EACT,WAAU;EACV,SAAQ;EACR,eAAe,KAAK,sBAAsB;CAC3C,CAAA,EACW,CAAA,EAElB,EACF,CACF;CAEA,wBAAyE,CACvE;EACE,MAAM;EACN,aAAa,CAAC,IAAI;EAElB,UAAU;EACV,YAAY,EACV,UAAU,UACR,oCAAA,IAAC,cAAD,EAAA,UACE,oCAAA,IAAC,wBAAA,uBAAD;GAAuB,GAAI;GAAO,QAAQ,MAAM;EAAiC,CAAA,EACrE,CAAA,EAElB;CACF,GACA;EACE,MAAM;EACN,aAAa,CAAC,IAAI;EAClB,UAAU;EACV,YAAY,EACV,UAAU,UACR,oCAAA,IAAC,cAAD,EAAA,UACE,oCAAA,IAAC,mCAAA,0BAAD;GAA0B,GAAI;GAAO,QAAQ,MAAM;EAAmC,CAAA,EAC1E,CAAA,EAElB;CACF,CACF;CAEA,sBAAsB,CACpB;EACE,MAAM;EACN,aAAa,CAAC,IAAI;EAClB,YAAY,EACV,WAAW,UACT,oCAAA,IAAC,cAAD,EAAA,UACE,oCAAA,IAAC,+BAAA,qBAAD,EAAqB,GAAI,MAAQ,CAAA,EACrB,CAAA,EAElB;CACF,CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/renderer/index.tsx"],"sourcesContent":["/**\n * Copyright (c) Freelens Authors. All rights reserved.\n * Licensed under MIT License. See THIRD_PARTY_LICENSES for more information.\n */\n\nimport { Common, Renderer } from \"@freelensapp/extensions\";\nimport { computed, reaction } from \"mobx\";\nimport { observer } from \"mobx-react\";\nimport { EXTENSION_DISPLAY_NAME, EXTENSION_ID } from \"../common/extension-info\";\nimport { AiPreferencesStore } from \"../common/store/ai-preferences-store\";\nimport { AiShortcutsStore } from \"../common/store/ai-shortcuts-store\";\nimport { AppearancePreferencesStore } from \"../common/store/appearance-preferences-store\";\nimport { DashboardPreferencesStore } from \"../common/store/dashboard-preferences-store\";\nimport { MonitoringPreferencesStore } from \"../common/store/monitoring-preferences-store\";\nimport { NodeShellPreferencesStore } from \"../common/store/node-shell-preferences-store\";\nimport { PowerPreferencesStore } from \"../common/store/power-preferences-store\";\nimport { ReadOnlyPreferencesStore } from \"../common/store/read-only-preferences-store\";\nimport { startAiChat } from \"./ai\";\nimport { startAppearanceOverride } from \"./appearance\";\nimport { startPowerButtonStyles } from \"./button-styles\";\nimport { ClusterIconsPage } from \"./cluster-icons\";\nimport { DashboardPage } from \"./dashboard\";\nimport { HpaDiagnosticsDetails } from \"./details/hpa-diagnostics-details\";\nimport { NamespaceHealthDetails } from \"./details/namespace-health-details\";\nimport { ResourceHealthDetails } from \"./details/resource-health-details\";\nimport { SecretCertificateDetails } from \"./details/secret-certificate-details\";\nimport { ServiceDiagnosticsDetails } from \"./details/service-diagnostics-details\";\nimport { DiagnosticsPage } from \"./diagnostics\";\nimport { focusDiagnosticsNamespace } from \"./diagnostics-state\";\nimport { SecureNodeShellMenu } from \"./menus/secure-node-shell-menu\";\nimport { startMonitoring } from \"./monitoring\";\nimport { startMonitoringCollector } from \"./monitoring-collector\";\nimport { startMonitoringHistoryCollection } from \"./monitoring-history-collection\";\nimport { NodeMonitoringDetails } from \"./node-monitoring\";\nimport { startPodMonitoring } from \"./pod-monitoring\";\nimport { PowerPreferences } from \"./preferences/preferences\";\nimport { startReadOnlyMode } from \"./read-only\";\nimport { ResourceRelationshipsPage } from \"./resource-relationships\";\nimport { startResourceSearch } from \"./resource-search\";\nimport { startWelcomeOverride } from \"./welcome\";\n\nimport type { ReactNode } from \"react\";\n\nconst PowerEnabled = observer(({ children }: { children: ReactNode }) =>\n PowerPreferencesStore.getInstanceOrCreate<PowerPreferencesStore>().enabled ? <>{children}</> : null,\n);\n\nconst RelationshipsPage = observer(() => (\n <PowerEnabled>\n <ResourceRelationshipsPage\n enabled={MonitoringPreferencesStore.getInstanceOrCreate<MonitoringPreferencesStore>().relationshipsVisible}\n />\n </PowerEnabled>\n));\n\nexport default class FreelensPowerRenderer extends Renderer.LensExtension {\n get name() {\n return EXTENSION_DISPLAY_NAME;\n }\n get sanitizedExtensionId() {\n return EXTENSION_ID;\n }\n get storeName() {\n return this.manifest.storeName || EXTENSION_ID;\n }\n\n private stopFeatures?: () => void;\n\n onActivate() {\n const power = PowerPreferencesStore.getInstanceOrCreate<PowerPreferencesStore>();\n power.loadExtension(this);\n AiPreferencesStore.getInstanceOrCreate().loadExtension(this);\n AiShortcutsStore.getInstanceOrCreate().loadExtension(this);\n ReadOnlyPreferencesStore.getInstanceOrCreate().loadExtension(this);\n NodeShellPreferencesStore.getInstanceOrCreate().loadExtension(this);\n MonitoringPreferencesStore.getInstanceOrCreate().loadExtension(this);\n AppearancePreferencesStore.getInstanceOrCreate().loadExtension(this);\n DashboardPreferencesStore.getInstanceOrCreate().loadExtension(this);\n this.stopFeatures?.();\n let disposers: (() => void)[] = [];\n const stop = reaction(\n () => power.enabled,\n (enabled) => {\n for (const dispose of disposers) dispose();\n disposers = [];\n if (enabled) {\n for (const start of [\n startReadOnlyMode,\n startMonitoringCollector,\n startMonitoringHistoryCollection,\n startMonitoring,\n startPodMonitoring,\n startPowerButtonStyles,\n startAppearanceOverride,\n startWelcomeOverride,\n startAiChat,\n startResourceSearch,\n ]) {\n try {\n disposers.push(start());\n } catch {\n Common.logger.warn(\"[Freelens Power] feature could not start\", { feature: start.name });\n }\n }\n }\n },\n { fireImmediately: true },\n );\n this.stopFeatures = () => {\n stop();\n for (const dispose of disposers) dispose();\n disposers = [];\n };\n }\n\n onDeactivate() {\n this.stopFeatures?.();\n this.stopFeatures = undefined;\n }\n\n appPreferences = [\n {\n id: \"freelens-power-settings\",\n title: \"\",\n components: { Input: PowerPreferences, Hint: () => null },\n },\n ];\n\n globalPages = [\n {\n id: \"cluster-icons\",\n components: {\n Page: () => (\n <PowerEnabled>\n <ClusterIconsPage />\n </PowerEnabled>\n ),\n },\n },\n {\n id: \"dashboard\",\n components: {\n Page: () => (\n <PowerEnabled>\n <DashboardPage onOpenPreferences={() => this.navigateToPreferences()} />\n </PowerEnabled>\n ),\n },\n },\n ];\n\n clusterPages = [\n { id: \"relationships\", components: { Page: () => <RelationshipsPage /> } },\n {\n id: \"diagnostics\",\n components: {\n Page: () => (\n <PowerEnabled>\n <DiagnosticsPage />\n </PowerEnabled>\n ),\n },\n },\n ];\n\n clusterPageMenus = [\n {\n visible: computed(\n () =>\n PowerPreferencesStore.getInstanceOrCreate<PowerPreferencesStore>().enabled &&\n MonitoringPreferencesStore.getInstanceOrCreate<MonitoringPreferencesStore>().diagnosticsVisible,\n ),\n target: { pageId: \"diagnostics\" },\n title: \"Diagnostics\",\n orderNumber: 5,\n components: { Icon: () => <Renderer.Component.Icon material=\"insights\" tooltip=\"Resource diagnostics\" /> },\n },\n {\n visible: computed(\n () =>\n PowerPreferencesStore.getInstanceOrCreate<PowerPreferencesStore>().enabled &&\n MonitoringPreferencesStore.getInstanceOrCreate<MonitoringPreferencesStore>().relationshipsVisible,\n ),\n id: \"relationships\",\n target: { pageId: \"relationships\" },\n title: \"Relationships\",\n orderNumber: 6,\n components: {\n Icon: () => <Renderer.Component.Icon material=\"account_tree\" tooltip=\"Resource relationships\" />,\n },\n },\n ];\n\n topBarItems = [\n {\n components: {\n Item: () => (\n <PowerEnabled>\n <Renderer.Component.Icon\n material=\"battery_charging_full\"\n className=\"freelens-power-settings-icon\"\n tooltip=\"Freelens Power settings\"\n onClick={() => this.navigateToPreferences()}\n />\n </PowerEnabled>\n ),\n },\n },\n ];\n\n private openDiagnostics = (namespace?: string) => {\n const clusterId = Renderer.Catalog.activeCluster.get()?.metadata.uid;\n if (clusterId && namespace) focusDiagnosticsNamespace(clusterId, namespace);\n void this.navigate(\"diagnostics\");\n };\n\n kubeObjectDetailItems: Renderer.LensExtension[\"kubeObjectDetailItems\"] = [\n ...[\"Pod\", \"Deployment\", \"StatefulSet\", \"DaemonSet\", \"Node\"].map((kind) => ({\n kind,\n apiVersions: kind === \"Pod\" || kind === \"Node\" ? [\"v1\"] : [\"apps/v1\"],\n priority: 320,\n components: {\n Details: (props: Renderer.Component.KubeObjectDetailsProps) => (\n <PowerEnabled>\n <ResourceHealthDetails {...props} onOpenDiagnostics={this.openDiagnostics} />\n </PowerEnabled>\n ),\n },\n })),\n {\n kind: \"Namespace\",\n apiVersions: [\"v1\"],\n priority: 320,\n components: {\n Details: (props) => (\n <PowerEnabled>\n <NamespaceHealthDetails {...props} onOpenDiagnostics={this.openDiagnostics} />\n </PowerEnabled>\n ),\n },\n },\n {\n kind: \"Service\",\n apiVersions: [\"v1\"],\n priority: 320,\n components: {\n Details: (props) => (\n <PowerEnabled>\n <ServiceDiagnosticsDetails {...props} object={props.object as Renderer.K8sApi.Service} />\n </PowerEnabled>\n ),\n },\n },\n {\n kind: \"HorizontalPodAutoscaler\",\n apiVersions: [\"autoscaling/v1\", \"autoscaling/v2\"],\n priority: 320,\n components: {\n Details: (props) => (\n <PowerEnabled>\n <HpaDiagnosticsDetails {...props} object={props.object as Renderer.K8sApi.HorizontalPodAutoscaler} />\n </PowerEnabled>\n ),\n },\n },\n {\n kind: \"Node\",\n apiVersions: [\"v1\"],\n // host order is [300 - priority], before native metrics at [-1]\n priority: 310,\n components: {\n Details: (props) => (\n <PowerEnabled>\n <NodeMonitoringDetails {...props} object={props.object as Renderer.K8sApi.Node} />\n </PowerEnabled>\n ),\n },\n },\n {\n kind: \"Secret\",\n apiVersions: [\"v1\"],\n priority: 10,\n components: {\n Details: (props) => (\n <PowerEnabled>\n <SecretCertificateDetails {...props} object={props.object as Renderer.K8sApi.Secret} />\n </PowerEnabled>\n ),\n },\n },\n ];\n\n kubeObjectMenuItems = [\n {\n kind: \"Node\",\n apiVersions: [\"v1\"],\n components: {\n MenuItem: (props: Renderer.Component.KubeObjectMenuProps<Renderer.K8sApi.Node>) => (\n <PowerEnabled>\n <SecureNodeShellMenu {...props} />\n </PowerEnabled>\n ),\n },\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,eAAe,oCAAA,UAAU,EAAE,eAC/B,gCAAA,sBAAsB,oBAA2C,CAAC,CAAC,UAAU,oCAAA,IAAA,oBAAA,UAAA,EAAG,SAAW,CAAA,IAAI,IACjG;AAEA,IAAM,oBAAoB,oCAAA,eACxB,oCAAA,IAAC,cAAD,EAAA,UACE,oCAAA,IAAC,+BAAA,2BAAD,EACE,SAAS,qCAAA,2BAA2B,oBAAgD,CAAC,CAAC,qBACvF,CAAA,EACW,CAAA,CACf;AAED,IAAqB,wBAArB,cAAmD,mBAAA,SAAS,cAAc;CACxE,IAAI,OAAO;EACT,OAAO,uBAAA;CACT;CACA,IAAI,uBAAuB;EACzB,OAAO,uBAAA;CACT;CACA,IAAI,YAAY;EACd,OAAO,KAAK,SAAS,aAAA;CACvB;CAEA;CAEA,aAAa;EACX,MAAM,QAAQ,gCAAA,sBAAsB,oBAA2C;EAC/E,MAAM,cAAc,IAAI;EACxB,6BAAA,mBAAmB,oBAAoB,CAAC,CAAC,cAAc,IAAI;EAC3D,2BAAA,iBAAiB,oBAAoB,CAAC,CAAC,cAAc,IAAI;EACzD,oCAAA,yBAAyB,oBAAoB,CAAC,CAAC,cAAc,IAAI;EACjE,qCAAA,0BAA0B,oBAAoB,CAAC,CAAC,cAAc,IAAI;EAClE,qCAAA,2BAA2B,oBAAoB,CAAC,CAAC,cAAc,IAAI;EACnE,qCAAA,2BAA2B,oBAAoB,CAAC,CAAC,cAAc,IAAI;EACnE,oCAAA,0BAA0B,oBAAoB,CAAC,CAAC,cAAc,IAAI;E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AA,IAAC,cAAD,EAAA,UACE,oCAAA,IAAC,+BAAA,qBAAD,EAAqB,GAAI,MAAQ,CAAA,EACrB,CAAA,EAElB;CACF,CACF;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_extensions = require("./_virtual/_global-external_@freelensapp/extensions.js");
|
|
2
2
|
const require_monitoring_preferences_store = require("./src/common/store/monitoring-preferences-store.js");
|
|
3
3
|
const require_monitoring_math = require("./src/common/monitoring-math.js");
|
|
4
|
-
const require_resource_diagnostics = require("./src/common/resource-diagnostics.js");
|
|
5
4
|
const require_monitoring_collector = require("./monitoring-collector.js");
|
|
5
|
+
const require_resource_diagnostics = require("./src/common/resource-diagnostics.js");
|
|
6
6
|
const require_monitoring_history = require("./monitoring-history.js");
|
|
7
7
|
//#region src/renderer/monitoring-history-collection.ts
|
|
8
8
|
function numeric(sample) {
|
|
@@ -36,6 +36,16 @@ var MonitoringPreferences = require__global_external_mobx_react.observer(() => {
|
|
|
36
36
|
className: "power-settings-hint",
|
|
37
37
|
children: "Resource consumers, application events and Pending diagnostics."
|
|
38
38
|
})] }),
|
|
39
|
+
/* @__PURE__ */ require_jsx_runtime.jsxs("div", { children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Switch, {
|
|
40
|
+
checked: preferences.relationshipsVisible,
|
|
41
|
+
onChange: (value) => {
|
|
42
|
+
preferences.relationshipsVisible = value;
|
|
43
|
+
},
|
|
44
|
+
children: "Show resource relationships"
|
|
45
|
+
}), /* @__PURE__ */ require_jsx_runtime.jsx("div", {
|
|
46
|
+
className: "power-settings-hint",
|
|
47
|
+
children: "Focused resource connections from API evidence, with links to related objects."
|
|
48
|
+
})] }),
|
|
39
49
|
/* @__PURE__ */ require_jsx_runtime.jsxs("div", { children: [/* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Switch, {
|
|
40
50
|
checked: preferences.enabled,
|
|
41
51
|
onChange: (value) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitoring-preferences.js","names":[],"sources":["../../../src/renderer/preferences/monitoring-preferences.tsx"],"sourcesContent":["import { Renderer } from \"@freelensapp/extensions\";\nimport { observer } from \"mobx-react\";\nimport { useEffect, useState } from \"react\";\nimport { HISTORY_MAX_BYTES, type HistoryStatus } from \"../../common/monitoring-history\";\nimport { MonitoringPreferencesStore } from \"../../common/store/monitoring-preferences-store\";\nimport { monitoringHistory } from \"../monitoring-history\";\n\nexport const MonitoringPreferences = observer(() => {\n const preferences = MonitoringPreferencesStore.getInstanceOrCreate<MonitoringPreferencesStore>();\n const [status, setStatus] = useState<HistoryStatus>();\n const refresh = () => {\n void monitoringHistory\n .status()\n .then(setStatus)\n .catch(() =>\n setStatus({\n available: false,\n enabled: preferences.historyEnabled,\n bytes: 0,\n samples: 0,\n error: \"History service unavailable\",\n }),\n );\n };\n useEffect(refresh, [preferences.historyEnabled]);\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 20 }}>\n <div>\n <Renderer.Component.Switch\n checked={preferences.diagnosticsVisible}\n onChange={(value) => {\n preferences.diagnosticsVisible = value;\n }}\n >\n Show Diagnostics in sidebar\n </Renderer.Component.Switch>\n <div className=\"power-settings-hint\">Resource consumers, application events and Pending diagnostics.</div>\n </div>\n <div>\n <Renderer.Component.Switch\n checked={preferences.enabled}\n onChange={(value) => {\n preferences.enabled = value;\n }}\n >\n Metrics-server monitoring\n </Renderer.Component.Switch>\n <div className=\"power-settings-hint\">\n CPU/RAM charts for clusters, nodes and pods. Keeps 30 minutes of live samples.\n </div>\n </div>\n <div>\n <Renderer.Component.Switch\n checked={preferences.historyEnabled}\n onChange={(value) => {\n preferences.historyEnabled = value;\n }}\n >\n Keep local history\n </Renderer.Component.Switch>\n <div\n className=\"power-settings-hint\"\n title=\"SQLite storage. Collects while the cluster view is active. Resolution: 30 seconds for 2 hours, 5 minutes for 24 hours, 30 minutes for 7 days. Disabling preserves saved history.\"\n >\n Up to 7 days, limited to 100 MiB.\n </div>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\", gap: 12 }}>\n <div style={{ flex: 1, minWidth: 0 }} role=\"status\">\n <div style={{ display: \"flex\", justifyContent: \"space-between\", alignItems: \"baseline\", gap: 12 }}>\n <span>Local storage</span>\n <span style={{ fontVariantNumeric: \"tabular-nums\", color: \"var(--textColorSecondary)\" }}>\n {status?.available\n ? `${(status.bytes / 1024 / 1024).toFixed(2)} / ${HISTORY_MAX_BYTES / 1024 / 1024} MiB`\n : \"— / 100 MiB\"}\n </span>\n </div>\n {status?.available && (\n <div\n role=\"progressbar\"\n aria-label=\"Local history storage\"\n aria-valuemin={0}\n aria-valuemax={HISTORY_MAX_BYTES}\n aria-valuenow={status.bytes}\n aria-valuetext={`${(status.bytes / 1024 / 1024).toFixed(2)} of 100 MiB`}\n style={{ height: 4, marginTop: 8, borderRadius: 2, overflow: \"hidden\", background: \"var(--borderColor)\" }}\n >\n <div\n style={{\n height: \"100%\",\n width: `${Math.min(100, Math.max(0, (status.bytes / HISTORY_MAX_BYTES) * 100))}%`,\n background: \"var(--primary)\",\n transition: \"width 180ms ease\",\n }}\n />\n </div>\n )}\n <div className=\"power-settings-hint\" style={{ marginTop: 6 }}>\n {status?.error ??\n (status?.available\n ? `${status.samples.toLocaleString()} metric buckets · 7-day retention`\n : \"Checking history storage…\")}\n </div>\n </div>\n <Renderer.Component.Button\n style={{\n flexShrink: 0,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n height: 30,\n padding: \"0 10px\",\n fontSize: 12,\n lineHeight: \"16px\",\n border: \"1px solid var(--borderFaintColor)\",\n borderRadius: 6,\n background: \"var(--contentColor)\",\n color: \"var(--textColorSecondary)\",\n }}\n title=\"Delete locally collected metric history without changing other settings\"\n onClick={() => {\n void monitoringHistory\n .clear()\n .then(refresh)\n .catch(() =>\n setStatus((previous) => ({\n available: previous?.available ?? false,\n enabled: preferences.historyEnabled,\n bytes: previous?.bytes ?? 0,\n samples: previous?.samples ?? 0,\n error: \"Unable to clear local history. Try again.\",\n })),\n );\n }}\n >\n <Renderer.Component.Icon material=\"delete_outline\" size={14} />\n <span>Clear</span>\n </Renderer.Component.Button>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;;AAOA,IAAa,wBAAwB,oCAAA,eAAe;CAClD,MAAM,cAAc,qCAAA,2BAA2B,oBAAgD;CAC/F,MAAM,CAAC,QAAQ,aAAa,+BAAA,SAAwB;CACpD,MAAM,gBAAgB;EACpB,6BAAK,kBACF,OAAO,CAAC,CACR,KAAK,SAAS,CAAC,CACf,YACC,UAAU;GACR,WAAW;GACX,SAAS,YAAY;GACrB,OAAO;GACP,SAAS;GACT,OAAO;EACT,CAAC,CACH;CACJ;CACA,+BAAA,UAAU,SAAS,CAAC,YAAY,cAAc,CAAC;CAC/C,OACE,oCAAA,KAAC,OAAD;EAAK,OAAO;GAAE,SAAS;GAAQ,eAAe;GAAU,KAAK;EAAG;YAAhE;GACE,oCAAA,KAAC,OAAD,EAAA,UAAA,CACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,QAApB;IACE,SAAS,YAAY;IACrB,WAAW,UAAU;KACnB,YAAY,qBAAqB;IACnC;cACD;GAE0B,CAAA,GAC3B,oCAAA,IAAC,OAAD;IAAK,WAAU;cAAsB;GAAoE,CAAA,CACtG,EAAA,CAAA;GACL,oCAAA,KAAC,OAAD,EAAA,UAAA,CACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,QAApB;IACE,SAAS,YAAY;IACrB,WAAW,UAAU;KACnB,YAAY,UAAU;IACxB;cACD;GAE0B,CAAA,GAC3B,oCAAA,IAAC,OAAD;IAAK,WAAU;cAAsB;GAEhC,CAAA,CACF,EAAA,CAAA;GACL,oCAAA,KAAC,OAAD,EAAA,UAAA,CACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,QAApB;IACE,SAAS,YAAY;IACrB,WAAW,UAAU;KACnB,YAAY,iBAAiB;IAC/B;c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,CAAA;KACF;QACL,oCAAA,KAAC,mBAAA,SAAS,UAAU,QAApB;KACE,OAAO;MACL,YAAY;MACZ,SAAS;MACT,YAAY;MACZ,gBAAgB;MAChB,KAAK;MACL,QAAQ;MACR,SAAS;MACT,UAAU;MACV,YAAY;MACZ,QAAQ;MACR,cAAc;MACd,YAAY;MACZ,OAAO;KACT;KACA,OAAM;KACN,eAAe;MACb,6BAAK,kBACF,MAAM,CAAC,CACP,KAAK,OAAO,CAAC,CACb,YACC,WAAW,cAAc;OACvB,WAAW,UAAU,aAAa;OAClC,SAAS,YAAY;OACrB,OAAO,UAAU,SAAS;OAC1B,SAAS,UAAU,WAAW;OAC9B,OAAO;MACT,EAAE,CACJ;KACJ;eA9BF,CAgCE,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;MAAyB,UAAS;MAAiB,MAAM;KAAK,CAAA,GAC9D,oCAAA,IAAC,QAAD,EAAA,UAAM,QAAW,CAAA,CACQ;MACxB;;EACF;;AAET,CAAC"}
|
|
1
|
+
{"version":3,"file":"monitoring-preferences.js","names":[],"sources":["../../../src/renderer/preferences/monitoring-preferences.tsx"],"sourcesContent":["import { Renderer } from \"@freelensapp/extensions\";\nimport { observer } from \"mobx-react\";\nimport { useEffect, useState } from \"react\";\nimport { HISTORY_MAX_BYTES, type HistoryStatus } from \"../../common/monitoring-history\";\nimport { MonitoringPreferencesStore } from \"../../common/store/monitoring-preferences-store\";\nimport { monitoringHistory } from \"../monitoring-history\";\n\nexport const MonitoringPreferences = observer(() => {\n const preferences = MonitoringPreferencesStore.getInstanceOrCreate<MonitoringPreferencesStore>();\n const [status, setStatus] = useState<HistoryStatus>();\n const refresh = () => {\n void monitoringHistory\n .status()\n .then(setStatus)\n .catch(() =>\n setStatus({\n available: false,\n enabled: preferences.historyEnabled,\n bytes: 0,\n samples: 0,\n error: \"History service unavailable\",\n }),\n );\n };\n useEffect(refresh, [preferences.historyEnabled]);\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 20 }}>\n <div>\n <Renderer.Component.Switch\n checked={preferences.diagnosticsVisible}\n onChange={(value) => {\n preferences.diagnosticsVisible = value;\n }}\n >\n Show Diagnostics in sidebar\n </Renderer.Component.Switch>\n <div className=\"power-settings-hint\">Resource consumers, application events and Pending diagnostics.</div>\n </div>\n <div>\n <Renderer.Component.Switch\n checked={preferences.relationshipsVisible}\n onChange={(value) => {\n preferences.relationshipsVisible = value;\n }}\n >\n Show resource relationships\n </Renderer.Component.Switch>\n <div className=\"power-settings-hint\">\n Focused resource connections from API evidence, with links to related objects.\n </div>\n </div>\n <div>\n <Renderer.Component.Switch\n checked={preferences.enabled}\n onChange={(value) => {\n preferences.enabled = value;\n }}\n >\n Metrics-server monitoring\n </Renderer.Component.Switch>\n <div className=\"power-settings-hint\">\n CPU/RAM charts for clusters, nodes and pods. Keeps 30 minutes of live samples.\n </div>\n </div>\n <div>\n <Renderer.Component.Switch\n checked={preferences.historyEnabled}\n onChange={(value) => {\n preferences.historyEnabled = value;\n }}\n >\n Keep local history\n </Renderer.Component.Switch>\n <div\n className=\"power-settings-hint\"\n title=\"SQLite storage. Collects while the cluster view is active. Resolution: 30 seconds for 2 hours, 5 minutes for 24 hours, 30 minutes for 7 days. Disabling preserves saved history.\"\n >\n Up to 7 days, limited to 100 MiB.\n </div>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\", gap: 12 }}>\n <div style={{ flex: 1, minWidth: 0 }} role=\"status\">\n <div style={{ display: \"flex\", justifyContent: \"space-between\", alignItems: \"baseline\", gap: 12 }}>\n <span>Local storage</span>\n <span style={{ fontVariantNumeric: \"tabular-nums\", color: \"var(--textColorSecondary)\" }}>\n {status?.available\n ? `${(status.bytes / 1024 / 1024).toFixed(2)} / ${HISTORY_MAX_BYTES / 1024 / 1024} MiB`\n : \"— / 100 MiB\"}\n </span>\n </div>\n {status?.available && (\n <div\n role=\"progressbar\"\n aria-label=\"Local history storage\"\n aria-valuemin={0}\n aria-valuemax={HISTORY_MAX_BYTES}\n aria-valuenow={status.bytes}\n aria-valuetext={`${(status.bytes / 1024 / 1024).toFixed(2)} of 100 MiB`}\n style={{ height: 4, marginTop: 8, borderRadius: 2, overflow: \"hidden\", background: \"var(--borderColor)\" }}\n >\n <div\n style={{\n height: \"100%\",\n width: `${Math.min(100, Math.max(0, (status.bytes / HISTORY_MAX_BYTES) * 100))}%`,\n background: \"var(--primary)\",\n transition: \"width 180ms ease\",\n }}\n />\n </div>\n )}\n <div className=\"power-settings-hint\" style={{ marginTop: 6 }}>\n {status?.error ??\n (status?.available\n ? `${status.samples.toLocaleString()} metric buckets · 7-day retention`\n : \"Checking history storage…\")}\n </div>\n </div>\n <Renderer.Component.Button\n style={{\n flexShrink: 0,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n height: 30,\n padding: \"0 10px\",\n fontSize: 12,\n lineHeight: \"16px\",\n border: \"1px solid var(--borderFaintColor)\",\n borderRadius: 6,\n background: \"var(--contentColor)\",\n color: \"var(--textColorSecondary)\",\n }}\n title=\"Delete locally collected metric history without changing other settings\"\n onClick={() => {\n void monitoringHistory\n .clear()\n .then(refresh)\n .catch(() =>\n setStatus((previous) => ({\n available: previous?.available ?? false,\n enabled: preferences.historyEnabled,\n bytes: previous?.bytes ?? 0,\n samples: previous?.samples ?? 0,\n error: \"Unable to clear local history. Try again.\",\n })),\n );\n }}\n >\n <Renderer.Component.Icon material=\"delete_outline\" size={14} />\n <span>Clear</span>\n </Renderer.Component.Button>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;;AAOA,IAAa,wBAAwB,oCAAA,eAAe;CAClD,MAAM,cAAc,qCAAA,2BAA2B,oBAAgD;CAC/F,MAAM,CAAC,QAAQ,aAAa,+BAAA,SAAwB;CACpD,MAAM,gBAAgB;EACpB,6BAAK,kBACF,OAAO,CAAC,CACR,KAAK,SAAS,CAAC,CACf,YACC,UAAU;GACR,WAAW;GACX,SAAS,YAAY;GACrB,OAAO;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AAY;MACZ,OAAO;KACT;KACA,OAAM;KACN,eAAe;MACb,6BAAK,kBACF,MAAM,CAAC,CACP,KAAK,OAAO,CAAC,CACb,YACC,WAAW,cAAc;OACvB,WAAW,UAAU,aAAa;OAClC,SAAS,YAAY;OACrB,OAAO,UAAU,SAAS;OAC1B,SAAS,UAAU,WAAW;OAC9B,OAAO;MACT,EAAE,CACJ;KACJ;eA9BF,CAgCE,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;MAAyB,UAAS;MAAiB,MAAM;KAAK,CAAA,GAC9D,oCAAA,IAAC,QAAD,EAAA,UAAM,QAAW,CAAA,CACQ;MACxB;;EACF;;AAET,CAAC"}
|
|
@@ -17,6 +17,29 @@ var styles = `
|
|
|
17
17
|
#freelens-power-settings > .hint,
|
|
18
18
|
#freelens-power-settings + hr { display: none; }
|
|
19
19
|
.freelens-power-preferences { display: grid; gap: 24px; max-width: 760px; }
|
|
20
|
+
.freelens-power-preferences .power-preferences-section-links {
|
|
21
|
+
display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; gap: 8px;
|
|
22
|
+
}
|
|
23
|
+
:root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link {
|
|
24
|
+
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
|
25
|
+
width: 100%; min-width: 0; min-height: 32px; padding: 4px 2px;
|
|
26
|
+
border: 0; border-radius: 4px; background: transparent; box-shadow: none;
|
|
27
|
+
color: var(--textColorSecondary); text-transform: none; white-space: nowrap; cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
:root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link:hover {
|
|
30
|
+
color: var(--primary); background: transparent; box-shadow: none;
|
|
31
|
+
}
|
|
32
|
+
:root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link:focus-visible {
|
|
33
|
+
color: var(--primary); background: transparent; box-shadow: none;
|
|
34
|
+
outline: 2px solid var(--primary); outline-offset: 2px;
|
|
35
|
+
}
|
|
36
|
+
@media (max-width: 600px) {
|
|
37
|
+
.freelens-power-preferences .power-preferences-section-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
38
|
+
}
|
|
39
|
+
@media (max-width: 360px) {
|
|
40
|
+
.freelens-power-preferences .power-preferences-section-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
41
|
+
}
|
|
42
|
+
.freelens-power-preferences section[id] { scroll-margin-top: 16px; }
|
|
20
43
|
.freelens-power-preferences section {
|
|
21
44
|
padding: 24px; border: 1px solid var(--borderFaintColor);
|
|
22
45
|
border-radius: 12px; background: var(--contentColor);
|
|
@@ -51,6 +74,38 @@ var styles = `
|
|
|
51
74
|
.freelens-power-preferences .power-settings-row { flex-wrap: wrap; }
|
|
52
75
|
}
|
|
53
76
|
`;
|
|
77
|
+
var sectionLinks = [
|
|
78
|
+
{
|
|
79
|
+
id: "safety",
|
|
80
|
+
title: "Safety",
|
|
81
|
+
icon: "lock_outline"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "appearance",
|
|
85
|
+
title: "Appearance",
|
|
86
|
+
icon: "palette"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "monitoring",
|
|
90
|
+
title: "Monitoring",
|
|
91
|
+
icon: "show_chart"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "shell",
|
|
95
|
+
title: "Node shell",
|
|
96
|
+
icon: "vpn_key"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: "ai",
|
|
100
|
+
title: "AI",
|
|
101
|
+
icon: "chat_bubble_outline"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "dashboard",
|
|
105
|
+
title: "Dashboard",
|
|
106
|
+
icon: "dashboard"
|
|
107
|
+
}
|
|
108
|
+
];
|
|
54
109
|
var PowerPreferences = () => /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
|
|
55
110
|
className: "freelens-power-preferences",
|
|
56
111
|
children: [
|
|
@@ -60,7 +115,30 @@ var PowerPreferences = () => /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
|
|
|
60
115
|
"aria-label": "Freelens Power",
|
|
61
116
|
children: /* @__PURE__ */ require_jsx_runtime.jsx(require_power_preferences.PowerPreferencesToggle, {})
|
|
62
117
|
}),
|
|
118
|
+
/* @__PURE__ */ require_jsx_runtime.jsx("nav", {
|
|
119
|
+
className: "power-preferences-section-links",
|
|
120
|
+
"aria-label": "Settings sections",
|
|
121
|
+
children: sectionLinks.map(({ id, title, icon }) => /* @__PURE__ */ require_jsx_runtime.jsxs(require_extensions.Renderer.Component.Button, {
|
|
122
|
+
className: "power-settings-section-link",
|
|
123
|
+
title: `Jump to ${title} settings`,
|
|
124
|
+
onClick: () => {
|
|
125
|
+
const section = document.getElementById(`freelens-power-${id}-section`);
|
|
126
|
+
section?.focus({ preventScroll: true });
|
|
127
|
+
section?.scrollIntoView({ block: "start" });
|
|
128
|
+
},
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Icon, {
|
|
131
|
+
material: icon,
|
|
132
|
+
size: 16
|
|
133
|
+
}),
|
|
134
|
+
" ",
|
|
135
|
+
title
|
|
136
|
+
]
|
|
137
|
+
}, id))
|
|
138
|
+
}),
|
|
63
139
|
/* @__PURE__ */ require_jsx_runtime.jsxs("section", {
|
|
140
|
+
id: "freelens-power-safety-section",
|
|
141
|
+
tabIndex: -1,
|
|
64
142
|
"aria-labelledby": "freelens-power-safety-title",
|
|
65
143
|
children: [/* @__PURE__ */ require_jsx_runtime.jsxs("h3", {
|
|
66
144
|
id: "freelens-power-safety-title",
|
|
@@ -71,6 +149,8 @@ var PowerPreferences = () => /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
|
|
|
71
149
|
}), /* @__PURE__ */ require_jsx_runtime.jsx(require_read_only_preferences.ReadOnlyPreferences, {})]
|
|
72
150
|
}),
|
|
73
151
|
/* @__PURE__ */ require_jsx_runtime.jsxs("section", {
|
|
152
|
+
id: "freelens-power-appearance-section",
|
|
153
|
+
tabIndex: -1,
|
|
74
154
|
"aria-labelledby": "freelens-power-appearance-title",
|
|
75
155
|
children: [
|
|
76
156
|
/* @__PURE__ */ require_jsx_runtime.jsxs("h3", {
|
|
@@ -104,6 +184,8 @@ var PowerPreferences = () => /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
|
|
|
104
184
|
]
|
|
105
185
|
}),
|
|
106
186
|
/* @__PURE__ */ require_jsx_runtime.jsxs("section", {
|
|
187
|
+
id: "freelens-power-monitoring-section",
|
|
188
|
+
tabIndex: -1,
|
|
107
189
|
"aria-labelledby": "freelens-power-monitoring-title",
|
|
108
190
|
children: [/* @__PURE__ */ require_jsx_runtime.jsxs("h3", {
|
|
109
191
|
id: "freelens-power-monitoring-title",
|
|
@@ -114,6 +196,8 @@ var PowerPreferences = () => /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
|
|
|
114
196
|
}), /* @__PURE__ */ require_jsx_runtime.jsx(require_monitoring_preferences.MonitoringPreferences, {})]
|
|
115
197
|
}),
|
|
116
198
|
/* @__PURE__ */ require_jsx_runtime.jsxs("section", {
|
|
199
|
+
id: "freelens-power-shell-section",
|
|
200
|
+
tabIndex: -1,
|
|
117
201
|
"aria-labelledby": "freelens-power-shell-title",
|
|
118
202
|
children: [/* @__PURE__ */ require_jsx_runtime.jsxs("h3", {
|
|
119
203
|
id: "freelens-power-shell-title",
|
|
@@ -124,6 +208,8 @@ var PowerPreferences = () => /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
|
|
|
124
208
|
}), /* @__PURE__ */ require_jsx_runtime.jsx(require_node_shell_preferences.NodeShellPreferences, {})]
|
|
125
209
|
}),
|
|
126
210
|
/* @__PURE__ */ require_jsx_runtime.jsxs("section", {
|
|
211
|
+
id: "freelens-power-ai-section",
|
|
212
|
+
tabIndex: -1,
|
|
127
213
|
"aria-labelledby": "freelens-power-ai-title",
|
|
128
214
|
children: [/* @__PURE__ */ require_jsx_runtime.jsxs("h3", {
|
|
129
215
|
id: "freelens-power-ai-title",
|
|
@@ -134,6 +220,8 @@ var PowerPreferences = () => /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
|
|
|
134
220
|
}), /* @__PURE__ */ require_jsx_runtime.jsx(require_ai_preferences.AiPreferences, {})]
|
|
135
221
|
}),
|
|
136
222
|
/* @__PURE__ */ require_jsx_runtime.jsxs("section", {
|
|
223
|
+
id: "freelens-power-dashboard-section",
|
|
224
|
+
tabIndex: -1,
|
|
137
225
|
"aria-labelledby": "freelens-power-dashboard-title",
|
|
138
226
|
children: [/* @__PURE__ */ require_jsx_runtime.jsxs("h3", {
|
|
139
227
|
id: "freelens-power-dashboard-title",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.js","names":[],"sources":["../../../src/renderer/preferences/preferences.tsx"],"sourcesContent":["import { Renderer } from \"@freelensapp/extensions\";\nimport { EXTENSION_ID } from \"../../common/extension-info\";\nimport { AiPreferences } from \"./ai-preferences\";\nimport { AppearancePreferences } from \"./appearance-preferences\";\nimport { DashboardPreferences } from \"./dashboard-preferences\";\nimport { MonitoringPreferences } from \"./monitoring-preferences\";\nimport { NodeShellPreferences } from \"./node-shell-preferences\";\nimport { PowerPreferencesToggle } from \"./power-preferences\";\nimport { ReadOnlyPreferences } from \"./read-only-preferences\";\nimport { SettingsExport } from \"./settings-export\";\n\nconst styles = `\n .power-preferences-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }\n .power-preferences-header-actions { display: inline-flex; margin-left: auto; flex-shrink: 0; }\n #freelens-power-settings > .SubTitle,\n #freelens-power-settings > .hint,\n #freelens-power-settings + hr { display: none; }\n .freelens-power-preferences { display: grid; gap: 24px; max-width: 760px; }\n .freelens-power-preferences section {\n padding: 24px; border: 1px solid var(--borderFaintColor);\n border-radius: 12px; background: var(--contentColor);\n }\n .freelens-power-preferences button, .freelens-power-preferences .Button { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }\n :root .freelens-power-preferences button.power-settings-icon-action,\n :root .power-preferences-header-actions button.power-settings-icon-action {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; min-width: 32px; padding: 0; flex-shrink: 0;\n border: 0; border-radius: 6px; background: transparent; color: var(--textColorSecondary); cursor: pointer;\n transition: color 160ms ease, background-color 160ms ease;\n }\n :root .freelens-power-preferences button.power-settings-icon-action:not(:disabled):hover,\n :root .power-preferences-header-actions button.power-settings-icon-action:not(:disabled):hover {\n color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent);\n }\n :root .freelens-power-preferences button.power-settings-icon-action:focus-visible,\n :root .power-preferences-header-actions button.power-settings-icon-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }\n :root .freelens-power-preferences button.power-settings-icon-action:disabled,\n :root .power-preferences-header-actions button.power-settings-icon-action:disabled { opacity: 0.4; cursor: default; }\n .freelens-power-preferences h3 {\n display: flex; align-items: center; gap: 10px; margin: 0 0 24px; font-size: 16px; font-weight: 600; color: var(--textColorAccent);\n }\n .freelens-power-preferences label[data-testid=\"switch\"] {\n display: flex; width: 100%; align-items: center; justify-content: space-between;\n }\n .freelens-power-preferences .power-settings-hint {\n margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--textColorSecondary);\n }\n @media (max-width: 760px) {\n .freelens-power-preferences section { padding: 18px; }\n .freelens-power-preferences .power-settings-row { flex-wrap: wrap; }\n }\n`;\n\nexport const PowerPreferences = () => (\n <div className=\"freelens-power-preferences\">\n <style>{styles}</style>\n <SettingsExport />\n <section aria-label=\"Freelens Power\">\n <PowerPreferencesToggle />\n </section>\n <section aria-labelledby=\"freelens-power-safety-title\">\n <h3 id=\"freelens-power-safety-title\">\n <Renderer.Component.Icon material=\"lock_outline\" size={20} /> Read-only mode\n </h3>\n <ReadOnlyPreferences />\n </section>\n <section aria-labelledby=\"freelens-power-appearance-title\">\n <h3 id=\"freelens-power-appearance-title\">\n <Renderer.Component.Icon material=\"palette\" size={20} /> Appearance\n </h3>\n <AppearancePreferences />\n <div style={{ display: \"flex\", justifyContent: \"flex-end\", marginTop: 20 }}>\n <Renderer.Component.Button\n style={{ display: \"inline-flex\", alignItems: \"center\", gap: 6 }}\n onClick={() => Renderer.Navigation.navigate(`/extension/${EXTENSION_ID}/cluster-icons`)}\n title=\"Create matching icons for your saved clusters\"\n >\n <Renderer.Component.Icon material=\"palette\" size={16} /> Cluster icons\n </Renderer.Component.Button>\n </div>\n </section>\n <section aria-labelledby=\"freelens-power-monitoring-title\">\n <h3 id=\"freelens-power-monitoring-title\">\n <Renderer.Component.Icon material=\"show_chart\" size={20} /> Monitoring\n </h3>\n <MonitoringPreferences />\n </section>\n <section aria-labelledby=\"freelens-power-shell-title\">\n <h3 id=\"freelens-power-shell-title\">\n <Renderer.Component.Icon material=\"vpn_key\" size={20} /> Secure Node Shell\n </h3>\n <NodeShellPreferences />\n </section>\n <section aria-labelledby=\"freelens-power-ai-title\">\n <h3 id=\"freelens-power-ai-title\">\n <Renderer.Component.Icon material=\"chat_bubble_outline\" size={20} /> AI assistant\n </h3>\n <AiPreferences />\n </section>\n <section aria-labelledby=\"freelens-power-dashboard-title\">\n <h3 id=\"freelens-power-dashboard-title\">\n <Renderer.Component.Icon material=\"dashboard\" size={20} /> Dashboard\n </h3>\n <DashboardPreferences />\n </section>\n </div>\n);\n"],"mappings":";;;;;;;;;;;;AAWA,IAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Cf,IAAa,yBACX,oCAAA,KAAC,OAAD;CAAK,WAAU;WAAf;EACE,oCAAA,IAAC,SAAD,EAAA,UAAQ,OAAc,CAAA;EACtB,oCAAA,IAAC,wBAAA,gBAAD,CAAiB,CAAA;EACjB,oCAAA,IAAC,WAAD;GAAS,cAAW;aAClB,oCAAA,IAAC,0BAAA,wBAAD,CAAyB,CAAA;EAClB,CAAA;EACT,oCAAA,KAAC,WAAD;GAAS,mBAAgB;aAAzB,CACE,oCAAA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AAD,CAAuB,CAAA,CAChB;;EACT,oCAAA,KAAC,WAAD;GAAS,mBAAgB;aAAzB,CACE,oCAAA,KAAC,MAAD;IAAI,IAAG;cAAP,CACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;KAAyB,UAAS;KAAsB,MAAM;IAAK,CAAA,GAAC,eAClE;OACJ,oCAAA,IAAC,uBAAA,eAAD,CAAgB,CAAA,CACT;;EACT,oCAAA,KAAC,WAAD;GAAS,mBAAgB;aAAzB,CACE,oCAAA,KAAC,MAAD;IAAI,IAAG;cAAP,CACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;KAAyB,UAAS;KAAY,MAAM;IAAK,CAAA,GAAC,YACxD;OACJ,oCAAA,IAAC,8BAAA,sBAAD,CAAuB,CAAA,CAChB;;CACN"}
|
|
1
|
+
{"version":3,"file":"preferences.js","names":[],"sources":["../../../src/renderer/preferences/preferences.tsx"],"sourcesContent":["import { Renderer } from \"@freelensapp/extensions\";\nimport { EXTENSION_ID } from \"../../common/extension-info\";\nimport { AiPreferences } from \"./ai-preferences\";\nimport { AppearancePreferences } from \"./appearance-preferences\";\nimport { DashboardPreferences } from \"./dashboard-preferences\";\nimport { MonitoringPreferences } from \"./monitoring-preferences\";\nimport { NodeShellPreferences } from \"./node-shell-preferences\";\nimport { PowerPreferencesToggle } from \"./power-preferences\";\nimport { ReadOnlyPreferences } from \"./read-only-preferences\";\nimport { SettingsExport } from \"./settings-export\";\n\nconst styles = `\n .power-preferences-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }\n .power-preferences-header-actions { display: inline-flex; margin-left: auto; flex-shrink: 0; }\n #freelens-power-settings > .SubTitle,\n #freelens-power-settings > .hint,\n #freelens-power-settings + hr { display: none; }\n .freelens-power-preferences { display: grid; gap: 24px; max-width: 760px; }\n .freelens-power-preferences .power-preferences-section-links {\n display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; gap: 8px;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link {\n display: inline-flex; align-items: center; justify-content: center; gap: 6px;\n width: 100%; min-width: 0; min-height: 32px; padding: 4px 2px;\n border: 0; border-radius: 4px; background: transparent; box-shadow: none;\n color: var(--textColorSecondary); text-transform: none; white-space: nowrap; cursor: pointer;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link:hover {\n color: var(--primary); background: transparent; box-shadow: none;\n }\n :root .freelens-power-preferences .power-preferences-section-links button.power-settings-section-link:focus-visible {\n color: var(--primary); background: transparent; box-shadow: none;\n outline: 2px solid var(--primary); outline-offset: 2px;\n }\n @media (max-width: 600px) {\n .freelens-power-preferences .power-preferences-section-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n }\n @media (max-width: 360px) {\n .freelens-power-preferences .power-preferences-section-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n }\n .freelens-power-preferences section[id] { scroll-margin-top: 16px; }\n .freelens-power-preferences section {\n padding: 24px; border: 1px solid var(--borderFaintColor);\n border-radius: 12px; background: var(--contentColor);\n }\n .freelens-power-preferences button, .freelens-power-preferences .Button { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }\n :root .freelens-power-preferences button.power-settings-icon-action,\n :root .power-preferences-header-actions button.power-settings-icon-action {\n display: inline-flex; align-items: center; justify-content: center;\n width: 32px; height: 32px; min-width: 32px; padding: 0; flex-shrink: 0;\n border: 0; border-radius: 6px; background: transparent; color: var(--textColorSecondary); cursor: pointer;\n transition: color 160ms ease, background-color 160ms ease;\n }\n :root .freelens-power-preferences button.power-settings-icon-action:not(:disabled):hover,\n :root .power-preferences-header-actions button.power-settings-icon-action:not(:disabled):hover {\n color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent);\n }\n :root .freelens-power-preferences button.power-settings-icon-action:focus-visible,\n :root .power-preferences-header-actions button.power-settings-icon-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }\n :root .freelens-power-preferences button.power-settings-icon-action:disabled,\n :root .power-preferences-header-actions button.power-settings-icon-action:disabled { opacity: 0.4; cursor: default; }\n .freelens-power-preferences h3 {\n display: flex; align-items: center; gap: 10px; margin: 0 0 24px; font-size: 16px; font-weight: 600; color: var(--textColorAccent);\n }\n .freelens-power-preferences label[data-testid=\"switch\"] {\n display: flex; width: 100%; align-items: center; justify-content: space-between;\n }\n .freelens-power-preferences .power-settings-hint {\n margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--textColorSecondary);\n }\n @media (max-width: 760px) {\n .freelens-power-preferences section { padding: 18px; }\n .freelens-power-preferences .power-settings-row { flex-wrap: wrap; }\n }\n`;\n\nconst sectionLinks = [\n { id: \"safety\", title: \"Safety\", icon: \"lock_outline\" },\n { id: \"appearance\", title: \"Appearance\", icon: \"palette\" },\n { id: \"monitoring\", title: \"Monitoring\", icon: \"show_chart\" },\n { id: \"shell\", title: \"Node shell\", icon: \"vpn_key\" },\n { id: \"ai\", title: \"AI\", icon: \"chat_bubble_outline\" },\n { id: \"dashboard\", title: \"Dashboard\", icon: \"dashboard\" },\n];\n\nexport const PowerPreferences = () => (\n <div className=\"freelens-power-preferences\">\n <style>{styles}</style>\n <SettingsExport />\n <section aria-label=\"Freelens Power\">\n <PowerPreferencesToggle />\n </section>\n <nav className=\"power-preferences-section-links\" aria-label=\"Settings sections\">\n {sectionLinks.map(({ id, title, icon }) => (\n <Renderer.Component.Button\n key={id}\n className=\"power-settings-section-link\"\n title={`Jump to ${title} settings`}\n onClick={() => {\n const section = document.getElementById(`freelens-power-${id}-section`);\n section?.focus({ preventScroll: true });\n section?.scrollIntoView({ block: \"start\" });\n }}\n >\n <Renderer.Component.Icon material={icon} size={16} /> {title}\n </Renderer.Component.Button>\n ))}\n </nav>\n <section id=\"freelens-power-safety-section\" tabIndex={-1} aria-labelledby=\"freelens-power-safety-title\">\n <h3 id=\"freelens-power-safety-title\">\n <Renderer.Component.Icon material=\"lock_outline\" size={20} /> Read-only mode\n </h3>\n <ReadOnlyPreferences />\n </section>\n <section id=\"freelens-power-appearance-section\" tabIndex={-1} aria-labelledby=\"freelens-power-appearance-title\">\n <h3 id=\"freelens-power-appearance-title\">\n <Renderer.Component.Icon material=\"palette\" size={20} /> Appearance\n </h3>\n <AppearancePreferences />\n <div style={{ display: \"flex\", justifyContent: \"flex-end\", marginTop: 20 }}>\n <Renderer.Component.Button\n style={{ display: \"inline-flex\", alignItems: \"center\", gap: 6 }}\n onClick={() => Renderer.Navigation.navigate(`/extension/${EXTENSION_ID}/cluster-icons`)}\n title=\"Create matching icons for your saved clusters\"\n >\n <Renderer.Component.Icon material=\"palette\" size={16} /> Cluster icons\n </Renderer.Component.Button>\n </div>\n </section>\n <section id=\"freelens-power-monitoring-section\" tabIndex={-1} aria-labelledby=\"freelens-power-monitoring-title\">\n <h3 id=\"freelens-power-monitoring-title\">\n <Renderer.Component.Icon material=\"show_chart\" size={20} /> Monitoring\n </h3>\n <MonitoringPreferences />\n </section>\n <section id=\"freelens-power-shell-section\" tabIndex={-1} aria-labelledby=\"freelens-power-shell-title\">\n <h3 id=\"freelens-power-shell-title\">\n <Renderer.Component.Icon material=\"vpn_key\" size={20} /> Secure Node Shell\n </h3>\n <NodeShellPreferences />\n </section>\n <section id=\"freelens-power-ai-section\" tabIndex={-1} aria-labelledby=\"freelens-power-ai-title\">\n <h3 id=\"freelens-power-ai-title\">\n <Renderer.Component.Icon material=\"chat_bubble_outline\" size={20} /> AI assistant\n </h3>\n <AiPreferences />\n </section>\n <section id=\"freelens-power-dashboard-section\" tabIndex={-1} aria-labelledby=\"freelens-power-dashboard-title\">\n <h3 id=\"freelens-power-dashboard-title\">\n <Renderer.Component.Icon material=\"dashboard\" size={20} /> Dashboard\n </h3>\n <DashboardPreferences />\n </section>\n </div>\n);\n"],"mappings":";;;;;;;;;;;;AAWA,IAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEf,IAAM,eAAe;CACnB;EAAE,IAAI;EAAU,OAA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ACE,oCAAA,KAAC,MAAD;IAAI,IAAG;cAAP,CACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;KAAyB,UAAS;KAAsB,MAAM;IAAK,CAAA,GAAC,eAClE;OACJ,oCAAA,IAAC,uBAAA,eAAD,CAAgB,CAAA,CACT;;EACT,oCAAA,KAAC,WAAD;GAAS,IAAG;GAAmC,UAAU;GAAI,mBAAgB;aAA7E,CACE,oCAAA,KAAC,MAAD;IAAI,IAAG;cAAP,CACE,oCAAA,IAAC,mBAAA,SAAS,UAAU,MAApB;KAAyB,UAAS;KAAY,MAAM;IAAK,CAAA,GAAC,YACxD;OACJ,oCAAA,IAAC,8BAAA,sBAAD,CAAuB,CAAA,CAChB;;CACN"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/renderer/resource-relationships.css.ts
|
|
2
|
+
var resourceRelationshipsStyles = `
|
|
3
|
+
.power-relationships{height:100%;overflow:auto;box-sizing:border-box;min-width:0;padding:24px;max-width:1550px;margin:auto;color:var(--textColorPrimary)}.power-relationships h2{margin:0}.power-relationships .page-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:8px}.power-relationships .intro{color:var(--textColorSecondary);max-width:900px;line-height:1.6}.power-relationships .controls{display:flex;gap:24px;align-items:end;flex-wrap:wrap;margin:24px 0}.power-relationships .control{min-width:200px;flex:1;max-width:340px}.power-relationships .control>span{display:block;font-size:12px;margin-bottom:8px;color:var(--textColorSecondary)}.power-relationships button{min-height:32px;cursor:pointer}.power-relationships .refresh{background:transparent;border:1px solid var(--borderColor);border-radius:5px;padding:5px 10px;color:var(--textColorPrimary);display:flex;align-items:center;gap:8px}.power-relationships .notice{padding:14px 16px;background:var(--contentColor);border:1px solid var(--borderColor);border-radius:7px;margin:16px 0;line-height:1.6}.power-relationships .warning{color:var(--colorWarning)}.power-relationships .healthy{color:var(--colorOk)}.power-relationships .neutral{color:var(--textColorSecondary)}.power-relationships .graph-scroll{min-width:0;max-width:100%;overflow:auto;margin-top:24px}.power-relationships .graph{min-width:1000px;display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));column-gap:64px;row-gap:16px;position:relative;padding:6px 2px 56px}.power-relationships .graph.hide-upstreams{min-width:740px;grid-template-columns:repeat(3,minmax(180px,1fr))}.power-relationships .graph-option{display:flex;align-items:center;gap:8px;width:fit-content;margin:0;cursor:pointer}.power-relationships .graph-option input{margin:0}.power-relationships .column{position:relative;min-width:0;display:grid;grid-row:1/-1;grid-template-rows:subgrid}.power-relationships .column>h3{font-size:13px;margin:0;color:var(--textColorSecondary);font-weight:500}.power-relationships .card{background:var(--contentColor);border:1px solid var(--borderColor);border-radius:8px;padding:14px;margin:0;position:relative;z-index:1;overflow-wrap:anywhere}.power-relationships .card-kind{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--textColorSecondary);margin-bottom:6px}.power-relationships .resource-name{font-size:14px;font-weight:600;color:var(--textColorPrimary);text-align:left;background:transparent;border:0;padding:0;max-width:100%}.power-relationships .resource-name:hover{color:var(--primary)}.power-relationships .card p{font-size:12px;line-height:1.5;margin:6px 0 0}.power-relationships .relation-label{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--textColorSecondary);margin-bottom:6px}.power-relationships .resource-connections{position:absolute;inset:0;overflow:visible;pointer-events:none;color:var(--textColorSecondary)}.power-relationships .connection{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;opacity:.55;transition:opacity .15s,stroke .15s,stroke-width .15s}.power-relationships .connection.highlighted{opacity:1;stroke:var(--primary);stroke-width:2.5}.power-relationships .connection.dimmed{opacity:.12}.power-relationships .scope{max-width:68ch;margin-top:8px;color:var(--textColorSecondary);font-size:12px;line-height:1.6}.power-relationships .scope>span{display:block;margin-top:3px}.power-relationships details{margin-top:16px}.power-relationships summary{cursor:pointer;min-height:32px}.power-relationships .edge-list{columns:2;line-height:1.7;font-size:12px;list-style:none;padding:0}.power-relationships .empty{padding:28px;border:1px dashed var(--borderColor);border-radius:8px;color:var(--textColorSecondary);text-align:center}.power-relationships .relationship-summary{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 24px}.power-relationships .ports{margin-left:auto;justify-content:flex-end;display:flex;gap:12px;flex-wrap:wrap;font-size:12px}.power-relationships .ports span{padding:4px 8px;border-radius:4px;background:var(--contentColor);border:1px solid var(--borderColor)}@media(max-width:900px){.power-relationships{padding:16px}.power-relationships .controls{gap:16px}.power-relationships .edge-list{columns:1}}`;
|
|
4
|
+
//#endregion
|
|
5
|
+
exports.resourceRelationshipsStyles = resourceRelationshipsStyles;
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=resource-relationships.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-relationships.css.js","names":[],"sources":["../../src/renderer/resource-relationships.css.ts"],"sourcesContent":["export const resourceRelationshipsStyles = `\n.power-relationships{height:100%;overflow:auto;box-sizing:border-box;min-width:0;padding:24px;max-width:1550px;margin:auto;color:var(--textColorPrimary)}.power-relationships h2{margin:0}.power-relationships .page-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:8px}.power-relationships .intro{color:var(--textColorSecondary);max-width:900px;line-height:1.6}.power-relationships .controls{display:flex;gap:24px;align-items:end;flex-wrap:wrap;margin:24px 0}.power-relationships .control{min-width:200px;flex:1;max-width:340px}.power-relationships .control>span{display:block;font-size:12px;margin-bottom:8px;color:var(--textColorSecondary)}.power-relationships button{min-height:32px;cursor:pointer}.power-relationships .refresh{background:transparent;border:1px solid var(--borderColor);border-radius:5px;padding:5px 10px;color:var(--textColorPrimary);display:flex;align-items:center;gap:8px}.power-relationships .notice{padding:14px 16px;background:var(--contentColor);border:1px solid var(--borderColor);border-radius:7px;margin:16px 0;line-height:1.6}.power-relationships .warning{color:var(--colorWarning)}.power-relationships .healthy{color:var(--colorOk)}.power-relationships .neutral{color:var(--textColorSecondary)}.power-relationships .graph-scroll{min-width:0;max-width:100%;overflow:auto;margin-top:24px}.power-relationships .graph{min-width:1000px;display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));column-gap:64px;row-gap:16px;position:relative;padding:6px 2px 56px}.power-relationships .graph.hide-upstreams{min-width:740px;grid-template-columns:repeat(3,minmax(180px,1fr))}.power-relationships .graph-option{display:flex;align-items:center;gap:8px;width:fit-content;margin:0;cursor:pointer}.power-relationships .graph-option input{margin:0}.power-relationships .column{position:relative;min-width:0;display:grid;grid-row:1/-1;grid-template-rows:subgrid}.power-relationships .column>h3{font-size:13px;margin:0;color:var(--textColorSecondary);font-weight:500}.power-relationships .card{background:var(--contentColor);border:1px solid var(--borderColor);border-radius:8px;padding:14px;margin:0;position:relative;z-index:1;overflow-wrap:anywhere}.power-relationships .card-kind{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--textColorSecondary);margin-bottom:6px}.power-relationships .resource-name{font-size:14px;font-weight:600;color:var(--textColorPrimary);text-align:left;background:transparent;border:0;padding:0;max-width:100%}.power-relationships .resource-name:hover{color:var(--primary)}.power-relationships .card p{font-size:12px;line-height:1.5;margin:6px 0 0}.power-relationships .relation-label{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--textColorSecondary);margin-bottom:6px}.power-relationships .resource-connections{position:absolute;inset:0;overflow:visible;pointer-events:none;color:var(--textColorSecondary)}.power-relationships .connection{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;opacity:.55;transition:opacity .15s,stroke .15s,stroke-width .15s}.power-relationships .connection.highlighted{opacity:1;stroke:var(--primary);stroke-width:2.5}.power-relationships .connection.dimmed{opacity:.12}.power-relationships .scope{max-width:68ch;margin-top:8px;color:var(--textColorSecondary);font-size:12px;line-height:1.6}.power-relationships .scope>span{display:block;margin-top:3px}.power-relationships details{margin-top:16px}.power-relationships summary{cursor:pointer;min-height:32px}.power-relationships .edge-list{columns:2;line-height:1.7;font-size:12px;list-style:none;padding:0}.power-relationships .empty{padding:28px;border:1px dashed var(--borderColor);border-radius:8px;color:var(--textColorSecondary);text-align:center}.power-relationships .relationship-summary{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 24px}.power-relationships .ports{margin-left:auto;justify-content:flex-end;display:flex;gap:12px;flex-wrap:wrap;font-size:12px}.power-relationships .ports span{padding:4px 8px;border-radius:4px;background:var(--contentColor);border:1px solid var(--borderColor)}@media(max-width:900px){.power-relationships{padding:16px}.power-relationships .controls{gap:16px}.power-relationships .edge-list{columns:1}}`;\n"],"mappings":";AAAA,IAAa,8BAA8B"}
|