@escalated-dev/escalated 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +380 -361
- package/package.json +85 -84
- package/src/components/ActiveChatsPanel.vue +246 -246
- package/src/components/AdminDashboard.stories.js +1423 -1423
- package/src/components/AttachmentList.vue +65 -65
- package/src/components/ChatActionBar.vue +226 -226
- package/src/components/ChatBubble.vue +162 -162
- package/src/components/ChatComposer.vue +308 -308
- package/src/components/ChatQueue.vue +222 -222
- package/src/components/ChatThread.vue +197 -197
- package/src/components/CustomTicketActions.stories.js +71 -0
- package/src/components/CustomTicketActions.vue +101 -0
- package/src/components/EscalatedLayout.vue +619 -604
- package/src/components/FollowButton.vue +20 -1
- package/src/components/MentionDropdown.vue +154 -154
- package/src/components/MetricComparison.vue +89 -89
- package/src/components/PercentileChart.vue +67 -67
- package/src/components/PeriodSelector.vue +98 -98
- package/src/components/PresenceIndicator.vue +228 -213
- package/src/components/ReplyComposer.vue +336 -336
- package/src/components/ReplyThread.vue +153 -153
- package/src/components/ReportChart.vue +395 -395
- package/src/components/ReportExportButton.vue +108 -108
- package/src/components/SaveViewDialog.vue +172 -172
- package/src/components/SavedViewSidebar.vue +208 -208
- package/src/components/SkillTagManager.vue +3 -0
- package/src/components/SnoozeButton.vue +247 -247
- package/src/components/TicketFilters.vue +270 -270
- package/src/components/TicketList.vue +655 -655
- package/src/components/TicketSidebar.vue +4 -0
- package/src/components/TicketSplitDialog.vue +98 -98
- package/src/components/TicketSubjects.stories.js +63 -0
- package/src/components/TicketSubjects.vue +107 -0
- package/src/components/TwoFactorSetup.vue +1 -37
- package/src/components/VariableTokenInput.vue +111 -111
- package/src/components/WorkflowActionConfig.vue +287 -287
- package/src/components/WorkflowActionList.vue +350 -350
- package/src/components/WorkflowConditionBuilder.vue +265 -265
- package/src/components/WorkflowTriggerSelector.vue +125 -125
- package/src/components/admin/newsletters/AnalyticsTiles.stories.js +14 -0
- package/src/components/admin/newsletters/AnalyticsTiles.vue +55 -0
- package/src/components/admin/newsletters/DeliveriesTable.stories.js +28 -0
- package/src/components/admin/newsletters/DeliveriesTable.vue +104 -0
- package/src/components/admin/newsletters/DynamicFilterBuilder.stories.js +11 -0
- package/src/components/admin/newsletters/DynamicFilterBuilder.vue +53 -0
- package/src/components/admin/newsletters/ListMemberTable.stories.js +12 -0
- package/src/components/admin/newsletters/ListMemberTable.vue +53 -0
- package/src/components/admin/newsletters/MarkdownEditor.stories.js +6 -0
- package/src/components/admin/newsletters/MarkdownEditor.vue +53 -0
- package/src/components/admin/newsletters/MergeFieldDropdown.stories.js +6 -0
- package/src/components/admin/newsletters/MergeFieldDropdown.vue +84 -0
- package/src/components/admin/newsletters/PreviewIframe.stories.js +7 -0
- package/src/components/admin/newsletters/PreviewIframe.vue +40 -0
- package/src/components/admin/newsletters/SummaryTiles.stories.js +8 -0
- package/src/components/admin/newsletters/SummaryTiles.vue +63 -0
- package/src/composables/useChat.js +187 -187
- package/src/composables/useI18n.js +102 -102
- package/src/composables/useMentions.js +134 -134
- package/src/composables/usePermissions.js +31 -0
- package/src/composables/useRealtime.js +182 -182
- package/src/index.js +85 -84
- package/src/locales/README.md +13 -13
- package/src/locales/ar.json +727 -727
- package/src/locales/de.json +690 -690
- package/src/locales/en.json +889 -729
- package/src/locales/es.json +691 -691
- package/src/locales/fr.json +691 -691
- package/src/locales/index.js +16 -16
- package/src/locales/it.json +727 -727
- package/src/locales/ja.json +727 -727
- package/src/locales/ko.json +727 -727
- package/src/locales/nl.json +727 -727
- package/src/locales/pl.json +727 -727
- package/src/locales/pt-BR.json +727 -727
- package/src/locales/ru.json +727 -727
- package/src/locales/tr.json +727 -727
- package/src/locales/zh-CN.json +727 -727
- package/src/pages/Admin/Newsletters/Compose.vue +192 -0
- package/src/pages/Admin/Newsletters/Edit.vue +24 -0
- package/src/pages/Admin/Newsletters/Index.vue +141 -0
- package/src/pages/Admin/Newsletters/Lists/Create.vue +64 -0
- package/src/pages/Admin/Newsletters/Lists/Index.vue +59 -0
- package/src/pages/Admin/Newsletters/Lists/Show.vue +53 -0
- package/src/pages/Admin/Newsletters/Settings.vue +85 -0
- package/src/pages/Admin/Newsletters/Show.vue +140 -0
- package/src/pages/Admin/Newsletters/Templates/Create.vue +11 -0
- package/src/pages/Admin/Newsletters/Templates/Index.vue +54 -0
- package/src/pages/Admin/Newsletters/Templates/Show.vue +65 -0
- package/src/pages/Admin/Newsletters/usePreview.js +44 -0
- package/src/pages/Admin/Reports/AgentDetail.vue +132 -132
- package/src/pages/Admin/Reports/AgentRanking.vue +246 -246
- package/src/pages/Admin/Reports/Cohorts.vue +180 -180
- package/src/pages/Admin/Reports/Comparison.vue +141 -141
- package/src/pages/Admin/Reports/Dashboard.vue +226 -226
- package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -164
- package/src/pages/Admin/Reports/ResponseTimes.vue +164 -164
- package/src/pages/Admin/Reports/SlaTrends.vue +183 -183
- package/src/pages/Admin/Settings/SsoSettings.vue +157 -4
- package/src/pages/Admin/Settings/TwoFactor.vue +32 -6
- package/src/pages/Admin/Settings.vue +1008 -1008
- package/src/pages/Admin/Skills/Form.vue +30 -10
- package/src/pages/Admin/Tickets/Index.vue +126 -126
- package/src/pages/Admin/Tickets/Show.vue +254 -249
- package/src/pages/Admin/Users/Index.vue +145 -145
- package/src/pages/Admin/Workflows/Builder.vue +207 -207
- package/src/pages/Admin/Workflows/Index.vue +235 -235
- package/src/pages/Admin/Workflows/Logs.vue +286 -286
- package/src/pages/Agent/TicketIndex.vue +112 -112
- package/src/pages/Agent/TicketShow.vue +547 -494
- package/src/pages/Customer/Index.vue +56 -56
- package/src/pages/Customer/KnowledgeBase/Article.vue +129 -129
- package/src/plugin.js +175 -175
- package/src/utils/mentionHighlight.js +24 -24
- package/src/widget/EscalatedWidget.vue +804 -804
- package/src/widget/index.js +254 -254
|
@@ -1,235 +1,235 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import EscalatedLayout from '../../../components/EscalatedLayout.vue';
|
|
3
|
-
import { Link, router } from '@inertiajs/vue3';
|
|
4
|
-
import { ref } from 'vue';
|
|
5
|
-
|
|
6
|
-
defineProps({
|
|
7
|
-
workflows: { type: Array, default: () => [] },
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const dragIndex = ref(null);
|
|
11
|
-
|
|
12
|
-
function destroy(id) {
|
|
13
|
-
if (confirm('Delete this workflow? This cannot be undone.')) {
|
|
14
|
-
router.delete(route('escalated.admin.workflows.destroy', id));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function toggleActive(workflow) {
|
|
19
|
-
router.put(route('escalated.admin.workflows.toggle', workflow.id), {
|
|
20
|
-
active: !workflow.active,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function onDragStart(index) {
|
|
25
|
-
dragIndex.value = index;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function onDragOver(event) {
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function onDrop(event, workflows, targetIndex) {
|
|
33
|
-
event.preventDefault();
|
|
34
|
-
if (dragIndex.value === null || dragIndex.value === targetIndex) return;
|
|
35
|
-
const ids = workflows.map((w) => w.id);
|
|
36
|
-
const [moved] = ids.splice(dragIndex.value, 1);
|
|
37
|
-
ids.splice(targetIndex, 0, moved);
|
|
38
|
-
router.post(route('escalated.admin.workflows.reorder'), { ids });
|
|
39
|
-
dragIndex.value = null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function onDragEnd() {
|
|
43
|
-
dragIndex.value = null;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function triggerBadgeClass(trigger) {
|
|
47
|
-
const classes = {
|
|
48
|
-
ticket_created: 'bg-blue-500/10 text-blue-400',
|
|
49
|
-
ticket_updated: 'bg-cyan-500/10 text-cyan-400',
|
|
50
|
-
reply_added: 'bg-emerald-500/10 text-emerald-400',
|
|
51
|
-
status_changed: 'bg-violet-500/10 text-violet-400',
|
|
52
|
-
ticket_assigned: 'bg-indigo-500/10 text-indigo-400',
|
|
53
|
-
ticket_escalated: 'bg-red-500/10 text-red-400',
|
|
54
|
-
sla_breached: 'bg-rose-500/10 text-rose-400',
|
|
55
|
-
sla_warning: 'bg-amber-500/10 text-amber-400',
|
|
56
|
-
chat_started: 'bg-teal-500/10 text-teal-400',
|
|
57
|
-
chat_ended: 'bg-gray-500/10 text-gray-400',
|
|
58
|
-
};
|
|
59
|
-
return classes[trigger] || 'bg-gray-500/10 text-gray-400';
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function triggerLabel(trigger) {
|
|
63
|
-
return (trigger || '').replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
|
|
64
|
-
}
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<template>
|
|
68
|
-
<EscalatedLayout title="Workflows">
|
|
69
|
-
<div class="mb-4 flex items-center justify-between">
|
|
70
|
-
<div>
|
|
71
|
-
<h2 class="text-lg font-semibold text-[var(--esc-panel-text-secondary)]">Workflows</h2>
|
|
72
|
-
<p class="text-xs text-[var(--esc-panel-text-muted)]">
|
|
73
|
-
Event-driven automations with conditions, actions, and delays
|
|
74
|
-
</p>
|
|
75
|
-
</div>
|
|
76
|
-
<div class="flex items-center gap-3">
|
|
77
|
-
<Link
|
|
78
|
-
:href="route('escalated.admin.workflows.logs')"
|
|
79
|
-
class="rounded-lg border border-[var(--esc-panel-border)] px-3 py-2 text-sm font-medium text-[var(--esc-panel-text-secondary)] transition-colors hover:bg-[var(--esc-panel-hover)]"
|
|
80
|
-
>
|
|
81
|
-
View Logs
|
|
82
|
-
</Link>
|
|
83
|
-
<Link
|
|
84
|
-
:href="route('escalated.admin.workflows.create')"
|
|
85
|
-
class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-4 py-2 text-sm font-medium text-white shadow-lg shadow-[var(--esc-panel-bg)]/20 transition-all hover:from-[var(--esc-panel-accent-hover)] hover:to-[var(--esc-panel-accent-secondary-hover)]"
|
|
86
|
-
>
|
|
87
|
-
Create Workflow
|
|
88
|
-
</Link>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
|
|
92
|
-
<div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]">
|
|
93
|
-
<table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
|
|
94
|
-
<thead>
|
|
95
|
-
<tr class="bg-[var(--esc-panel-hover)]">
|
|
96
|
-
<th class="w-8 px-2 py-3" />
|
|
97
|
-
<th
|
|
98
|
-
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
99
|
-
>
|
|
100
|
-
Name
|
|
101
|
-
</th>
|
|
102
|
-
<th
|
|
103
|
-
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
104
|
-
>
|
|
105
|
-
Trigger
|
|
106
|
-
</th>
|
|
107
|
-
<th
|
|
108
|
-
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
109
|
-
>
|
|
110
|
-
Status
|
|
111
|
-
</th>
|
|
112
|
-
<th
|
|
113
|
-
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
114
|
-
>
|
|
115
|
-
Last Triggered
|
|
116
|
-
</th>
|
|
117
|
-
<th
|
|
118
|
-
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
119
|
-
>
|
|
120
|
-
Runs
|
|
121
|
-
</th>
|
|
122
|
-
<th
|
|
123
|
-
class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
124
|
-
>
|
|
125
|
-
Actions
|
|
126
|
-
</th>
|
|
127
|
-
</tr>
|
|
128
|
-
</thead>
|
|
129
|
-
<tbody class="divide-y divide-[var(--esc-panel-border)]">
|
|
130
|
-
<tr v-if="!workflows?.length">
|
|
131
|
-
<td colspan="7" class="px-4 py-12 text-center">
|
|
132
|
-
<svg
|
|
133
|
-
class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
|
|
134
|
-
fill="none"
|
|
135
|
-
stroke="currentColor"
|
|
136
|
-
stroke-width="1.5"
|
|
137
|
-
viewBox="0 0 24 24"
|
|
138
|
-
>
|
|
139
|
-
<path
|
|
140
|
-
stroke-linecap="round"
|
|
141
|
-
stroke-linejoin="round"
|
|
142
|
-
d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"
|
|
143
|
-
/>
|
|
144
|
-
<path
|
|
145
|
-
stroke-linecap="round"
|
|
146
|
-
stroke-linejoin="round"
|
|
147
|
-
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
148
|
-
/>
|
|
149
|
-
</svg>
|
|
150
|
-
<p class="text-sm text-[var(--esc-panel-text-muted)]">No workflows yet</p>
|
|
151
|
-
<p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
|
|
152
|
-
Create event-driven automations with conditions and actions
|
|
153
|
-
</p>
|
|
154
|
-
</td>
|
|
155
|
-
</tr>
|
|
156
|
-
<tr
|
|
157
|
-
v-for="(workflow, i) in workflows"
|
|
158
|
-
:key="workflow.id"
|
|
159
|
-
class="transition-colors hover:bg-[var(--esc-panel-hover)]"
|
|
160
|
-
draggable="true"
|
|
161
|
-
@dragstart="onDragStart(i)"
|
|
162
|
-
@dragover="onDragOver($event)"
|
|
163
|
-
@drop="onDrop($event, workflows, i)"
|
|
164
|
-
@dragend="onDragEnd"
|
|
165
|
-
>
|
|
166
|
-
<td class="px-2 py-3">
|
|
167
|
-
<div class="cursor-grab text-[var(--esc-panel-text-muted)]">
|
|
168
|
-
<svg class="h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
|
|
169
|
-
<circle cx="9" cy="6" r="1.5" />
|
|
170
|
-
<circle cx="15" cy="6" r="1.5" />
|
|
171
|
-
<circle cx="9" cy="12" r="1.5" />
|
|
172
|
-
<circle cx="15" cy="12" r="1.5" />
|
|
173
|
-
<circle cx="9" cy="18" r="1.5" />
|
|
174
|
-
<circle cx="15" cy="18" r="1.5" />
|
|
175
|
-
</svg>
|
|
176
|
-
</div>
|
|
177
|
-
</td>
|
|
178
|
-
<td class="px-4 py-3">
|
|
179
|
-
<Link
|
|
180
|
-
:href="route('escalated.admin.workflows.edit', workflow.id)"
|
|
181
|
-
class="text-sm font-medium text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
|
|
182
|
-
>
|
|
183
|
-
{{ workflow.name }}
|
|
184
|
-
</Link>
|
|
185
|
-
<p
|
|
186
|
-
v-if="workflow.description"
|
|
187
|
-
class="mt-0.5 truncate text-xs text-[var(--esc-panel-text-muted)]"
|
|
188
|
-
>
|
|
189
|
-
{{ workflow.description }}
|
|
190
|
-
</p>
|
|
191
|
-
</td>
|
|
192
|
-
<td class="px-4 py-3">
|
|
193
|
-
<span
|
|
194
|
-
class="inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium"
|
|
195
|
-
:class="triggerBadgeClass(workflow.trigger)"
|
|
196
|
-
>
|
|
197
|
-
{{ triggerLabel(workflow.trigger) }}
|
|
198
|
-
</span>
|
|
199
|
-
</td>
|
|
200
|
-
<td class="px-4 py-3">
|
|
201
|
-
<button
|
|
202
|
-
type="button"
|
|
203
|
-
class="relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none"
|
|
204
|
-
:class="workflow.active ? 'bg-emerald-500' : 'bg-[var(--esc-panel-border)]'"
|
|
205
|
-
@click="toggleActive(workflow)"
|
|
206
|
-
>
|
|
207
|
-
<span
|
|
208
|
-
class="pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out"
|
|
209
|
-
:class="workflow.active ? 'translate-x-4' : 'translate-x-0'"
|
|
210
|
-
/>
|
|
211
|
-
</button>
|
|
212
|
-
</td>
|
|
213
|
-
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
214
|
-
{{ workflow.last_triggered_at || '---' }}
|
|
215
|
-
</td>
|
|
216
|
-
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
217
|
-
{{ workflow.trigger_count || 0 }}
|
|
218
|
-
</td>
|
|
219
|
-
<td class="px-4 py-3 text-right text-sm">
|
|
220
|
-
<Link
|
|
221
|
-
:href="route('escalated.admin.workflows.edit', workflow.id)"
|
|
222
|
-
class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
|
|
223
|
-
>
|
|
224
|
-
Edit
|
|
225
|
-
</Link>
|
|
226
|
-
<button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(workflow.id)">
|
|
227
|
-
Delete
|
|
228
|
-
</button>
|
|
229
|
-
</td>
|
|
230
|
-
</tr>
|
|
231
|
-
</tbody>
|
|
232
|
-
</table>
|
|
233
|
-
</div>
|
|
234
|
-
</EscalatedLayout>
|
|
235
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import EscalatedLayout from '../../../components/EscalatedLayout.vue';
|
|
3
|
+
import { Link, router } from '@inertiajs/vue3';
|
|
4
|
+
import { ref } from 'vue';
|
|
5
|
+
|
|
6
|
+
defineProps({
|
|
7
|
+
workflows: { type: Array, default: () => [] },
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const dragIndex = ref(null);
|
|
11
|
+
|
|
12
|
+
function destroy(id) {
|
|
13
|
+
if (confirm('Delete this workflow? This cannot be undone.')) {
|
|
14
|
+
router.delete(route('escalated.admin.workflows.destroy', id));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function toggleActive(workflow) {
|
|
19
|
+
router.put(route('escalated.admin.workflows.toggle', workflow.id), {
|
|
20
|
+
active: !workflow.active,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function onDragStart(index) {
|
|
25
|
+
dragIndex.value = index;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function onDragOver(event) {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function onDrop(event, workflows, targetIndex) {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
if (dragIndex.value === null || dragIndex.value === targetIndex) return;
|
|
35
|
+
const ids = workflows.map((w) => w.id);
|
|
36
|
+
const [moved] = ids.splice(dragIndex.value, 1);
|
|
37
|
+
ids.splice(targetIndex, 0, moved);
|
|
38
|
+
router.post(route('escalated.admin.workflows.reorder'), { ids });
|
|
39
|
+
dragIndex.value = null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function onDragEnd() {
|
|
43
|
+
dragIndex.value = null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function triggerBadgeClass(trigger) {
|
|
47
|
+
const classes = {
|
|
48
|
+
ticket_created: 'bg-blue-500/10 text-blue-400',
|
|
49
|
+
ticket_updated: 'bg-cyan-500/10 text-cyan-400',
|
|
50
|
+
reply_added: 'bg-emerald-500/10 text-emerald-400',
|
|
51
|
+
status_changed: 'bg-violet-500/10 text-violet-400',
|
|
52
|
+
ticket_assigned: 'bg-indigo-500/10 text-indigo-400',
|
|
53
|
+
ticket_escalated: 'bg-red-500/10 text-red-400',
|
|
54
|
+
sla_breached: 'bg-rose-500/10 text-rose-400',
|
|
55
|
+
sla_warning: 'bg-amber-500/10 text-amber-400',
|
|
56
|
+
chat_started: 'bg-teal-500/10 text-teal-400',
|
|
57
|
+
chat_ended: 'bg-gray-500/10 text-gray-400',
|
|
58
|
+
};
|
|
59
|
+
return classes[trigger] || 'bg-gray-500/10 text-gray-400';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function triggerLabel(trigger) {
|
|
63
|
+
return (trigger || '').replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<EscalatedLayout title="Workflows">
|
|
69
|
+
<div class="mb-4 flex items-center justify-between">
|
|
70
|
+
<div>
|
|
71
|
+
<h2 class="text-lg font-semibold text-[var(--esc-panel-text-secondary)]">Workflows</h2>
|
|
72
|
+
<p class="text-xs text-[var(--esc-panel-text-muted)]">
|
|
73
|
+
Event-driven automations with conditions, actions, and delays
|
|
74
|
+
</p>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="flex items-center gap-3">
|
|
77
|
+
<Link
|
|
78
|
+
:href="route('escalated.admin.workflows.logs')"
|
|
79
|
+
class="rounded-lg border border-[var(--esc-panel-border)] px-3 py-2 text-sm font-medium text-[var(--esc-panel-text-secondary)] transition-colors hover:bg-[var(--esc-panel-hover)]"
|
|
80
|
+
>
|
|
81
|
+
View Logs
|
|
82
|
+
</Link>
|
|
83
|
+
<Link
|
|
84
|
+
:href="route('escalated.admin.workflows.create')"
|
|
85
|
+
class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-4 py-2 text-sm font-medium text-white shadow-lg shadow-[var(--esc-panel-bg)]/20 transition-all hover:from-[var(--esc-panel-accent-hover)] hover:to-[var(--esc-panel-accent-secondary-hover)]"
|
|
86
|
+
>
|
|
87
|
+
Create Workflow
|
|
88
|
+
</Link>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]">
|
|
93
|
+
<table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
|
|
94
|
+
<thead>
|
|
95
|
+
<tr class="bg-[var(--esc-panel-hover)]">
|
|
96
|
+
<th class="w-8 px-2 py-3" />
|
|
97
|
+
<th
|
|
98
|
+
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
99
|
+
>
|
|
100
|
+
Name
|
|
101
|
+
</th>
|
|
102
|
+
<th
|
|
103
|
+
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
104
|
+
>
|
|
105
|
+
Trigger
|
|
106
|
+
</th>
|
|
107
|
+
<th
|
|
108
|
+
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
109
|
+
>
|
|
110
|
+
Status
|
|
111
|
+
</th>
|
|
112
|
+
<th
|
|
113
|
+
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
114
|
+
>
|
|
115
|
+
Last Triggered
|
|
116
|
+
</th>
|
|
117
|
+
<th
|
|
118
|
+
class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
119
|
+
>
|
|
120
|
+
Runs
|
|
121
|
+
</th>
|
|
122
|
+
<th
|
|
123
|
+
class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
124
|
+
>
|
|
125
|
+
Actions
|
|
126
|
+
</th>
|
|
127
|
+
</tr>
|
|
128
|
+
</thead>
|
|
129
|
+
<tbody class="divide-y divide-[var(--esc-panel-border)]">
|
|
130
|
+
<tr v-if="!workflows?.length">
|
|
131
|
+
<td colspan="7" class="px-4 py-12 text-center">
|
|
132
|
+
<svg
|
|
133
|
+
class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
|
|
134
|
+
fill="none"
|
|
135
|
+
stroke="currentColor"
|
|
136
|
+
stroke-width="1.5"
|
|
137
|
+
viewBox="0 0 24 24"
|
|
138
|
+
>
|
|
139
|
+
<path
|
|
140
|
+
stroke-linecap="round"
|
|
141
|
+
stroke-linejoin="round"
|
|
142
|
+
d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"
|
|
143
|
+
/>
|
|
144
|
+
<path
|
|
145
|
+
stroke-linecap="round"
|
|
146
|
+
stroke-linejoin="round"
|
|
147
|
+
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
148
|
+
/>
|
|
149
|
+
</svg>
|
|
150
|
+
<p class="text-sm text-[var(--esc-panel-text-muted)]">No workflows yet</p>
|
|
151
|
+
<p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
|
|
152
|
+
Create event-driven automations with conditions and actions
|
|
153
|
+
</p>
|
|
154
|
+
</td>
|
|
155
|
+
</tr>
|
|
156
|
+
<tr
|
|
157
|
+
v-for="(workflow, i) in workflows"
|
|
158
|
+
:key="workflow.id"
|
|
159
|
+
class="transition-colors hover:bg-[var(--esc-panel-hover)]"
|
|
160
|
+
draggable="true"
|
|
161
|
+
@dragstart="onDragStart(i)"
|
|
162
|
+
@dragover="onDragOver($event)"
|
|
163
|
+
@drop="onDrop($event, workflows, i)"
|
|
164
|
+
@dragend="onDragEnd"
|
|
165
|
+
>
|
|
166
|
+
<td class="px-2 py-3">
|
|
167
|
+
<div class="cursor-grab text-[var(--esc-panel-text-muted)]">
|
|
168
|
+
<svg class="h-4 w-4" fill="currentColor" viewBox="0 0 24 24">
|
|
169
|
+
<circle cx="9" cy="6" r="1.5" />
|
|
170
|
+
<circle cx="15" cy="6" r="1.5" />
|
|
171
|
+
<circle cx="9" cy="12" r="1.5" />
|
|
172
|
+
<circle cx="15" cy="12" r="1.5" />
|
|
173
|
+
<circle cx="9" cy="18" r="1.5" />
|
|
174
|
+
<circle cx="15" cy="18" r="1.5" />
|
|
175
|
+
</svg>
|
|
176
|
+
</div>
|
|
177
|
+
</td>
|
|
178
|
+
<td class="px-4 py-3">
|
|
179
|
+
<Link
|
|
180
|
+
:href="route('escalated.admin.workflows.edit', workflow.id)"
|
|
181
|
+
class="text-sm font-medium text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
|
|
182
|
+
>
|
|
183
|
+
{{ workflow.name }}
|
|
184
|
+
</Link>
|
|
185
|
+
<p
|
|
186
|
+
v-if="workflow.description"
|
|
187
|
+
class="mt-0.5 truncate text-xs text-[var(--esc-panel-text-muted)]"
|
|
188
|
+
>
|
|
189
|
+
{{ workflow.description }}
|
|
190
|
+
</p>
|
|
191
|
+
</td>
|
|
192
|
+
<td class="px-4 py-3">
|
|
193
|
+
<span
|
|
194
|
+
class="inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium"
|
|
195
|
+
:class="triggerBadgeClass(workflow.trigger)"
|
|
196
|
+
>
|
|
197
|
+
{{ triggerLabel(workflow.trigger) }}
|
|
198
|
+
</span>
|
|
199
|
+
</td>
|
|
200
|
+
<td class="px-4 py-3">
|
|
201
|
+
<button
|
|
202
|
+
type="button"
|
|
203
|
+
class="relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none"
|
|
204
|
+
:class="workflow.active ? 'bg-emerald-500' : 'bg-[var(--esc-panel-border)]'"
|
|
205
|
+
@click="toggleActive(workflow)"
|
|
206
|
+
>
|
|
207
|
+
<span
|
|
208
|
+
class="pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out"
|
|
209
|
+
:class="workflow.active ? 'translate-x-4' : 'translate-x-0'"
|
|
210
|
+
/>
|
|
211
|
+
</button>
|
|
212
|
+
</td>
|
|
213
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
214
|
+
{{ workflow.last_triggered_at || '---' }}
|
|
215
|
+
</td>
|
|
216
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
217
|
+
{{ workflow.trigger_count || 0 }}
|
|
218
|
+
</td>
|
|
219
|
+
<td class="px-4 py-3 text-right text-sm">
|
|
220
|
+
<Link
|
|
221
|
+
:href="route('escalated.admin.workflows.edit', workflow.id)"
|
|
222
|
+
class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
|
|
223
|
+
>
|
|
224
|
+
Edit
|
|
225
|
+
</Link>
|
|
226
|
+
<button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(workflow.id)">
|
|
227
|
+
Delete
|
|
228
|
+
</button>
|
|
229
|
+
</td>
|
|
230
|
+
</tr>
|
|
231
|
+
</tbody>
|
|
232
|
+
</table>
|
|
233
|
+
</div>
|
|
234
|
+
</EscalatedLayout>
|
|
235
|
+
</template>
|