@elevasis/ui 2.25.5 → 2.26.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.
Files changed (101) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.css +18 -29
  3. package/dist/app/index.d.ts +118 -64
  4. package/dist/app/index.js +6 -5
  5. package/dist/charts/index.js +6 -5
  6. package/dist/chunk-3MEXPLWT.js +265 -0
  7. package/dist/{chunk-IS53MXE4.js → chunk-4KTLOK7K.js} +1 -1
  8. package/dist/{chunk-KMAXFJPH.js → chunk-CW3UNAF2.js} +5 -409
  9. package/dist/{chunk-HKBEURCV.js → chunk-G26INIF3.js} +1 -1
  10. package/dist/{chunk-NHHCUECV.js → chunk-G66QFZXD.js} +11 -214
  11. package/dist/{chunk-QIW6OCEI.js → chunk-HLFFKKT3.js} +27 -373
  12. package/dist/chunk-JDNEWB5F.js +10 -0
  13. package/dist/{chunk-VMAWXEVG.js → chunk-JKBGDFX2.js} +1136 -828
  14. package/dist/{chunk-MU4VPAMR.js → chunk-JPGX3533.js} +4 -3
  15. package/dist/chunk-KCGGA36K.js +73 -0
  16. package/dist/chunk-KEFWANZY.js +155 -0
  17. package/dist/chunk-LH4GPYDX.js +448 -0
  18. package/dist/{chunk-QNCVK3ZF.js → chunk-LWKZ3BCC.js} +5 -4
  19. package/dist/chunk-OGXKOMUT.js +412 -0
  20. package/dist/chunk-OHXU5WWK.js +3731 -0
  21. package/dist/chunk-ONFKASZI.js +2004 -0
  22. package/dist/{chunk-U36X6NZM.js → chunk-RIFTUOPE.js} +2 -14
  23. package/dist/{chunk-T6INEVX6.js → chunk-SGS4CQ2B.js} +1 -1
  24. package/dist/{chunk-KINQW4JT.js → chunk-UPMX5GJI.js} +5 -5
  25. package/dist/{chunk-N2AP4I5N.js → chunk-UY5I2KOZ.js} +223 -3857
  26. package/dist/{chunk-JMI7L7Y7.js → chunk-W2ZTLH7Y.js} +142 -4
  27. package/dist/{chunk-3KY2GNPE.js → chunk-WUVR4QY6.js} +9 -9
  28. package/dist/{chunk-Q5BEODAT.js → chunk-X2SUMO3P.js} +2 -1
  29. package/dist/{chunk-SNHGSCKH.js → chunk-XBMCDGHA.js} +1 -1
  30. package/dist/{chunk-N55DVMAG.js → chunk-XQQEKWTL.js} +2 -6
  31. package/dist/{chunk-F7JDHS2I.js → chunk-XZSEPJZQ.js} +5 -5
  32. package/dist/{chunk-5BJXMZN4.js → chunk-YHBPR67D.js} +438 -620
  33. package/dist/{chunk-FVKLHLF4.js → chunk-YO2YORW4.js} +4 -4
  34. package/dist/{chunk-TAIX4NO3.js → chunk-ZFLM2YVW.js} +2 -2
  35. package/dist/components/index.css +18 -29
  36. package/dist/components/index.d.ts +211 -383
  37. package/dist/components/index.js +43 -427
  38. package/dist/components/navigation/index.css +28 -39
  39. package/dist/execution/index.d.ts +0 -73
  40. package/dist/features/auth/index.css +28 -39
  41. package/dist/features/crm/index.css +28 -39
  42. package/dist/features/crm/index.d.ts +49 -49
  43. package/dist/features/crm/index.js +14 -14
  44. package/dist/features/dashboard/index.css +28 -39
  45. package/dist/features/dashboard/index.js +18 -15
  46. package/dist/features/delivery/index.css +18 -29
  47. package/dist/features/delivery/index.js +14 -14
  48. package/dist/features/knowledge/index.css +611 -0
  49. package/dist/features/knowledge/index.js +700 -1
  50. package/dist/features/lead-gen/index.css +28 -39
  51. package/dist/features/lead-gen/index.d.ts +212 -166
  52. package/dist/features/lead-gen/index.js +16 -15
  53. package/dist/features/monitoring/index.css +18 -29
  54. package/dist/features/monitoring/index.js +17 -16
  55. package/dist/features/monitoring/requests/index.css +28 -39
  56. package/dist/features/monitoring/requests/index.js +13 -13
  57. package/dist/features/operations/index.css +28 -39
  58. package/dist/features/operations/index.d.ts +16 -98
  59. package/dist/features/operations/index.js +26 -20
  60. package/dist/features/settings/index.css +28 -39
  61. package/dist/features/settings/index.d.ts +1 -0
  62. package/dist/features/settings/index.js +15 -15
  63. package/dist/hooks/delivery/index.css +28 -39
  64. package/dist/hooks/delivery/index.js +2 -2
  65. package/dist/hooks/index.css +18 -29
  66. package/dist/hooks/index.d.ts +180 -377
  67. package/dist/hooks/index.js +13 -13
  68. package/dist/hooks/published.css +18 -29
  69. package/dist/hooks/published.d.ts +180 -377
  70. package/dist/hooks/published.js +13 -13
  71. package/dist/index.css +18 -29
  72. package/dist/index.d.ts +1549 -946
  73. package/dist/index.js +15 -14
  74. package/dist/initialization/index.d.ts +1 -0
  75. package/dist/knowledge/index.d.ts +991 -41
  76. package/dist/knowledge/index.js +5469 -413
  77. package/dist/layout/index.d.ts +2 -0
  78. package/dist/layout/index.js +3 -2
  79. package/dist/organization/index.css +28 -39
  80. package/dist/organization/index.d.ts +1 -0
  81. package/dist/provider/index.css +28 -39
  82. package/dist/provider/index.d.ts +1147 -348
  83. package/dist/provider/index.js +11 -10
  84. package/dist/provider/published.css +28 -39
  85. package/dist/provider/published.d.ts +1146 -347
  86. package/dist/provider/published.js +8 -8
  87. package/dist/test-utils/index.js +2 -2
  88. package/dist/test-utils/setup.js +1 -1
  89. package/dist/theme/index.js +3 -2
  90. package/dist/theme/presets/index.d.ts +97 -0
  91. package/dist/theme/presets/index.js +3 -0
  92. package/dist/types/index.d.ts +71 -126
  93. package/dist/utils/index.js +1 -1
  94. package/dist/vite/index.d.ts +7 -0
  95. package/dist/vite/index.js +10 -0
  96. package/dist/vite-plugin-knowledge/index.d.ts +1 -33
  97. package/dist/vite-plugin-knowledge/index.js +1 -66
  98. package/package.json +46 -33
  99. package/src/knowledge/README.md +8 -8
  100. package/src/theme/presets/README.md +19 -0
  101. /package/dist/{chunk-SGXXJE52.js → chunk-QD4X4H5A.js} +0 -0
@@ -1,40 +1,9 @@
1
- import { useErrorTrends } from './chunk-VKMNWHTL.js';
2
- import { CardHeader, CenteredErrorState, TrendIndicator, EmptyState, StatCard } from './chunk-U36X6NZM.js';
3
- import { getTimeRangeLabel, getTimeRangeDates, formatBucketTime } from './chunk-SGXXJE52.js';
4
- import { useRef, useState, useLayoutEffect, useEffect, useMemo, useCallback } from 'react';
5
- import { jsx, jsxs } from 'react/jsx-runtime';
6
- import { useComputedColorScheme, Group, Text, Box, Stack, Center, Loader, Paper, Button, NumberFormatter, Badge, Space, Tooltip as Tooltip$1, SimpleGrid, Alert, SegmentedControl } from '@mantine/core';
1
+ import { useMemo, useState, useEffect } from 'react';
2
+ import { useComputedColorScheme, Group, Text, Box, Stack } from '@mantine/core';
7
3
  import { ResponsiveContainer, AreaChart, CartesianGrid, XAxis, YAxis, Tooltip, ReferenceLine as ReferenceLine$1, Area, PieChart, Pie, Cell } from 'recharts';
8
- import { IconActivity, IconDownload, IconChartLine, IconInfoCircle, IconApps, IconPlayerPlay, IconChartBar, IconAlertTriangle, IconRocket, IconAlertCircle } from '@tabler/icons-react';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
9
5
 
10
- function ChartFrame({ h, debounceMs = 150, children }) {
11
- const ref = useRef(null);
12
- const [width, setWidth] = useState(0);
13
- useLayoutEffect(() => {
14
- const el = ref.current;
15
- if (!el) return;
16
- const w = el.getBoundingClientRect().width;
17
- if (w > 0) setWidth(w);
18
- }, []);
19
- useEffect(() => {
20
- const el = ref.current;
21
- if (!el) return;
22
- let timeout;
23
- const ro = new ResizeObserver((entries) => {
24
- if (timeout !== void 0) window.clearTimeout(timeout);
25
- const nextWidth = entries[0]?.contentRect.width ?? 0;
26
- timeout = window.setTimeout(() => {
27
- if (nextWidth > 0) setWidth(nextWidth);
28
- }, debounceMs);
29
- });
30
- ro.observe(el);
31
- return () => {
32
- ro.disconnect();
33
- if (timeout !== void 0) window.clearTimeout(timeout);
34
- };
35
- }, [debounceMs]);
36
- return /* @__PURE__ */ jsx("div", { ref, style: { width: "100%", height: h, position: "relative" }, children: width > 0 && /* @__PURE__ */ jsx("div", { style: { width, height: h }, children }) });
37
- }
6
+ // src/components/charts/cyber-theme.ts
38
7
  var THEME_DERIVED = {
39
8
  grid: "var(--color-border)",
40
9
  gridLine: "var(--color-border)",
@@ -573,378 +542,5 @@ function CyberDonut({
573
542
  ] }, seg.name)) })
574
543
  ] });
575
544
  }
576
- var GRANULARITY_MAP = {
577
- "1h": "hour",
578
- "24h": "hour",
579
- "7d": "day",
580
- "30d": "day"
581
- };
582
- var BUCKET_CONFIG = {
583
- "1h": { size: 5 * 60 * 1e3, count: 12 },
584
- "24h": { size: 60 * 60 * 1e3, count: 24 },
585
- "7d": { size: 24 * 60 * 60 * 1e3, count: 7 },
586
- "30d": { size: 24 * 60 * 60 * 1e3, count: 30 }
587
- };
588
- function groupTimestampsByTime(timestamps, timeRange) {
589
- const { size: bucketSize, count: bucketCount } = BUCKET_CONFIG[timeRange];
590
- const granularity = GRANULARITY_MAP[timeRange];
591
- const now = /* @__PURE__ */ new Date();
592
- const flooredNow = new Date(now.getTime() - now.getTime() % bucketSize);
593
- const buckets = /* @__PURE__ */ new Map();
594
- for (let i = bucketCount - 1; i >= 0; i--) {
595
- const bucketTime = new Date(flooredNow.getTime() - i * bucketSize);
596
- const label = formatBucketTime(bucketTime.toISOString(), granularity);
597
- buckets.set(label, 0);
598
- }
599
- timestamps.forEach((occurredAt) => {
600
- const timeDiff = flooredNow.getTime() - occurredAt.getTime();
601
- const bucketIndex = Math.floor(timeDiff / bucketSize);
602
- if (bucketIndex >= 0 && bucketIndex < bucketCount) {
603
- const bucketTime = new Date(flooredNow.getTime() - bucketIndex * bucketSize);
604
- const label = formatBucketTime(bucketTime.toISOString(), granularity);
605
- buckets.set(label, (buckets.get(label) || 0) + 1);
606
- }
607
- });
608
- return Array.from(buckets.entries()).map(([time, count]) => ({
609
- time,
610
- "Activity Count": count
611
- }));
612
- }
613
- function ActivityTrendChart({ timestamps, total, isLoading, timeRange }) {
614
- const chartData = useMemo(() => {
615
- return groupTimestampsByTime(timestamps, timeRange);
616
- }, [timestamps, timeRange]);
617
- if (isLoading) {
618
- return /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) });
619
- }
620
- return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
621
- /* @__PURE__ */ jsx(
622
- CardHeader,
623
- {
624
- icon: /* @__PURE__ */ jsx(IconActivity, { size: 18 }),
625
- title: "Activity Trend",
626
- subtitle: `${total} activities in ${getTimeRangeLabel(timeRange)}`
627
- }
628
- ),
629
- /* @__PURE__ */ jsx(
630
- CyberAreaChart,
631
- {
632
- data: chartData,
633
- series: [{ dataKey: "Activity Count", color: "blue" }],
634
- height: 200,
635
- yAxisLabel: "Count",
636
- yDomain: [0, "auto"]
637
- }
638
- )
639
- ] });
640
- }
641
- function formatDollar(value) {
642
- return `$${value.toFixed(2)}`;
643
- }
644
- function CostTrendChart({ data, summaryData, isLoading, error }) {
645
- const todayCost = summaryData?.current.totalCostUsd ?? 0;
646
- const previousCost = summaryData?.previous.totalCostUsd ?? 0;
647
- const mtdCost = summaryData?.mtd.totalCostUsd ?? 0;
648
- const projectedMonthlyCost = summaryData?.projection.monthlyCostUsd ?? 0;
649
- const confidence = summaryData?.projection.confidence ?? "low";
650
- const budget = 1500;
651
- const budgetStatus = projectedMonthlyCost <= budget ? "green" : projectedMonthlyCost <= budget * 1.1 ? "yellow" : "red";
652
- const budgetLabel = projectedMonthlyCost <= budget ? "On Budget" : projectedMonthlyCost <= budget * 1.1 ? "Warning" : "Over Budget";
653
- const chartData = data?.trendData.map((point) => {
654
- const date = new Date(point.time);
655
- const timeLabel = data.granularity === "hour" ? date.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" }) : date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
656
- return {
657
- time: timeLabel,
658
- "Total Cost": point.totalCostUsd
659
- };
660
- }) ?? [];
661
- const handleExport = () => {
662
- if (!data) return;
663
- const csvContent = [
664
- ["Time", "Total Cost ($)", "Executions", "Avg Cost/Execution ($)"],
665
- ...data.trendData.map((d) => [
666
- d.time,
667
- d.totalCostUsd.toFixed(4),
668
- d.executionCount,
669
- d.avgCostPerExecution.toFixed(4)
670
- ])
671
- ].map((row) => row.join(",")).join("\n");
672
- const blob = new Blob([csvContent], { type: "text/csv" });
673
- const url = URL.createObjectURL(blob);
674
- const link = document.createElement("a");
675
- link.href = url;
676
- link.download = `cost-trends-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
677
- link.click();
678
- URL.revokeObjectURL(url);
679
- };
680
- if (error) {
681
- return /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load cost trends" }) });
682
- }
683
- if (isLoading) {
684
- return /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) });
685
- }
686
- const granularityLabel = data?.granularity === "hour" ? "Hourly" : "Daily";
687
- return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
688
- /* @__PURE__ */ jsx(
689
- CardHeader,
690
- {
691
- icon: /* @__PURE__ */ jsx(IconChartLine, { size: 18 }),
692
- title: `Cost Trend (${granularityLabel})`,
693
- rightSection: /* @__PURE__ */ jsx(Button, { variant: "subtle", size: "xs", leftSection: /* @__PURE__ */ jsx(IconDownload, { size: 14 }), onClick: handleExport, children: "Export CSV" })
694
- }
695
- ),
696
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "center", mb: "md", children: [
697
- /* @__PURE__ */ jsxs(Group, { gap: "lg", children: [
698
- /* @__PURE__ */ jsxs(Group, { gap: 6, align: "baseline", children: [
699
- /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, style: { fontFamily: "var(--mantine-font-family-headings)" }, children: /* @__PURE__ */ jsx(NumberFormatter, { prefix: "$", value: todayCost, decimalScale: 2 }) }),
700
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "period" }),
701
- /* @__PURE__ */ jsx(TrendIndicator, { current: todayCost, previous: previousCost, inverse: true })
702
- ] }),
703
- /* @__PURE__ */ jsxs(Group, { gap: 6, align: "baseline", children: [
704
- /* @__PURE__ */ jsx(Text, { size: "xl", fw: 700, style: { fontFamily: "var(--mantine-font-family-headings)" }, children: /* @__PURE__ */ jsx(NumberFormatter, { prefix: "$", value: mtdCost, thousandSeparator: true, decimalScale: 2 }) }),
705
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "MTD" })
706
- ] })
707
- ] }),
708
- /* @__PURE__ */ jsx(Badge, { size: "md", variant: "dot", color: budgetStatus, children: budgetLabel })
709
- ] }),
710
- chartData.length > 0 ? /* @__PURE__ */ jsx(
711
- CyberAreaChart,
712
- {
713
- data: chartData,
714
- series: [{ dataKey: "Total Cost", color: "blue", name: "Total Cost" }],
715
- height: 200,
716
- yDomain: [0, (max) => Math.max(max * 1.1, 0.01)],
717
- yTickFormatter: formatDollar,
718
- tooltipFormatter: formatDollar,
719
- baselineColor: "blue"
720
- }
721
- ) : /* @__PURE__ */ jsx(EmptyState, { icon: IconChartLine, title: "No cost data available for this time period" }),
722
- /* @__PURE__ */ jsx(Space, { h: "lg" }),
723
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
724
- /* @__PURE__ */ jsxs(Group, { gap: 4, children: [
725
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
726
- "Projected monthly:",
727
- " ",
728
- /* @__PURE__ */ jsx(NumberFormatter, { prefix: "$", value: projectedMonthlyCost, thousandSeparator: true, decimalScale: 2 })
729
- ] }),
730
- /* @__PURE__ */ jsx(Tooltip$1, { label: `Projection confidence: ${confidence}`, children: /* @__PURE__ */ jsx(IconInfoCircle, { size: 12, color: "var(--color-text-subtle)" }) })
731
- ] }),
732
- /* @__PURE__ */ jsxs(
733
- Text,
734
- {
735
- size: "xs",
736
- fw: 600,
737
- c: projectedMonthlyCost > budget ? "red" : "dimmed",
738
- style: { fontFamily: "var(--mantine-font-family-headings)" },
739
- children: [
740
- "Budget: ",
741
- /* @__PURE__ */ jsx(NumberFormatter, { prefix: "$", value: budget, thousandSeparator: true, decimalScale: 2 })
742
- ]
743
- }
744
- )
745
- ] })
746
- ] });
747
- }
748
- var EM_DASH = "\u2014";
749
- function getSuccessRateColor(rate) {
750
- if (rate >= 95) return "var(--mantine-color-teal-6)";
751
- if (rate >= 80) return "var(--mantine-color-yellow-6)";
752
- return "var(--mantine-color-red-6)";
753
- }
754
- function getErrorCountColor(count) {
755
- if (count === 0) return "var(--mantine-color-teal-6)";
756
- if (count <= 5) return "var(--mantine-color-yellow-6)";
757
- return "var(--mantine-color-red-6)";
758
- }
759
- function HeroStatsRow({
760
- resourcesData,
761
- resourcesLoading,
762
- dashboardData,
763
- dashboardLoading,
764
- unresolvedErrorCount,
765
- errorsLoading
766
- }) {
767
- const health = dashboardData?.executionHealth;
768
- const resourceCount = resourcesData?.total ?? null;
769
- const totalExecutions = health?.totalExecutions ?? null;
770
- const successRate = totalExecutions ? health?.successRate ?? null : null;
771
- return /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 2, sm: 5 }, children: [
772
- /* @__PURE__ */ jsx(
773
- StatCard,
774
- {
775
- variant: "hero",
776
- icon: IconApps,
777
- value: resourceCount ?? EM_DASH,
778
- label: "Resources",
779
- isLoading: resourcesLoading
780
- }
781
- ),
782
- /* @__PURE__ */ jsx(
783
- StatCard,
784
- {
785
- variant: "hero",
786
- icon: IconPlayerPlay,
787
- value: totalExecutions ?? EM_DASH,
788
- label: "Executions",
789
- isLoading: dashboardLoading
790
- }
791
- ),
792
- /* @__PURE__ */ jsx(
793
- StatCard,
794
- {
795
- variant: "hero",
796
- icon: IconChartBar,
797
- value: successRate != null ? `${Math.round(successRate)}%` : EM_DASH,
798
- label: "Success Rate",
799
- valueColor: successRate != null ? getSuccessRateColor(successRate) : void 0,
800
- isLoading: dashboardLoading
801
- }
802
- ),
803
- /* @__PURE__ */ jsx(
804
- StatCard,
805
- {
806
- variant: "hero",
807
- icon: IconAlertTriangle,
808
- value: errorsLoading ? EM_DASH : unresolvedErrorCount ?? EM_DASH,
809
- label: "Errors",
810
- valueColor: unresolvedErrorCount != null ? getErrorCountColor(unresolvedErrorCount) : void 0
811
- }
812
- ),
813
- /* @__PURE__ */ jsx(
814
- StatCard,
815
- {
816
- variant: "hero",
817
- icon: IconRocket,
818
- value: dashboardData?.activeDeploymentVersion ?? EM_DASH,
819
- label: "Deployment",
820
- isLoading: dashboardLoading
821
- }
822
- )
823
- ] });
824
- }
825
- function getGranularityFromTimeRange(timeRange) {
826
- return ["1h", "24h"].includes(timeRange) ? "hour" : "day";
827
- }
828
- function formatPeakPeriod(peakPeriod, granularity) {
829
- if (!peakPeriod) return "N/A";
830
- const date = new Date(peakPeriod);
831
- if (granularity === "hour") {
832
- return date.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit", hour12: true });
833
- } else {
834
- return date.toLocaleDateString("en-US", { weekday: "short", month: "short", day: "numeric" });
835
- }
836
- }
837
- function CombinedTrendChart({
838
- healthData,
839
- errorData: _errorData,
840
- isLoading,
841
- error,
842
- timeRange,
843
- navigationAction
844
- }) {
845
- const [activeTab, setActiveTab] = useState("success");
846
- const colors = useCyberColors();
847
- const { startDate: start, endDate: end } = useMemo(() => getTimeRangeDates(timeRange), [timeRange]);
848
- const granularity = getGranularityFromTimeRange(timeRange);
849
- const { data: errorTrends } = useErrorTrends({
850
- startDate: start,
851
- endDate: end,
852
- granularity
853
- });
854
- const xTickFormatter = useCallback((value) => formatBucketTime(value, granularity), [granularity]);
855
- if (error) {
856
- return /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load trend data" }) });
857
- }
858
- if (isLoading) {
859
- return /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) });
860
- }
861
- const errorTrendsMap = new Map(errorTrends?.map((trend) => [trend.time, trend.errorCount]) || []);
862
- const successErrorData = healthData?.trendData.length ? healthData.trendData.map((d) => {
863
- const errorCount = errorTrendsMap.get(d.time) || 0;
864
- return {
865
- time: d.time,
866
- "Success Count": d.successCount,
867
- "Error Count": errorCount
868
- };
869
- }) : [];
870
- const throughputData = healthData?.trendData.length ? healthData.trendData.map((d) => ({
871
- time: d.time,
872
- Executions: d.executionCount
873
- })) : [];
874
- const totalExecutions = healthData?.totalExecutions ?? 0;
875
- const peakPeriod = healthData?.peakPeriod ?? "";
876
- const dataGranularity = healthData?.granularity ?? granularity;
877
- if (!successErrorData.length) {
878
- return /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { h: 300, children: /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, {}), color: "gray", variant: "light", children: "No trend data available for the selected time range" }) }) });
879
- }
880
- return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
881
- /* @__PURE__ */ jsx(
882
- CardHeader,
883
- {
884
- icon: /* @__PURE__ */ jsx(IconChartLine, { size: 18 }),
885
- title: "Execution Trends",
886
- subtitle: `${getTimeRangeLabel(timeRange)} - ${dataGranularity === "hour" ? "Hourly" : "Daily"} data`,
887
- rightSection: /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
888
- /* @__PURE__ */ jsx(
889
- SegmentedControl,
890
- {
891
- value: activeTab ?? "success",
892
- onChange: setActiveTab,
893
- size: "xs",
894
- data: [
895
- { label: "Success & Errors", value: "success" },
896
- { label: "Throughput", value: "throughput" }
897
- ]
898
- }
899
- ),
900
- navigationAction
901
- ] })
902
- }
903
- ),
904
- activeTab === "success" && /* @__PURE__ */ jsxs(Box, { style: { height: 280 }, children: [
905
- /* @__PURE__ */ jsxs(Group, { gap: "lg", justify: "center", mb: "xs", h: 24, align: "center", children: [
906
- /* @__PURE__ */ jsx(CyberLegendItem, { color: colors.green, label: "Success Count" }),
907
- /* @__PURE__ */ jsx(CyberLegendItem, { color: colors.red, label: "Error Count" })
908
- ] }),
909
- /* @__PURE__ */ jsx(
910
- CyberAreaChart,
911
- {
912
- data: successErrorData,
913
- series: [
914
- { dataKey: "Error Count", color: "red" },
915
- { dataKey: "Success Count", color: "green", animationDuration: 1400 }
916
- ],
917
- height: 250,
918
- yAxisLabel: "Count",
919
- baselineColor: "green",
920
- xTickFormatter
921
- }
922
- )
923
- ] }),
924
- activeTab === "throughput" && /* @__PURE__ */ jsxs(Box, { style: { height: 280 }, children: [
925
- /* @__PURE__ */ jsxs(Group, { gap: "lg", justify: "center", mb: "xs", h: 24, align: "center", children: [
926
- /* @__PURE__ */ jsxs(Group, { gap: 6, children: [
927
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, style: { color: colors.blue, fontVariantNumeric: "tabular-nums" }, children: totalExecutions.toLocaleString() }),
928
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "executions" })
929
- ] }),
930
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "|" }),
931
- /* @__PURE__ */ jsxs(Group, { gap: 6, children: [
932
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "peak" }),
933
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, style: { color: colors.blue, fontVariantNumeric: "tabular-nums" }, children: formatPeakPeriod(peakPeriod, dataGranularity) })
934
- ] }),
935
- /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "dot", color: "green", children: "Normal" })
936
- ] }),
937
- /* @__PURE__ */ jsx(
938
- CyberAreaChart,
939
- {
940
- data: throughputData,
941
- series: [{ dataKey: "Executions", color: "blue" }],
942
- height: 250,
943
- xTickFormatter
944
- }
945
- )
946
- ] })
947
- ] });
948
- }
949
545
 
950
- export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors };
546
+ export { CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, getSeriesColor, useCyberColors };
@@ -1,4 +1,4 @@
1
- import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-SGXXJE52.js';
1
+ import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-QD4X4H5A.js';
2
2
  import { useElevasisServices } from './chunk-5WWZXCS5.js';
3
3
  import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
4
4
  import { notifications } from '@mantine/notifications';