@elevasis/ui 1.3.1 → 1.3.3
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/api/index.js +1 -1
- package/dist/auth/guards/AdminGuard.d.ts +32 -0
- package/dist/auth/guards/AdminGuard.d.ts.map +1 -0
- package/dist/auth/guards/ProtectedRoute.d.ts +60 -0
- package/dist/auth/guards/ProtectedRoute.d.ts.map +1 -0
- package/dist/auth/guards/__tests__/AdminGuard.test.d.ts +12 -0
- package/dist/auth/guards/__tests__/AdminGuard.test.d.ts.map +1 -0
- package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts +14 -0
- package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts.map +1 -0
- package/dist/auth/index.d.ts +14 -174
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +1 -1
- package/dist/{chunk-A3MCANC6.js → chunk-6IX5JZEH.js} +110 -50
- package/dist/chunk-GIFAF5ZS.js +313 -0
- package/dist/chunk-JQLT6HBI.js +850 -0
- package/dist/chunk-LFYO3MDC.js +58 -0
- package/dist/{chunk-72HOBFMP.js → chunk-LTQAAIGE.js} +3 -3
- package/dist/{chunk-JBFFCZI4.js → chunk-U34YGJQB.js} +1 -93
- package/dist/components/index.d.ts +1 -1353
- package/dist/components/index.js +1 -20
- package/dist/components/navigation/index.d.ts +2 -32
- package/dist/components/navigation/index.js +1 -29
- package/dist/execution/index.d.ts +63 -231
- package/dist/execution/index.js +1 -4
- package/dist/graph/index.css +0 -1
- package/dist/graph/index.d.ts +4 -203
- package/dist/graph/index.js +1 -1
- package/dist/hooks/command-queue/index.d.ts +7 -0
- package/dist/hooks/command-queue/index.d.ts.map +1 -0
- package/dist/hooks/command-queue/useCommandQueue.d.ts +33 -0
- package/dist/hooks/command-queue/useCommandQueue.d.ts.map +1 -0
- package/dist/hooks/command-queue/useCommandQueueTotals.d.ts +17 -0
- package/dist/hooks/command-queue/useCommandQueueTotals.d.ts.map +1 -0
- package/dist/hooks/command-queue/useDeleteTask.d.ts +5 -0
- package/dist/hooks/command-queue/useDeleteTask.d.ts.map +1 -0
- package/dist/hooks/command-queue/usePatchTask.d.ts +6 -0
- package/dist/hooks/command-queue/usePatchTask.d.ts.map +1 -0
- package/dist/hooks/command-queue/useSubmitAction.d.ts +29 -0
- package/dist/hooks/command-queue/useSubmitAction.d.ts.map +1 -0
- package/dist/hooks/executions/index.d.ts +16 -0
- package/dist/hooks/executions/index.d.ts.map +1 -0
- package/dist/hooks/executions/useBulkDeleteExecutions.d.ts +15 -0
- package/dist/hooks/executions/useBulkDeleteExecutions.d.ts.map +1 -0
- package/dist/hooks/executions/useCancelExecution.d.ts +20 -0
- package/dist/hooks/executions/useCancelExecution.d.ts.map +1 -0
- package/dist/hooks/executions/useDeleteExecution.d.ts +13 -0
- package/dist/hooks/executions/useDeleteExecution.d.ts.map +1 -0
- package/dist/hooks/executions/useExecuteAsync.d.ts +21 -0
- package/dist/hooks/executions/useExecuteAsync.d.ts.map +1 -0
- package/dist/hooks/executions/useExecution.d.ts +10 -0
- package/dist/hooks/executions/useExecution.d.ts.map +1 -0
- package/dist/hooks/executions/useExecutions.d.ts +16 -0
- package/dist/hooks/executions/useExecutions.d.ts.map +1 -0
- package/dist/hooks/executions/useResourceDefinition.d.ts +9 -0
- package/dist/hooks/executions/useResourceDefinition.d.ts.map +1 -0
- package/dist/hooks/executions/useResources.d.ts +15 -0
- package/dist/hooks/executions/useResources.d.ts.map +1 -0
- package/dist/hooks/executions/useRetryExecution.d.ts +16 -0
- package/dist/hooks/executions/useRetryExecution.d.ts.map +1 -0
- package/dist/hooks/feature-access/createUseFeatureAccess.d.ts +44 -0
- package/dist/hooks/feature-access/createUseFeatureAccess.d.ts.map +1 -0
- package/dist/hooks/feature-access/index.d.ts +2 -0
- package/dist/hooks/feature-access/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +11 -4554
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +2 -4
- package/dist/hooks/monitoring/index.d.ts +9 -0
- package/dist/hooks/monitoring/index.d.ts.map +1 -0
- package/dist/hooks/monitoring/useActivities.d.ts +52 -0
- package/dist/hooks/monitoring/useActivities.d.ts.map +1 -0
- package/dist/hooks/monitoring/useCostSummary.d.ts +7 -0
- package/dist/hooks/monitoring/useCostSummary.d.ts.map +1 -0
- package/dist/hooks/monitoring/useExecutionHealth.d.ts +10 -0
- package/dist/hooks/monitoring/useExecutionHealth.d.ts.map +1 -0
- package/dist/hooks/monitoring/useExecutionLogs.d.ts +56 -0
- package/dist/hooks/monitoring/useExecutionLogs.d.ts.map +1 -0
- package/dist/hooks/monitoring/useNotifications.d.ts +11 -0
- package/dist/hooks/monitoring/useNotifications.d.ts.map +1 -0
- package/dist/hooks/notifications/index.d.ts +8 -0
- package/dist/hooks/notifications/index.d.ts.map +1 -0
- package/dist/hooks/notifications/useMarkAllAsRead.d.ts +2 -0
- package/dist/hooks/notifications/useMarkAllAsRead.d.ts.map +1 -0
- package/dist/hooks/notifications/useMarkAsRead.d.ts +2 -0
- package/dist/hooks/notifications/useMarkAsRead.d.ts.map +1 -0
- package/dist/hooks/notifications/useNotificationCount.d.ts +8 -0
- package/dist/hooks/notifications/useNotificationCount.d.ts.map +1 -0
- package/dist/hooks/observability/index.d.ts +19 -0
- package/dist/hooks/observability/index.d.ts.map +1 -0
- package/dist/hooks/observability/useBusinessImpact.d.ts +9 -0
- package/dist/hooks/observability/useBusinessImpact.d.ts.map +1 -0
- package/dist/hooks/observability/useCostBreakdown.d.ts +10 -0
- package/dist/hooks/observability/useCostBreakdown.d.ts.map +1 -0
- package/dist/hooks/observability/useCostByModel.d.ts +3 -0
- package/dist/hooks/observability/useCostByModel.d.ts.map +1 -0
- package/dist/hooks/observability/useCostTrends.d.ts +3 -0
- package/dist/hooks/observability/useCostTrends.d.ts.map +1 -0
- package/dist/hooks/observability/useDashboardMetrics.d.ts +3 -0
- package/dist/hooks/observability/useDashboardMetrics.d.ts.map +1 -0
- package/dist/hooks/observability/useErrorAnalysis.d.ts +7 -0
- package/dist/hooks/observability/useErrorAnalysis.d.ts.map +1 -0
- package/dist/hooks/observability/useErrorDetails.d.ts +20 -0
- package/dist/hooks/observability/useErrorDetails.d.ts.map +1 -0
- package/dist/hooks/observability/useErrorDistribution.d.ts +12 -0
- package/dist/hooks/observability/useErrorDistribution.d.ts.map +1 -0
- package/dist/hooks/observability/useErrorTrends.d.ts +12 -0
- package/dist/hooks/observability/useErrorTrends.d.ts.map +1 -0
- package/dist/hooks/observability/useResolveError.d.ts +17 -0
- package/dist/hooks/observability/useResolveError.d.ts.map +1 -0
- package/dist/hooks/observability/useTopFailingResources.d.ts +13 -0
- package/dist/hooks/observability/useTopFailingResources.d.ts.map +1 -0
- package/dist/hooks/published.d.ts +19 -4279
- package/dist/hooks/published.d.ts.map +1 -0
- package/dist/hooks/published.js +367 -4
- package/dist/hooks/scheduling/index.d.ts +5 -0
- package/dist/hooks/scheduling/index.d.ts.map +1 -0
- package/dist/hooks/scheduling/useSchedules.d.ts +185 -0
- package/dist/hooks/scheduling/useSchedules.d.ts.map +1 -0
- package/dist/hooks/sessions/index.d.ts +8 -0
- package/dist/hooks/sessions/index.d.ts.map +1 -0
- package/dist/hooks/sessions/useSessionExecutions.d.ts +13 -0
- package/dist/hooks/sessions/useSessionExecutions.d.ts.map +1 -0
- package/dist/hooks/sessions/useSessionMessages.d.ts +7 -0
- package/dist/hooks/sessions/useSessionMessages.d.ts.map +1 -0
- package/dist/hooks/sessions/useSessions.d.ts +26 -0
- package/dist/hooks/sessions/useSessions.d.ts.map +1 -0
- package/dist/index.css +0 -118
- package/dist/index.d.ts +15 -7889
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1119 -24
- package/dist/initialization/InitializationProvider.d.ts +48 -0
- package/dist/initialization/InitializationProvider.d.ts.map +1 -0
- package/dist/initialization/hooks/useAppInitialization.d.ts +32 -0
- package/dist/initialization/hooks/useAppInitialization.d.ts.map +1 -0
- package/dist/initialization/index.d.ts +22 -2361
- package/dist/initialization/index.d.ts.map +1 -0
- package/dist/initialization/index.js +1 -1
- package/dist/organization/context/OrganizationProvider.d.ts +20 -0
- package/dist/organization/context/OrganizationProvider.d.ts.map +1 -0
- package/dist/organization/hooks/useOrgInitialization.d.ts +56 -0
- package/dist/organization/hooks/useOrgInitialization.d.ts.map +1 -0
- package/dist/organization/index.d.ts +21 -283
- package/dist/organization/index.d.ts.map +1 -0
- package/dist/organization/index.js +3 -3
- package/dist/profile/context/ProfileProvider.d.ts +27 -0
- package/dist/profile/context/ProfileProvider.d.ts.map +1 -0
- package/dist/profile/hooks/useUserProfile.d.ts +31 -0
- package/dist/profile/hooks/useUserProfile.d.ts.map +1 -0
- package/dist/profile/index.d.ts +14 -2290
- package/dist/profile/index.d.ts.map +1 -0
- package/dist/provider/CoreAuthKitInner.d.ts +12 -0
- package/dist/provider/CoreAuthKitInner.d.ts.map +1 -0
- package/dist/provider/ElevasisCoreProvider.d.ts +39 -0
- package/dist/provider/ElevasisCoreProvider.d.ts.map +1 -0
- package/dist/provider/ElevasisServiceContext.d.ts +31 -0
- package/dist/provider/ElevasisServiceContext.d.ts.map +1 -0
- package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts +2 -0
- package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts.map +1 -0
- package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts +2 -0
- package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts.map +1 -0
- package/dist/provider/index.d.ts +7 -372
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +3 -12
- package/dist/provider/published.d.ts +9 -263
- package/dist/provider/published.d.ts.map +1 -0
- package/dist/provider/published.js +5 -5
- package/dist/provider/types.d.ts +143 -0
- package/dist/provider/types.d.ts.map +1 -0
- package/dist/provider/types.js +1 -0
- package/dist/sdk-barrel.d.ts +20 -0
- package/dist/sdk-barrel.d.ts.map +1 -0
- package/dist/supabase/index.d.ts +0 -255
- package/dist/theme/cssVariables.d.ts +12 -0
- package/dist/theme/cssVariables.d.ts.map +1 -0
- package/dist/theme/cssVariables.js +93 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +1 -0
- package/dist/theme/presets/__tests__/getPreset.test.d.ts +2 -0
- package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +1 -0
- package/dist/theme/presets/abyss.d.ts +3 -0
- package/dist/theme/presets/abyss.d.ts.map +1 -0
- package/dist/theme/presets/abyss.js +54 -0
- package/dist/theme/presets/aurora.d.ts +8 -0
- package/dist/theme/presets/aurora.d.ts.map +1 -0
- package/dist/theme/presets/aurora.js +59 -0
- package/dist/theme/presets/canopy.d.ts +3 -0
- package/dist/theme/presets/canopy.d.ts.map +1 -0
- package/dist/theme/presets/canopy.js +58 -0
- package/dist/theme/presets/cyber-flux.d.ts +8 -0
- package/dist/theme/presets/cyber-flux.d.ts.map +1 -0
- package/dist/theme/presets/cyber-flux.js +66 -0
- package/dist/theme/presets/cyber-strike.d.ts +9 -0
- package/dist/theme/presets/cyber-strike.d.ts.map +1 -0
- package/dist/theme/presets/cyber-strike.js +62 -0
- package/dist/theme/presets/cyber-void.d.ts +8 -0
- package/dist/theme/presets/cyber-void.d.ts.map +1 -0
- package/dist/theme/presets/cyber-void.js +62 -0
- package/dist/theme/presets/cyber-volt.d.ts +8 -0
- package/dist/theme/presets/cyber-volt.d.ts.map +1 -0
- package/dist/theme/presets/cyber-volt.js +66 -0
- package/dist/theme/presets/default.d.ts +4 -0
- package/dist/theme/presets/default.d.ts.map +1 -0
- package/dist/theme/presets/ember.d.ts +8 -0
- package/dist/theme/presets/ember.d.ts.map +1 -0
- package/dist/theme/presets/ember.js +63 -0
- package/dist/theme/presets/honey.d.ts +3 -0
- package/dist/theme/presets/honey.d.ts.map +1 -0
- package/dist/theme/presets/honey.js +62 -0
- package/dist/theme/presets/index.d.ts +6 -0
- package/dist/theme/presets/index.d.ts.map +1 -0
- package/dist/theme/presets/index.js +39 -0
- package/dist/theme/presets/midnight.d.ts +8 -0
- package/dist/theme/presets/midnight.d.ts.map +1 -0
- package/dist/theme/presets/midnight.js +68 -0
- package/dist/theme/presets/obsidian.d.ts +3 -0
- package/dist/theme/presets/obsidian.d.ts.map +1 -0
- package/dist/theme/presets/obsidian.js +56 -0
- package/dist/theme/presets/regal.d.ts +8 -0
- package/dist/theme/presets/regal.d.ts.map +1 -0
- package/dist/theme/presets/regal.js +63 -0
- package/dist/theme/presets/rose-gold.d.ts +8 -0
- package/dist/theme/presets/rose-gold.d.ts.map +1 -0
- package/dist/theme/presets/rose-gold.js +63 -0
- package/dist/theme/presets/slate.d.ts +3 -0
- package/dist/theme/presets/slate.d.ts.map +1 -0
- package/dist/theme/presets/slate.js +56 -0
- package/dist/theme/presets/tactical.d.ts +8 -0
- package/dist/theme/presets/tactical.d.ts.map +1 -0
- package/dist/theme/presets/tactical.js +57 -0
- package/dist/theme/presets/types.d.ts +26 -0
- package/dist/theme/presets/types.d.ts.map +1 -0
- package/dist/theme/presets/types.js +1 -0
- package/dist/utils/index.d.ts +1 -22
- package/dist/utils/index.js +1 -1
- package/package.json +4 -52
- package/dist/chunk-3KMDHCAR.js +0 -52
- package/dist/chunk-6BJOYF6E.js +0 -8
- package/dist/chunk-BLO4SISK.js +0 -113
- package/dist/chunk-HUWJXLLF.js +0 -681
- package/dist/chunk-JVAZHVNV.js +0 -110
- package/dist/chunk-JYSYHVLU.js +0 -379
- package/dist/chunk-NE36BUGQ.js +0 -146
- package/dist/chunk-O3PY6B6E.js +0 -749
- package/dist/chunk-OXVOHOP3.js +0 -661
- package/dist/chunk-PSLKGOBZ.js +0 -58
- package/dist/chunk-RJCA5672.js +0 -1664
- package/dist/chunk-TMFCNFLW.js +0 -107
- package/dist/chunk-TN3PU2WK.js +0 -748
- package/dist/chunk-TZPAA4RC.js +0 -1461
- package/dist/chunk-W7ZBF5AA.js +0 -1
- package/dist/chunk-YZ6GTZXL.js +0 -48
- package/dist/components/command-queue/index.css +0 -53
- package/dist/components/command-queue/index.d.ts +0 -204
- package/dist/components/command-queue/index.js +0 -12
- package/dist/components/forms/index.d.ts +0 -56
- package/dist/components/forms/index.js +0 -2
- package/dist/components/index.css +0 -443
- package/dist/components/monitoring/index.d.ts +0 -66
- package/dist/components/monitoring/index.js +0 -2
- package/dist/components/notifications/index.d.ts +0 -52
- package/dist/components/notifications/index.js +0 -5
- package/dist/components/resource-definition/index.css +0 -388
- package/dist/components/resource-definition/index.d.ts +0 -301
- package/dist/components/resource-definition/index.js +0 -3
- package/dist/display/index.css +0 -53
- package/dist/display/index.d.ts +0 -606
- package/dist/display/index.js +0 -7
- package/dist/execution/index.css +0 -388
- package/dist/provider/index.css +0 -61
- package/dist/{chunk-TYV5NJV2.js → chunk-BUZONXAW.js} +0 -0
- package/dist/{chunk-UMXDDEAG.js → chunk-SFF5MJEI.js} +1 -1
- /package/dist/{chunk-NXHL23JW.js → chunk-XXDDMASA.js} +0 -0
package/dist/chunk-JVAZHVNV.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-4VGWQ5AN.js';
|
|
2
|
-
import { notifications } from '@mantine/notifications';
|
|
3
|
-
import { IconUser, IconExternalLink, IconPlug, IconBolt, IconGitBranch, IconBrain } from '@tabler/icons-react';
|
|
4
|
-
|
|
5
|
-
var showInfoNotification = (message) => {
|
|
6
|
-
notifications.show({
|
|
7
|
-
title: "Info",
|
|
8
|
-
message,
|
|
9
|
-
autoClose: 5e3,
|
|
10
|
-
color: "blue",
|
|
11
|
-
position: "top-right"
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
var showSuccessNotification = (message) => {
|
|
15
|
-
notifications.show({
|
|
16
|
-
title: "Action Successful",
|
|
17
|
-
message,
|
|
18
|
-
autoClose: 5e3,
|
|
19
|
-
color: "green",
|
|
20
|
-
position: "top-right"
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var showErrorNotification = (error) => {
|
|
24
|
-
if (error instanceof Error) {
|
|
25
|
-
error = error.message;
|
|
26
|
-
}
|
|
27
|
-
notifications.show({
|
|
28
|
-
title: "Action Failed",
|
|
29
|
-
message: error,
|
|
30
|
-
autoClose: 5e3,
|
|
31
|
-
color: "red",
|
|
32
|
-
position: "top-right"
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
var showWarningNotification = (message) => {
|
|
36
|
-
notifications.show({
|
|
37
|
-
title: "Warning",
|
|
38
|
-
message,
|
|
39
|
-
autoClose: 5e3,
|
|
40
|
-
color: "orange",
|
|
41
|
-
position: "top-right"
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var showApiErrorNotification = (error) => {
|
|
45
|
-
const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
|
|
46
|
-
notifications.show({
|
|
47
|
-
title: getErrorTitle(code),
|
|
48
|
-
message: formatErrorMessage(message, requestId, fields, retryAfter),
|
|
49
|
-
autoClose: retryAfter ? retryAfter * 1e3 : 5e3,
|
|
50
|
-
color: "red",
|
|
51
|
-
position: "top-right"
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// src/utils/formatDate.ts
|
|
56
|
-
var formatDate = (dateString) => {
|
|
57
|
-
const date = new Date(dateString);
|
|
58
|
-
return date.toLocaleDateString("en-US", {
|
|
59
|
-
year: "numeric",
|
|
60
|
-
month: "long",
|
|
61
|
-
day: "numeric",
|
|
62
|
-
hour: "2-digit",
|
|
63
|
-
minute: "2-digit"
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// src/utils/validateEmail.ts
|
|
68
|
-
var validateEmail = (email) => {
|
|
69
|
-
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/.test(email);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// ../core/src/platform/registry/resource-metadata.ts
|
|
73
|
-
var resourceTypeIconNames = {
|
|
74
|
-
agent: "IconBrain",
|
|
75
|
-
workflow: "IconGitBranch",
|
|
76
|
-
trigger: "IconBolt",
|
|
77
|
-
integration: "IconPlug",
|
|
78
|
-
external: "IconExternalLink",
|
|
79
|
-
human: "IconUser"
|
|
80
|
-
};
|
|
81
|
-
var resourceTypeColors = {
|
|
82
|
-
agent: "violet",
|
|
83
|
-
workflow: "blue",
|
|
84
|
-
trigger: "orange",
|
|
85
|
-
integration: "teal",
|
|
86
|
-
external: "gray",
|
|
87
|
-
human: "yellow"
|
|
88
|
-
};
|
|
89
|
-
function getResourceIconName(type) {
|
|
90
|
-
return resourceTypeIconNames[type];
|
|
91
|
-
}
|
|
92
|
-
function getResourceColor(type) {
|
|
93
|
-
return resourceTypeColors[type];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// src/utils/resource-icons.tsx
|
|
97
|
-
var iconNameToComponent = {
|
|
98
|
-
IconBrain,
|
|
99
|
-
IconGitBranch,
|
|
100
|
-
IconBolt,
|
|
101
|
-
IconPlug,
|
|
102
|
-
IconExternalLink,
|
|
103
|
-
IconUser
|
|
104
|
-
};
|
|
105
|
-
function getResourceIcon(type) {
|
|
106
|
-
const iconName = getResourceIconName(type);
|
|
107
|
-
return iconNameToComponent[iconName];
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export { formatDate, getResourceColor, getResourceIcon, showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, validateEmail };
|
package/dist/chunk-JYSYHVLU.js
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
import { useSubmitAction, useDeleteTask } from './chunk-NXHL23JW.js';
|
|
2
|
-
import { FormFieldRenderer } from './chunk-PSLKGOBZ.js';
|
|
3
|
-
import { ContextViewer, JsonViewer } from './chunk-O3PY6B6E.js';
|
|
4
|
-
import { getErrorInfo, formatErrorMessage } from './chunk-4VGWQ5AN.js';
|
|
5
|
-
import { Modal, Stack, Title, Text, Textarea, Alert, Group, Button, Card, ThemeIcon, Badge, Loader, Menu, ActionIcon, Accordion } from '@mantine/core';
|
|
6
|
-
import { IconMail, IconSend, IconFileText, IconClock, IconArrowUp, IconMessageCircle, IconRocket, IconEye, IconEdit, IconAlertTriangle, IconRefresh, IconX, IconCheck, IconAlertCircle, IconRobot, IconGitBranch, IconDotsVertical, IconTrash, IconPlayerPlay, IconExternalLink } from '@tabler/icons-react';
|
|
7
|
-
import { useState } from 'react';
|
|
8
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
-
import { useForm } from '@mantine/form';
|
|
10
|
-
|
|
11
|
-
var CustomModal = ({ children, opened, onClose, loading, style, size }) => {
|
|
12
|
-
const canClose = loading === true ? false : true;
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
Modal,
|
|
15
|
-
{
|
|
16
|
-
opened,
|
|
17
|
-
onClose,
|
|
18
|
-
padding: "xs",
|
|
19
|
-
withCloseButton: false,
|
|
20
|
-
closeOnClickOutside: canClose,
|
|
21
|
-
closeOnEscape: canClose,
|
|
22
|
-
centered: true,
|
|
23
|
-
style,
|
|
24
|
-
size,
|
|
25
|
-
children
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
var iconMap = {
|
|
30
|
-
IconCheck,
|
|
31
|
-
IconX,
|
|
32
|
-
IconRefresh,
|
|
33
|
-
IconAlertTriangle,
|
|
34
|
-
IconEdit,
|
|
35
|
-
IconEye,
|
|
36
|
-
IconRocket,
|
|
37
|
-
IconMessageCircle,
|
|
38
|
-
IconArrowUp,
|
|
39
|
-
IconClock,
|
|
40
|
-
IconFileText,
|
|
41
|
-
IconSend,
|
|
42
|
-
IconMail
|
|
43
|
-
};
|
|
44
|
-
function getIcon(iconName) {
|
|
45
|
-
if (!iconName) return null;
|
|
46
|
-
const icon = iconMap[iconName];
|
|
47
|
-
if (!icon && process.env.NODE_ENV !== "production") {
|
|
48
|
-
console.warn(`[iconMap] Unknown icon "${iconName}". Allowed: ${Object.keys(iconMap).join(", ")}`);
|
|
49
|
-
}
|
|
50
|
-
return icon || null;
|
|
51
|
-
}
|
|
52
|
-
function resolveDefaultValue(context, path) {
|
|
53
|
-
if (!context || typeof context !== "object") return void 0;
|
|
54
|
-
return path.split(".").reduce((obj, key) => {
|
|
55
|
-
if (obj && typeof obj === "object" && key in obj) {
|
|
56
|
-
return obj[key];
|
|
57
|
-
}
|
|
58
|
-
return void 0;
|
|
59
|
-
}, context);
|
|
60
|
-
}
|
|
61
|
-
function ActionModal({
|
|
62
|
-
action,
|
|
63
|
-
task,
|
|
64
|
-
opened,
|
|
65
|
-
onClose,
|
|
66
|
-
onSubmit,
|
|
67
|
-
richTextRenderer,
|
|
68
|
-
error,
|
|
69
|
-
isPending
|
|
70
|
-
}) {
|
|
71
|
-
const getInitialValuesFromContext = () => {
|
|
72
|
-
if (!action.form?.fields) return {};
|
|
73
|
-
return action.form.fields.reduce(
|
|
74
|
-
(acc, field) => {
|
|
75
|
-
if (field.defaultValueFromContext && task?.context) {
|
|
76
|
-
const value = resolveDefaultValue(task.context, field.defaultValueFromContext);
|
|
77
|
-
if (value !== void 0) {
|
|
78
|
-
acc[field.name] = value;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return acc;
|
|
82
|
-
},
|
|
83
|
-
{}
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
const form = useForm({
|
|
87
|
-
initialValues: {
|
|
88
|
-
...getInitialValuesFromContext(),
|
|
89
|
-
...action.payloadTemplate || {},
|
|
90
|
-
notes: ""
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
const handleSubmit = form.onSubmit((values) => {
|
|
94
|
-
const { notes, ...payload } = values;
|
|
95
|
-
onSubmit(payload, notes || void 0);
|
|
96
|
-
});
|
|
97
|
-
const Icon = getIcon(action.icon);
|
|
98
|
-
const errorMessage = error ? (() => {
|
|
99
|
-
const { message, fields, requestId } = getErrorInfo(error);
|
|
100
|
-
return formatErrorMessage(message, requestId, fields);
|
|
101
|
-
})() : null;
|
|
102
|
-
if (!action.form) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
return /* @__PURE__ */ jsx(CustomModal, { opened, onClose, size: "xl", children: /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
106
|
-
/* @__PURE__ */ jsx(Title, { order: 3, children: action.form.title || action.label }),
|
|
107
|
-
action.form.description && /* @__PURE__ */ jsx(Text, { c: "dimmed", children: action.form.description }),
|
|
108
|
-
action.form.fields.map((field) => /* @__PURE__ */ jsx(FormFieldRenderer, { field, form, richTextRenderer }, field.name)),
|
|
109
|
-
/* @__PURE__ */ jsx(
|
|
110
|
-
Textarea,
|
|
111
|
-
{
|
|
112
|
-
label: "Notes (optional)",
|
|
113
|
-
placeholder: "Add any notes or reasoning...",
|
|
114
|
-
...form.getInputProps("notes")
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
errorMessage && /* @__PURE__ */ jsx(Alert, { color: "red", variant: "light", icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), title: "Submission failed", children: /* @__PURE__ */ jsx(Text, { size: "sm", style: { whiteSpace: "pre-line" }, children: errorMessage }) }),
|
|
118
|
-
/* @__PURE__ */ jsxs(Group, { mt: "md", justify: "space-between", children: [
|
|
119
|
-
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: onClose, children: "Cancel" }),
|
|
120
|
-
/* @__PURE__ */ jsx(
|
|
121
|
-
Button,
|
|
122
|
-
{
|
|
123
|
-
type: "submit",
|
|
124
|
-
color: action.color || "blue",
|
|
125
|
-
leftSection: Icon ? /* @__PURE__ */ jsx(Icon, { size: 16 }) : null,
|
|
126
|
-
loading: isPending,
|
|
127
|
-
children: action.label
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
] })
|
|
131
|
-
] }) }) });
|
|
132
|
-
}
|
|
133
|
-
function TaskCard({ task, onViewExecution, richTextRenderer }) {
|
|
134
|
-
const [isExpanded, setIsExpanded] = useState(false);
|
|
135
|
-
const { mutate: submitAction, isPending } = useSubmitAction();
|
|
136
|
-
const { mutate: deleteTask, isPending: isDeleting } = useDeleteTask();
|
|
137
|
-
const [actionModalOpened, setActionModalOpened] = useState(false);
|
|
138
|
-
const [selectedAction, setSelectedAction] = useState(null);
|
|
139
|
-
const [confirmAction, setConfirmAction] = useState(null);
|
|
140
|
-
const [deleteConfirmOpened, setDeleteConfirmOpened] = useState(false);
|
|
141
|
-
const handleActionClick = (action) => {
|
|
142
|
-
if (action.requiresConfirmation) {
|
|
143
|
-
setConfirmAction(action);
|
|
144
|
-
} else if (action.form) {
|
|
145
|
-
setSelectedAction(action);
|
|
146
|
-
setActionModalOpened(true);
|
|
147
|
-
} else {
|
|
148
|
-
submitAction({
|
|
149
|
-
taskId: task.id,
|
|
150
|
-
actionId: action.id
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
const handleConfirm = () => {
|
|
155
|
-
if (!confirmAction) return;
|
|
156
|
-
if (confirmAction.form) {
|
|
157
|
-
setSelectedAction(confirmAction);
|
|
158
|
-
setActionModalOpened(true);
|
|
159
|
-
} else {
|
|
160
|
-
submitAction({
|
|
161
|
-
taskId: task.id,
|
|
162
|
-
actionId: confirmAction.id
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
setConfirmAction(null);
|
|
166
|
-
};
|
|
167
|
-
const getPriorityColor = (priority) => {
|
|
168
|
-
if (priority >= 8) return "red";
|
|
169
|
-
if (priority >= 5) return "yellow";
|
|
170
|
-
return "gray";
|
|
171
|
-
};
|
|
172
|
-
const getStatusColor = (status) => {
|
|
173
|
-
switch (status) {
|
|
174
|
-
case "pending":
|
|
175
|
-
return "blue";
|
|
176
|
-
case "processing":
|
|
177
|
-
return "blue";
|
|
178
|
-
case "completed":
|
|
179
|
-
return "green";
|
|
180
|
-
case "failed":
|
|
181
|
-
return "red";
|
|
182
|
-
case "expired":
|
|
183
|
-
return "orange";
|
|
184
|
-
default:
|
|
185
|
-
return "gray";
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
const handleRetry = () => {
|
|
189
|
-
if (task.selectedAction) {
|
|
190
|
-
submitAction({
|
|
191
|
-
taskId: task.id,
|
|
192
|
-
actionId: task.selectedAction,
|
|
193
|
-
payload: task.actionPayload
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
const formatDate = (date) => {
|
|
198
|
-
const now = /* @__PURE__ */ new Date();
|
|
199
|
-
const diffMs = now.getTime() - date.getTime();
|
|
200
|
-
const diffMins = Math.floor(diffMs / 6e4);
|
|
201
|
-
const diffHours = Math.floor(diffMins / 60);
|
|
202
|
-
const diffDays = Math.floor(diffHours / 24);
|
|
203
|
-
if (diffMins < 60) return `${diffMins}m ago`;
|
|
204
|
-
if (diffHours < 24) return `${diffHours}h ago`;
|
|
205
|
-
return `${diffDays}d ago`;
|
|
206
|
-
};
|
|
207
|
-
return /* @__PURE__ */ jsx(
|
|
208
|
-
Card,
|
|
209
|
-
{
|
|
210
|
-
withBorder: true,
|
|
211
|
-
style: { transition: "box-shadow var(--duration-fast) var(--easing)" },
|
|
212
|
-
onMouseEnter: (e) => {
|
|
213
|
-
e.currentTarget.style.boxShadow = "var(--standard-box-shadow)";
|
|
214
|
-
},
|
|
215
|
-
onMouseLeave: (e) => {
|
|
216
|
-
e.currentTarget.style.boxShadow = "";
|
|
217
|
-
},
|
|
218
|
-
children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
219
|
-
/* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
|
|
220
|
-
/* @__PURE__ */ jsxs(Group, { gap: "sm", style: { flex: 1 }, children: [
|
|
221
|
-
/* @__PURE__ */ jsx(ThemeIcon, { size: "lg", variant: "light", color: task.originResourceType === "agent" ? "blue" : "grape", children: task.originResourceType === "agent" ? /* @__PURE__ */ jsx(IconRobot, { size: 20 }) : /* @__PURE__ */ jsx(IconGitBranch, { size: 20 }) }),
|
|
222
|
-
/* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
|
|
223
|
-
/* @__PURE__ */ jsxs(Group, { gap: "xs", mb: 4, children: [
|
|
224
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, size: "sm", style: { fontFamily: "var(--mantine-font-family-headings)" }, children: task.description || "Task approval required" }),
|
|
225
|
-
/* @__PURE__ */ jsxs(Badge, { size: "xs", variant: "light", color: getPriorityColor(task.priority), radius: "sm", children: [
|
|
226
|
-
"P",
|
|
227
|
-
task.priority
|
|
228
|
-
] })
|
|
229
|
-
] }),
|
|
230
|
-
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
231
|
-
/* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
|
|
232
|
-
task.originResourceType === "agent" ? "Agent" : "Workflow",
|
|
233
|
-
": ",
|
|
234
|
-
task.originResourceId
|
|
235
|
-
] }),
|
|
236
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "\u2022" }),
|
|
237
|
-
/* @__PURE__ */ jsxs(Group, { gap: 4, children: [
|
|
238
|
-
/* @__PURE__ */ jsx(IconClock, { size: 12 }),
|
|
239
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDate(task.createdAt) })
|
|
240
|
-
] })
|
|
241
|
-
] })
|
|
242
|
-
] })
|
|
243
|
-
] }),
|
|
244
|
-
/* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
245
|
-
/* @__PURE__ */ jsx(
|
|
246
|
-
Badge,
|
|
247
|
-
{
|
|
248
|
-
size: "sm",
|
|
249
|
-
variant: "light",
|
|
250
|
-
color: getStatusColor(task.status),
|
|
251
|
-
radius: "sm",
|
|
252
|
-
leftSection: task.status === "processing" ? /* @__PURE__ */ jsx(Loader, { size: 6 }) : void 0,
|
|
253
|
-
children: task.status.charAt(0).toUpperCase() + task.status.slice(1)
|
|
254
|
-
}
|
|
255
|
-
),
|
|
256
|
-
task.status === "failed" && /* @__PURE__ */ jsx(Button, { variant: "light", color: "red", size: "xs", loading: isPending, onClick: handleRetry, children: "Retry" }),
|
|
257
|
-
/* @__PURE__ */ jsxs(Menu, { shadow: "md", position: "bottom-end", offset: 8, children: [
|
|
258
|
-
/* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "gray", size: "sm", children: /* @__PURE__ */ jsx(IconDotsVertical, { size: 16 }) }) }),
|
|
259
|
-
/* @__PURE__ */ jsx(Menu.Dropdown, { children: /* @__PURE__ */ jsx(
|
|
260
|
-
Menu.Item,
|
|
261
|
-
{
|
|
262
|
-
leftSection: /* @__PURE__ */ jsx(IconTrash, { size: 14 }),
|
|
263
|
-
disabled: task.status === "processing",
|
|
264
|
-
onClick: () => setDeleteConfirmOpened(true),
|
|
265
|
-
children: "Delete"
|
|
266
|
-
}
|
|
267
|
-
) })
|
|
268
|
-
] })
|
|
269
|
-
] })
|
|
270
|
-
] }),
|
|
271
|
-
/* @__PURE__ */ jsx(Accordion, { value: isExpanded ? "details" : null, onChange: (value) => setIsExpanded(!!value), children: /* @__PURE__ */ jsxs(Accordion.Item, { value: "details", children: [
|
|
272
|
-
/* @__PURE__ */ jsx(Accordion.Control, { children: /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, children: "View Context" }) }),
|
|
273
|
-
/* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsx(ContextViewer, { data: task.context }) })
|
|
274
|
-
] }) }),
|
|
275
|
-
task.status === "pending" && /* @__PURE__ */ jsx(Group, { gap: "xs", children: task.actions.map((action) => {
|
|
276
|
-
const Icon = getIcon(action.icon);
|
|
277
|
-
const variant = "light";
|
|
278
|
-
return /* @__PURE__ */ jsx(
|
|
279
|
-
Button,
|
|
280
|
-
{
|
|
281
|
-
variant,
|
|
282
|
-
color: action.color || (action.type === "danger" ? "red" : "blue"),
|
|
283
|
-
leftSection: Icon ? /* @__PURE__ */ jsx(Icon, { size: 16 }) : null,
|
|
284
|
-
loading: isPending,
|
|
285
|
-
onClick: () => handleActionClick(action),
|
|
286
|
-
title: action.description,
|
|
287
|
-
size: "xs",
|
|
288
|
-
radius: "xs",
|
|
289
|
-
children: action.label
|
|
290
|
-
},
|
|
291
|
-
action.id
|
|
292
|
-
);
|
|
293
|
-
}) }),
|
|
294
|
-
task.selectedAction && /* @__PURE__ */ jsx(Accordion, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: "submitted", children: [
|
|
295
|
-
/* @__PURE__ */ jsx(Accordion.Control, { children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
296
|
-
/* @__PURE__ */ jsx(ThemeIcon, { size: "sm", variant: "light", color: "green", radius: "xl", children: /* @__PURE__ */ jsx(IconCheck, { size: 12 }) }),
|
|
297
|
-
/* @__PURE__ */ jsxs(Text, { size: "sm", fw: 500, children: [
|
|
298
|
-
"Submitted: ",
|
|
299
|
-
task.actions.find((a) => a.id === task.selectedAction)?.label || task.selectedAction
|
|
300
|
-
] }),
|
|
301
|
-
task.targetExecutionId && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "cyan", leftSection: /* @__PURE__ */ jsx(IconPlayerPlay, { size: 10 }), children: "Executed" })
|
|
302
|
-
] }) }),
|
|
303
|
-
/* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
|
|
304
|
-
task.actionPayload !== void 0 && task.actionPayload !== null && /* @__PURE__ */ jsx(JsonViewer, { data: task.actionPayload, maxHeight: 200 }),
|
|
305
|
-
task.completedAt && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
|
|
306
|
-
"Completed ",
|
|
307
|
-
formatDate(task.completedAt),
|
|
308
|
-
task.completedBy ? ` by ${task.completedBy}` : ""
|
|
309
|
-
] }),
|
|
310
|
-
task.targetExecutionId && /* @__PURE__ */ jsx(
|
|
311
|
-
Button,
|
|
312
|
-
{
|
|
313
|
-
variant: "light",
|
|
314
|
-
size: "xs",
|
|
315
|
-
leftSection: /* @__PURE__ */ jsx(IconExternalLink, { size: 14 }),
|
|
316
|
-
onClick: () => {
|
|
317
|
-
onViewExecution?.({
|
|
318
|
-
resourceType: task.originResourceType,
|
|
319
|
-
resourceId: task.originResourceId,
|
|
320
|
-
executionId: task.targetExecutionId
|
|
321
|
-
});
|
|
322
|
-
},
|
|
323
|
-
children: "View Execution"
|
|
324
|
-
}
|
|
325
|
-
)
|
|
326
|
-
] }) })
|
|
327
|
-
] }) }),
|
|
328
|
-
/* @__PURE__ */ jsx(CustomModal, { opened: !!confirmAction, onClose: () => setConfirmAction(null), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
329
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, children: "Confirm Action" }),
|
|
330
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", children: confirmAction?.confirmationMessage || `Are you sure you want to ${confirmAction?.label.toLowerCase()}?` }),
|
|
331
|
-
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
|
|
332
|
-
/* @__PURE__ */ jsx(Button, { variant: "default", onClick: () => setConfirmAction(null), children: "Cancel" }),
|
|
333
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleConfirm, children: confirmAction?.label })
|
|
334
|
-
] })
|
|
335
|
-
] }) }),
|
|
336
|
-
selectedAction && /* @__PURE__ */ jsx(
|
|
337
|
-
ActionModal,
|
|
338
|
-
{
|
|
339
|
-
action: selectedAction,
|
|
340
|
-
task,
|
|
341
|
-
opened: actionModalOpened,
|
|
342
|
-
onClose: () => setActionModalOpened(false),
|
|
343
|
-
onSubmit: (payload, notes) => {
|
|
344
|
-
submitAction({
|
|
345
|
-
taskId: task.id,
|
|
346
|
-
actionId: selectedAction.id,
|
|
347
|
-
payload,
|
|
348
|
-
notes
|
|
349
|
-
});
|
|
350
|
-
setActionModalOpened(false);
|
|
351
|
-
},
|
|
352
|
-
richTextRenderer
|
|
353
|
-
}
|
|
354
|
-
),
|
|
355
|
-
/* @__PURE__ */ jsx(CustomModal, { opened: deleteConfirmOpened, onClose: () => setDeleteConfirmOpened(false), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
356
|
-
/* @__PURE__ */ jsx(Text, { fw: 600, children: "Delete Task" }),
|
|
357
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", children: "Are you sure you want to delete this task? This action cannot be undone." }),
|
|
358
|
-
/* @__PURE__ */ jsxs(Group, { justify: "flex-end", children: [
|
|
359
|
-
/* @__PURE__ */ jsx(Button, { variant: "default", onClick: () => setDeleteConfirmOpened(false), children: "Cancel" }),
|
|
360
|
-
/* @__PURE__ */ jsx(
|
|
361
|
-
Button,
|
|
362
|
-
{
|
|
363
|
-
color: "red",
|
|
364
|
-
loading: isDeleting,
|
|
365
|
-
onClick: () => {
|
|
366
|
-
deleteTask(task.id);
|
|
367
|
-
setDeleteConfirmOpened(false);
|
|
368
|
-
},
|
|
369
|
-
children: "Delete"
|
|
370
|
-
}
|
|
371
|
-
)
|
|
372
|
-
] })
|
|
373
|
-
] }) })
|
|
374
|
-
] })
|
|
375
|
-
}
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export { ActionModal, CustomModal, TaskCard, getIcon, iconMap };
|
package/dist/chunk-NE36BUGQ.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { formatDuration } from './chunk-6BJOYF6E.js';
|
|
2
|
-
import { Table, Text, Badge, Tooltip, Box, Center, Loader, Stack } from '@mantine/core';
|
|
3
|
-
import { IconFileOff, IconCircle, IconAlertTriangle, IconCircleX, IconCircleCheck } from '@tabler/icons-react';
|
|
4
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
-
import { AreaChart } from '@mantine/charts';
|
|
6
|
-
|
|
7
|
-
function formatStartTime(timestamp) {
|
|
8
|
-
return new Date(timestamp).toLocaleString("en-US", {
|
|
9
|
-
month: "short",
|
|
10
|
-
day: "numeric",
|
|
11
|
-
hour: "numeric",
|
|
12
|
-
minute: "2-digit"
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
function getStatusConfig(status) {
|
|
16
|
-
switch (status) {
|
|
17
|
-
case "running":
|
|
18
|
-
return {
|
|
19
|
-
icon: /* @__PURE__ */ jsx(IconCircle, { size: 14, color: "var(--color-primary)" }),
|
|
20
|
-
label: "Running",
|
|
21
|
-
color: "blue"
|
|
22
|
-
};
|
|
23
|
-
case "completed":
|
|
24
|
-
return {
|
|
25
|
-
icon: /* @__PURE__ */ jsx(IconCircleCheck, { size: 14, color: "var(--color-success)" }),
|
|
26
|
-
label: "Completed",
|
|
27
|
-
color: "green"
|
|
28
|
-
};
|
|
29
|
-
case "failed":
|
|
30
|
-
return {
|
|
31
|
-
icon: /* @__PURE__ */ jsx(IconCircleX, { size: 14, color: "var(--color-error)" }),
|
|
32
|
-
label: "Failed",
|
|
33
|
-
color: "red"
|
|
34
|
-
};
|
|
35
|
-
case "warning":
|
|
36
|
-
return {
|
|
37
|
-
icon: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 14, color: "var(--color-warning)" }),
|
|
38
|
-
label: "Warning",
|
|
39
|
-
color: "yellow"
|
|
40
|
-
};
|
|
41
|
-
case "pending":
|
|
42
|
-
default:
|
|
43
|
-
return {
|
|
44
|
-
icon: /* @__PURE__ */ jsx(IconCircle, { size: 14, color: "var(--mantine-color-gray-6)" }),
|
|
45
|
-
label: "Pending",
|
|
46
|
-
color: "gray"
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function LoadingState() {
|
|
51
|
-
return /* @__PURE__ */ jsx(Center, { py: "xl", children: /* @__PURE__ */ jsx(Loader, { size: "md" }) });
|
|
52
|
-
}
|
|
53
|
-
function EmptyState() {
|
|
54
|
-
return /* @__PURE__ */ jsx(Center, { py: "xl", children: /* @__PURE__ */ jsxs(Stack, { align: "center", gap: "xs", children: [
|
|
55
|
-
/* @__PURE__ */ jsx(IconFileOff, { size: 48, color: "var(--color-text-subtle)" }),
|
|
56
|
-
/* @__PURE__ */ jsx(Text, { size: "lg", fw: 500, c: "dimmed", children: "No executions found" }),
|
|
57
|
-
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Executions will appear here when workflows or agents are run" })
|
|
58
|
-
] }) });
|
|
59
|
-
}
|
|
60
|
-
function ExecutionLogsTable({ executions, isLoading, onRowClick }) {
|
|
61
|
-
const handleRowClick = (execution) => {
|
|
62
|
-
onRowClick?.({
|
|
63
|
-
resourceType: execution.resourceType,
|
|
64
|
-
resourceId: execution.resourceId,
|
|
65
|
-
executionId: execution.id
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
return /* @__PURE__ */ jsxs(Table, { highlightOnHover: true, children: [
|
|
69
|
-
/* @__PURE__ */ jsx(Table.Thead, { children: /* @__PURE__ */ jsxs(Table.Tr, { children: [
|
|
70
|
-
/* @__PURE__ */ jsx(Table.Th, { children: "Resource" }),
|
|
71
|
-
/* @__PURE__ */ jsx(Table.Th, { children: "Status" }),
|
|
72
|
-
/* @__PURE__ */ jsx(Table.Th, { children: "Started" }),
|
|
73
|
-
/* @__PURE__ */ jsx(Table.Th, { ta: "right", children: "Duration" }),
|
|
74
|
-
/* @__PURE__ */ jsx(Table.Th, { ta: "center", children: "Env" }),
|
|
75
|
-
/* @__PURE__ */ jsx(Table.Th, { ta: "center", children: "Version" })
|
|
76
|
-
] }) }),
|
|
77
|
-
/* @__PURE__ */ jsx(Table.Tbody, { children: isLoading ? /* @__PURE__ */ jsx(Table.Tr, { children: /* @__PURE__ */ jsx(Table.Td, { colSpan: 6, children: /* @__PURE__ */ jsx(LoadingState, {}) }) }) : executions.length === 0 ? /* @__PURE__ */ jsx(Table.Tr, { children: /* @__PURE__ */ jsx(Table.Td, { colSpan: 6, children: /* @__PURE__ */ jsx(EmptyState, {}) }) }) : executions.map((execution) => {
|
|
78
|
-
const statusConfig = getStatusConfig(execution.status);
|
|
79
|
-
return /* @__PURE__ */ jsxs(
|
|
80
|
-
Table.Tr,
|
|
81
|
-
{
|
|
82
|
-
style: { cursor: onRowClick ? "pointer" : void 0 },
|
|
83
|
-
onClick: () => handleRowClick(execution),
|
|
84
|
-
children: [
|
|
85
|
-
/* @__PURE__ */ jsx(Table.Td, { style: { maxWidth: 200 }, children: /* @__PURE__ */ jsx(Text, { size: "sm", lineClamp: 1, title: execution.resourceName, children: execution.resourceName }) }),
|
|
86
|
-
/* @__PURE__ */ jsx(Table.Td, { children: /* @__PURE__ */ jsx(Badge, { color: statusConfig.color, variant: "light", size: "sm", leftSection: statusConfig.icon, children: statusConfig.label }) }),
|
|
87
|
-
/* @__PURE__ */ jsx(Table.Td, { style: { whiteSpace: "nowrap" }, children: /* @__PURE__ */ jsx(Text, { size: "sm", children: formatStartTime(execution.startTime) }) }),
|
|
88
|
-
/* @__PURE__ */ jsx(Table.Td, { ta: "right", children: /* @__PURE__ */ jsx(Text, { size: "sm", c: execution.status === "running" ? "dimmed" : void 0, children: formatDuration(execution.duration) }) }),
|
|
89
|
-
/* @__PURE__ */ jsx(Table.Td, { ta: "center", children: /* @__PURE__ */ jsx(Badge, { color: execution.resourceStatus === "prod" ? "green" : "gray", variant: "light", size: "sm", children: execution.resourceStatus.toUpperCase() }) }),
|
|
90
|
-
/* @__PURE__ */ jsx(Table.Td, { ta: "center", children: /* @__PURE__ */ jsx(
|
|
91
|
-
Tooltip,
|
|
92
|
-
{
|
|
93
|
-
label: `Resource: ${execution.resourceVersion ?? "-"}
|
|
94
|
-
API: ${execution.apiVersion ?? "-"}
|
|
95
|
-
SDK: ${execution.sdkVersion ?? "-"}`,
|
|
96
|
-
multiline: true,
|
|
97
|
-
position: "left",
|
|
98
|
-
children: /* @__PURE__ */ jsx(Text, { size: "sm", ff: "monospace", c: "dimmed", style: { cursor: "help" }, children: execution.resourceVersion ?? "-" })
|
|
99
|
-
}
|
|
100
|
-
) })
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
execution.id
|
|
104
|
-
);
|
|
105
|
-
}) })
|
|
106
|
-
] });
|
|
107
|
-
}
|
|
108
|
-
function getHealthColor(successRate, hasExecutions = true) {
|
|
109
|
-
if (!hasExecutions) return "var(--mantine-color-gray-6)";
|
|
110
|
-
if (successRate >= 95) return "var(--color-success)";
|
|
111
|
-
if (successRate >= 80) return "var(--color-warning)";
|
|
112
|
-
return "var(--color-error)";
|
|
113
|
-
}
|
|
114
|
-
function ResourceHealthChart({
|
|
115
|
-
healthData,
|
|
116
|
-
hasExecutions = true,
|
|
117
|
-
width = 300,
|
|
118
|
-
height = 60
|
|
119
|
-
}) {
|
|
120
|
-
if (!healthData || healthData.trendData.length === 0) {
|
|
121
|
-
return /* @__PURE__ */ jsx(Box, { w: width, h: height, style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No activity" }) });
|
|
122
|
-
}
|
|
123
|
-
const chartData = healthData.trendData.map((d) => ({
|
|
124
|
-
time: d.time,
|
|
125
|
-
rate: d.rate
|
|
126
|
-
}));
|
|
127
|
-
const chartColor = getHealthColor(healthData.summary.successRate, hasExecutions);
|
|
128
|
-
return /* @__PURE__ */ jsx(Box, { w: width, h: height, children: /* @__PURE__ */ jsx(
|
|
129
|
-
AreaChart,
|
|
130
|
-
{
|
|
131
|
-
h: height,
|
|
132
|
-
data: chartData,
|
|
133
|
-
dataKey: "time",
|
|
134
|
-
series: [{ name: "rate", color: chartColor }],
|
|
135
|
-
curveType: "monotone",
|
|
136
|
-
withDots: false,
|
|
137
|
-
withTooltip: false,
|
|
138
|
-
withXAxis: false,
|
|
139
|
-
withYAxis: false,
|
|
140
|
-
fillOpacity: 0.2,
|
|
141
|
-
gridAxis: "none"
|
|
142
|
-
}
|
|
143
|
-
) });
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export { ExecutionLogsTable, ResourceHealthChart, getHealthColor };
|