@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,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-full flex flex-col overflow-hidden">
|
|
3
|
+
<!-- Header -->
|
|
4
|
+
<div class="border-b border-gray-200 dark:border-gray-800 px-6 py-3 shrink-0">
|
|
5
|
+
<div class="flex items-center justify-between">
|
|
6
|
+
<div class="flex items-center gap-4">
|
|
7
|
+
<h1 class="text-lg font-semibold">
|
|
8
|
+
Triggers
|
|
9
|
+
</h1>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="flex items-center gap-3">
|
|
12
|
+
<LiveIndicator
|
|
13
|
+
:is-connected="triggerWs.connected.value"
|
|
14
|
+
:is-reconnecting="triggerWs.reconnecting.value"
|
|
15
|
+
/>
|
|
16
|
+
<UButton
|
|
17
|
+
icon="i-lucide-plus"
|
|
18
|
+
label="Create Trigger"
|
|
19
|
+
color="primary"
|
|
20
|
+
size="sm"
|
|
21
|
+
@click="router.push('/triggers/new')"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<!-- Main Content -->
|
|
28
|
+
<div class="flex-1 min-h-0 overflow-y-auto">
|
|
29
|
+
<div class="max-w-7xl mx-auto p-6">
|
|
30
|
+
<!-- Stats Overview -->
|
|
31
|
+
<div
|
|
32
|
+
v-if="stats"
|
|
33
|
+
class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-6"
|
|
34
|
+
>
|
|
35
|
+
<StatCard
|
|
36
|
+
icon="i-lucide-zap"
|
|
37
|
+
:count="stats.total"
|
|
38
|
+
label="Total Triggers"
|
|
39
|
+
variant="gray"
|
|
40
|
+
/>
|
|
41
|
+
<StatCard
|
|
42
|
+
icon="i-lucide-check-circle"
|
|
43
|
+
:count="stats.active"
|
|
44
|
+
label="Active"
|
|
45
|
+
variant="emerald"
|
|
46
|
+
/>
|
|
47
|
+
<StatCard
|
|
48
|
+
icon="i-lucide-users"
|
|
49
|
+
:count="stats.totalSubscriptions"
|
|
50
|
+
label="Subscriptions"
|
|
51
|
+
variant="blue"
|
|
52
|
+
/>
|
|
53
|
+
<StatCard
|
|
54
|
+
icon="i-lucide-activity"
|
|
55
|
+
:count="stats.totalFires"
|
|
56
|
+
label="Total Fires"
|
|
57
|
+
variant="purple"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- Filters -->
|
|
62
|
+
<div class="mb-4 flex items-center gap-3">
|
|
63
|
+
<div class="flex-1">
|
|
64
|
+
<UInput
|
|
65
|
+
v-model="searchQuery"
|
|
66
|
+
icon="i-lucide-search"
|
|
67
|
+
placeholder="Search triggers..."
|
|
68
|
+
size="sm"
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
<USelectMenu
|
|
72
|
+
v-model="typeFilter"
|
|
73
|
+
:items="typeFilterOptions"
|
|
74
|
+
value-key="value"
|
|
75
|
+
placeholder="All Types"
|
|
76
|
+
size="sm"
|
|
77
|
+
class="w-44"
|
|
78
|
+
>
|
|
79
|
+
<template #label>
|
|
80
|
+
<span v-if="typeFilter === 'all'">All Types</span>
|
|
81
|
+
<div
|
|
82
|
+
v-else
|
|
83
|
+
class="flex items-center gap-2"
|
|
84
|
+
>
|
|
85
|
+
<UIcon
|
|
86
|
+
:name="getTriggerIcon(typeFilter)"
|
|
87
|
+
class="w-4 h-4"
|
|
88
|
+
/>
|
|
89
|
+
<span class="capitalize">{{ typeFilter }}</span>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
</USelectMenu>
|
|
93
|
+
<USelectMenu
|
|
94
|
+
v-model="scopeFilter"
|
|
95
|
+
:items="scopeFilterOptions"
|
|
96
|
+
value-key="value"
|
|
97
|
+
placeholder="All Scopes"
|
|
98
|
+
size="sm"
|
|
99
|
+
class="w-40"
|
|
100
|
+
>
|
|
101
|
+
<template #label>
|
|
102
|
+
<span v-if="scopeFilter === 'all'">All Scopes</span>
|
|
103
|
+
<div
|
|
104
|
+
v-else
|
|
105
|
+
class="flex items-center gap-2"
|
|
106
|
+
>
|
|
107
|
+
<UIcon
|
|
108
|
+
:name="scopeFilter === 'flow' ? 'i-lucide-git-branch' : 'i-lucide-play-circle'"
|
|
109
|
+
class="w-4 h-4"
|
|
110
|
+
/>
|
|
111
|
+
<span class="capitalize">{{ scopeFilter }}</span>
|
|
112
|
+
</div>
|
|
113
|
+
</template>
|
|
114
|
+
</USelectMenu>
|
|
115
|
+
<USelectMenu
|
|
116
|
+
v-model="statusFilter"
|
|
117
|
+
:items="statusFilterOptions"
|
|
118
|
+
value-key="value"
|
|
119
|
+
placeholder="All Status"
|
|
120
|
+
size="sm"
|
|
121
|
+
class="w-40"
|
|
122
|
+
>
|
|
123
|
+
<template #label>
|
|
124
|
+
<span v-if="statusFilter === 'all'">All Status</span>
|
|
125
|
+
<div
|
|
126
|
+
v-else
|
|
127
|
+
class="flex items-center gap-2"
|
|
128
|
+
>
|
|
129
|
+
<UIcon
|
|
130
|
+
:name="statusFilter === 'active' ? 'i-lucide-check-circle' : statusFilter === 'inactive' ? 'i-lucide-pause-circle' : 'i-lucide-archive'"
|
|
131
|
+
class="w-4 h-4"
|
|
132
|
+
/>
|
|
133
|
+
<span class="capitalize">{{ statusFilter }}</span>
|
|
134
|
+
</div>
|
|
135
|
+
</template>
|
|
136
|
+
</USelectMenu>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<!-- Triggers List -->
|
|
140
|
+
<div
|
|
141
|
+
v-if="!filteredTriggers || filteredTriggers.length === 0"
|
|
142
|
+
class="bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 p-8 text-center text-gray-500"
|
|
143
|
+
>
|
|
144
|
+
<div v-if="loading">
|
|
145
|
+
<UIcon
|
|
146
|
+
name="i-lucide-loader-2"
|
|
147
|
+
class="w-12 h-12 animate-spin mx-auto mb-3 opacity-50"
|
|
148
|
+
/>
|
|
149
|
+
<p>Loading triggers...</p>
|
|
150
|
+
</div>
|
|
151
|
+
<div v-else-if="searchQuery || typeFilter !== 'all' || scopeFilter !== 'all' || statusFilter !== 'all'">
|
|
152
|
+
<UIcon
|
|
153
|
+
name="i-lucide-search-x"
|
|
154
|
+
class="w-12 h-12 mx-auto mb-3 opacity-50"
|
|
155
|
+
/>
|
|
156
|
+
<p>No triggers match your filters</p>
|
|
157
|
+
<UButton
|
|
158
|
+
size="xs"
|
|
159
|
+
color="neutral"
|
|
160
|
+
variant="ghost"
|
|
161
|
+
class="mt-2"
|
|
162
|
+
@click="clearFilters"
|
|
163
|
+
>
|
|
164
|
+
Clear Filters
|
|
165
|
+
</UButton>
|
|
166
|
+
</div>
|
|
167
|
+
<div v-else>
|
|
168
|
+
<UIcon
|
|
169
|
+
name="i-lucide-zap-off"
|
|
170
|
+
class="w-12 h-12 mx-auto mb-3 opacity-50"
|
|
171
|
+
/>
|
|
172
|
+
<p>No triggers registered</p>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
<div
|
|
176
|
+
v-else
|
|
177
|
+
class="bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 overflow-hidden"
|
|
178
|
+
>
|
|
179
|
+
<div class="divide-y divide-gray-100 dark:divide-gray-800">
|
|
180
|
+
<div
|
|
181
|
+
v-for="trigger in paginatedTriggers"
|
|
182
|
+
:key="trigger.name"
|
|
183
|
+
class="px-6 py-4 hover:bg-gray-50 dark:hover:bg-gray-900/50 transition-colors cursor-pointer"
|
|
184
|
+
@click="selectTrigger(trigger.name)"
|
|
185
|
+
>
|
|
186
|
+
<div class="flex items-start justify-between gap-4">
|
|
187
|
+
<!-- Left: Trigger Info -->
|
|
188
|
+
<div class="flex-1 min-w-0">
|
|
189
|
+
<div class="flex items-center gap-2 mb-1">
|
|
190
|
+
<UIcon
|
|
191
|
+
:name="getTriggerIcon(trigger.type)"
|
|
192
|
+
class="w-4 h-4 shrink-0"
|
|
193
|
+
:class="getTriggerIconColor(trigger.type)"
|
|
194
|
+
/>
|
|
195
|
+
<h3 class="text-sm font-semibold text-gray-900 dark:text-gray-100 truncate">
|
|
196
|
+
{{ trigger.displayName || trigger.name }}
|
|
197
|
+
</h3>
|
|
198
|
+
<UBadge
|
|
199
|
+
:label="trigger.type"
|
|
200
|
+
:color="getTriggerTypeColor(trigger.type)"
|
|
201
|
+
variant="subtle"
|
|
202
|
+
size="xs"
|
|
203
|
+
/>
|
|
204
|
+
<UBadge
|
|
205
|
+
:label="trigger.scope"
|
|
206
|
+
color="neutral"
|
|
207
|
+
variant="subtle"
|
|
208
|
+
size="xs"
|
|
209
|
+
/>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<p
|
|
213
|
+
v-if="trigger.description"
|
|
214
|
+
class="text-xs text-gray-500 dark:text-gray-400 mb-2 line-clamp-1"
|
|
215
|
+
>
|
|
216
|
+
{{ trigger.description }}
|
|
217
|
+
</p>
|
|
218
|
+
|
|
219
|
+
<div class="flex items-center gap-4 text-xs text-gray-500 dark:text-gray-400">
|
|
220
|
+
<div class="flex items-center gap-1">
|
|
221
|
+
<UIcon
|
|
222
|
+
name="i-lucide-git-branch"
|
|
223
|
+
class="w-3 h-3"
|
|
224
|
+
/>
|
|
225
|
+
<span>{{ trigger.subscriptionCount }} flow{{ trigger.subscriptionCount === 1 ? "" : "s" }}</span>
|
|
226
|
+
</div>
|
|
227
|
+
<div
|
|
228
|
+
v-if="trigger.stats.totalFires > 0"
|
|
229
|
+
class="flex items-center gap-1"
|
|
230
|
+
>
|
|
231
|
+
<UIcon
|
|
232
|
+
name="i-lucide-zap"
|
|
233
|
+
class="w-3 h-3"
|
|
234
|
+
/>
|
|
235
|
+
<span>{{ formatNumber(trigger.stats.totalFires) }} fires</span>
|
|
236
|
+
</div>
|
|
237
|
+
<div
|
|
238
|
+
v-if="trigger.lastActivityAt"
|
|
239
|
+
class="flex items-center gap-1"
|
|
240
|
+
>
|
|
241
|
+
<UIcon
|
|
242
|
+
name="i-lucide-clock"
|
|
243
|
+
class="w-3 h-3"
|
|
244
|
+
/>
|
|
245
|
+
<span>{{ formatTime(trigger.lastActivityAt) }}</span>
|
|
246
|
+
</div>
|
|
247
|
+
<div
|
|
248
|
+
v-if="trigger.source"
|
|
249
|
+
class="flex items-center gap-1"
|
|
250
|
+
>
|
|
251
|
+
<UIcon
|
|
252
|
+
name="i-lucide-package"
|
|
253
|
+
class="w-3 h-3"
|
|
254
|
+
/>
|
|
255
|
+
<span>{{ trigger.source }}</span>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<!-- Right: Stats & Status -->
|
|
261
|
+
<div class="flex items-center gap-3">
|
|
262
|
+
<!-- Status Badge -->
|
|
263
|
+
<UBadge
|
|
264
|
+
:label="trigger.status"
|
|
265
|
+
:color="trigger.status === 'active' ? 'success' : trigger.status === 'inactive' ? 'warning' : 'neutral'"
|
|
266
|
+
variant="subtle"
|
|
267
|
+
/>
|
|
268
|
+
|
|
269
|
+
<!-- Actions -->
|
|
270
|
+
<UButton
|
|
271
|
+
icon="i-lucide-arrow-right"
|
|
272
|
+
size="xs"
|
|
273
|
+
color="neutral"
|
|
274
|
+
variant="ghost"
|
|
275
|
+
square
|
|
276
|
+
/>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
<!-- Pagination -->
|
|
283
|
+
<div
|
|
284
|
+
v-if="totalPages > 1"
|
|
285
|
+
class="border-t border-gray-200 dark:border-gray-800 px-6 py-4 flex items-center justify-center"
|
|
286
|
+
>
|
|
287
|
+
<UPagination
|
|
288
|
+
v-model:page="currentPage"
|
|
289
|
+
:items-per-page="itemsPerPage"
|
|
290
|
+
:total="filteredTriggers.length"
|
|
291
|
+
/>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
<!-- Footer Info -->
|
|
296
|
+
<div
|
|
297
|
+
v-if="filteredTriggers && filteredTriggers.length > 0"
|
|
298
|
+
class="mt-4 text-center text-sm text-gray-500 dark:text-gray-400"
|
|
299
|
+
>
|
|
300
|
+
Showing {{ startIndex + 1 }}-{{ endIndex }} of {{ filteredTriggers.length }} trigger{{ filteredTriggers.length === 1 ? "" : "s" }}
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
</template>
|
|
306
|
+
|
|
307
|
+
<script setup>
|
|
308
|
+
import { ref, computed, onMounted, onBeforeUnmount } from "#imports";
|
|
309
|
+
import { UButton, UIcon, UBadge, UInput, USelectMenu, UPagination } from "#components";
|
|
310
|
+
import { useComponentRouter } from "../../composables/useComponentRouter";
|
|
311
|
+
import { useTriggerWebSocket } from "../../composables/useTriggerWebSocket";
|
|
312
|
+
import StatCard from "../../components/StatCard.vue";
|
|
313
|
+
import LiveIndicator from "../../components/LiveIndicator.vue";
|
|
314
|
+
const router = useComponentRouter();
|
|
315
|
+
const triggers = ref([]);
|
|
316
|
+
const loading = ref(true);
|
|
317
|
+
const triggerWs = useTriggerWebSocket();
|
|
318
|
+
async function fetchTriggers() {
|
|
319
|
+
try {
|
|
320
|
+
const data = await $fetch("/api/_triggers");
|
|
321
|
+
triggers.value = data;
|
|
322
|
+
} catch (err) {
|
|
323
|
+
console.error("Error fetching triggers:", err);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
function updateTriggerStats(data) {
|
|
327
|
+
const triggerName = data?.id;
|
|
328
|
+
if (!triggerName || !triggers.value)
|
|
329
|
+
return;
|
|
330
|
+
const triggerIndex = triggers.value.findIndex((t) => t.name === triggerName);
|
|
331
|
+
if (triggerIndex === -1) {
|
|
332
|
+
console.warn("[Trigger Index] Trigger not found in list:", triggerName);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
const metadata = data?.metadata;
|
|
336
|
+
if (!metadata) {
|
|
337
|
+
console.warn("[Trigger Index] No metadata in update:", data);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const stats2 = {
|
|
341
|
+
totalFires: metadata.stats?.totalFires || metadata.totalFires || metadata["stats.totalFires"] || triggers.value[triggerIndex].stats?.totalFires || 0,
|
|
342
|
+
totalFlowsStarted: metadata.stats?.totalFlowsStarted || metadata.totalFlowsStarted || metadata["stats.totalFlowsStarted"] || triggers.value[triggerIndex].stats?.totalFlowsStarted || 0,
|
|
343
|
+
activeSubscribers: metadata.stats?.activeSubscribers || metadata.activeSubscribers || metadata["stats.activeSubscribers"] || triggers.value[triggerIndex].stats?.activeSubscribers || 0,
|
|
344
|
+
lastFiredAt: metadata.stats?.lastFiredAt || metadata.lastFiredAt || metadata["stats.lastFiredAt"] || triggers.value[triggerIndex].stats?.lastFiredAt
|
|
345
|
+
};
|
|
346
|
+
triggers.value[triggerIndex] = {
|
|
347
|
+
...triggers.value[triggerIndex],
|
|
348
|
+
stats: stats2,
|
|
349
|
+
status: metadata.status ?? triggers.value[triggerIndex].status,
|
|
350
|
+
lastActivityAt: metadata.lastActivityAt ?? triggers.value[triggerIndex].lastActivityAt
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
onMounted(async () => {
|
|
354
|
+
await fetchTriggers();
|
|
355
|
+
if (import.meta.client) {
|
|
356
|
+
triggerWs.subscribeStats(
|
|
357
|
+
{
|
|
358
|
+
onInitial: (data) => {
|
|
359
|
+
updateTriggerStats(data);
|
|
360
|
+
},
|
|
361
|
+
onUpdate: (data) => {
|
|
362
|
+
updateTriggerStats(data);
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
autoReconnect: true,
|
|
367
|
+
onOpen: () => {
|
|
368
|
+
loading.value = false;
|
|
369
|
+
},
|
|
370
|
+
onError: (err) => {
|
|
371
|
+
console.error("[Trigger Stats] Error:", err);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
onBeforeUnmount(() => {
|
|
378
|
+
triggerWs.unsubscribeStats();
|
|
379
|
+
triggerWs.stop();
|
|
380
|
+
});
|
|
381
|
+
const searchQuery = ref("");
|
|
382
|
+
const typeFilter = ref("all");
|
|
383
|
+
const scopeFilter = ref("all");
|
|
384
|
+
const statusFilter = ref("all");
|
|
385
|
+
const typeFilterOptions = [
|
|
386
|
+
{ label: "All Types", value: "all" },
|
|
387
|
+
{ label: "Event", value: "event", icon: "i-lucide-radio" },
|
|
388
|
+
{ label: "Webhook", value: "webhook", icon: "i-lucide-webhook" },
|
|
389
|
+
{ label: "Schedule", value: "schedule", icon: "i-lucide-clock" },
|
|
390
|
+
{ label: "Manual", value: "manual", icon: "i-lucide-hand" }
|
|
391
|
+
];
|
|
392
|
+
const scopeFilterOptions = [
|
|
393
|
+
{ label: "All Scopes", value: "all" },
|
|
394
|
+
{ label: "Flow", value: "flow", icon: "i-lucide-git-branch" },
|
|
395
|
+
{ label: "Run", value: "run", icon: "i-lucide-play-circle" }
|
|
396
|
+
];
|
|
397
|
+
const statusFilterOptions = [
|
|
398
|
+
{ label: "All Status", value: "all" },
|
|
399
|
+
{ label: "Active", value: "active", icon: "i-lucide-check-circle" },
|
|
400
|
+
{ label: "Inactive", value: "inactive", icon: "i-lucide-pause-circle" },
|
|
401
|
+
{ label: "Retired", value: "retired", icon: "i-lucide-archive" }
|
|
402
|
+
];
|
|
403
|
+
const currentPage = ref(1);
|
|
404
|
+
const itemsPerPage = 10;
|
|
405
|
+
const filteredTriggers = computed(() => {
|
|
406
|
+
if (!triggers.value) return [];
|
|
407
|
+
let result = triggers.value;
|
|
408
|
+
if (searchQuery.value) {
|
|
409
|
+
const query = searchQuery.value.toLowerCase();
|
|
410
|
+
result = result.filter(
|
|
411
|
+
(t) => t.name.toLowerCase().includes(query) || t.displayName?.toLowerCase().includes(query) || t.description?.toLowerCase().includes(query)
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
if (typeFilter.value !== "all") {
|
|
415
|
+
result = result.filter((t) => t.type === typeFilter.value);
|
|
416
|
+
}
|
|
417
|
+
if (scopeFilter.value !== "all") {
|
|
418
|
+
result = result.filter((t) => t.scope === scopeFilter.value);
|
|
419
|
+
}
|
|
420
|
+
if (statusFilter.value !== "all") {
|
|
421
|
+
result = result.filter((t) => t.status === statusFilter.value);
|
|
422
|
+
}
|
|
423
|
+
return result;
|
|
424
|
+
});
|
|
425
|
+
const totalPages = computed(() => {
|
|
426
|
+
if (!filteredTriggers.value) return 0;
|
|
427
|
+
return Math.ceil(filteredTriggers.value.length / itemsPerPage);
|
|
428
|
+
});
|
|
429
|
+
const startIndex = computed(() => {
|
|
430
|
+
return (currentPage.value - 1) * itemsPerPage;
|
|
431
|
+
});
|
|
432
|
+
const endIndex = computed(() => {
|
|
433
|
+
if (!filteredTriggers.value) return 0;
|
|
434
|
+
return Math.min(startIndex.value + itemsPerPage, filteredTriggers.value.length);
|
|
435
|
+
});
|
|
436
|
+
const paginatedTriggers = computed(() => {
|
|
437
|
+
if (!filteredTriggers.value) return [];
|
|
438
|
+
return filteredTriggers.value.slice(startIndex.value, endIndex.value);
|
|
439
|
+
});
|
|
440
|
+
const clearFilters = () => {
|
|
441
|
+
searchQuery.value = "";
|
|
442
|
+
typeFilter.value = "all";
|
|
443
|
+
scopeFilter.value = "all";
|
|
444
|
+
statusFilter.value = "all";
|
|
445
|
+
currentPage.value = 1;
|
|
446
|
+
};
|
|
447
|
+
const selectTrigger = (name) => {
|
|
448
|
+
router.push(`/triggers/${encodeURIComponent(name)}`);
|
|
449
|
+
};
|
|
450
|
+
const getTriggerIcon = (type) => {
|
|
451
|
+
switch (type) {
|
|
452
|
+
case "event":
|
|
453
|
+
return "i-lucide-radio";
|
|
454
|
+
case "webhook":
|
|
455
|
+
return "i-lucide-webhook";
|
|
456
|
+
case "schedule":
|
|
457
|
+
return "i-lucide-clock";
|
|
458
|
+
case "manual":
|
|
459
|
+
return "i-lucide-hand";
|
|
460
|
+
default:
|
|
461
|
+
return "i-lucide-zap";
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
const getTriggerIconColor = (type) => {
|
|
465
|
+
switch (type) {
|
|
466
|
+
case "event":
|
|
467
|
+
return "text-blue-500";
|
|
468
|
+
case "webhook":
|
|
469
|
+
return "text-purple-500";
|
|
470
|
+
case "schedule":
|
|
471
|
+
return "text-emerald-500";
|
|
472
|
+
case "manual":
|
|
473
|
+
return "text-amber-500";
|
|
474
|
+
default:
|
|
475
|
+
return "text-gray-500";
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
const getTriggerTypeColor = (type) => {
|
|
479
|
+
switch (type) {
|
|
480
|
+
case "event":
|
|
481
|
+
return "primary";
|
|
482
|
+
case "webhook":
|
|
483
|
+
return "success";
|
|
484
|
+
case "schedule":
|
|
485
|
+
return "warning";
|
|
486
|
+
case "manual":
|
|
487
|
+
return "neutral";
|
|
488
|
+
default:
|
|
489
|
+
return "neutral";
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
const formatTime = (timestamp) => {
|
|
493
|
+
const date = new Date(timestamp);
|
|
494
|
+
const now = /* @__PURE__ */ new Date();
|
|
495
|
+
const diff = now.getTime() - date.getTime();
|
|
496
|
+
const seconds = Math.floor(diff / 1e3);
|
|
497
|
+
const minutes = Math.floor(seconds / 60);
|
|
498
|
+
const hours = Math.floor(minutes / 60);
|
|
499
|
+
const days = Math.floor(hours / 24);
|
|
500
|
+
if (days > 0) return `${days}d ago`;
|
|
501
|
+
if (hours > 0) return `${hours}h ago`;
|
|
502
|
+
if (minutes > 0) return `${minutes}m ago`;
|
|
503
|
+
if (seconds > 10) return `${seconds}s ago`;
|
|
504
|
+
return "just now";
|
|
505
|
+
};
|
|
506
|
+
const formatNumber = (num) => {
|
|
507
|
+
if (num == null) return "0";
|
|
508
|
+
if (num >= 1e6) return `${(num / 1e6).toFixed(1)}M`;
|
|
509
|
+
if (num >= 1e3) return `${(num / 1e3).toFixed(1)}K`;
|
|
510
|
+
return num.toString();
|
|
511
|
+
};
|
|
512
|
+
const stats = computed(() => {
|
|
513
|
+
if (!triggers.value || triggers.value.length === 0) {
|
|
514
|
+
return {
|
|
515
|
+
total: 0,
|
|
516
|
+
active: 0,
|
|
517
|
+
totalSubscriptions: 0,
|
|
518
|
+
totalFires: 0
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
return {
|
|
522
|
+
total: triggers.value.length,
|
|
523
|
+
active: triggers.value.filter((t) => t.status === "active").length,
|
|
524
|
+
totalSubscriptions: triggers.value.reduce((acc, t) => acc + (t.subscriptionCount || t.stats?.activeSubscribers || 0), 0),
|
|
525
|
+
totalFires: triggers.value.reduce((acc, t) => acc + (t.stats?.totalFires || 0), 0)
|
|
526
|
+
};
|
|
527
|
+
});
|
|
528
|
+
</script>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|