@prorobotech/openapi-k8s-toolkit 1.2.0-alpha.19 → 1.2.0-alpha.20

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.
@@ -75664,7 +75664,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75664
75664
  range = "1h",
75665
75665
  refetchInterval,
75666
75666
  width,
75667
- height
75667
+ height,
75668
+ formatValue
75668
75669
  }) => {
75669
75670
  const {
75670
75671
  data: series,
@@ -75702,11 +75703,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75702
75703
  error.message
75703
75704
  ] });
75704
75705
  }
75706
+ const valueFormatter = formatValue ?? formatBytes;
75705
75707
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data: chartData, children: [
75706
75708
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
75707
75709
  /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: formatTimestamp }),
75708
- /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: formatBytes }),
75709
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => formatBytes(v), labelFormatter: (v) => formatTimestamp(v) }),
75710
+ /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
75711
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => formatTimestamp(v) }),
75710
75712
  series?.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
75711
75713
  Area,
75712
75714
  {
@@ -75752,7 +75754,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75752
75754
  range = "1h",
75753
75755
  refetchInterval,
75754
75756
  width,
75755
- height
75757
+ height,
75758
+ formatValue
75756
75759
  }) => {
75757
75760
  const { data = [], isLoading, error } = usePromMatrixToLineSingle({ baseUrl, query, range, refetchInterval });
75758
75761
  if (isLoading) {
@@ -75764,6 +75767,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75764
75767
  error.message
75765
75768
  ] });
75766
75769
  }
75770
+ const valueFormatter = formatValue ?? formatBytes;
75767
75771
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data, children: [
75768
75772
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
75769
75773
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -75781,8 +75785,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75781
75785
  }
75782
75786
  }
75783
75787
  ),
75784
- /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => formatBytes(value) }),
75785
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => formatBytes(value), labelFormatter: (value) => formatTimestamp(value) }),
75788
+ /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => valueFormatter(value) }),
75789
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => valueFormatter(value), labelFormatter: (value) => formatTimestamp(value) }),
75786
75790
  /* @__PURE__ */ jsxRuntimeExports.jsx(
75787
75791
  Area,
75788
75792
  {
@@ -75822,7 +75826,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75822
75826
  range = "1h",
75823
75827
  refetchInterval,
75824
75828
  width,
75825
- height
75829
+ height,
75830
+ formatValue
75826
75831
  }) => {
75827
75832
  const { data: series = [], isLoading, error } = usePromMatrixToLineMulti({ baseUrl, query, range, refetchInterval });
75828
75833
  const chartData = React$1.useMemo(() => matrixToStackedAreaData(series), [series]);
@@ -75835,11 +75840,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75835
75840
  error.message
75836
75841
  ] });
75837
75842
  }
75843
+ const valueFormatter = formatValue ?? formatBytes;
75838
75844
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data: chartData, children: [
75839
75845
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
75840
75846
  /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: formatTimestamp }),
75841
- /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: formatBytes }),
75842
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => formatBytes(v), labelFormatter: (v) => formatTimestamp(v) }),
75847
+ /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
75848
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => formatTimestamp(v) }),
75843
75849
  series.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
75844
75850
  Area,
75845
75851
  {
@@ -75864,7 +75870,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75864
75870
  range = "1h",
75865
75871
  refetchInterval,
75866
75872
  width,
75867
- height
75873
+ height,
75874
+ formatValue
75868
75875
  }) => {
75869
75876
  const {
75870
75877
  data: series,
@@ -75902,11 +75909,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75902
75909
  error.message
75903
75910
  ] });
75904
75911
  }
75912
+ const valueFormatter = formatValue ?? formatBytes;
75905
75913
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(LineChart, { data: chartData, children: [
75906
75914
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
75907
75915
  /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: formatTimestamp }),
75908
- /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: formatBytes }),
75909
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => formatBytes(v), labelFormatter: (v) => formatTimestamp(v) }),
75916
+ /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
75917
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => formatTimestamp(v) }),
75910
75918
  series?.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
75911
75919
  Line,
75912
75920
  {
@@ -75928,7 +75936,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75928
75936
  range = "1h",
75929
75937
  refetchInterval,
75930
75938
  width,
75931
- height
75939
+ height,
75940
+ formatValue
75932
75941
  }) => {
75933
75942
  const {
75934
75943
  data = [],
@@ -75949,6 +75958,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75949
75958
  error.message
75950
75959
  ] });
75951
75960
  }
75961
+ const valueFormatter = formatValue ?? formatBytes;
75952
75962
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(LineChart, { data, children: [
75953
75963
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
75954
75964
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -75966,8 +75976,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
75966
75976
  }
75967
75977
  }
75968
75978
  ),
75969
- /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => formatBytes(value) }),
75970
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => formatBytes(value), labelFormatter: (value) => formatTimestamp(value) }),
75979
+ /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => valueFormatter(value) }),
75980
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => valueFormatter(value), labelFormatter: (value) => formatTimestamp(value) }),
75971
75981
  /* @__PURE__ */ jsxRuntimeExports.jsx(
75972
75982
  Line,
75973
75983
  {
@@ -76033,7 +76043,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76033
76043
  refetchInterval,
76034
76044
  mode = "avg",
76035
76045
  width,
76036
- height
76046
+ height,
76047
+ formatValue
76037
76048
  }) => {
76038
76049
  const {
76039
76050
  data: series = [],
@@ -76058,8 +76069,14 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76058
76069
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(BarChart, { data: reduced, children: [
76059
76070
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
76060
76071
  /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "id" }),
76061
- /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, {}),
76062
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => `${value} bytes`, labelFormatter: (label) => `Series: ${label}` }),
76072
+ /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: formatValue }),
76073
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
76074
+ Tooltip,
76075
+ {
76076
+ formatter: (value) => formatValue ? formatValue(Number(value)) : `${value} bytes`,
76077
+ labelFormatter: (label) => `Series: ${label}`
76078
+ }
76079
+ ),
76063
76080
  /* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { dataKey: "value", children: reduced.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 35 % 360}, 70%, 55%)` }, `cell-${i}`)) })
76064
76081
  ] }) }) });
76065
76082
  };
@@ -76069,7 +76086,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76069
76086
  query = "container_memory_usage_bytes",
76070
76087
  range = "1h",
76071
76088
  refetchInterval,
76072
- title = "Memory usage (min / max / current)"
76089
+ title = "Memory usage (min / max / current)",
76090
+ formatValue
76073
76091
  }) => {
76074
76092
  const {
76075
76093
  data: series = [],
@@ -76109,6 +76127,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76109
76127
  };
76110
76128
  });
76111
76129
  }, [series]);
76130
+ const valueFormatter = formatValue ?? formatBytes;
76112
76131
  const columns = React$1.useMemo(
76113
76132
  () => [
76114
76133
  {
@@ -76127,7 +76146,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76127
76146
  dataIndex: "min",
76128
76147
  key: "min",
76129
76148
  align: "right",
76130
- render: (v) => v == null ? "" : formatBytes(v),
76149
+ render: (v) => v == null ? "-" : valueFormatter(v),
76131
76150
  sorter: (a, b) => (a.min ?? -Infinity) - (b.min ?? -Infinity),
76132
76151
  defaultSortOrder: void 0
76133
76152
  },
@@ -76136,7 +76155,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76136
76155
  dataIndex: "max",
76137
76156
  key: "max",
76138
76157
  align: "right",
76139
- render: (v) => v == null ? "" : formatBytes(v),
76158
+ render: (v) => v == null ? "-" : valueFormatter(v),
76140
76159
  sorter: (a, b) => (a.max ?? -Infinity) - (b.max ?? -Infinity)
76141
76160
  },
76142
76161
  {
@@ -76144,7 +76163,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76144
76163
  dataIndex: "current",
76145
76164
  key: "current",
76146
76165
  align: "right",
76147
- render: (v) => v == null ? "" : formatBytes(v),
76166
+ render: (v) => v == null ? "-" : valueFormatter(v),
76148
76167
  sorter: (a, b) => (a.current ?? -Infinity) - (b.current ?? -Infinity),
76149
76168
  defaultSortOrder: "descend"
76150
76169
  },
@@ -76157,7 +76176,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76157
76176
  sorter: (a, b) => (a.currentTs ?? -Infinity) - (b.currentTs ?? -Infinity)
76158
76177
  }
76159
76178
  ],
76160
- []
76179
+ [valueFormatter]
76161
76180
  );
76162
76181
  if (error) {
76163
76182
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -76226,7 +76245,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76226
76245
  refetchInterval,
76227
76246
  topN = 10,
76228
76247
  width,
76229
- height
76248
+ height,
76249
+ formatValue
76230
76250
  }) => {
76231
76251
  const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
76232
76252
  const items = React$1.useMemo(() => {
@@ -76242,11 +76262,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76242
76262
  error.message
76243
76263
  ] });
76244
76264
  }
76265
+ const valueFormatter = formatValue ?? formatBytes;
76245
76266
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(BarChart, { data: items, layout: "vertical", children: [
76246
76267
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
76247
- /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { type: "number", tickFormatter: formatBytes }),
76268
+ /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { type: "number", tickFormatter: valueFormatter }),
76248
76269
  /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { type: "category", dataKey: "id", width: 160 }),
76249
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => formatBytes(v) }),
76270
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v) }),
76250
76271
  /* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { dataKey: "value", children: items.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 35 % 360}, 70%, 55%)` }, `cell-${i}`)) })
76251
76272
  ] }) }) });
76252
76273
  };
@@ -76283,7 +76304,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76283
76304
  query = "container_memory_usage_bytes",
76284
76305
  refetchInterval,
76285
76306
  width,
76286
- height
76307
+ height,
76308
+ formatValue
76287
76309
  }) => {
76288
76310
  const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
76289
76311
  const items = React$1.useMemo(() => data ? vectorToBarHorizontal(data) : [], [data]);
@@ -76296,11 +76318,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76296
76318
  error.message
76297
76319
  ] });
76298
76320
  }
76321
+ const valueFormatter = formatValue ?? formatBytes;
76299
76322
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(BarChart, { data: items, layout: "vertical", children: [
76300
76323
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
76301
- /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { type: "number", tickFormatter: formatBytes }),
76324
+ /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { type: "number", tickFormatter: valueFormatter }),
76302
76325
  /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { type: "category", dataKey: "id", width: 140 }),
76303
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => formatBytes(v) }),
76326
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v) }),
76304
76327
  /* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { dataKey: "value", children: items.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 35 % 360}, 70%, 55%)` }, `cell-${i}`)) })
76305
76328
  ] }) }) });
76306
76329
  };
@@ -76310,7 +76333,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76310
76333
  query = "container_memory_usage_bytes",
76311
76334
  refetchInterval,
76312
76335
  width,
76313
- height
76336
+ height,
76337
+ formatValue
76314
76338
  }) => {
76315
76339
  const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
76316
76340
  const items = React$1.useMemo(() => data ? vectorToBarVertical(data) : [], [data]);
@@ -76323,11 +76347,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76323
76347
  error.message
76324
76348
  ] });
76325
76349
  }
76350
+ const valueFormatter = formatValue ?? formatBytes;
76326
76351
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(BarChart, { data: items, children: [
76327
76352
  /* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
76328
76353
  /* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "id" }),
76329
- /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: formatBytes }),
76330
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => formatBytes(v) }),
76354
+ /* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
76355
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v) }),
76331
76356
  /* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { dataKey: "value", children: items.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 35 % 360}, 70%, 55%)` }, `cell-${i}`)) })
76332
76357
  ] }) }) });
76333
76358
  };
@@ -76351,7 +76376,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76351
76376
  min = 0,
76352
76377
  max = 1,
76353
76378
  width,
76354
- height
76379
+ height,
76380
+ formatValue
76355
76381
  }) => {
76356
76382
  const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
76357
76383
  const gauge = React$1.useMemo(() => data ? vectorToGaugeRadial(data) : null, [data]);
@@ -76360,6 +76386,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76360
76386
  const filled = clamped - min;
76361
76387
  const total = max - min;
76362
76388
  const rest = Math.max(0, total - filled);
76389
+ const displayValue = formatValue ? formatValue(value) : String(value);
76363
76390
  const chartData = React$1.useMemo(
76364
76391
  () => [
76365
76392
  { name: "value", value: filled },
@@ -76383,7 +76410,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76383
76410
  ":"
76384
76411
  ] }),
76385
76412
  " ",
76386
- String(value)
76413
+ displayValue
76387
76414
  ] }),
76388
76415
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
76389
76416
  /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PieChart, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -76425,7 +76452,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76425
76452
  query = "container_memory_usage_bytes",
76426
76453
  refetchInterval,
76427
76454
  width,
76428
- height
76455
+ height,
76456
+ formatValue
76429
76457
  }) => {
76430
76458
  const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
76431
76459
  const slices = React$1.useMemo(() => data ? vectorToPie(data) : [], [data]);
@@ -76438,8 +76466,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76438
76466
  error.message
76439
76467
  ] });
76440
76468
  }
76469
+ const valueFormatter = formatValue ?? formatBytes;
76441
76470
  return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(PieChart, { children: [
76442
- /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => formatBytes(v) }),
76471
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v) }),
76443
76472
  /* @__PURE__ */ jsxRuntimeExports.jsx(Pie, { data: slices, dataKey: "value", nameKey: "id", label: true, children: slices.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 60 % 360}, 70%, 55%)` }, `cell-${i}`)) })
76444
76473
  ] }) }) });
76445
76474
  };
@@ -76462,6 +76491,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76462
76491
  baseUrl,
76463
76492
  query = "container_memory_usage_bytes",
76464
76493
  refetchInterval,
76494
+ formatValue,
76465
76495
  title = "Vector → Table"
76466
76496
  }) => {
76467
76497
  const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
@@ -76469,6 +76499,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76469
76499
  const rows = data ? vectorToTableRows(data) : [];
76470
76500
  return rows.map((r) => ({ key: r.id, ...r }));
76471
76501
  }, [data]);
76502
+ const valueFormatter = formatValue ?? formatBytes;
76472
76503
  const columns = React$1.useMemo(
76473
76504
  () => [
76474
76505
  {
@@ -76484,7 +76515,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76484
76515
  dataIndex: "value",
76485
76516
  key: "value",
76486
76517
  align: "right",
76487
- render: (v) => formatBytes(v),
76518
+ render: (v) => valueFormatter(v),
76488
76519
  sorter: (a, b) => a.value - b.value,
76489
76520
  defaultSortOrder: "descend",
76490
76521
  width: 160
@@ -76498,7 +76529,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76498
76529
  width: 220
76499
76530
  }
76500
76531
  ],
76501
- []
76532
+ [valueFormatter]
76502
76533
  );
76503
76534
  if (error) {
76504
76535
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
@@ -76583,9 +76614,12 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76583
76614
  }
76584
76615
  const v = gauge?.value;
76585
76616
  const safeV = v == null || !Number.isFinite(v) ? null : v;
76617
+ const valueFormatter = formatValue ?? ((val) => String(val));
76586
76618
  const denom = max - min;
76587
76619
  const percent = safeV == null || !Number.isFinite(denom) || denom === 0 ? 0 : Math.round(clamp01((safeV - min) / denom) * 100);
76588
- const label = safeV == null ? "" : formatValue ? formatValue(safeV) : String(safeV);
76620
+ const label = safeV == null ? "-" : valueFormatter(safeV);
76621
+ const minLabel = valueFormatter(min);
76622
+ const maxLabel = valueFormatter(max);
76589
76623
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Card, { size: "small", children: [
76590
76624
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "secondary", children: title }),
76591
76625
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
@@ -76596,9 +76630,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76596
76630
  " ",
76597
76631
  /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Typography.Text, { type: "secondary", children: [
76598
76632
  "(",
76599
- min,
76600
- " ",
76601
- max,
76633
+ minLabel,
76634
+ " - ",
76635
+ maxLabel,
76602
76636
  ")"
76603
76637
  ] })
76604
76638
  ] }) }),
@@ -76623,13 +76657,44 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76623
76657
  error.message ?? String(error)
76624
76658
  ] });
76625
76659
  const value = stat?.value;
76626
- const display = value == null || !Number.isFinite(value) ? "—" : formatValue ? formatValue(value) : value;
76660
+ const valueFormatter = formatValue ?? ((v) => v);
76661
+ const display = value == null || !Number.isFinite(value) ? "-" : valueFormatter(value);
76627
76662
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Card, { size: "small", children: [
76628
76663
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "secondary", children: title }),
76629
76664
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Statistic, { value: display, loading: isLoading })
76630
76665
  ] });
76631
76666
  };
76632
76667
 
76668
+ const createValueFormatter = ({
76669
+ formatter,
76670
+ unit
76671
+ }) => {
76672
+ if (formatter === "none") {
76673
+ return (value) => {
76674
+ return String(value);
76675
+ };
76676
+ }
76677
+ if (formatter === "bytes") {
76678
+ return (value) => {
76679
+ const num = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
76680
+ return Number.isFinite(num) ? formatBytesAuto(num) : value != null ? String(value) : "";
76681
+ };
76682
+ }
76683
+ if (formatter === "cores") {
76684
+ return (value) => {
76685
+ const num = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
76686
+ return Number.isFinite(num) ? formatCoresAuto(num) : value != null ? String(value) : "";
76687
+ };
76688
+ }
76689
+ if (formatter === "unit") {
76690
+ return (value) => {
76691
+ const strValue = String(value);
76692
+ return `${strValue} ${unit}`;
76693
+ };
76694
+ }
76695
+ return void 0;
76696
+ };
76697
+
76633
76698
  const COMPONENTS = {
76634
76699
  MatrixToAreaMulti,
76635
76700
  MatrixToAreaSingle,
@@ -76663,6 +76728,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76663
76728
  min,
76664
76729
  max,
76665
76730
  topN,
76731
+ formatter,
76732
+ unit,
76666
76733
  ...props
76667
76734
  } = data;
76668
76735
  const partsOfUrl = usePartsOfUrl();
@@ -76676,7 +76743,8 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
76676
76743
  v === void 0 ? void 0 : parseAll({ text: v, replaceValues, multiQueryData })
76677
76744
  ])
76678
76745
  );
76679
- const preparedProps = { width, height, refetchInterval, min, max, topN, ...parsedProps };
76746
+ const formatValue = createValueFormatter({ formatter, unit });
76747
+ const preparedProps = { width, height, refetchInterval, min, max, topN, formatValue, ...parsedProps };
76680
76748
  if (isMultiqueryLoading) {
76681
76749
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
76682
76750
  }