@nvent-addon/app 0.4.5 → 0.5.1
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/module.d.mts +19 -1
- package/dist/module.mjs +20 -8
- package/dist/runtime/app/components/{nhealth/component-router.d.vue.ts → ComponentRouter.d.vue.ts} +1 -5
- package/dist/runtime/app/components/{nhealth/component-router.vue.d.ts → ComponentRouter.vue.d.ts} +1 -5
- package/dist/runtime/app/components/{nhealth/component-shell.d.vue.ts → ComponentShell.d.vue.ts} +4 -9
- package/dist/runtime/app/components/ComponentShell.vue +87 -0
- package/dist/runtime/app/components/{nhealth/component-shell.vue.d.ts → ComponentShell.vue.d.ts} +4 -9
- package/dist/runtime/app/components/ConfirmDialog.d.vue.ts +1 -6
- package/dist/runtime/app/components/ConfirmDialog.vue.d.ts +1 -6
- package/dist/runtime/app/components/ListItem.d.vue.ts +3 -6
- package/dist/runtime/app/components/ListItem.vue.d.ts +3 -6
- package/dist/runtime/app/components/LiveIndicator.d.vue.ts +7 -0
- package/dist/runtime/app/components/LiveIndicator.vue +30 -0
- package/dist/runtime/app/components/LiveIndicator.vue.d.ts +7 -0
- package/dist/runtime/app/components/{QueueConfigDetails.d.vue.ts → QueueConfiguration.d.vue.ts} +1 -10
- package/dist/runtime/app/components/QueueConfiguration.vue +387 -0
- package/dist/runtime/app/components/{QueueConfigDetails.vue.d.ts → QueueConfiguration.vue.d.ts} +1 -10
- package/dist/runtime/app/components/StatCard.d.vue.ts +9 -0
- package/dist/runtime/app/components/StatCard.vue +57 -0
- package/dist/runtime/app/components/StatCard.vue.d.ts +9 -0
- package/dist/runtime/app/components/TimelineList.vue +67 -0
- package/dist/runtime/app/components/flow/AwaitNode.d.vue.ts +18 -0
- package/dist/runtime/app/components/flow/AwaitNode.vue +91 -0
- package/dist/runtime/app/components/flow/AwaitNode.vue.d.ts +18 -0
- package/dist/runtime/app/components/{FlowDiagram.d.vue.ts → flow/Diagram.d.vue.ts} +12 -1
- package/dist/runtime/app/components/{FlowDiagram.vue → flow/Diagram.vue} +92 -11
- package/dist/runtime/app/components/{FlowDiagram.vue.d.ts → flow/Diagram.vue.d.ts} +12 -1
- package/dist/runtime/app/components/{FlowRunOverview.d.vue.ts → flow/RunOverview.d.vue.ts} +3 -0
- package/dist/runtime/app/components/{FlowRunOverview.vue → flow/RunOverview.vue} +94 -8
- package/dist/runtime/app/components/{FlowRunOverview.vue.d.ts → flow/RunOverview.vue.d.ts} +3 -0
- package/dist/runtime/app/components/{FlowRunStatusBadge.d.vue.ts → flow/RunStatusBadge.d.vue.ts} +2 -8
- package/dist/runtime/app/components/{FlowRunStatusBadge.vue → flow/RunStatusBadge.vue} +8 -1
- package/dist/runtime/app/components/{FlowRunStatusBadge.vue.d.ts → flow/RunStatusBadge.vue.d.ts} +2 -8
- package/dist/runtime/app/components/{FlowRunTimeline.vue → flow/RunTimeline.vue} +1 -1
- package/dist/runtime/app/components/{FlowStepSelector.d.vue.ts → flow/StepSelector.d.vue.ts} +1 -0
- package/dist/runtime/app/components/flow/StepSelector.vue +553 -0
- package/dist/runtime/app/components/{FlowStepSelector.vue.d.ts → flow/StepSelector.vue.d.ts} +1 -0
- package/dist/runtime/app/components/trigger/BasicInfoCard.d.vue.ts +33 -0
- package/dist/runtime/app/components/trigger/BasicInfoCard.vue +168 -0
- package/dist/runtime/app/components/trigger/BasicInfoCard.vue.d.ts +33 -0
- package/dist/runtime/app/components/{FlowSchedulesList.d.vue.ts → trigger/DangerZone.d.vue.ts} +4 -6
- package/dist/runtime/app/components/trigger/DangerZone.vue +46 -0
- package/dist/runtime/app/components/{FlowSchedulesList.vue.d.ts → trigger/DangerZone.vue.d.ts} +4 -6
- package/dist/runtime/app/components/trigger/EditHeader.d.vue.ts +15 -0
- package/dist/runtime/app/components/trigger/EditHeader.vue +55 -0
- package/dist/runtime/app/components/trigger/EditHeader.vue.d.ts +15 -0
- package/dist/runtime/app/components/trigger/EventConfig.d.vue.ts +24 -0
- package/dist/runtime/app/components/trigger/EventConfig.vue +68 -0
- package/dist/runtime/app/components/trigger/EventConfig.vue.d.ts +24 -0
- package/dist/runtime/app/components/trigger/FlowSubscriptions.d.vue.ts +14 -0
- package/dist/runtime/app/components/trigger/FlowSubscriptions.vue +128 -0
- package/dist/runtime/app/components/trigger/FlowSubscriptions.vue.d.ts +14 -0
- package/dist/runtime/app/components/trigger/ScheduleConfig.d.vue.ts +27 -0
- package/dist/runtime/app/components/trigger/ScheduleConfig.vue +375 -0
- package/dist/runtime/app/components/trigger/ScheduleConfig.vue.d.ts +27 -0
- package/dist/runtime/app/components/{FlowScheduleDialog.d.vue.ts → trigger/StatusConfig.d.vue.ts} +6 -6
- package/dist/runtime/app/components/trigger/StatusConfig.vue +78 -0
- package/dist/runtime/app/components/{FlowScheduleDialog.vue.d.ts → trigger/StatusConfig.vue.d.ts} +6 -6
- package/dist/runtime/app/components/trigger/WebhookConfig.d.vue.ts +30 -0
- package/dist/runtime/app/components/trigger/WebhookConfig.vue +97 -0
- package/dist/runtime/app/components/trigger/WebhookConfig.vue.d.ts +30 -0
- package/dist/runtime/app/composables/useAnalyzedFlows.d.ts +5 -0
- package/dist/runtime/app/composables/useAnalyzedFlows.js +15 -1
- package/dist/runtime/app/composables/useComponentRouter.d.ts +8 -0
- package/dist/runtime/app/composables/useComponentRouter.js +10 -2
- package/dist/runtime/app/composables/useFlowRunsInfinite.d.ts +1 -1
- package/dist/runtime/app/composables/useFlowState.js +65 -0
- package/dist/runtime/app/composables/useFlowWebSocket.d.ts +11 -2
- package/dist/runtime/app/composables/useFlowWebSocket.js +181 -65
- package/dist/runtime/app/composables/useQueueJobs.d.ts +12 -1
- package/dist/runtime/app/composables/useQueueJobs.js +13 -7
- package/dist/runtime/app/composables/useTrigger.d.ts +137 -0
- package/dist/runtime/app/composables/useTrigger.js +116 -0
- package/dist/runtime/app/composables/useTriggerWebSocket.d.ts +35 -0
- package/dist/runtime/app/composables/useTriggerWebSocket.js +333 -0
- package/dist/runtime/app/pages/dashboard.d.vue.ts +3 -0
- package/dist/runtime/app/pages/dashboard.vue +738 -0
- package/dist/runtime/app/pages/dashboard.vue.d.ts +3 -0
- package/dist/runtime/app/pages/flows/[name].d.vue.ts +3 -0
- package/dist/runtime/app/pages/flows/[name].vue +680 -0
- package/dist/runtime/app/pages/flows/[name].vue.d.ts +3 -0
- package/dist/runtime/app/pages/flows/index.vue +321 -620
- package/dist/runtime/app/pages/index.vue +39 -9
- package/dist/runtime/app/pages/queues/index.vue +202 -194
- package/dist/runtime/app/pages/queues/jobs.vue +534 -207
- package/dist/runtime/app/pages/settings/scheduler.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/scheduler.vue +310 -0
- package/dist/runtime/app/pages/settings/scheduler.vue.d.ts +3 -0
- package/dist/runtime/app/pages/triggers/[name]/edit.d.vue.ts +3 -0
- package/dist/runtime/app/pages/triggers/[name]/edit.vue +429 -0
- package/dist/runtime/app/pages/triggers/[name]/edit.vue.d.ts +3 -0
- package/dist/runtime/app/pages/triggers/[name].d.vue.ts +3 -0
- package/dist/runtime/app/pages/triggers/[name].vue +898 -0
- package/dist/runtime/app/pages/triggers/[name].vue.d.ts +3 -0
- package/dist/runtime/app/pages/triggers/index.d.vue.ts +3 -0
- package/dist/runtime/app/pages/triggers/index.vue +528 -0
- package/dist/runtime/app/pages/triggers/index.vue.d.ts +3 -0
- package/dist/runtime/app/pages/triggers/new.d.vue.ts +3 -0
- package/dist/runtime/app/pages/triggers/new.vue +610 -0
- package/dist/runtime/app/pages/triggers/new.vue.d.ts +3 -0
- package/dist/runtime/server/api/_flows/[name]/clear-history.delete.d.ts +10 -0
- package/dist/runtime/server/api/_flows/[name]/clear-history.delete.js +49 -0
- package/dist/runtime/server/api/_flows/[name]/runs/[runId]/cancel.post.d.ts +2 -0
- package/dist/runtime/server/api/_flows/[name]/runs/[runId]/cancel.post.js +21 -0
- package/dist/runtime/server/api/_flows/[name]/runs.get.d.ts +17 -0
- package/dist/runtime/server/api/_flows/[name]/runs.get.js +64 -0
- package/dist/runtime/server/api/_flows/[name]/start.post.d.ts +2 -0
- package/dist/runtime/server/api/_flows/[name]/start.post.js +9 -0
- package/dist/runtime/server/api/_flows/index.get.d.ts +7 -0
- package/dist/runtime/server/api/_flows/index.get.js +5 -0
- package/dist/runtime/server/api/_flows/recent-runs.get.d.ts +15 -0
- package/dist/runtime/server/api/_flows/recent-runs.get.js +67 -0
- package/dist/runtime/server/api/_flows/ws.d.ts +80 -0
- package/dist/runtime/server/api/_flows/ws.js +309 -0
- package/dist/runtime/server/api/_queues/[name]/job/[id].get.d.ts +2 -0
- package/dist/runtime/server/api/_queues/[name]/job/[id].get.js +14 -0
- package/dist/runtime/server/api/_queues/[name]/job/index.get.d.ts +2 -0
- package/dist/runtime/server/api/_queues/[name]/job/index.get.js +39 -0
- package/dist/runtime/server/api/_queues/index.get.d.ts +2 -0
- package/dist/runtime/server/api/_queues/index.get.js +106 -0
- package/dist/runtime/server/api/_queues/ws.d.ts +48 -0
- package/dist/runtime/server/api/_queues/ws.js +215 -0
- package/dist/runtime/server/api/_scheduler/jobs.get.d.ts +19 -0
- package/dist/runtime/server/api/_scheduler/jobs.get.js +36 -0
- package/dist/runtime/server/api/_triggers/[name]/events.get.d.ts +6 -0
- package/dist/runtime/server/api/_triggers/[name]/events.get.js +43 -0
- package/dist/runtime/server/api/_triggers/[name]/index.get.d.ts +6 -0
- package/dist/runtime/server/api/_triggers/[name]/index.get.js +76 -0
- package/dist/runtime/server/api/_triggers/[name].delete.d.ts +7 -0
- package/dist/runtime/server/api/_triggers/[name].delete.js +37 -0
- package/dist/runtime/server/api/_triggers/[name].patch.d.ts +7 -0
- package/dist/runtime/server/api/_triggers/[name].patch.js +117 -0
- package/dist/runtime/server/api/_triggers/index.get.d.ts +6 -0
- package/dist/runtime/server/api/_triggers/index.get.js +44 -0
- package/dist/runtime/server/api/_triggers/index.post.d.ts +7 -0
- package/dist/runtime/server/api/_triggers/index.post.js +124 -0
- package/dist/runtime/server/api/_triggers/stats.get.d.ts +6 -0
- package/dist/runtime/server/api/_triggers/stats.get.js +41 -0
- package/dist/runtime/server/api/_triggers/ws.d.ts +74 -0
- package/dist/runtime/server/api/_triggers/ws.js +315 -0
- package/dist/runtime/server/tsconfig.json +7 -0
- package/package.json +8 -8
- package/dist/runtime/app/components/FlowScheduleDialog.vue +0 -226
- package/dist/runtime/app/components/FlowSchedulesList.vue +0 -99
- package/dist/runtime/app/components/FlowStepSelector.vue +0 -238
- package/dist/runtime/app/components/QueueConfigDetails.vue +0 -412
- package/dist/runtime/app/components/nhealth/component-shell.vue +0 -89
- /package/dist/runtime/app/components/{nhealth/component-router.vue → ComponentRouter.vue} +0 -0
- /package/dist/runtime/app/components/{FlowNodeCard.d.vue.ts → flow/NodeCard.d.vue.ts} +0 -0
- /package/dist/runtime/app/components/{FlowNodeCard.vue → flow/NodeCard.vue} +0 -0
- /package/dist/runtime/app/components/{FlowNodeCard.vue.d.ts → flow/NodeCard.vue.d.ts} +0 -0
- /package/dist/runtime/app/components/{FlowRunTimeline.d.vue.ts → flow/RunTimeline.d.vue.ts} +0 -0
- /package/dist/runtime/app/components/{FlowRunTimeline.vue.d.ts → flow/RunTimeline.vue.d.ts} +0 -0
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="ui.root">
|
|
3
|
+
<component
|
|
4
|
+
:is="item.clickable !== false ? 'button' : 'div'"
|
|
5
|
+
v-for="item in items"
|
|
6
|
+
:key="item.value"
|
|
7
|
+
:type="item.clickable !== false ? 'button' : void 0"
|
|
8
|
+
:class="itemClasses(item)"
|
|
9
|
+
@click="item.clickable !== false ? $emit('update:modelValue', item.value) : void 0"
|
|
10
|
+
>
|
|
11
|
+
<!-- Status Icon or All Icon -->
|
|
12
|
+
<div
|
|
13
|
+
class="flex-shrink-0"
|
|
14
|
+
:class="item.step.showAllIndicator ? '' : 'mt-0.5'"
|
|
15
|
+
>
|
|
16
|
+
<div
|
|
17
|
+
v-if="item.step.showAllIndicator"
|
|
18
|
+
class="w-6 h-6 rounded-full flex items-center justify-center bg-gray-100 dark:bg-gray-800"
|
|
19
|
+
>
|
|
20
|
+
<UIcon
|
|
21
|
+
name="i-lucide-layers"
|
|
22
|
+
class="w-3 h-3 text-gray-600 dark:text-gray-400"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
<div
|
|
26
|
+
v-else
|
|
27
|
+
class="w-8 h-8 rounded-full flex items-center justify-center"
|
|
28
|
+
:class="getStepStatusBg(item.step.status)"
|
|
29
|
+
>
|
|
30
|
+
<UIcon
|
|
31
|
+
:name="getStepStatusIcon(item.step.status)"
|
|
32
|
+
class="w-4 h-4"
|
|
33
|
+
:class="getStepStatusIconColor(item.step.status)"
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- Step Details -->
|
|
39
|
+
<div class="flex-1 min-w-0 ml-3">
|
|
40
|
+
<div class="flex items-center gap-2">
|
|
41
|
+
<h4 class="text-sm font-medium text-gray-900 dark:text-gray-100">
|
|
42
|
+
{{ getStepDisplayName(item.step.key) }}
|
|
43
|
+
</h4>
|
|
44
|
+
<!-- Await Badge with Type Icon -->
|
|
45
|
+
<UBadge
|
|
46
|
+
v-if="isAwaitStep(item.step.key)"
|
|
47
|
+
size="xs"
|
|
48
|
+
:color="getAwaitBadgeColor(item.step.status)"
|
|
49
|
+
variant="subtle"
|
|
50
|
+
class="flex items-center gap-1"
|
|
51
|
+
>
|
|
52
|
+
<UIcon
|
|
53
|
+
:name="getAwaitTypeIcon(item.step.awaitType)"
|
|
54
|
+
class="w-3 h-3"
|
|
55
|
+
/>
|
|
56
|
+
<span>{{ getAwaitTypeLabel(item.step.awaitType) }}</span>
|
|
57
|
+
</UBadge>
|
|
58
|
+
</div>
|
|
59
|
+
<div
|
|
60
|
+
v-if="!item.step.showAllIndicator"
|
|
61
|
+
class="flex items-center gap-3 mt-1 text-xs text-gray-500"
|
|
62
|
+
>
|
|
63
|
+
<span
|
|
64
|
+
class="capitalize"
|
|
65
|
+
:class="getStepStatusTextColor(item.step.status)"
|
|
66
|
+
>
|
|
67
|
+
{{ item.step.status || "pending" }}
|
|
68
|
+
</span>
|
|
69
|
+
<span v-if="item.step.attempt && item.step.attempt > 1">
|
|
70
|
+
Attempt {{ item.step.attempt }}
|
|
71
|
+
</span>
|
|
72
|
+
<!-- Await Position Badge -->
|
|
73
|
+
<UBadge
|
|
74
|
+
v-if="isAwaitStep(item.step.key)"
|
|
75
|
+
size="xs"
|
|
76
|
+
color="neutral"
|
|
77
|
+
variant="outline"
|
|
78
|
+
>
|
|
79
|
+
{{ getAwaitPosition(item.step.key) }}
|
|
80
|
+
</UBadge>
|
|
81
|
+
</div>
|
|
82
|
+
<div
|
|
83
|
+
v-else
|
|
84
|
+
class="mt-1 text-xs text-gray-500"
|
|
85
|
+
>
|
|
86
|
+
Show all events from all steps
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<!-- Additional Details (from description slot) -->
|
|
90
|
+
<div
|
|
91
|
+
v-if="!item.step.showAllIndicator && (item.step.startedAt || item.step.completedAt || item.step.error || item.step.awaitType)"
|
|
92
|
+
class="mt-3"
|
|
93
|
+
>
|
|
94
|
+
<!-- Timing Info -->
|
|
95
|
+
<div
|
|
96
|
+
v-if="item.step.startedAt || item.step.completedAt"
|
|
97
|
+
class="flex items-center gap-4 text-xs text-gray-500"
|
|
98
|
+
>
|
|
99
|
+
<div
|
|
100
|
+
v-if="item.step.startedAt"
|
|
101
|
+
class="flex items-center gap-1"
|
|
102
|
+
>
|
|
103
|
+
<UIcon
|
|
104
|
+
name="i-lucide-clock"
|
|
105
|
+
class="w-3 h-3"
|
|
106
|
+
/>
|
|
107
|
+
<span>{{ formatTime(item.step.startedAt) }}</span>
|
|
108
|
+
</div>
|
|
109
|
+
<div
|
|
110
|
+
v-if="item.step.completedAt"
|
|
111
|
+
class="flex items-center gap-1"
|
|
112
|
+
>
|
|
113
|
+
<UIcon
|
|
114
|
+
name="i-lucide-check-circle"
|
|
115
|
+
class="w-3 h-3"
|
|
116
|
+
/>
|
|
117
|
+
<span>{{ formatTime(item.step.completedAt) }}</span>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- Error Message -->
|
|
122
|
+
<div
|
|
123
|
+
v-if="item.step.error"
|
|
124
|
+
class="mt-2"
|
|
125
|
+
>
|
|
126
|
+
<div
|
|
127
|
+
class="p-2 bg-red-50 dark:bg-red-900/10 border border-red-200 dark:border-red-900/30 rounded text-xs text-red-600 dark:text-red-400"
|
|
128
|
+
:title="String(item.step.error || '')"
|
|
129
|
+
>
|
|
130
|
+
<div class="flex items-start gap-1">
|
|
131
|
+
<UIcon
|
|
132
|
+
name="i-lucide-alert-circle"
|
|
133
|
+
class="w-3 h-3 flex-shrink-0 mt-0.5"
|
|
134
|
+
/>
|
|
135
|
+
<p class="line-clamp-2 break-all">
|
|
136
|
+
{{ item.step.error }}
|
|
137
|
+
</p>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<!-- Await Config Details -->
|
|
143
|
+
<div
|
|
144
|
+
v-if="item.step.awaitType"
|
|
145
|
+
class="mt-2 p-2.5 rounded-md border"
|
|
146
|
+
:class="getAwaitConfigBgClass(item.step.status)"
|
|
147
|
+
>
|
|
148
|
+
<div class="flex flex-col gap-2">
|
|
149
|
+
<!-- Primary Info -->
|
|
150
|
+
<div class="flex items-center gap-2">
|
|
151
|
+
<UIcon
|
|
152
|
+
:name="getAwaitTypeIcon(item.step.awaitType)"
|
|
153
|
+
class="w-3.5 h-3.5"
|
|
154
|
+
:class="getAwaitIconColor(item.step.status)"
|
|
155
|
+
/>
|
|
156
|
+
<span
|
|
157
|
+
class="font-medium"
|
|
158
|
+
:class="getAwaitTextColor(item.step.status)"
|
|
159
|
+
>
|
|
160
|
+
{{ getAwaitTypeLabel(item.step.awaitType) }} Pattern
|
|
161
|
+
</span>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<!-- Configuration Details -->
|
|
165
|
+
<div class="space-y-1.5 text-xs">
|
|
166
|
+
<!-- Webhook specific -->
|
|
167
|
+
<div
|
|
168
|
+
v-if="item.step.awaitType === 'webhook' && item.step.awaitConfig"
|
|
169
|
+
class="space-y-1"
|
|
170
|
+
>
|
|
171
|
+
<div
|
|
172
|
+
v-if="item.step.awaitConfig.method"
|
|
173
|
+
class="flex items-center gap-1.5"
|
|
174
|
+
>
|
|
175
|
+
<UIcon
|
|
176
|
+
name="i-lucide-route"
|
|
177
|
+
class="w-3 h-3 opacity-60"
|
|
178
|
+
/>
|
|
179
|
+
<span class="opacity-75">Method:</span>
|
|
180
|
+
<UBadge
|
|
181
|
+
size="xs"
|
|
182
|
+
:color="getMethodBadgeColor(item.step.awaitConfig.method)"
|
|
183
|
+
variant="subtle"
|
|
184
|
+
>
|
|
185
|
+
{{ item.step.awaitConfig.method }}
|
|
186
|
+
</UBadge>
|
|
187
|
+
</div>
|
|
188
|
+
<div
|
|
189
|
+
v-if="item.step.awaitConfig.path"
|
|
190
|
+
class="flex items-start gap-1.5"
|
|
191
|
+
>
|
|
192
|
+
<UIcon
|
|
193
|
+
name="i-lucide-link"
|
|
194
|
+
class="w-3 h-3 opacity-60 mt-0.5"
|
|
195
|
+
/>
|
|
196
|
+
<span class="opacity-75">Path:</span>
|
|
197
|
+
<code class="px-1.5 py-0.5 bg-black/5 dark:bg-white/5 rounded text-[10px] flex-1">{{ item.step.awaitConfig.path }}</code>
|
|
198
|
+
</div>
|
|
199
|
+
<div
|
|
200
|
+
v-if="item.step.webhookUrl"
|
|
201
|
+
class="flex items-start gap-1.5 pt-1"
|
|
202
|
+
>
|
|
203
|
+
<UIcon
|
|
204
|
+
name="i-lucide-globe"
|
|
205
|
+
class="w-3 h-3 opacity-60 mt-1"
|
|
206
|
+
/>
|
|
207
|
+
<span class="opacity-75 mt-0.5">URL:</span>
|
|
208
|
+
<div class="flex-1 flex items-start gap-1">
|
|
209
|
+
<code class="px-1.5 py-0.5 bg-black/5 dark:bg-white/5 rounded text-[10px] flex-1 break-all">{{ item.step.webhookUrl }}</code>
|
|
210
|
+
<button
|
|
211
|
+
type="button"
|
|
212
|
+
class="flex-shrink-0 p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded transition-colors"
|
|
213
|
+
:title="copiedUrl === item.step.webhookUrl ? 'Copied!' : 'Copy URL'"
|
|
214
|
+
@click.stop="copyToClipboard(item.step.webhookUrl)"
|
|
215
|
+
>
|
|
216
|
+
<UIcon
|
|
217
|
+
:name="copiedUrl === item.step.webhookUrl ? 'i-lucide-check' : 'i-lucide-copy'"
|
|
218
|
+
class="w-3 h-3"
|
|
219
|
+
:class="copiedUrl === item.step.webhookUrl ? 'text-emerald-600 dark:text-emerald-400' : 'opacity-60'"
|
|
220
|
+
/>
|
|
221
|
+
</button>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<!-- Event specific -->
|
|
227
|
+
<div
|
|
228
|
+
v-if="item.step.awaitType === 'event' && item.step.awaitConfig?.event"
|
|
229
|
+
class="flex items-center gap-1.5"
|
|
230
|
+
>
|
|
231
|
+
<UIcon
|
|
232
|
+
name="i-lucide-radio"
|
|
233
|
+
class="w-3 h-3 opacity-60"
|
|
234
|
+
/>
|
|
235
|
+
<span class="opacity-75">Event:</span>
|
|
236
|
+
<code class="px-1.5 py-0.5 bg-black/5 dark:bg-white/5 rounded text-xs">{{ item.step.awaitConfig.event }}</code>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<!-- Time specific -->
|
|
240
|
+
<div
|
|
241
|
+
v-if="item.step.awaitType === 'time' && item.step.awaitConfig?.delay"
|
|
242
|
+
class="flex items-center gap-1.5"
|
|
243
|
+
>
|
|
244
|
+
<UIcon
|
|
245
|
+
name="i-lucide-hourglass"
|
|
246
|
+
class="w-3 h-3 opacity-60"
|
|
247
|
+
/>
|
|
248
|
+
<span class="opacity-75">Delay:</span>
|
|
249
|
+
<span class="font-medium">{{ formatDuration(item.step.awaitConfig.delay) }}</span>
|
|
250
|
+
</div>
|
|
251
|
+
|
|
252
|
+
<!-- Timeout -->
|
|
253
|
+
<div
|
|
254
|
+
v-if="item.step.awaitConfig?.timeout"
|
|
255
|
+
class="flex items-center gap-1.5"
|
|
256
|
+
>
|
|
257
|
+
<UIcon
|
|
258
|
+
name="i-lucide-clock-alert"
|
|
259
|
+
class="w-3 h-3 opacity-60"
|
|
260
|
+
/>
|
|
261
|
+
<span class="opacity-75">Timeout:</span>
|
|
262
|
+
<span class="font-medium">{{ formatDuration(item.step.awaitConfig.timeout) }}</span>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<!-- Timeout Action -->
|
|
266
|
+
<div
|
|
267
|
+
v-if="item.step.awaitConfig?.timeoutAction"
|
|
268
|
+
class="flex items-center gap-1.5"
|
|
269
|
+
>
|
|
270
|
+
<UIcon
|
|
271
|
+
name="i-lucide-zap"
|
|
272
|
+
class="w-3 h-3 opacity-60"
|
|
273
|
+
/>
|
|
274
|
+
<span class="opacity-75">On Timeout:</span>
|
|
275
|
+
<UBadge
|
|
276
|
+
size="xs"
|
|
277
|
+
:color="getTimeoutActionColor(item.step.awaitConfig.timeoutAction)"
|
|
278
|
+
variant="subtle"
|
|
279
|
+
>
|
|
280
|
+
{{ item.step.awaitConfig.timeoutAction }}
|
|
281
|
+
</UBadge>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
</component>
|
|
289
|
+
</div>
|
|
290
|
+
</template>
|
|
291
|
+
|
|
292
|
+
<script setup>
|
|
293
|
+
import { computed, ref } from "vue";
|
|
294
|
+
import { tv } from "tailwind-variants";
|
|
295
|
+
import { twMerge } from "tailwind-merge";
|
|
296
|
+
import { UIcon, UBadge } from "#components";
|
|
297
|
+
const props = defineProps({
|
|
298
|
+
modelValue: { type: String, required: true },
|
|
299
|
+
items: { type: Array, required: true },
|
|
300
|
+
ui: { type: Object, required: false }
|
|
301
|
+
});
|
|
302
|
+
defineEmits(["update:modelValue"]);
|
|
303
|
+
const copiedUrl = ref(null);
|
|
304
|
+
const copyToClipboard = async (text) => {
|
|
305
|
+
try {
|
|
306
|
+
await navigator.clipboard.writeText(text);
|
|
307
|
+
copiedUrl.value = text;
|
|
308
|
+
setTimeout(() => {
|
|
309
|
+
copiedUrl.value = null;
|
|
310
|
+
}, 2e3);
|
|
311
|
+
} catch (err) {
|
|
312
|
+
console.error("Failed to copy:", err);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
const defaultUi = {
|
|
316
|
+
root: "space-y-3",
|
|
317
|
+
itemBase: "w-full flex items-start border rounded-lg text-sm p-3.5 transition-colors text-left",
|
|
318
|
+
itemClickable: "hover:bg-gray-50 dark:hover:bg-gray-900/50 cursor-pointer",
|
|
319
|
+
itemNonClickable: "bg-blue-50/50 dark:bg-blue-900/10 opacity-75 cursor-default",
|
|
320
|
+
item: "border-gray-200 dark:border-gray-800",
|
|
321
|
+
itemSelected: "border-primary bg-primary/5 dark:bg-primary/10"
|
|
322
|
+
};
|
|
323
|
+
const ui = computed(() => ({
|
|
324
|
+
root: twMerge(defaultUi.root, props.ui?.root),
|
|
325
|
+
itemBase: twMerge(defaultUi.itemBase, props.ui?.itemBase),
|
|
326
|
+
itemClickable: defaultUi.itemClickable,
|
|
327
|
+
itemNonClickable: defaultUi.itemNonClickable,
|
|
328
|
+
item: props.ui?.item || defaultUi.item,
|
|
329
|
+
itemSelected: props.ui?.itemSelected || defaultUi.itemSelected
|
|
330
|
+
}));
|
|
331
|
+
const itemVariants = computed(() => tv({
|
|
332
|
+
base: ui.value.itemBase,
|
|
333
|
+
variants: {
|
|
334
|
+
selected: {
|
|
335
|
+
true: ui.value.itemSelected,
|
|
336
|
+
false: ui.value.item
|
|
337
|
+
},
|
|
338
|
+
clickable: {
|
|
339
|
+
true: ui.value.itemClickable,
|
|
340
|
+
false: ui.value.itemNonClickable
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}));
|
|
344
|
+
const itemClasses = (item) => {
|
|
345
|
+
const isClickable = item.clickable !== false;
|
|
346
|
+
return itemVariants.value({
|
|
347
|
+
selected: isClickable && props.modelValue === item.value,
|
|
348
|
+
clickable: isClickable
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
const formatTime = (timestamp) => {
|
|
352
|
+
const date = new Date(timestamp);
|
|
353
|
+
const now = /* @__PURE__ */ new Date();
|
|
354
|
+
const diff = now.getTime() - date.getTime();
|
|
355
|
+
const seconds = Math.floor(diff / 1e3);
|
|
356
|
+
const minutes = Math.floor(seconds / 60);
|
|
357
|
+
const hours = Math.floor(minutes / 60);
|
|
358
|
+
const days = Math.floor(hours / 24);
|
|
359
|
+
if (days > 0)
|
|
360
|
+
return `${days}d ago`;
|
|
361
|
+
if (hours > 0)
|
|
362
|
+
return `${hours}h ago`;
|
|
363
|
+
if (minutes > 0)
|
|
364
|
+
return `${minutes}m ago`;
|
|
365
|
+
if (seconds > 10)
|
|
366
|
+
return `${seconds}s ago`;
|
|
367
|
+
return "just now";
|
|
368
|
+
};
|
|
369
|
+
const getStepStatusBg = (status) => {
|
|
370
|
+
switch (status) {
|
|
371
|
+
case "completed":
|
|
372
|
+
return "bg-emerald-50 dark:bg-emerald-900/20";
|
|
373
|
+
case "failed":
|
|
374
|
+
return "bg-red-50 dark:bg-red-900/20";
|
|
375
|
+
case "running":
|
|
376
|
+
return "bg-blue-50 dark:bg-blue-900/20";
|
|
377
|
+
default:
|
|
378
|
+
return "bg-gray-50 dark:bg-gray-900/20";
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
const getStepStatusIcon = (status) => {
|
|
382
|
+
switch (status) {
|
|
383
|
+
case "completed":
|
|
384
|
+
return "i-lucide-check-circle";
|
|
385
|
+
case "failed":
|
|
386
|
+
return "i-lucide-x-circle";
|
|
387
|
+
case "running":
|
|
388
|
+
return "i-lucide-loader-circle";
|
|
389
|
+
default:
|
|
390
|
+
return "i-lucide-circle";
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
const getStepStatusIconColor = (status) => {
|
|
394
|
+
switch (status) {
|
|
395
|
+
case "completed":
|
|
396
|
+
return "text-emerald-600 dark:text-emerald-400";
|
|
397
|
+
case "failed":
|
|
398
|
+
return "text-red-600 dark:text-red-400";
|
|
399
|
+
case "running":
|
|
400
|
+
return "text-blue-600 dark:text-blue-400 animate-spin";
|
|
401
|
+
default:
|
|
402
|
+
return "text-gray-400";
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
const getStepStatusTextColor = (status) => {
|
|
406
|
+
switch (status) {
|
|
407
|
+
case "completed":
|
|
408
|
+
return "text-emerald-600 dark:text-emerald-400";
|
|
409
|
+
case "failed":
|
|
410
|
+
return "text-red-600 dark:text-red-400";
|
|
411
|
+
case "running":
|
|
412
|
+
return "text-blue-600 dark:text-blue-400";
|
|
413
|
+
default:
|
|
414
|
+
return "text-gray-500";
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
const isAwaitStep = (key) => {
|
|
418
|
+
return key.includes(":await-");
|
|
419
|
+
};
|
|
420
|
+
const getAwaitPosition = (key) => {
|
|
421
|
+
if (key.includes(":await-before")) return "before";
|
|
422
|
+
if (key.includes(":await-after")) return "after";
|
|
423
|
+
return "";
|
|
424
|
+
};
|
|
425
|
+
const getStepDisplayName = (key) => {
|
|
426
|
+
if (key.includes(":await-")) {
|
|
427
|
+
return key.split(":await-")[0];
|
|
428
|
+
}
|
|
429
|
+
return key;
|
|
430
|
+
};
|
|
431
|
+
const getAwaitTypeIcon = (type) => {
|
|
432
|
+
switch (type) {
|
|
433
|
+
case "webhook":
|
|
434
|
+
return "i-lucide-webhook";
|
|
435
|
+
case "event":
|
|
436
|
+
return "i-lucide-zap";
|
|
437
|
+
case "time":
|
|
438
|
+
return "i-lucide-clock";
|
|
439
|
+
case "schedule":
|
|
440
|
+
return "i-lucide-calendar-clock";
|
|
441
|
+
default:
|
|
442
|
+
return "i-lucide-timer";
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
const getAwaitTypeLabel = (type) => {
|
|
446
|
+
switch (type) {
|
|
447
|
+
case "webhook":
|
|
448
|
+
return "Webhook";
|
|
449
|
+
case "event":
|
|
450
|
+
return "Event";
|
|
451
|
+
case "time":
|
|
452
|
+
return "Time";
|
|
453
|
+
case "schedule":
|
|
454
|
+
return "Schedule";
|
|
455
|
+
default:
|
|
456
|
+
return "Await";
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
const getAwaitBadgeColor = (status) => {
|
|
460
|
+
switch (status) {
|
|
461
|
+
case "waiting":
|
|
462
|
+
return "warning";
|
|
463
|
+
case "completed":
|
|
464
|
+
return "success";
|
|
465
|
+
case "timeout":
|
|
466
|
+
return "error";
|
|
467
|
+
default:
|
|
468
|
+
return "neutral";
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
const getAwaitConfigBgClass = (status) => {
|
|
472
|
+
switch (status) {
|
|
473
|
+
case "waiting":
|
|
474
|
+
return "bg-amber-50 dark:bg-amber-900/10 border-amber-200 dark:border-amber-900/30 text-amber-700 dark:text-amber-300";
|
|
475
|
+
case "completed":
|
|
476
|
+
return "bg-emerald-50 dark:bg-emerald-900/10 border-emerald-200 dark:border-emerald-900/30 text-emerald-700 dark:text-emerald-300";
|
|
477
|
+
case "timeout":
|
|
478
|
+
return "bg-red-50 dark:bg-red-900/10 border-red-200 dark:border-red-900/30 text-red-700 dark:text-red-300";
|
|
479
|
+
default:
|
|
480
|
+
return "bg-gray-50 dark:bg-gray-900/10 border-gray-200 dark:border-gray-800 text-gray-700 dark:text-gray-300";
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
const getAwaitIconColor = (status) => {
|
|
484
|
+
switch (status) {
|
|
485
|
+
case "waiting":
|
|
486
|
+
return "text-amber-600 dark:text-amber-400";
|
|
487
|
+
case "completed":
|
|
488
|
+
return "text-emerald-600 dark:text-emerald-400";
|
|
489
|
+
case "timeout":
|
|
490
|
+
return "text-red-600 dark:text-red-400";
|
|
491
|
+
default:
|
|
492
|
+
return "text-gray-600 dark:text-gray-400";
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
const getAwaitTextColor = (status) => {
|
|
496
|
+
switch (status) {
|
|
497
|
+
case "waiting":
|
|
498
|
+
return "text-amber-700 dark:text-amber-300";
|
|
499
|
+
case "completed":
|
|
500
|
+
return "text-emerald-700 dark:text-emerald-300";
|
|
501
|
+
case "timeout":
|
|
502
|
+
return "text-red-700 dark:text-red-300";
|
|
503
|
+
default:
|
|
504
|
+
return "text-gray-700 dark:text-gray-300";
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
const getMethodBadgeColor = (method) => {
|
|
508
|
+
switch (method?.toUpperCase()) {
|
|
509
|
+
case "GET":
|
|
510
|
+
return "primary";
|
|
511
|
+
case "POST":
|
|
512
|
+
return "success";
|
|
513
|
+
case "PUT":
|
|
514
|
+
return "warning";
|
|
515
|
+
case "DELETE":
|
|
516
|
+
return "error";
|
|
517
|
+
default:
|
|
518
|
+
return "neutral";
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
const getTimeoutActionColor = (action) => {
|
|
522
|
+
switch (action) {
|
|
523
|
+
case "fail":
|
|
524
|
+
return "error";
|
|
525
|
+
case "continue":
|
|
526
|
+
return "success";
|
|
527
|
+
case "retry":
|
|
528
|
+
return "warning";
|
|
529
|
+
default:
|
|
530
|
+
return "neutral";
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
const formatDuration = (ms) => {
|
|
534
|
+
if (!ms) return "\u2014";
|
|
535
|
+
const seconds = Math.floor(ms / 1e3);
|
|
536
|
+
const minutes = Math.floor(seconds / 60);
|
|
537
|
+
const hours = Math.floor(minutes / 60);
|
|
538
|
+
const days = Math.floor(hours / 24);
|
|
539
|
+
if (days > 0) {
|
|
540
|
+
const remainingHours = hours % 24;
|
|
541
|
+
return remainingHours > 0 ? `${days}d ${remainingHours}h` : `${days}d`;
|
|
542
|
+
}
|
|
543
|
+
if (hours > 0) {
|
|
544
|
+
const remainingMinutes = minutes % 60;
|
|
545
|
+
return remainingMinutes > 0 ? `${hours}h ${remainingMinutes}m` : `${hours}h`;
|
|
546
|
+
}
|
|
547
|
+
if (minutes > 0) {
|
|
548
|
+
const remainingSeconds = seconds % 60;
|
|
549
|
+
return remainingSeconds > 0 ? `${minutes}m ${remainingSeconds}s` : `${minutes}m`;
|
|
550
|
+
}
|
|
551
|
+
return `${seconds}s`;
|
|
552
|
+
};
|
|
553
|
+
</script>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
noCard?: boolean;
|
|
3
|
+
isEdit?: boolean;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_ModelProps = {
|
|
6
|
+
modelValue: {
|
|
7
|
+
name: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
description: string;
|
|
10
|
+
type: 'event' | 'webhook' | 'schedule' | 'manual';
|
|
11
|
+
scope: 'flow' | 'run';
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (value: {
|
|
17
|
+
name: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
description: string;
|
|
20
|
+
type: "event" | "webhook" | "schedule" | "manual";
|
|
21
|
+
scope: "flow" | "run";
|
|
22
|
+
}) => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
24
|
+
"onUpdate:modelValue"?: ((value: {
|
|
25
|
+
name: string;
|
|
26
|
+
displayName: string;
|
|
27
|
+
description: string;
|
|
28
|
+
type: "event" | "webhook" | "schedule" | "manual";
|
|
29
|
+
scope: "flow" | "run";
|
|
30
|
+
}) => any) | undefined;
|
|
31
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|