@escalated-dev/escalated 0.7.1 → 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 -357
- package/package.json +85 -81
- 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 -598
- 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 +29 -22
- 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 +30 -8
- 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 -0
- 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 +164 -4
- package/src/pages/Admin/Skills/Index.vue +14 -3
- 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 -0
- 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 +26 -1
- 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,222 +1,222 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref, computed, inject, onMounted, onUnmounted } from 'vue';
|
|
3
|
-
import { usePage } from '@inertiajs/vue3';
|
|
4
|
-
import { useI18n } from '../composables/useI18n';
|
|
5
|
-
import { useChat } from '../composables/useChat';
|
|
6
|
-
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
sessions: { type: Array, default: () => [] },
|
|
9
|
-
acceptEndpoint: { type: String, default: '' },
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const emit = defineEmits(['accept', 'refresh']);
|
|
13
|
-
|
|
14
|
-
const escDark = inject(
|
|
15
|
-
'esc-dark',
|
|
16
|
-
computed(() => false),
|
|
17
|
-
);
|
|
18
|
-
const { t } = useI18n();
|
|
19
|
-
|
|
20
|
-
// Live elapsed timers
|
|
21
|
-
const now = ref(Date.now());
|
|
22
|
-
let timerInterval = null;
|
|
23
|
-
|
|
24
|
-
onMounted(() => {
|
|
25
|
-
timerInterval = setInterval(() => {
|
|
26
|
-
now.value = Date.now();
|
|
27
|
-
}, 1000);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
onUnmounted(() => {
|
|
31
|
-
clearInterval(timerInterval);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
function waitTime(createdAt) {
|
|
35
|
-
if (!createdAt) return '0s';
|
|
36
|
-
const diffMs = now.value - new Date(createdAt).getTime();
|
|
37
|
-
const totalSecs = Math.max(0, Math.floor(diffMs / 1000));
|
|
38
|
-
if (totalSecs < 60) return `${totalSecs}s`;
|
|
39
|
-
const mins = Math.floor(totalSecs / 60);
|
|
40
|
-
if (mins < 60) return `${mins}m ${totalSecs % 60}s`;
|
|
41
|
-
const hrs = Math.floor(mins / 60);
|
|
42
|
-
return `${hrs}h ${mins % 60}m`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const sortedSessions = computed(() => {
|
|
46
|
-
return [...props.sessions].sort((a, b) => {
|
|
47
|
-
return new Date(a.created_at) - new Date(b.created_at);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
async function acceptChat(session) {
|
|
52
|
-
emit('accept', session);
|
|
53
|
-
if (props.acceptEndpoint) {
|
|
54
|
-
try {
|
|
55
|
-
await fetch(props.acceptEndpoint.replace(':id', session.id), {
|
|
56
|
-
method: 'POST',
|
|
57
|
-
headers: {
|
|
58
|
-
Accept: 'application/json',
|
|
59
|
-
'Content-Type': 'application/json',
|
|
60
|
-
'X-Requested-With': 'XMLHttpRequest',
|
|
61
|
-
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.content || '',
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
} catch {
|
|
65
|
-
// handled by caller
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Subscribe to queue for real-time updates. Read the host framework's
|
|
71
|
-
// route prefix from Inertia page props so chat API calls resolve
|
|
72
|
-
// correctly on NestJS backends ('/escalated/widget') as well as every
|
|
73
|
-
// other framework ('/support/widget').
|
|
74
|
-
const page = usePage();
|
|
75
|
-
const routePrefix = page.props.escalated?.prefix || 'support';
|
|
76
|
-
const { subscribeToChatQueue } = useChat({ widgetPath: `/${routePrefix}/widget` });
|
|
77
|
-
|
|
78
|
-
onMounted(() => {
|
|
79
|
-
subscribeToChatQueue({
|
|
80
|
-
onNewChat() {
|
|
81
|
-
emit('refresh');
|
|
82
|
-
},
|
|
83
|
-
onChatAccepted() {
|
|
84
|
-
emit('refresh');
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
</script>
|
|
89
|
-
|
|
90
|
-
<template>
|
|
91
|
-
<div>
|
|
92
|
-
<!-- Empty state -->
|
|
93
|
-
<div
|
|
94
|
-
v-if="!sortedSessions.length"
|
|
95
|
-
:class="[
|
|
96
|
-
'rounded-xl border p-8 text-center',
|
|
97
|
-
escDark ? 'border-white/[0.06] bg-neutral-900/60' : 'border-gray-200 bg-white',
|
|
98
|
-
]"
|
|
99
|
-
>
|
|
100
|
-
<svg
|
|
101
|
-
:class="['mx-auto mb-3 h-10 w-10', escDark ? 'text-neutral-700' : 'text-gray-300']"
|
|
102
|
-
fill="none"
|
|
103
|
-
stroke="currentColor"
|
|
104
|
-
stroke-width="1.5"
|
|
105
|
-
viewBox="0 0 24 24"
|
|
106
|
-
>
|
|
107
|
-
<path
|
|
108
|
-
stroke-linecap="round"
|
|
109
|
-
stroke-linejoin="round"
|
|
110
|
-
d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"
|
|
111
|
-
/>
|
|
112
|
-
</svg>
|
|
113
|
-
<p :class="['text-sm', escDark ? 'text-neutral-600' : 'text-gray-400']">
|
|
114
|
-
{{ t('chat.no_chats_waiting') }}
|
|
115
|
-
</p>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<!-- Queue list -->
|
|
119
|
-
<div
|
|
120
|
-
v-else
|
|
121
|
-
:class="[
|
|
122
|
-
'overflow-hidden rounded-xl border',
|
|
123
|
-
escDark ? 'border-white/[0.06] bg-neutral-900/60' : 'border-gray-200 bg-white',
|
|
124
|
-
]"
|
|
125
|
-
>
|
|
126
|
-
<table class="min-w-full">
|
|
127
|
-
<thead>
|
|
128
|
-
<tr :class="escDark ? 'bg-white/[0.02]' : 'bg-gray-50'">
|
|
129
|
-
<th
|
|
130
|
-
:class="[
|
|
131
|
-
'px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider',
|
|
132
|
-
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
133
|
-
]"
|
|
134
|
-
>
|
|
135
|
-
{{ t('chat.customer') }}
|
|
136
|
-
</th>
|
|
137
|
-
<th
|
|
138
|
-
:class="[
|
|
139
|
-
'px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider',
|
|
140
|
-
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
141
|
-
]"
|
|
142
|
-
>
|
|
143
|
-
{{ t('chat.department') }}
|
|
144
|
-
</th>
|
|
145
|
-
<th
|
|
146
|
-
:class="[
|
|
147
|
-
'px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider',
|
|
148
|
-
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
149
|
-
]"
|
|
150
|
-
>
|
|
151
|
-
{{ t('chat.first_message') }}
|
|
152
|
-
</th>
|
|
153
|
-
<th
|
|
154
|
-
:class="[
|
|
155
|
-
'px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider',
|
|
156
|
-
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
157
|
-
]"
|
|
158
|
-
>
|
|
159
|
-
{{ t('chat.wait_time') }}
|
|
160
|
-
</th>
|
|
161
|
-
<th
|
|
162
|
-
:class="[
|
|
163
|
-
'px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider',
|
|
164
|
-
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
165
|
-
]"
|
|
166
|
-
></th>
|
|
167
|
-
</tr>
|
|
168
|
-
</thead>
|
|
169
|
-
<tbody :class="escDark ? 'divide-y divide-white/[0.04]' : 'divide-y divide-gray-100'">
|
|
170
|
-
<tr
|
|
171
|
-
v-for="session in sortedSessions"
|
|
172
|
-
:key="session.id"
|
|
173
|
-
:class="['transition-colors', escDark ? 'hover:bg-white/[0.03]' : 'hover:bg-gray-50']"
|
|
174
|
-
>
|
|
175
|
-
<td class="px-4 py-3">
|
|
176
|
-
<div :class="['text-sm font-medium', escDark ? 'text-neutral-200' : 'text-gray-900']">
|
|
177
|
-
{{ session.customer_name || t('ticket.unknown') }}
|
|
178
|
-
</div>
|
|
179
|
-
<div :class="['text-xs', escDark ? 'text-neutral-600' : 'text-gray-400']">
|
|
180
|
-
{{ session.customer_email || '' }}
|
|
181
|
-
</div>
|
|
182
|
-
</td>
|
|
183
|
-
<td :class="['px-4 py-3 text-sm', escDark ? 'text-neutral-400' : 'text-gray-500']">
|
|
184
|
-
{{ session.department?.name || '---' }}
|
|
185
|
-
</td>
|
|
186
|
-
<td
|
|
187
|
-
:class="[
|
|
188
|
-
'max-w-[200px] truncate px-4 py-3 text-sm',
|
|
189
|
-
escDark ? 'text-neutral-400' : 'text-gray-600',
|
|
190
|
-
]"
|
|
191
|
-
>
|
|
192
|
-
{{ session.first_message || '...' }}
|
|
193
|
-
</td>
|
|
194
|
-
<td class="px-4 py-3">
|
|
195
|
-
<span
|
|
196
|
-
:class="[
|
|
197
|
-
'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',
|
|
198
|
-
escDark ? 'bg-amber-500/10 text-amber-400' : 'bg-amber-50 text-amber-700',
|
|
199
|
-
]"
|
|
200
|
-
>
|
|
201
|
-
{{ waitTime(session.created_at) }}
|
|
202
|
-
</span>
|
|
203
|
-
</td>
|
|
204
|
-
<td class="px-4 py-3 text-right">
|
|
205
|
-
<button
|
|
206
|
-
:class="[
|
|
207
|
-
'rounded-lg px-3 py-1.5 text-sm font-medium text-white transition-all',
|
|
208
|
-
escDark
|
|
209
|
-
? 'bg-gradient-to-r from-cyan-500 to-violet-500 hover:from-cyan-400 hover:to-violet-400'
|
|
210
|
-
: 'bg-blue-600 hover:bg-blue-500',
|
|
211
|
-
]"
|
|
212
|
-
@click="acceptChat(session)"
|
|
213
|
-
>
|
|
214
|
-
{{ t('chat.accept') }}
|
|
215
|
-
</button>
|
|
216
|
-
</td>
|
|
217
|
-
</tr>
|
|
218
|
-
</tbody>
|
|
219
|
-
</table>
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed, inject, onMounted, onUnmounted } from 'vue';
|
|
3
|
+
import { usePage } from '@inertiajs/vue3';
|
|
4
|
+
import { useI18n } from '../composables/useI18n';
|
|
5
|
+
import { useChat } from '../composables/useChat';
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
sessions: { type: Array, default: () => [] },
|
|
9
|
+
acceptEndpoint: { type: String, default: '' },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits(['accept', 'refresh']);
|
|
13
|
+
|
|
14
|
+
const escDark = inject(
|
|
15
|
+
'esc-dark',
|
|
16
|
+
computed(() => false),
|
|
17
|
+
);
|
|
18
|
+
const { t } = useI18n();
|
|
19
|
+
|
|
20
|
+
// Live elapsed timers
|
|
21
|
+
const now = ref(Date.now());
|
|
22
|
+
let timerInterval = null;
|
|
23
|
+
|
|
24
|
+
onMounted(() => {
|
|
25
|
+
timerInterval = setInterval(() => {
|
|
26
|
+
now.value = Date.now();
|
|
27
|
+
}, 1000);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
onUnmounted(() => {
|
|
31
|
+
clearInterval(timerInterval);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function waitTime(createdAt) {
|
|
35
|
+
if (!createdAt) return '0s';
|
|
36
|
+
const diffMs = now.value - new Date(createdAt).getTime();
|
|
37
|
+
const totalSecs = Math.max(0, Math.floor(diffMs / 1000));
|
|
38
|
+
if (totalSecs < 60) return `${totalSecs}s`;
|
|
39
|
+
const mins = Math.floor(totalSecs / 60);
|
|
40
|
+
if (mins < 60) return `${mins}m ${totalSecs % 60}s`;
|
|
41
|
+
const hrs = Math.floor(mins / 60);
|
|
42
|
+
return `${hrs}h ${mins % 60}m`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const sortedSessions = computed(() => {
|
|
46
|
+
return [...props.sessions].sort((a, b) => {
|
|
47
|
+
return new Date(a.created_at) - new Date(b.created_at);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
async function acceptChat(session) {
|
|
52
|
+
emit('accept', session);
|
|
53
|
+
if (props.acceptEndpoint) {
|
|
54
|
+
try {
|
|
55
|
+
await fetch(props.acceptEndpoint.replace(':id', session.id), {
|
|
56
|
+
method: 'POST',
|
|
57
|
+
headers: {
|
|
58
|
+
Accept: 'application/json',
|
|
59
|
+
'Content-Type': 'application/json',
|
|
60
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
61
|
+
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.content || '',
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
} catch {
|
|
65
|
+
// handled by caller
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Subscribe to queue for real-time updates. Read the host framework's
|
|
71
|
+
// route prefix from Inertia page props so chat API calls resolve
|
|
72
|
+
// correctly on NestJS backends ('/escalated/widget') as well as every
|
|
73
|
+
// other framework ('/support/widget').
|
|
74
|
+
const page = usePage();
|
|
75
|
+
const routePrefix = page.props.escalated?.prefix || 'support';
|
|
76
|
+
const { subscribeToChatQueue } = useChat({ widgetPath: `/${routePrefix}/widget` });
|
|
77
|
+
|
|
78
|
+
onMounted(() => {
|
|
79
|
+
subscribeToChatQueue({
|
|
80
|
+
onNewChat() {
|
|
81
|
+
emit('refresh');
|
|
82
|
+
},
|
|
83
|
+
onChatAccepted() {
|
|
84
|
+
emit('refresh');
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<template>
|
|
91
|
+
<div>
|
|
92
|
+
<!-- Empty state -->
|
|
93
|
+
<div
|
|
94
|
+
v-if="!sortedSessions.length"
|
|
95
|
+
:class="[
|
|
96
|
+
'rounded-xl border p-8 text-center',
|
|
97
|
+
escDark ? 'border-white/[0.06] bg-neutral-900/60' : 'border-gray-200 bg-white',
|
|
98
|
+
]"
|
|
99
|
+
>
|
|
100
|
+
<svg
|
|
101
|
+
:class="['mx-auto mb-3 h-10 w-10', escDark ? 'text-neutral-700' : 'text-gray-300']"
|
|
102
|
+
fill="none"
|
|
103
|
+
stroke="currentColor"
|
|
104
|
+
stroke-width="1.5"
|
|
105
|
+
viewBox="0 0 24 24"
|
|
106
|
+
>
|
|
107
|
+
<path
|
|
108
|
+
stroke-linecap="round"
|
|
109
|
+
stroke-linejoin="round"
|
|
110
|
+
d="M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z"
|
|
111
|
+
/>
|
|
112
|
+
</svg>
|
|
113
|
+
<p :class="['text-sm', escDark ? 'text-neutral-600' : 'text-gray-400']">
|
|
114
|
+
{{ t('chat.no_chats_waiting') }}
|
|
115
|
+
</p>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<!-- Queue list -->
|
|
119
|
+
<div
|
|
120
|
+
v-else
|
|
121
|
+
:class="[
|
|
122
|
+
'overflow-hidden rounded-xl border',
|
|
123
|
+
escDark ? 'border-white/[0.06] bg-neutral-900/60' : 'border-gray-200 bg-white',
|
|
124
|
+
]"
|
|
125
|
+
>
|
|
126
|
+
<table class="min-w-full">
|
|
127
|
+
<thead>
|
|
128
|
+
<tr :class="escDark ? 'bg-white/[0.02]' : 'bg-gray-50'">
|
|
129
|
+
<th
|
|
130
|
+
:class="[
|
|
131
|
+
'px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider',
|
|
132
|
+
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
133
|
+
]"
|
|
134
|
+
>
|
|
135
|
+
{{ t('chat.customer') }}
|
|
136
|
+
</th>
|
|
137
|
+
<th
|
|
138
|
+
:class="[
|
|
139
|
+
'px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider',
|
|
140
|
+
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
141
|
+
]"
|
|
142
|
+
>
|
|
143
|
+
{{ t('chat.department') }}
|
|
144
|
+
</th>
|
|
145
|
+
<th
|
|
146
|
+
:class="[
|
|
147
|
+
'px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider',
|
|
148
|
+
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
149
|
+
]"
|
|
150
|
+
>
|
|
151
|
+
{{ t('chat.first_message') }}
|
|
152
|
+
</th>
|
|
153
|
+
<th
|
|
154
|
+
:class="[
|
|
155
|
+
'px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider',
|
|
156
|
+
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
157
|
+
]"
|
|
158
|
+
>
|
|
159
|
+
{{ t('chat.wait_time') }}
|
|
160
|
+
</th>
|
|
161
|
+
<th
|
|
162
|
+
:class="[
|
|
163
|
+
'px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider',
|
|
164
|
+
escDark ? 'text-neutral-500' : 'text-gray-500',
|
|
165
|
+
]"
|
|
166
|
+
></th>
|
|
167
|
+
</tr>
|
|
168
|
+
</thead>
|
|
169
|
+
<tbody :class="escDark ? 'divide-y divide-white/[0.04]' : 'divide-y divide-gray-100'">
|
|
170
|
+
<tr
|
|
171
|
+
v-for="session in sortedSessions"
|
|
172
|
+
:key="session.id"
|
|
173
|
+
:class="['transition-colors', escDark ? 'hover:bg-white/[0.03]' : 'hover:bg-gray-50']"
|
|
174
|
+
>
|
|
175
|
+
<td class="px-4 py-3">
|
|
176
|
+
<div :class="['text-sm font-medium', escDark ? 'text-neutral-200' : 'text-gray-900']">
|
|
177
|
+
{{ session.customer_name || t('ticket.unknown') }}
|
|
178
|
+
</div>
|
|
179
|
+
<div :class="['text-xs', escDark ? 'text-neutral-600' : 'text-gray-400']">
|
|
180
|
+
{{ session.customer_email || '' }}
|
|
181
|
+
</div>
|
|
182
|
+
</td>
|
|
183
|
+
<td :class="['px-4 py-3 text-sm', escDark ? 'text-neutral-400' : 'text-gray-500']">
|
|
184
|
+
{{ session.department?.name || '---' }}
|
|
185
|
+
</td>
|
|
186
|
+
<td
|
|
187
|
+
:class="[
|
|
188
|
+
'max-w-[200px] truncate px-4 py-3 text-sm',
|
|
189
|
+
escDark ? 'text-neutral-400' : 'text-gray-600',
|
|
190
|
+
]"
|
|
191
|
+
>
|
|
192
|
+
{{ session.first_message || '...' }}
|
|
193
|
+
</td>
|
|
194
|
+
<td class="px-4 py-3">
|
|
195
|
+
<span
|
|
196
|
+
:class="[
|
|
197
|
+
'inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium',
|
|
198
|
+
escDark ? 'bg-amber-500/10 text-amber-400' : 'bg-amber-50 text-amber-700',
|
|
199
|
+
]"
|
|
200
|
+
>
|
|
201
|
+
{{ waitTime(session.created_at) }}
|
|
202
|
+
</span>
|
|
203
|
+
</td>
|
|
204
|
+
<td class="px-4 py-3 text-right">
|
|
205
|
+
<button
|
|
206
|
+
:class="[
|
|
207
|
+
'rounded-lg px-3 py-1.5 text-sm font-medium text-white transition-all',
|
|
208
|
+
escDark
|
|
209
|
+
? 'bg-gradient-to-r from-cyan-500 to-violet-500 hover:from-cyan-400 hover:to-violet-400'
|
|
210
|
+
: 'bg-blue-600 hover:bg-blue-500',
|
|
211
|
+
]"
|
|
212
|
+
@click="acceptChat(session)"
|
|
213
|
+
>
|
|
214
|
+
{{ t('chat.accept') }}
|
|
215
|
+
</button>
|
|
216
|
+
</td>
|
|
217
|
+
</tr>
|
|
218
|
+
</tbody>
|
|
219
|
+
</table>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</template>
|