@prorobotech/openapi-k8s-toolkit 1.2.0-alpha.20 → 1.2.0-alpha.21
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 +171 -44
- package/dist/openapi-k8s-toolkit.es.js.map +1 -1
- package/dist/openapi-k8s-toolkit.umd.js +171 -43
- package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/helpers.d.ts +2 -0
- package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/types/chartsProps.d.ts +2 -0
- package/dist/types/components/organisms/DynamicComponents/types.d.ts +2 -0
- package/dist/types/utils/converterDates/converterDates.d.ts +33 -0
- package/dist/types/utils/converterDates/converterDates.test.d.ts +1 -0
- package/dist/types/utils/converterDates/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -75650,7 +75650,8 @@ const MatrixToAreaMulti = ({
|
|
|
75650
75650
|
refetchInterval,
|
|
75651
75651
|
width,
|
|
75652
75652
|
height,
|
|
75653
|
-
formatValue
|
|
75653
|
+
formatValue,
|
|
75654
|
+
formatTimestamp: formatTimestamp$1
|
|
75654
75655
|
}) => {
|
|
75655
75656
|
const {
|
|
75656
75657
|
data: series,
|
|
@@ -75689,11 +75690,12 @@ const MatrixToAreaMulti = ({
|
|
|
75689
75690
|
] });
|
|
75690
75691
|
}
|
|
75691
75692
|
const valueFormatter = formatValue ?? formatBytes;
|
|
75693
|
+
const timestampFormatter = formatTimestamp$1 ?? formatTimestamp;
|
|
75692
75694
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data: chartData, children: [
|
|
75693
75695
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75694
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter:
|
|
75696
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: timestampFormatter }),
|
|
75695
75697
|
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
|
|
75696
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) =>
|
|
75698
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => timestampFormatter(v) }),
|
|
75697
75699
|
series?.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75698
75700
|
Area,
|
|
75699
75701
|
{
|
|
@@ -75740,7 +75742,8 @@ const MatrixToAreaSingle = ({
|
|
|
75740
75742
|
refetchInterval,
|
|
75741
75743
|
width,
|
|
75742
75744
|
height,
|
|
75743
|
-
formatValue
|
|
75745
|
+
formatValue,
|
|
75746
|
+
formatTimestamp: formatTimestamp$1
|
|
75744
75747
|
}) => {
|
|
75745
75748
|
const { data = [], isLoading, error } = usePromMatrixToLineSingle({ baseUrl, query, range, refetchInterval });
|
|
75746
75749
|
if (isLoading) {
|
|
@@ -75753,25 +75756,25 @@ const MatrixToAreaSingle = ({
|
|
|
75753
75756
|
] });
|
|
75754
75757
|
}
|
|
75755
75758
|
const valueFormatter = formatValue ?? formatBytes;
|
|
75759
|
+
const xAxisFormatter = formatTimestamp$1 ?? ((value) => {
|
|
75760
|
+
const ts = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
75761
|
+
if (!Number.isFinite(ts)) {
|
|
75762
|
+
return "";
|
|
75763
|
+
}
|
|
75764
|
+
return new Date(ts).toLocaleTimeString();
|
|
75765
|
+
});
|
|
75766
|
+
const tooltipTimestampFormatter = formatTimestamp$1 ?? formatTimestamp;
|
|
75756
75767
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data, children: [
|
|
75757
75768
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75769
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", type: "number", domain: ["auto", "auto"], tickFormatter: xAxisFormatter }),
|
|
75770
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => valueFormatter(value) }),
|
|
75758
75771
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75759
|
-
|
|
75772
|
+
Tooltip,
|
|
75760
75773
|
{
|
|
75761
|
-
|
|
75762
|
-
|
|
75763
|
-
domain: ["auto", "auto"],
|
|
75764
|
-
tickFormatter: (value) => {
|
|
75765
|
-
const ts = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
75766
|
-
if (!Number.isFinite(ts)) {
|
|
75767
|
-
return "";
|
|
75768
|
-
}
|
|
75769
|
-
return new Date(ts).toLocaleTimeString();
|
|
75770
|
-
}
|
|
75774
|
+
formatter: (value) => valueFormatter(value),
|
|
75775
|
+
labelFormatter: (value) => tooltipTimestampFormatter(value)
|
|
75771
75776
|
}
|
|
75772
75777
|
),
|
|
75773
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => valueFormatter(value) }),
|
|
75774
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => valueFormatter(value), labelFormatter: (value) => formatTimestamp(value) }),
|
|
75775
75778
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75776
75779
|
Area,
|
|
75777
75780
|
{
|
|
@@ -75812,7 +75815,8 @@ const MatrixToAreaStacked = ({
|
|
|
75812
75815
|
refetchInterval,
|
|
75813
75816
|
width,
|
|
75814
75817
|
height,
|
|
75815
|
-
formatValue
|
|
75818
|
+
formatValue,
|
|
75819
|
+
formatTimestamp: formatTimestamp$1
|
|
75816
75820
|
}) => {
|
|
75817
75821
|
const { data: series = [], isLoading, error } = usePromMatrixToLineMulti({ baseUrl, query, range, refetchInterval });
|
|
75818
75822
|
const chartData = useMemo(() => matrixToStackedAreaData(series), [series]);
|
|
@@ -75826,11 +75830,12 @@ const MatrixToAreaStacked = ({
|
|
|
75826
75830
|
] });
|
|
75827
75831
|
}
|
|
75828
75832
|
const valueFormatter = formatValue ?? formatBytes;
|
|
75833
|
+
const timestampFormatter = formatTimestamp$1 ?? formatTimestamp;
|
|
75829
75834
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data: chartData, children: [
|
|
75830
75835
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75831
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter:
|
|
75836
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: timestampFormatter }),
|
|
75832
75837
|
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
|
|
75833
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) =>
|
|
75838
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => timestampFormatter(v) }),
|
|
75834
75839
|
series.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75835
75840
|
Area,
|
|
75836
75841
|
{
|
|
@@ -75856,7 +75861,8 @@ const MatrixToLineMulti = ({
|
|
|
75856
75861
|
refetchInterval,
|
|
75857
75862
|
width,
|
|
75858
75863
|
height,
|
|
75859
|
-
formatValue
|
|
75864
|
+
formatValue,
|
|
75865
|
+
formatTimestamp: formatTimestamp$1
|
|
75860
75866
|
}) => {
|
|
75861
75867
|
const {
|
|
75862
75868
|
data: series,
|
|
@@ -75895,11 +75901,12 @@ const MatrixToLineMulti = ({
|
|
|
75895
75901
|
] });
|
|
75896
75902
|
}
|
|
75897
75903
|
const valueFormatter = formatValue ?? formatBytes;
|
|
75904
|
+
const timestampFormatter = formatTimestamp$1 ?? formatTimestamp;
|
|
75898
75905
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(LineChart, { data: chartData, children: [
|
|
75899
75906
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75900
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter:
|
|
75907
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", tickFormatter: timestampFormatter }),
|
|
75901
75908
|
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: valueFormatter }),
|
|
75902
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) =>
|
|
75909
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (v) => valueFormatter(v), labelFormatter: (v) => timestampFormatter(v) }),
|
|
75903
75910
|
series?.map((s, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75904
75911
|
Line,
|
|
75905
75912
|
{
|
|
@@ -75922,7 +75929,8 @@ const MatrixToLineSingle = ({
|
|
|
75922
75929
|
refetchInterval,
|
|
75923
75930
|
width,
|
|
75924
75931
|
height,
|
|
75925
|
-
formatValue
|
|
75932
|
+
formatValue,
|
|
75933
|
+
formatTimestamp: formatTimestamp$1
|
|
75926
75934
|
}) => {
|
|
75927
75935
|
const {
|
|
75928
75936
|
data = [],
|
|
@@ -75944,25 +75952,25 @@ const MatrixToLineSingle = ({
|
|
|
75944
75952
|
] });
|
|
75945
75953
|
}
|
|
75946
75954
|
const valueFormatter = formatValue ?? formatBytes;
|
|
75955
|
+
const xAxisFormatter = formatTimestamp$1 ?? ((value) => {
|
|
75956
|
+
const ts = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
75957
|
+
if (!Number.isFinite(ts)) {
|
|
75958
|
+
return "";
|
|
75959
|
+
}
|
|
75960
|
+
return new Date(ts).toLocaleTimeString();
|
|
75961
|
+
});
|
|
75962
|
+
const tooltipTimestampFormatter = formatTimestamp$1 ?? formatTimestamp;
|
|
75947
75963
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(WidthHeightDiv, { $width: width, $height: height, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(LineChart, { data, children: [
|
|
75948
75964
|
/* @__PURE__ */ jsxRuntimeExports.jsx(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
75965
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(XAxis, { dataKey: "timestamp", type: "number", domain: ["auto", "auto"], tickFormatter: xAxisFormatter }),
|
|
75966
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => valueFormatter(value) }),
|
|
75949
75967
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75950
|
-
|
|
75968
|
+
Tooltip,
|
|
75951
75969
|
{
|
|
75952
|
-
|
|
75953
|
-
|
|
75954
|
-
domain: ["auto", "auto"],
|
|
75955
|
-
tickFormatter: (value) => {
|
|
75956
|
-
const ts = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
75957
|
-
if (!Number.isFinite(ts)) {
|
|
75958
|
-
return "";
|
|
75959
|
-
}
|
|
75960
|
-
return new Date(ts).toLocaleTimeString();
|
|
75961
|
-
}
|
|
75970
|
+
formatter: (value) => valueFormatter(value),
|
|
75971
|
+
labelFormatter: (value) => tooltipTimestampFormatter(value)
|
|
75962
75972
|
}
|
|
75963
75973
|
),
|
|
75964
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(YAxis, { tickFormatter: (value) => valueFormatter(value) }),
|
|
75965
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { formatter: (value) => valueFormatter(value), labelFormatter: (value) => formatTimestamp(value) }),
|
|
75966
75974
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75967
75975
|
Line,
|
|
75968
75976
|
{
|
|
@@ -76072,7 +76080,8 @@ const MatrixToTableRows = ({
|
|
|
76072
76080
|
range = "1h",
|
|
76073
76081
|
refetchInterval,
|
|
76074
76082
|
title = "Memory usage (min / max / current)",
|
|
76075
|
-
formatValue
|
|
76083
|
+
formatValue,
|
|
76084
|
+
formatTimestamp: formatTimestamp$1
|
|
76076
76085
|
}) => {
|
|
76077
76086
|
const {
|
|
76078
76087
|
data: series = [],
|
|
@@ -76113,6 +76122,7 @@ const MatrixToTableRows = ({
|
|
|
76113
76122
|
});
|
|
76114
76123
|
}, [series]);
|
|
76115
76124
|
const valueFormatter = formatValue ?? formatBytes;
|
|
76125
|
+
const timestampFormatter = formatTimestamp$1 ?? formatTimestamp;
|
|
76116
76126
|
const columns = useMemo(
|
|
76117
76127
|
() => [
|
|
76118
76128
|
{
|
|
@@ -76157,11 +76167,11 @@ const MatrixToTableRows = ({
|
|
|
76157
76167
|
dataIndex: "currentTs",
|
|
76158
76168
|
key: "currentTs",
|
|
76159
76169
|
width: 180,
|
|
76160
|
-
render: (ts) => ts == null ? "
|
|
76170
|
+
render: (ts) => ts == null ? "-" : timestampFormatter(ts),
|
|
76161
76171
|
sorter: (a, b) => (a.currentTs ?? -Infinity) - (b.currentTs ?? -Infinity)
|
|
76162
76172
|
}
|
|
76163
76173
|
],
|
|
76164
|
-
[valueFormatter]
|
|
76174
|
+
[valueFormatter, timestampFormatter]
|
|
76165
76175
|
);
|
|
76166
76176
|
if (error) {
|
|
76167
76177
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -76477,6 +76487,7 @@ const VectorToTableRows = ({
|
|
|
76477
76487
|
query = "container_memory_usage_bytes",
|
|
76478
76488
|
refetchInterval,
|
|
76479
76489
|
formatValue,
|
|
76490
|
+
formatTimestamp: formatTimestamp$1,
|
|
76480
76491
|
title = "Vector → Table"
|
|
76481
76492
|
}) => {
|
|
76482
76493
|
const { data, isLoading, error } = usePromVector({ baseUrl, query, refetchInterval });
|
|
@@ -76485,6 +76496,7 @@ const VectorToTableRows = ({
|
|
|
76485
76496
|
return rows.map((r) => ({ key: r.id, ...r }));
|
|
76486
76497
|
}, [data]);
|
|
76487
76498
|
const valueFormatter = formatValue ?? formatBytes;
|
|
76499
|
+
const timestampFormatter = formatTimestamp$1 ?? formatTimestamp;
|
|
76488
76500
|
const columns = useMemo(
|
|
76489
76501
|
() => [
|
|
76490
76502
|
{
|
|
@@ -76509,12 +76521,12 @@ const VectorToTableRows = ({
|
|
|
76509
76521
|
title: "timestamp",
|
|
76510
76522
|
dataIndex: "timestamp",
|
|
76511
76523
|
key: "timestamp",
|
|
76512
|
-
render: (ts) =>
|
|
76524
|
+
render: (ts) => timestampFormatter(ts),
|
|
76513
76525
|
sorter: (a, b) => a.timestamp - b.timestamp,
|
|
76514
76526
|
width: 220
|
|
76515
76527
|
}
|
|
76516
76528
|
],
|
|
76517
|
-
[valueFormatter]
|
|
76529
|
+
[valueFormatter, timestampFormatter]
|
|
76518
76530
|
);
|
|
76519
76531
|
if (error) {
|
|
76520
76532
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -76650,6 +76662,95 @@ const ScalarToStat = ({
|
|
|
76650
76662
|
] });
|
|
76651
76663
|
};
|
|
76652
76664
|
|
|
76665
|
+
const toDate = (input) => {
|
|
76666
|
+
const d = input instanceof Date ? input : new Date(input);
|
|
76667
|
+
return Number.isFinite(d.getTime()) ? d : null;
|
|
76668
|
+
};
|
|
76669
|
+
const formatRelative = (date, { locale, timeZone, relative }) => {
|
|
76670
|
+
const nowDate = relative?.now ? toDate(relative.now) ?? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date();
|
|
76671
|
+
const diffMs = date.getTime() - nowDate.getTime();
|
|
76672
|
+
const absMs = Math.abs(diffMs);
|
|
76673
|
+
const divisions = [
|
|
76674
|
+
["year", 1e3 * 60 * 60 * 24 * 365],
|
|
76675
|
+
["month", 1e3 * 60 * 60 * 24 * 30],
|
|
76676
|
+
["week", 1e3 * 60 * 60 * 24 * 7],
|
|
76677
|
+
["day", 1e3 * 60 * 60 * 24],
|
|
76678
|
+
["hour", 1e3 * 60 * 60],
|
|
76679
|
+
["minute", 1e3 * 60],
|
|
76680
|
+
["second", 1e3]
|
|
76681
|
+
];
|
|
76682
|
+
const forcedUnit = relative?.unit;
|
|
76683
|
+
const [unit, unitMs] = forcedUnit ? divisions.find((d) => d[0] === forcedUnit) ?? ["second", 1e3] : divisions.find(([, ms]) => absMs >= ms) ?? ["second", 1e3];
|
|
76684
|
+
const value = Math.round(diffMs / unitMs);
|
|
76685
|
+
const rtf = new Intl.RelativeTimeFormat(locale, { numeric: relative?.numeric ?? "auto" });
|
|
76686
|
+
return rtf.format(value, unit);
|
|
76687
|
+
};
|
|
76688
|
+
const presetIntlOptions = (style, opts) => {
|
|
76689
|
+
const { hour12 = false, seconds, timeZoneName } = opts;
|
|
76690
|
+
switch (style) {
|
|
76691
|
+
case "date":
|
|
76692
|
+
return { year: "numeric", month: "long", day: "numeric" };
|
|
76693
|
+
case "time":
|
|
76694
|
+
return {
|
|
76695
|
+
hour: "2-digit",
|
|
76696
|
+
minute: "2-digit",
|
|
76697
|
+
...seconds ? { second: "2-digit" } : {},
|
|
76698
|
+
hour12
|
|
76699
|
+
};
|
|
76700
|
+
case "datetime":
|
|
76701
|
+
return {
|
|
76702
|
+
year: "numeric",
|
|
76703
|
+
month: "long",
|
|
76704
|
+
day: "numeric",
|
|
76705
|
+
hour: "2-digit",
|
|
76706
|
+
minute: "2-digit",
|
|
76707
|
+
...seconds ? { second: "2-digit" } : {},
|
|
76708
|
+
hour12
|
|
76709
|
+
};
|
|
76710
|
+
case "timestamp":
|
|
76711
|
+
return {
|
|
76712
|
+
year: "numeric",
|
|
76713
|
+
month: "2-digit",
|
|
76714
|
+
day: "2-digit",
|
|
76715
|
+
hour: "2-digit",
|
|
76716
|
+
minute: "2-digit",
|
|
76717
|
+
second: "2-digit",
|
|
76718
|
+
hour12
|
|
76719
|
+
};
|
|
76720
|
+
case "full":
|
|
76721
|
+
return {
|
|
76722
|
+
year: "numeric",
|
|
76723
|
+
month: "long",
|
|
76724
|
+
day: "numeric",
|
|
76725
|
+
hour: "2-digit",
|
|
76726
|
+
minute: "2-digit",
|
|
76727
|
+
second: "2-digit",
|
|
76728
|
+
hour12,
|
|
76729
|
+
timeZoneName: timeZoneName ?? "short"
|
|
76730
|
+
};
|
|
76731
|
+
case "custom":
|
|
76732
|
+
return opts.intl ?? {};
|
|
76733
|
+
default:
|
|
76734
|
+
return {};
|
|
76735
|
+
}
|
|
76736
|
+
};
|
|
76737
|
+
const formatDateAuto = (input, options = {}) => {
|
|
76738
|
+
const date = toDate(input);
|
|
76739
|
+
if (!date) return "Invalid date";
|
|
76740
|
+
const style = options.style ?? "datetime";
|
|
76741
|
+
if (style === "iso") {
|
|
76742
|
+
return date.toISOString();
|
|
76743
|
+
}
|
|
76744
|
+
if (style === "relative") {
|
|
76745
|
+
return formatRelative(date, options);
|
|
76746
|
+
}
|
|
76747
|
+
const intlOpts = presetIntlOptions(style, options);
|
|
76748
|
+
return date.toLocaleString(options.locale, {
|
|
76749
|
+
...intlOpts,
|
|
76750
|
+
...options.timeZone ? { timeZone: options.timeZone } : {}
|
|
76751
|
+
});
|
|
76752
|
+
};
|
|
76753
|
+
|
|
76653
76754
|
const createValueFormatter = ({
|
|
76654
76755
|
formatter,
|
|
76655
76756
|
unit
|
|
@@ -76679,6 +76780,30 @@ const createValueFormatter = ({
|
|
|
76679
76780
|
}
|
|
76680
76781
|
return void 0;
|
|
76681
76782
|
};
|
|
76783
|
+
const createDateFormatter = (options) => {
|
|
76784
|
+
if (!options) {
|
|
76785
|
+
return void 0;
|
|
76786
|
+
}
|
|
76787
|
+
return (value) => {
|
|
76788
|
+
if (value == null) {
|
|
76789
|
+
return "";
|
|
76790
|
+
}
|
|
76791
|
+
let input = null;
|
|
76792
|
+
if (value instanceof Date) {
|
|
76793
|
+
input = value;
|
|
76794
|
+
} else if (typeof value === "number") {
|
|
76795
|
+
input = value;
|
|
76796
|
+
} else if (typeof value === "string") {
|
|
76797
|
+
const num = Number(value);
|
|
76798
|
+
input = Number.isFinite(num) ? num : value;
|
|
76799
|
+
}
|
|
76800
|
+
if (input == null) {
|
|
76801
|
+
return "";
|
|
76802
|
+
}
|
|
76803
|
+
const formatted = formatDateAuto(input, options);
|
|
76804
|
+
return formatted === "Invalid date" ? "" : formatted;
|
|
76805
|
+
};
|
|
76806
|
+
};
|
|
76682
76807
|
|
|
76683
76808
|
const COMPONENTS = {
|
|
76684
76809
|
MatrixToAreaMulti,
|
|
@@ -76715,6 +76840,7 @@ const PrometheusGraph = ({
|
|
|
76715
76840
|
topN,
|
|
76716
76841
|
formatter,
|
|
76717
76842
|
unit,
|
|
76843
|
+
dateFormatter,
|
|
76718
76844
|
...props
|
|
76719
76845
|
} = data;
|
|
76720
76846
|
const partsOfUrl = usePartsOfUrl();
|
|
@@ -76729,7 +76855,8 @@ const PrometheusGraph = ({
|
|
|
76729
76855
|
])
|
|
76730
76856
|
);
|
|
76731
76857
|
const formatValue = createValueFormatter({ formatter, unit });
|
|
76732
|
-
const
|
|
76858
|
+
const formatTimestamp = createDateFormatter(dateFormatter);
|
|
76859
|
+
const preparedProps = { width, height, refetchInterval, min, max, topN, formatValue, formatTimestamp, ...parsedProps };
|
|
76733
76860
|
if (isMultiqueryLoading) {
|
|
76734
76861
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
|
|
76735
76862
|
}
|
|
@@ -85588,5 +85715,5 @@ const useResourceScope = ({ plural, cluster, apiGroup, apiVersion }) => {
|
|
|
85588
85715
|
});
|
|
85589
85716
|
};
|
|
85590
85717
|
|
|
85591
|
-
export { BackToDefaultIcon, BlackholeForm, BlackholeFormProvider, ContentCard$1 as ContentCard, CursorDefaultDiv, CursorPointerTag, CursorPointerTagMinContent, CustomSelect$4 as CustomSelect, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EarthIcon, EditIcon, EnrichedTable, EnrichedTableProvider, Events, FlexGrow, LockedIcon, LookingGlassIcon, ManageableBreadcrumbs, ManageableBreadcrumbsProvider, ManageableSidebar, ManageableSidebarProvider, MarketPlace, MarketplaceCard, MinusIcon, NodeTerminal, PaddingContainer, PauseCircleIcon, PlusIcon, PodLogs, PodLogsMonaco, PodTerminal, ProjectInfoCard, ResourceLink, ResumeCircleIcon, Search, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UncontrolledSelect, UnlockedIcon, UpIcon, VMVNC, YamlEditorSingleton$1 as YamlEditorSingleton, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, convertBytes, convertCompute, convertCores, convertStorage, createContextFactory, createNewEntry, deepMerge, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, formatBytesAuto, formatCoresAuto, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getKinds, getLinkToApiForm, getLinkToBuiltinForm, getLinkToForm, getNamespaceLink, getObjectFormItemsDraft, getPrefixSubarrays, getResourceLink, getSortedKinds, getSortedKindsAll, getStringByName, getSwagger, getUppercase, groupsToTreeData, hslFromString, includesArray, isFlatObject, isMultilineFromYaml, isMultilineString, kindByGvr, namespacedByGvr, normalizeValuesForQuotasToNumber, parseCoresWithUnit, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, parseValueWithUnit, pluralByKind, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, toBytes, toCores, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, useInfiniteSentinel, useK8sSmartResource, useK8sVerbs, useKinds, useListWatch, useManyK8sSmartResource, usePermissions, useResourceScope, useSmartResourceParams };
|
|
85718
|
+
export { BackToDefaultIcon, BlackholeForm, BlackholeFormProvider, ContentCard$1 as ContentCard, CursorDefaultDiv, CursorPointerTag, CursorPointerTagMinContent, CustomSelect$4 as CustomSelect, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EarthIcon, EditIcon, EnrichedTable, EnrichedTableProvider, Events, FlexGrow, LockedIcon, LookingGlassIcon, ManageableBreadcrumbs, ManageableBreadcrumbsProvider, ManageableSidebar, ManageableSidebarProvider, MarketPlace, MarketplaceCard, MinusIcon, NodeTerminal, PaddingContainer, PauseCircleIcon, PlusIcon, PodLogs, PodLogsMonaco, PodTerminal, ProjectInfoCard, ResourceLink, ResumeCircleIcon, Search, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UncontrolledSelect, UnlockedIcon, UpIcon, VMVNC, YamlEditorSingleton$1 as YamlEditorSingleton, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, convertBytes, convertCompute, convertCores, convertStorage, createContextFactory, createNewEntry, deepMerge, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, formatBytesAuto, formatCoresAuto, formatDateAuto, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getKinds, getLinkToApiForm, getLinkToBuiltinForm, getLinkToForm, getNamespaceLink, getObjectFormItemsDraft, getPrefixSubarrays, getResourceLink, getSortedKinds, getSortedKindsAll, getStringByName, getSwagger, getUppercase, groupsToTreeData, hslFromString, includesArray, isFlatObject, isMultilineFromYaml, isMultilineString, kindByGvr, namespacedByGvr, normalizeValuesForQuotasToNumber, parseCoresWithUnit, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, parseValueWithUnit, pluralByKind, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, toBytes, toCores, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, useInfiniteSentinel, useK8sSmartResource, useK8sVerbs, useKinds, useListWatch, useManyK8sSmartResource, usePermissions, useResourceScope, useSmartResourceParams };
|
|
85592
85719
|
//# sourceMappingURL=openapi-k8s-toolkit.es.js.map
|