@64mb/freelens-power 2.2.0 → 2.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.
@@ -7,15 +7,15 @@ const require__global_external_react = require("./_virtual/_global-external_reac
7
7
  const require_jsx_runtime = require("./_virtual/_global-external_react/jsx-runtime.js");
8
8
  const require_native_tooltip = require("./native-tooltip.js");
9
9
  const require_ai_diagnostic_handoff = require("./ai-diagnostic-handoff.js");
10
+ const require_power_log_field_filters = require("./src/common/power-log-field-filters.js");
11
+ const require_power_log_json_fields = require("./power-log-json-fields.js");
12
+ const require_power_log_json = require("./power-log-json.js");
10
13
  const require_date_time = require("./src/common/date-time.js");
11
14
  const require_diagnostic_explain_button = require("./diagnostic-explain-button.js");
12
- const require_power_log_field_filters = require("./src/common/power-log-field-filters.js");
13
15
  const require_power_log_json_filter_sql = require("./src/common/power-log-json-filter-sql.js");
14
16
  const require_power_log_json_preset = require("./src/common/power-log-json-preset.js");
15
17
  const require_power_log_sql_level = require("./src/common/power-log-sql-level.js");
16
18
  const require_power_logs_ai = require("./src/common/power-logs-ai.js");
17
- const require_power_log_json_fields = require("./power-log-json-fields.js");
18
- const require_power_log_json = require("./power-log-json.js");
19
19
  const require_power_log_message = require("./power-log-message.js");
20
20
  const require_power_log_json_cell = require("./power-log-json-cell.js");
21
21
  const require_power_log_sql_editor = require("./power-log-sql-editor.js");
@@ -978,28 +978,56 @@ function Workspace({ clusterId, contextId }) {
978
978
  const capture = captures.find((capture) => capture.id === id);
979
979
  if (!capture) return;
980
980
  require_extensions.Renderer.Component.ConfirmDialog.open({
981
- message: /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [
982
- "Delete snapshot ",
983
- /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: capture.target.name }),
984
- "? This cannot be undone."
985
- ] }),
986
- labelOk: "Delete snapshot",
981
+ message: /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
982
+ className: "power-logs-confirmation",
983
+ children: [
984
+ "Delete snapshot ",
985
+ /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: capture.target.name }),
986
+ "? This cannot be undone."
987
+ ]
988
+ }),
989
+ labelOk: /* @__PURE__ */ require_jsx_runtime.jsxs("span", {
990
+ className: "power-logs-confirm-label",
991
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("span", {
992
+ "aria-hidden": "true",
993
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Icon, {
994
+ material: "delete_outline",
995
+ size: 16
996
+ })
997
+ }), "Delete snapshot"]
998
+ }),
999
+ okButtonProps: { className: "ok power-logs-confirm-delete" },
987
1000
  ok: () => deleteCapture(id)
988
1001
  });
989
1002
  };
990
1003
  const confirmPersistentCapture = (capture) => {
991
1004
  const persistent = !capture.persistent;
992
1005
  require_extensions.Renderer.Component.ConfirmDialog.open({
993
- message: persistent ? /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [
994
- "Keep snapshot ",
995
- /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: capture.target.name }),
996
- " until you delete it? It will survive restarts and will not expire automatically."
997
- ] }) : /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [
998
- "Allow snapshot ",
999
- /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: capture.target.name }),
1000
- " to expire? Its retention period will start again now."
1001
- ] }),
1002
- labelOk: persistent ? "Keep snapshot" : "Allow expiration",
1006
+ message: persistent ? /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1007
+ className: "power-logs-confirmation",
1008
+ children: [
1009
+ "Keep snapshot ",
1010
+ /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: capture.target.name }),
1011
+ " until you delete it? It will survive restarts and will not expire automatically."
1012
+ ]
1013
+ }) : /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1014
+ className: "power-logs-confirmation",
1015
+ children: [
1016
+ "Allow snapshot ",
1017
+ /* @__PURE__ */ require_jsx_runtime.jsx("strong", { children: capture.target.name }),
1018
+ " to expire? Its retention period will start again now."
1019
+ ]
1020
+ }),
1021
+ labelOk: /* @__PURE__ */ require_jsx_runtime.jsxs("span", {
1022
+ className: "power-logs-confirm-label",
1023
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("span", {
1024
+ "aria-hidden": "true",
1025
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Icon, {
1026
+ svg: persistent ? "push_pin" : "push_off",
1027
+ size: 16
1028
+ })
1029
+ }), persistent ? "Keep snapshot" : "Allow expiration"]
1030
+ }),
1003
1031
  ok: async () => {
1004
1032
  if (!alive.current || deleting.current.has(capture.id) || queryRef.current || captureController.current) return;
1005
1033
  deleting.current.add(capture.id);
@@ -1022,8 +1050,21 @@ function Workspace({ clusterId, contextId }) {
1022
1050
  });
1023
1051
  };
1024
1052
  const clearSavedSnapshots = () => require_extensions.Renderer.Component.ConfirmDialog.open({
1025
- message: "Delete all saved snapshots from all clusters? Temporary snapshots will be kept. This cannot be undone.",
1026
- labelOk: "Clear saved snapshots",
1053
+ message: /* @__PURE__ */ require_jsx_runtime.jsx("div", {
1054
+ className: "power-logs-confirmation",
1055
+ children: "Delete all saved snapshots from all clusters? Temporary snapshots will be kept. This cannot be undone."
1056
+ }),
1057
+ labelOk: /* @__PURE__ */ require_jsx_runtime.jsxs("span", {
1058
+ className: "power-logs-confirm-label",
1059
+ children: [/* @__PURE__ */ require_jsx_runtime.jsx("span", {
1060
+ "aria-hidden": "true",
1061
+ children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Icon, {
1062
+ material: "delete_outline",
1063
+ size: 16
1064
+ })
1065
+ }), "Clear saved snapshots"]
1066
+ }),
1067
+ okButtonProps: { className: "ok power-logs-confirm-delete" },
1027
1068
  ok: async () => {
1028
1069
  if (queryRef.current || captureController.current || deleting.current.size) return;
1029
1070
  deleting.current.add("clear-saved");
@@ -1062,6 +1103,16 @@ function Workspace({ clusterId, contextId }) {
1062
1103
  });
1063
1104
  else setError("Open the Pod in the native resource view to use its Logs action");
1064
1105
  };
1106
+ const errorNotice = error && /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1107
+ role: "alert",
1108
+ className: "power-logs-notice power-logs-error",
1109
+ children: [error, savedPoolFull && /* @__PURE__ */ require_jsx_runtime.jsx("button", {
1110
+ type: "button",
1111
+ disabled: deletingCount > 0 || !!queryId || capturePending,
1112
+ onClick: clearSavedSnapshots,
1113
+ children: "Clear saved snapshots"
1114
+ })]
1115
+ });
1065
1116
  return /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1066
1117
  className: "power-logs",
1067
1118
  "data-testid": "power-logs-page",
@@ -1247,16 +1298,6 @@ function Workspace({ clusterId, contextId }) {
1247
1298
  ]
1248
1299
  })
1249
1300
  }) : /* @__PURE__ */ require_jsx_runtime.jsx(SourcePicker, {}),
1250
- error && /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1251
- role: "alert",
1252
- className: "power-logs-notice power-logs-error",
1253
- children: [error, savedPoolFull && /* @__PURE__ */ require_jsx_runtime.jsx("button", {
1254
- type: "button",
1255
- disabled: deletingCount > 0 || !!queryId || capturePending,
1256
- onClick: clearSavedSnapshots,
1257
- children: "Clear saved snapshots"
1258
- })]
1259
- }),
1260
1301
  tab === "live" ? /* @__PURE__ */ require_jsx_runtime.jsxs(require_jsx_runtime.Fragment, { children: [
1261
1302
  /* @__PURE__ */ require_jsx_runtime.jsxs("div", {
1262
1303
  className: "power-logs-filters",
@@ -1363,6 +1404,7 @@ function Workspace({ clusterId, contextId }) {
1363
1404
  })
1364
1405
  ]
1365
1406
  }),
1407
+ errorNotice,
1366
1408
  /* @__PURE__ */ require_jsx_runtime.jsx(FieldFilters, {
1367
1409
  filters: fieldFilters,
1368
1410
  onRemove: (index) => setFieldFilters(fieldFilters.filter((_, item) => item !== index))
@@ -1461,7 +1503,7 @@ function Workspace({ clusterId, contextId }) {
1461
1503
  confirmPersistentCapture(item);
1462
1504
  },
1463
1505
  children: /* @__PURE__ */ require_jsx_runtime.jsx(require_extensions.Renderer.Component.Icon, {
1464
- material: "push_pin",
1506
+ svg: item.persistent ? "push_off" : "push_pin",
1465
1507
  size: 16
1466
1508
  })
1467
1509
  })
@@ -1589,6 +1631,7 @@ function Workspace({ clusterId, contextId }) {
1589
1631
  onChange: setSql,
1590
1632
  fitVersion: sqlFitVersion
1591
1633
  }),
1634
+ errorNotice,
1592
1635
  sqlError && /* @__PURE__ */ require_jsx_runtime.jsx("div", {
1593
1636
  role: "alert",
1594
1637
  className: "power-logs-notice power-logs-error power-logs-query-error",