@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.
- package/dist/openapi-k8s-toolkit.es.js +112 -44
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +112 -44
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/helpers.d.ts +4 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/types/chartsProps.d.ts +15 -15
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -75649,7 +75649,8 @@ const MatrixToAreaMulti = ({
|
|
|
75649
75649
|
range = "1h",
|
|
75650
75650
|
refetchInterval,
|
|
75651
75651
|
width,
|
|
75652
|
-
height
|
|
75652
|
+
height,
|
|
75653
|
+
formatValue
|
|
75653
75654
|
}) => {
|
|
75654
75655
|
const {
|
|
75655
75656
|
data: series,
|
|
@@ -75687,11 +75688,12 @@ const MatrixToAreaMulti = ({
|
|
|
75687
75688
|
error.message
|
|
75688
75689
|
] });
|
|
75689
75690
|
}
|
|
75691
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
75690
75692
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data: chartData, children: [
|
|
75691
75693
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75692
75694
|
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: formatTimestamp }),
|
|
75693
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter:
|
|
75694
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) =>
|
|
75695
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
|
|
75696
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => formatTimestamp(v) }),
|
|
75695
75697
|
series?.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75696
75698
|
Area,
|
|
75697
75699
|
{
|
|
@@ -75737,7 +75739,8 @@ const MatrixToAreaSingle = ({
|
|
|
75737
75739
|
range = "1h",
|
|
75738
75740
|
refetchInterval,
|
|
75739
75741
|
width,
|
|
75740
|
-
height
|
|
75742
|
+
height,
|
|
75743
|
+
formatValue
|
|
75741
75744
|
}) => {
|
|
75742
75745
|
const { data = [], isLoading, error } = usePromMatrixToLineSingle({ baseUrl, query, range, refetchInterval });
|
|
75743
75746
|
if (isLoading) {
|
|
@@ -75749,6 +75752,7 @@ const MatrixToAreaSingle = ({
|
|
|
75749
75752
|
error.message
|
|
75750
75753
|
] });
|
|
75751
75754
|
}
|
|
75755
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
75752
75756
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data, children: [
|
|
75753
75757
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75754
75758
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -75766,8 +75770,8 @@ const MatrixToAreaSingle = ({
|
|
|
75766
75770
|
}
|
|
75767
75771
|
}
|
|
75768
75772
|
),
|
|
75769
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) =>
|
|
75770
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) =>
|
|
75773
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => valueFormatter(value) }),
|
|
75774
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => valueFormatter(value), labelFormatter: (value) => formatTimestamp(value) }),
|
|
75771
75775
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75772
75776
|
Area,
|
|
75773
75777
|
{
|
|
@@ -75807,7 +75811,8 @@ const MatrixToAreaStacked = ({
|
|
|
75807
75811
|
range = "1h",
|
|
75808
75812
|
refetchInterval,
|
|
75809
75813
|
width,
|
|
75810
|
-
height
|
|
75814
|
+
height,
|
|
75815
|
+
formatValue
|
|
75811
75816
|
}) => {
|
|
75812
75817
|
const { data: series = [], isLoading, error } = usePromMatrixToLineMulti({ baseUrl, query, range, refetchInterval });
|
|
75813
75818
|
const chartData = useMemo(() => matrixToStackedAreaData(series), [series]);
|
|
@@ -75820,11 +75825,12 @@ const MatrixToAreaStacked = ({
|
|
|
75820
75825
|
error.message
|
|
75821
75826
|
] });
|
|
75822
75827
|
}
|
|
75828
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
75823
75829
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data: chartData, children: [
|
|
75824
75830
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75825
75831
|
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: formatTimestamp }),
|
|
75826
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter:
|
|
75827
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) =>
|
|
75832
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
|
|
75833
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => formatTimestamp(v) }),
|
|
75828
75834
|
series.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75829
75835
|
Area,
|
|
75830
75836
|
{
|
|
@@ -75849,7 +75855,8 @@ const MatrixToLineMulti = ({
|
|
|
75849
75855
|
range = "1h",
|
|
75850
75856
|
refetchInterval,
|
|
75851
75857
|
width,
|
|
75852
|
-
height
|
|
75858
|
+
height,
|
|
75859
|
+
formatValue
|
|
75853
75860
|
}) => {
|
|
75854
75861
|
const {
|
|
75855
75862
|
data: series,
|
|
@@ -75887,11 +75894,12 @@ const MatrixToLineMulti = ({
|
|
|
75887
75894
|
error.message
|
|
75888
75895
|
] });
|
|
75889
75896
|
}
|
|
75897
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
75890
75898
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(LineChart, { data: chartData, children: [
|
|
75891
75899
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75892
75900
|
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: formatTimestamp }),
|
|
75893
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter:
|
|
75894
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) =>
|
|
75901
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
|
|
75902
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => formatTimestamp(v) }),
|
|
75895
75903
|
series?.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75896
75904
|
Line,
|
|
75897
75905
|
{
|
|
@@ -75913,7 +75921,8 @@ const MatrixToLineSingle = ({
|
|
|
75913
75921
|
range = "1h",
|
|
75914
75922
|
refetchInterval,
|
|
75915
75923
|
width,
|
|
75916
|
-
height
|
|
75924
|
+
height,
|
|
75925
|
+
formatValue
|
|
75917
75926
|
}) => {
|
|
75918
75927
|
const {
|
|
75919
75928
|
data = [],
|
|
@@ -75934,6 +75943,7 @@ const MatrixToLineSingle = ({
|
|
|
75934
75943
|
error.message
|
|
75935
75944
|
] });
|
|
75936
75945
|
}
|
|
75946
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
75937
75947
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(LineChart, { data, children: [
|
|
75938
75948
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75939
75949
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -75951,8 +75961,8 @@ const MatrixToLineSingle = ({
|
|
|
75951
75961
|
}
|
|
75952
75962
|
}
|
|
75953
75963
|
),
|
|
75954
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) =>
|
|
75955
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) =>
|
|
75964
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => valueFormatter(value) }),
|
|
75965
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => valueFormatter(value), labelFormatter: (value) => formatTimestamp(value) }),
|
|
75956
75966
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75957
75967
|
Line,
|
|
75958
75968
|
{
|
|
@@ -76018,7 +76028,8 @@ const MatrixToReducedBar = ({
|
|
|
76018
76028
|
refetchInterval,
|
|
76019
76029
|
mode = "avg",
|
|
76020
76030
|
width,
|
|
76021
|
-
height
|
|
76031
|
+
height,
|
|
76032
|
+
formatValue
|
|
76022
76033
|
}) => {
|
|
76023
76034
|
const {
|
|
76024
76035
|
data: series = [],
|
|
@@ -76043,8 +76054,14 @@ const MatrixToReducedBar = ({
|
|
|
76043
76054
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(BarChart, { data: reduced, children: [
|
|
76044
76055
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
76045
76056
|
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "id" }),
|
|
76046
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, {}),
|
|
76047
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76057
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: formatValue }),
|
|
76058
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76059
|
+
Tooltip,
|
|
76060
|
+
{
|
|
76061
|
+
formatter: (value) => formatValue ? formatValue(Number(value)) : `${value} bytes`,
|
|
76062
|
+
labelFormatter: (label) => `Series: ${label}`
|
|
76063
|
+
}
|
|
76064
|
+
),
|
|
76048
76065
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { dataKey: "value", children: reduced.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 35 % 360}, 70%, 55%)` }, `cell-${i}`)) })
|
|
76049
76066
|
] }) }) });
|
|
76050
76067
|
};
|
|
@@ -76054,7 +76071,8 @@ const MatrixToTableRows = ({
|
|
|
76054
76071
|
query = "container_memory_usage_bytes",
|
|
76055
76072
|
range = "1h",
|
|
76056
76073
|
refetchInterval,
|
|
76057
|
-
title = "Memory usage (min / max / current)"
|
|
76074
|
+
title = "Memory usage (min / max / current)",
|
|
76075
|
+
formatValue
|
|
76058
76076
|
}) => {
|
|
76059
76077
|
const {
|
|
76060
76078
|
data: series = [],
|
|
@@ -76094,6 +76112,7 @@ const MatrixToTableRows = ({
|
|
|
76094
76112
|
};
|
|
76095
76113
|
});
|
|
76096
76114
|
}, [series]);
|
|
76115
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
76097
76116
|
const columns = useMemo(
|
|
76098
76117
|
() => [
|
|
76099
76118
|
{
|
|
@@ -76112,7 +76131,7 @@ const MatrixToTableRows = ({
|
|
|
76112
76131
|
dataIndex: "min",
|
|
76113
76132
|
key: "min",
|
|
76114
76133
|
align: "right",
|
|
76115
|
-
render: (v) => v == null ? "
|
|
76134
|
+
render: (v) => v == null ? "-" : valueFormatter(v),
|
|
76116
76135
|
sorter: (a, b) => (a.min ?? -Infinity) - (b.min ?? -Infinity),
|
|
76117
76136
|
defaultSortOrder: void 0
|
|
76118
76137
|
},
|
|
@@ -76121,7 +76140,7 @@ const MatrixToTableRows = ({
|
|
|
76121
76140
|
dataIndex: "max",
|
|
76122
76141
|
key: "max",
|
|
76123
76142
|
align: "right",
|
|
76124
|
-
render: (v) => v == null ? "
|
|
76143
|
+
render: (v) => v == null ? "-" : valueFormatter(v),
|
|
76125
76144
|
sorter: (a, b) => (a.max ?? -Infinity) - (b.max ?? -Infinity)
|
|
76126
76145
|
},
|
|
76127
76146
|
{
|
|
@@ -76129,7 +76148,7 @@ const MatrixToTableRows = ({
|
|
|
76129
76148
|
dataIndex: "current",
|
|
76130
76149
|
key: "current",
|
|
76131
76150
|
align: "right",
|
|
76132
|
-
render: (v) => v == null ? "
|
|
76151
|
+
render: (v) => v == null ? "-" : valueFormatter(v),
|
|
76133
76152
|
sorter: (a, b) => (a.current ?? -Infinity) - (b.current ?? -Infinity),
|
|
76134
76153
|
defaultSortOrder: "descend"
|
|
76135
76154
|
},
|
|
@@ -76142,7 +76161,7 @@ const MatrixToTableRows = ({
|
|
|
76142
76161
|
sorter: (a, b) => (a.currentTs ?? -Infinity) - (b.currentTs ?? -Infinity)
|
|
76143
76162
|
}
|
|
76144
76163
|
],
|
|
76145
|
-
[]
|
|
76164
|
+
[valueFormatter]
|
|
76146
76165
|
);
|
|
76147
76166
|
if (error) {
|
|
76148
76167
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -76211,7 +76230,8 @@ const VectorToBarGauge = ({
|
|
|
76211
76230
|
refetchInterval,
|
|
76212
76231
|
topN = 10,
|
|
76213
76232
|
width,
|
|
76214
|
-
height
|
|
76233
|
+
height,
|
|
76234
|
+
formatValue
|
|
76215
76235
|
}) => {
|
|
76216
76236
|
const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
|
|
76217
76237
|
const items = useMemo(() => {
|
|
@@ -76227,11 +76247,12 @@ const VectorToBarGauge = ({
|
|
|
76227
76247
|
error.message
|
|
76228
76248
|
] });
|
|
76229
76249
|
}
|
|
76250
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
76230
76251
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(BarChart, { data: items, layout: "vertical", children: [
|
|
76231
76252
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
76232
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { type: "number", tickFormatter:
|
|
76253
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { type: "number", tickFormatter: valueFormatter }),
|
|
76233
76254
|
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { type: "category", dataKey: "id", width: 160 }),
|
|
76234
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) =>
|
|
76255
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v) }),
|
|
76235
76256
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { dataKey: "value", children: items.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 35 % 360}, 70%, 55%)` }, `cell-${i}`)) })
|
|
76236
76257
|
] }) }) });
|
|
76237
76258
|
};
|
|
@@ -76268,7 +76289,8 @@ const VectorToBarHorizontal = ({
|
|
|
76268
76289
|
query = "container_memory_usage_bytes",
|
|
76269
76290
|
refetchInterval,
|
|
76270
76291
|
width,
|
|
76271
|
-
height
|
|
76292
|
+
height,
|
|
76293
|
+
formatValue
|
|
76272
76294
|
}) => {
|
|
76273
76295
|
const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
|
|
76274
76296
|
const items = useMemo(() => data ? vectorToBarHorizontal(data) : [], [data]);
|
|
@@ -76281,11 +76303,12 @@ const VectorToBarHorizontal = ({
|
|
|
76281
76303
|
error.message
|
|
76282
76304
|
] });
|
|
76283
76305
|
}
|
|
76306
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
76284
76307
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(BarChart, { data: items, layout: "vertical", children: [
|
|
76285
76308
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
76286
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { type: "number", tickFormatter:
|
|
76309
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { type: "number", tickFormatter: valueFormatter }),
|
|
76287
76310
|
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { type: "category", dataKey: "id", width: 140 }),
|
|
76288
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) =>
|
|
76311
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v) }),
|
|
76289
76312
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { dataKey: "value", children: items.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 35 % 360}, 70%, 55%)` }, `cell-${i}`)) })
|
|
76290
76313
|
] }) }) });
|
|
76291
76314
|
};
|
|
@@ -76295,7 +76318,8 @@ const VectorToBarVertical = ({
|
|
|
76295
76318
|
query = "container_memory_usage_bytes",
|
|
76296
76319
|
refetchInterval,
|
|
76297
76320
|
width,
|
|
76298
|
-
height
|
|
76321
|
+
height,
|
|
76322
|
+
formatValue
|
|
76299
76323
|
}) => {
|
|
76300
76324
|
const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
|
|
76301
76325
|
const items = useMemo(() => data ? vectorToBarVertical(data) : [], [data]);
|
|
@@ -76308,11 +76332,12 @@ const VectorToBarVertical = ({
|
|
|
76308
76332
|
error.message
|
|
76309
76333
|
] });
|
|
76310
76334
|
}
|
|
76335
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
76311
76336
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(BarChart, { data: items, children: [
|
|
76312
76337
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
76313
76338
|
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "id" }),
|
|
76314
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter:
|
|
76315
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) =>
|
|
76339
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
|
|
76340
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v) }),
|
|
76316
76341
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Bar, { dataKey: "value", children: items.map((_, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: `hsl(${i * 35 % 360}, 70%, 55%)` }, `cell-${i}`)) })
|
|
76317
76342
|
] }) }) });
|
|
76318
76343
|
};
|
|
@@ -76336,7 +76361,8 @@ const VectorToGaugeRadial = ({
|
|
|
76336
76361
|
min = 0,
|
|
76337
76362
|
max = 1,
|
|
76338
76363
|
width,
|
|
76339
|
-
height
|
|
76364
|
+
height,
|
|
76365
|
+
formatValue
|
|
76340
76366
|
}) => {
|
|
76341
76367
|
const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
|
|
76342
76368
|
const gauge = useMemo(() => data ? vectorToGaugeRadial(data) : null, [data]);
|
|
@@ -76345,6 +76371,7 @@ const VectorToGaugeRadial = ({
|
|
|
76345
76371
|
const filled = clamped - min;
|
|
76346
76372
|
const total = max - min;
|
|
76347
76373
|
const rest = Math.max(0, total - filled);
|
|
76374
|
+
const displayValue = formatValue ? formatValue(value) : String(value);
|
|
76348
76375
|
const chartData = useMemo(
|
|
76349
76376
|
() => [
|
|
76350
76377
|
{ name: "value", value: filled },
|
|
@@ -76368,7 +76395,7 @@ const VectorToGaugeRadial = ({
|
|
|
76368
76395
|
":"
|
|
76369
76396
|
] }),
|
|
76370
76397
|
" ",
|
|
76371
|
-
|
|
76398
|
+
displayValue
|
|
76372
76399
|
] }),
|
|
76373
76400
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
|
|
76374
76401
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PieChart, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -76410,7 +76437,8 @@ const VectorToPie = ({
|
|
|
76410
76437
|
query = "container_memory_usage_bytes",
|
|
76411
76438
|
refetchInterval,
|
|
76412
76439
|
width,
|
|
76413
|
-
height
|
|
76440
|
+
height,
|
|
76441
|
+
formatValue
|
|
76414
76442
|
}) => {
|
|
76415
76443
|
const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
|
|
76416
76444
|
const slices = useMemo(() => data ? vectorToPie(data) : [], [data]);
|
|
@@ -76423,8 +76451,9 @@ const VectorToPie = ({
|
|
|
76423
76451
|
error.message
|
|
76424
76452
|
] });
|
|
76425
76453
|
}
|
|
76454
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
76426
76455
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(PieChart, { children: [
|
|
76427
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) =>
|
|
76456
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v) }),
|
|
76428
76457
|
/* @__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}`)) })
|
|
76429
76458
|
] }) }) });
|
|
76430
76459
|
};
|
|
@@ -76447,6 +76476,7 @@ const VectorToTableRows = ({
|
|
|
76447
76476
|
baseUrl,
|
|
76448
76477
|
query = "container_memory_usage_bytes",
|
|
76449
76478
|
refetchInterval,
|
|
76479
|
+
formatValue,
|
|
76450
76480
|
title = "Vector → Table"
|
|
76451
76481
|
}) => {
|
|
76452
76482
|
const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
|
|
@@ -76454,6 +76484,7 @@ const VectorToTableRows = ({
|
|
|
76454
76484
|
const rows = data ? vectorToTableRows(data) : [];
|
|
76455
76485
|
return rows.map((r) => ({ key: r.id, ...r }));
|
|
76456
76486
|
}, [data]);
|
|
76487
|
+
const valueFormatter = formatValue ?? formatBytes;
|
|
76457
76488
|
const columns = useMemo(
|
|
76458
76489
|
() => [
|
|
76459
76490
|
{
|
|
@@ -76469,7 +76500,7 @@ const VectorToTableRows = ({
|
|
|
76469
76500
|
dataIndex: "value",
|
|
76470
76501
|
key: "value",
|
|
76471
76502
|
align: "right",
|
|
76472
|
-
render: (v) =>
|
|
76503
|
+
render: (v) => valueFormatter(v),
|
|
76473
76504
|
sorter: (a, b) => a.value - b.value,
|
|
76474
76505
|
defaultSortOrder: "descend",
|
|
76475
76506
|
width: 160
|
|
@@ -76483,7 +76514,7 @@ const VectorToTableRows = ({
|
|
|
76483
76514
|
width: 220
|
|
76484
76515
|
}
|
|
76485
76516
|
],
|
|
76486
|
-
[]
|
|
76517
|
+
[valueFormatter]
|
|
76487
76518
|
);
|
|
76488
76519
|
if (error) {
|
|
76489
76520
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -76568,9 +76599,12 @@ const ScalarToGauge = ({
|
|
|
76568
76599
|
}
|
|
76569
76600
|
const v = gauge?.value;
|
|
76570
76601
|
const safeV = v == null || !Number.isFinite(v) ? null : v;
|
|
76602
|
+
const valueFormatter = formatValue ?? ((val) => String(val));
|
|
76571
76603
|
const denom = max - min;
|
|
76572
76604
|
const percent = safeV == null || !Number.isFinite(denom) || denom === 0 ? 0 : Math.round(clamp01((safeV - min) / denom) * 100);
|
|
76573
|
-
const label = safeV == null ? "
|
|
76605
|
+
const label = safeV == null ? "-" : valueFormatter(safeV);
|
|
76606
|
+
const minLabel = valueFormatter(min);
|
|
76607
|
+
const maxLabel = valueFormatter(max);
|
|
76574
76608
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card$1, { size: "small", children: [
|
|
76575
76609
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "secondary", children: title }),
|
|
76576
76610
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
|
|
@@ -76581,9 +76615,9 @@ const ScalarToGauge = ({
|
|
|
76581
76615
|
" ",
|
|
76582
76616
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.Text, { type: "secondary", children: [
|
|
76583
76617
|
"(",
|
|
76584
|
-
|
|
76585
|
-
"
|
|
76586
|
-
|
|
76618
|
+
minLabel,
|
|
76619
|
+
" - ",
|
|
76620
|
+
maxLabel,
|
|
76587
76621
|
")"
|
|
76588
76622
|
] })
|
|
76589
76623
|
] }) }),
|
|
@@ -76608,13 +76642,44 @@ const ScalarToStat = ({
|
|
|
76608
76642
|
error.message ?? String(error)
|
|
76609
76643
|
] });
|
|
76610
76644
|
const value = stat?.value;
|
|
76611
|
-
const
|
|
76645
|
+
const valueFormatter = formatValue ?? ((v) => v);
|
|
76646
|
+
const display = value == null || !Number.isFinite(value) ? "-" : valueFormatter(value);
|
|
76612
76647
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card$1, { size: "small", children: [
|
|
76613
76648
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { type: "secondary", children: title }),
|
|
76614
76649
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Statistic, { value: display, loading: isLoading })
|
|
76615
76650
|
] });
|
|
76616
76651
|
};
|
|
76617
76652
|
|
|
76653
|
+
const createValueFormatter = ({
|
|
76654
|
+
formatter,
|
|
76655
|
+
unit
|
|
76656
|
+
}) => {
|
|
76657
|
+
if (formatter === "none") {
|
|
76658
|
+
return (value) => {
|
|
76659
|
+
return String(value);
|
|
76660
|
+
};
|
|
76661
|
+
}
|
|
76662
|
+
if (formatter === "bytes") {
|
|
76663
|
+
return (value) => {
|
|
76664
|
+
const num = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
76665
|
+
return Number.isFinite(num) ? formatBytesAuto(num) : value != null ? String(value) : "";
|
|
76666
|
+
};
|
|
76667
|
+
}
|
|
76668
|
+
if (formatter === "cores") {
|
|
76669
|
+
return (value) => {
|
|
76670
|
+
const num = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
76671
|
+
return Number.isFinite(num) ? formatCoresAuto(num) : value != null ? String(value) : "";
|
|
76672
|
+
};
|
|
76673
|
+
}
|
|
76674
|
+
if (formatter === "unit") {
|
|
76675
|
+
return (value) => {
|
|
76676
|
+
const strValue = String(value);
|
|
76677
|
+
return `${strValue} ${unit}`;
|
|
76678
|
+
};
|
|
76679
|
+
}
|
|
76680
|
+
return void 0;
|
|
76681
|
+
};
|
|
76682
|
+
|
|
76618
76683
|
const COMPONENTS = {
|
|
76619
76684
|
MatrixToAreaMulti,
|
|
76620
76685
|
MatrixToAreaSingle,
|
|
@@ -76648,6 +76713,8 @@ const PrometheusGraph = ({
|
|
|
76648
76713
|
min,
|
|
76649
76714
|
max,
|
|
76650
76715
|
topN,
|
|
76716
|
+
formatter,
|
|
76717
|
+
unit,
|
|
76651
76718
|
...props
|
|
76652
76719
|
} = data;
|
|
76653
76720
|
const partsOfUrl = usePartsOfUrl();
|
|
@@ -76661,7 +76728,8 @@ const PrometheusGraph = ({
|
|
|
76661
76728
|
v === void 0 ? void 0 : parseAll({ text: v, replaceValues, multiQueryData })
|
|
76662
76729
|
])
|
|
76663
76730
|
);
|
|
76664
|
-
const
|
|
76731
|
+
const formatValue = createValueFormatter({ formatter, unit });
|
|
76732
|
+
const preparedProps = { width, height, refetchInterval, min, max, topN, formatValue, ...parsedProps };
|
|
76665
76733
|
if (isMultiqueryLoading) {
|
|
76666
76734
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
76667
76735
|
}
|