@escalated-dev/escalated 0.6.0 → 0.7.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/README.md +94 -2
- package/package.json +31 -2
- package/src/components/ActivityTimeline.stories.js +55 -0
- package/src/components/ActivityTimeline.vue +24 -7
- package/src/components/AdminDashboard.stories.js +1095 -0
- package/src/components/AgentLoadIndicator.stories.js +37 -0
- package/src/components/AgentLoadIndicator.vue +49 -0
- package/src/components/AgentPerformanceCard.vue +44 -0
- package/src/components/ArticleEditor.vue +82 -0
- package/src/components/AssigneeSelect.vue +19 -5
- package/src/components/AttachmentList.vue +53 -37
- package/src/components/AuditLogEntry.vue +95 -0
- package/src/components/BulkActionBar.vue +99 -30
- package/src/components/CategoryTree.vue +89 -0
- package/src/components/ChartWidget.vue +46 -0
- package/src/components/CollisionWarning.stories.js +30 -0
- package/src/components/CollisionWarning.vue +68 -0
- package/src/components/ConditionalFieldRules.vue +135 -0
- package/src/components/ContextPanel.vue +66 -0
- package/src/components/ContextPanelSection.vue +65 -0
- package/src/components/CustomFieldRenderer.vue +159 -0
- package/src/components/EscalatedLayout.vue +400 -69
- package/src/components/FileDropzone.vue +26 -10
- package/src/components/FollowButton.stories.js +30 -0
- package/src/components/FollowButton.vue +53 -28
- package/src/components/KeyboardShortcutHelp.vue +129 -39
- package/src/components/KnowledgePanel.vue +122 -0
- package/src/components/KpiCard.stories.js +32 -0
- package/src/components/KpiCard.vue +88 -0
- package/src/components/MacroDropdown.vue +95 -35
- package/src/components/PermissionMatrix.vue +107 -0
- package/src/components/PinnedNotes.vue +70 -31
- package/src/components/PresenceIndicator.vue +93 -27
- package/src/components/PriorityBadge.stories.js +33 -0
- package/src/components/PriorityBadge.vue +9 -2
- package/src/components/QuickFilters.vue +65 -49
- package/src/components/ReplyComposer.vue +144 -30
- package/src/components/ReplyThread.vue +72 -20
- package/src/components/SatisfactionRating.vue +98 -46
- package/src/components/ScheduleEditor.vue +104 -0
- package/src/components/SideConversation.vue +165 -0
- package/src/components/SideConversationList.vue +147 -0
- package/src/components/SkillTagManager.vue +79 -0
- package/src/components/SlaComplianceChart.vue +53 -0
- package/src/components/SlaTimer.stories.js +35 -0
- package/src/components/SlaTimer.vue +17 -4
- package/src/components/StatsCard.stories.js +24 -0
- package/src/components/StatsCard.vue +58 -46
- package/src/components/StatusBadge.stories.js +53 -0
- package/src/components/StatusBadge.vue +36 -4
- package/src/components/TagSelect.vue +43 -12
- package/src/components/TicketFilters.vue +225 -69
- package/src/components/TicketLinkPanel.vue +193 -0
- package/src/components/TicketList.vue +594 -193
- package/src/components/TicketMergeDialog.vue +157 -0
- package/src/components/TicketSidebar.vue +167 -99
- package/src/components/TicketTypeSelector.vue +21 -0
- package/src/components/TotpInput.stories.js +9 -0
- package/src/components/TotpInput.vue +81 -0
- package/src/components/TwoFactorSetup.vue +113 -0
- package/src/composables/useDebouncedSearch.js +38 -0
- package/src/composables/usePluginExtensions.js +95 -3
- package/src/composables/usePluginHooks.js +65 -0
- package/src/defineEscalatedPlugin.js +34 -8
- package/src/index.js +72 -35
- package/src/locales/en.json +25 -0
- package/src/pages/Admin/ApiTokens/Index.vue +231 -67
- package/src/pages/Admin/AuditLog/Index.vue +154 -0
- package/src/pages/Admin/Automations/Form.vue +184 -0
- package/src/pages/Admin/Automations/Index.vue +129 -0
- package/src/pages/Admin/BusinessHours/Form.vue +172 -0
- package/src/pages/Admin/BusinessHours/Index.vue +113 -0
- package/src/pages/Admin/CannedResponses/Index.vue +127 -70
- package/src/pages/Admin/Capacity/Index.vue +134 -0
- package/src/pages/Admin/CustomFields/Form.vue +195 -0
- package/src/pages/Admin/CustomFields/Index.vue +134 -0
- package/src/pages/Admin/CustomObjects/Form.vue +202 -0
- package/src/pages/Admin/CustomObjects/Index.vue +127 -0
- package/src/pages/Admin/CustomObjects/Records.vue +228 -0
- package/src/pages/Admin/Departments/Form.vue +75 -51
- package/src/pages/Admin/Departments/Index.vue +109 -57
- package/src/pages/Admin/EscalationRules/Form.vue +157 -96
- package/src/pages/Admin/EscalationRules/Index.vue +178 -57
- package/src/pages/Admin/Import/Connect.vue +96 -0
- package/src/pages/Admin/Import/Index.vue +102 -0
- package/src/pages/Admin/Import/Mapping.vue +110 -0
- package/src/pages/Admin/Import/Progress.vue +153 -0
- package/src/pages/Admin/Import/Review.vue +76 -0
- package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -0
- package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -0
- package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -0
- package/src/pages/Admin/Macros/Index.vue +250 -89
- package/src/pages/Admin/Plugins/Index.vue +205 -75
- package/src/pages/Admin/Reports/AgentMetrics.vue +115 -0
- package/src/pages/Admin/Reports/CsatReport.vue +127 -0
- package/src/pages/Admin/Reports/Dashboard.vue +211 -0
- package/src/pages/Admin/Reports/SlaReport.vue +166 -0
- package/src/pages/Admin/Reports.vue +139 -34
- package/src/pages/Admin/Roles/Form.vue +71 -0
- package/src/pages/Admin/Roles/Index.vue +122 -0
- package/src/pages/Admin/Settings/CsatSettings.vue +165 -0
- package/src/pages/Admin/Settings/DataRetention.vue +182 -0
- package/src/pages/Admin/Settings/EmailSettings.vue +243 -0
- package/src/pages/Admin/Settings/Sandbox.vue +135 -0
- package/src/pages/Admin/Settings/SsoSettings.vue +218 -0
- package/src/pages/Admin/Settings/TwoFactor.vue +110 -0
- package/src/pages/Admin/Settings.vue +468 -260
- package/src/pages/Admin/Skills/Form.vue +53 -0
- package/src/pages/Admin/Skills/Index.vue +94 -0
- package/src/pages/Admin/SlaPolicies/Form.vue +118 -75
- package/src/pages/Admin/SlaPolicies/Index.vue +120 -59
- package/src/pages/Admin/Statuses/Form.vue +114 -0
- package/src/pages/Admin/Statuses/Index.vue +153 -0
- package/src/pages/Admin/Tags/Index.vue +191 -105
- package/src/pages/Admin/Tickets/Index.vue +91 -39
- package/src/pages/Admin/Tickets/Show.vue +101 -37
- package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -0
- package/src/pages/Admin/Webhooks/Form.vue +110 -0
- package/src/pages/Admin/Webhooks/Index.vue +136 -0
- package/src/pages/Agent/Dashboard.vue +311 -186
- package/src/pages/Agent/TicketIndex.vue +88 -38
- package/src/pages/Agent/TicketShow.vue +258 -51
- package/src/pages/Customer/Create.vue +36 -9
- package/src/pages/Customer/Index.vue +31 -24
- package/src/pages/Customer/KnowledgeBase/Article.vue +127 -0
- package/src/pages/Customer/KnowledgeBase/Index.vue +151 -0
- package/src/plugin.js +86 -1
- package/src/utils/constants.js +30 -0
- package/src/utils/formatting.js +35 -0
- package/src/pages/Admin/Plugins.vue +0 -129
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import EscalatedLayout from '../../../components/EscalatedLayout.vue';
|
|
3
|
+
import KpiCard from '../../../components/KpiCard.vue';
|
|
4
|
+
import ChartWidget from '../../../components/ChartWidget.vue';
|
|
5
|
+
import { router, Link } from '@inertiajs/vue3';
|
|
6
|
+
import { ref } from 'vue';
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
period_days: Number,
|
|
10
|
+
volume: Array,
|
|
11
|
+
by_status: Array,
|
|
12
|
+
by_priority: Array,
|
|
13
|
+
avg_response_hours: Number,
|
|
14
|
+
avg_resolution_hours: Number,
|
|
15
|
+
sla_compliance: Number,
|
|
16
|
+
csat_average: Number,
|
|
17
|
+
agent_performance: Array,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const activeTab = ref('overview');
|
|
21
|
+
|
|
22
|
+
const tabs = [
|
|
23
|
+
{ key: 'overview', label: 'Overview' },
|
|
24
|
+
{ key: 'agents', label: 'Agents' },
|
|
25
|
+
{ key: 'sla', label: 'SLA' },
|
|
26
|
+
{ key: 'csat', label: 'CSAT' },
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
function changePeriod(days) {
|
|
30
|
+
router.get(route('escalated.admin.reports.dashboard'), { days }, { preserveState: true });
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<EscalatedLayout title="Reports Dashboard">
|
|
36
|
+
<!-- Period selector -->
|
|
37
|
+
<div class="mb-6 flex items-center justify-between">
|
|
38
|
+
<div class="flex gap-2">
|
|
39
|
+
<button
|
|
40
|
+
v-for="d in [7, 30, 90]"
|
|
41
|
+
:key="d"
|
|
42
|
+
:class="[
|
|
43
|
+
'rounded-lg px-3.5 py-1.5 text-sm font-medium transition-all',
|
|
44
|
+
period_days === d
|
|
45
|
+
? 'bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] text-white shadow-lg shadow-[var(--esc-panel-bg)]/20'
|
|
46
|
+
: 'border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] text-[var(--esc-panel-text-tertiary)] hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]',
|
|
47
|
+
]"
|
|
48
|
+
@click="changePeriod(d)"
|
|
49
|
+
>
|
|
50
|
+
Last {{ d }} days
|
|
51
|
+
</button>
|
|
52
|
+
</div>
|
|
53
|
+
<Link
|
|
54
|
+
:href="route('escalated.admin.reports')"
|
|
55
|
+
class="text-sm text-[var(--esc-panel-text-muted)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
56
|
+
>
|
|
57
|
+
Classic View
|
|
58
|
+
</Link>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<!-- Tabs -->
|
|
62
|
+
<div class="mb-6 flex gap-1 rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] p-1">
|
|
63
|
+
<button
|
|
64
|
+
v-for="tab in tabs"
|
|
65
|
+
:key="tab.key"
|
|
66
|
+
:class="[
|
|
67
|
+
'rounded-md px-4 py-2 text-sm font-medium transition-all',
|
|
68
|
+
activeTab === tab.key
|
|
69
|
+
? 'bg-[var(--esc-panel-active)] text-[var(--esc-panel-text)]'
|
|
70
|
+
: 'text-[var(--esc-panel-text-muted)] hover:text-[var(--esc-panel-text-secondary)]',
|
|
71
|
+
]"
|
|
72
|
+
@click="activeTab = tab.key"
|
|
73
|
+
>
|
|
74
|
+
{{ tab.label }}
|
|
75
|
+
</button>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<!-- Overview Tab -->
|
|
79
|
+
<div v-if="activeTab === 'overview'">
|
|
80
|
+
<!-- KPI Cards -->
|
|
81
|
+
<div class="mb-6 grid grid-cols-2 gap-4 md:grid-cols-4">
|
|
82
|
+
<KpiCard
|
|
83
|
+
label="Avg Response Time"
|
|
84
|
+
:value="`${avg_response_hours}h`"
|
|
85
|
+
:icon="'M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z'"
|
|
86
|
+
/>
|
|
87
|
+
<KpiCard
|
|
88
|
+
label="Avg Resolution Time"
|
|
89
|
+
:value="`${avg_resolution_hours}h`"
|
|
90
|
+
:icon="'M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z'"
|
|
91
|
+
/>
|
|
92
|
+
<KpiCard
|
|
93
|
+
label="SLA Compliance"
|
|
94
|
+
:value="`${sla_compliance}%`"
|
|
95
|
+
:icon="'M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z'"
|
|
96
|
+
/>
|
|
97
|
+
<KpiCard
|
|
98
|
+
label="CSAT Average"
|
|
99
|
+
:value="csat_average || '—'"
|
|
100
|
+
:icon="'M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z'"
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<!-- Charts -->
|
|
105
|
+
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
|
|
106
|
+
<ChartWidget title="Ticket Volume" :data="volume" color="cyan" />
|
|
107
|
+
<ChartWidget title="By Status" :data="by_status" color="violet" />
|
|
108
|
+
<ChartWidget title="By Priority" :data="by_priority" color="amber" />
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<!-- Agents Tab -->
|
|
113
|
+
<div v-if="activeTab === 'agents'">
|
|
114
|
+
<div class="mb-4 text-right">
|
|
115
|
+
<Link
|
|
116
|
+
:href="route('escalated.admin.reports.agents', { days: period_days })"
|
|
117
|
+
class="text-sm text-[var(--esc-panel-accent)] hover:text-[var(--esc-panel-accent)]"
|
|
118
|
+
>
|
|
119
|
+
Full Agent Report →
|
|
120
|
+
</Link>
|
|
121
|
+
</div>
|
|
122
|
+
<div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)]">
|
|
123
|
+
<table class="w-full">
|
|
124
|
+
<thead>
|
|
125
|
+
<tr class="border-b border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)]">
|
|
126
|
+
<th
|
|
127
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
128
|
+
>
|
|
129
|
+
Agent
|
|
130
|
+
</th>
|
|
131
|
+
<th
|
|
132
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
133
|
+
>
|
|
134
|
+
Tickets
|
|
135
|
+
</th>
|
|
136
|
+
<th
|
|
137
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
138
|
+
>
|
|
139
|
+
Resolved
|
|
140
|
+
</th>
|
|
141
|
+
<th
|
|
142
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
143
|
+
>
|
|
144
|
+
Avg Response
|
|
145
|
+
</th>
|
|
146
|
+
<th
|
|
147
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
148
|
+
>
|
|
149
|
+
Avg Resolution
|
|
150
|
+
</th>
|
|
151
|
+
</tr>
|
|
152
|
+
</thead>
|
|
153
|
+
<tbody class="divide-y divide-[var(--esc-panel-border)]">
|
|
154
|
+
<tr
|
|
155
|
+
v-for="agent in agent_performance"
|
|
156
|
+
:key="agent.agent_id"
|
|
157
|
+
class="hover:bg-[var(--esc-panel-hover)]"
|
|
158
|
+
>
|
|
159
|
+
<td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
|
|
160
|
+
{{ agent.agent_name }}
|
|
161
|
+
</td>
|
|
162
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
163
|
+
{{ agent.total_tickets }}
|
|
164
|
+
</td>
|
|
165
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
166
|
+
{{ agent.resolved_tickets }}
|
|
167
|
+
</td>
|
|
168
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
169
|
+
{{ agent.avg_response_hours ?? '—' }}h
|
|
170
|
+
</td>
|
|
171
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
172
|
+
{{ agent.avg_resolution_hours ?? '—' }}h
|
|
173
|
+
</td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr v-if="!agent_performance?.length">
|
|
176
|
+
<td colspan="5" class="px-4 py-8 text-center text-sm text-[var(--esc-panel-text-muted)]">
|
|
177
|
+
No agent data for this period.
|
|
178
|
+
</td>
|
|
179
|
+
</tr>
|
|
180
|
+
</tbody>
|
|
181
|
+
</table>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<!-- SLA Tab -->
|
|
186
|
+
<div v-if="activeTab === 'sla'">
|
|
187
|
+
<div class="mb-4 flex items-center justify-between">
|
|
188
|
+
<KpiCard label="Overall SLA Compliance" :value="`${sla_compliance}%`" />
|
|
189
|
+
<Link
|
|
190
|
+
:href="route('escalated.admin.reports.sla', { days: period_days })"
|
|
191
|
+
class="text-sm text-[var(--esc-panel-accent)] hover:text-[var(--esc-panel-accent)]"
|
|
192
|
+
>
|
|
193
|
+
Full SLA Report →
|
|
194
|
+
</Link>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<!-- CSAT Tab -->
|
|
199
|
+
<div v-if="activeTab === 'csat'">
|
|
200
|
+
<div class="mb-4 flex items-center justify-between">
|
|
201
|
+
<KpiCard label="Average CSAT" :value="csat_average || '—'" />
|
|
202
|
+
<Link
|
|
203
|
+
:href="route('escalated.admin.reports.csat', { days: period_days })"
|
|
204
|
+
class="text-sm text-[var(--esc-panel-accent)] hover:text-[var(--esc-panel-accent)]"
|
|
205
|
+
>
|
|
206
|
+
Full CSAT Report →
|
|
207
|
+
</Link>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</EscalatedLayout>
|
|
211
|
+
</template>
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import EscalatedLayout from '../../../components/EscalatedLayout.vue';
|
|
3
|
+
import KpiCard from '../../../components/KpiCard.vue';
|
|
4
|
+
import SlaComplianceChart from '../../../components/SlaComplianceChart.vue';
|
|
5
|
+
import { router, Link } from '@inertiajs/vue3';
|
|
6
|
+
import { computed } from 'vue';
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
period_days: Number,
|
|
10
|
+
compliance_rate: Number,
|
|
11
|
+
compliance_by_policy: Array,
|
|
12
|
+
breaches: Array,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function changePeriod(days) {
|
|
16
|
+
router.get(route('escalated.admin.reports.sla'), { days }, { preserveState: true });
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const totalTickets = computed(() => {
|
|
20
|
+
return props.compliance_by_policy?.reduce((sum, p) => sum + p.total, 0) || 0;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const totalBreaches = computed(() => {
|
|
24
|
+
return props.compliance_by_policy?.reduce((sum, p) => sum + p.breached, 0) || 0;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const firstResponseBreaches = computed(() => {
|
|
28
|
+
return props.breaches?.filter((b) => b.sla_first_response_breached).length || 0;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const resolutionBreaches = computed(() => {
|
|
32
|
+
return props.breaches?.filter((b) => b.sla_resolution_breached).length || 0;
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<EscalatedLayout title="SLA Achievement Report">
|
|
38
|
+
<div class="mb-6 flex items-center justify-between">
|
|
39
|
+
<div class="flex gap-2">
|
|
40
|
+
<button
|
|
41
|
+
v-for="d in [7, 30, 90]"
|
|
42
|
+
:key="d"
|
|
43
|
+
:class="[
|
|
44
|
+
'rounded-lg px-3.5 py-1.5 text-sm font-medium transition-all',
|
|
45
|
+
period_days === d
|
|
46
|
+
? 'bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] text-white shadow-lg shadow-[var(--esc-panel-bg)]/20'
|
|
47
|
+
: 'border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] text-[var(--esc-panel-text-tertiary)] hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]',
|
|
48
|
+
]"
|
|
49
|
+
@click="changePeriod(d)"
|
|
50
|
+
>
|
|
51
|
+
Last {{ d }} days
|
|
52
|
+
</button>
|
|
53
|
+
</div>
|
|
54
|
+
<Link
|
|
55
|
+
:href="route('escalated.admin.reports')"
|
|
56
|
+
class="text-sm text-[var(--esc-panel-text-muted)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
57
|
+
>
|
|
58
|
+
← Back to Reports
|
|
59
|
+
</Link>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<!-- Summary KPIs -->
|
|
63
|
+
<div class="mb-6 grid grid-cols-2 gap-4 md:grid-cols-4">
|
|
64
|
+
<KpiCard
|
|
65
|
+
label="Total SLA Tickets"
|
|
66
|
+
:value="totalTickets"
|
|
67
|
+
:icon="'M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 010 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 010-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375z'"
|
|
68
|
+
/>
|
|
69
|
+
<KpiCard
|
|
70
|
+
label="Compliance Rate"
|
|
71
|
+
:value="`${compliance_rate}%`"
|
|
72
|
+
:icon="'M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z'"
|
|
73
|
+
/>
|
|
74
|
+
<KpiCard
|
|
75
|
+
label="First Response Breaches"
|
|
76
|
+
:value="firstResponseBreaches"
|
|
77
|
+
:icon="'M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z'"
|
|
78
|
+
/>
|
|
79
|
+
<KpiCard
|
|
80
|
+
label="Resolution Breaches"
|
|
81
|
+
:value="resolutionBreaches"
|
|
82
|
+
:icon="'M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z'"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<!-- Compliance by Policy -->
|
|
87
|
+
<div class="mb-8">
|
|
88
|
+
<SlaComplianceChart :data="compliance_by_policy" />
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<!-- Breach Details Table -->
|
|
92
|
+
<div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)]">
|
|
93
|
+
<div class="border-b border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-4 py-3">
|
|
94
|
+
<h3 class="text-sm font-semibold text-[var(--esc-panel-text-secondary)]">Breach Details</h3>
|
|
95
|
+
</div>
|
|
96
|
+
<table class="w-full">
|
|
97
|
+
<thead>
|
|
98
|
+
<tr class="border-b border-[var(--esc-panel-border)]">
|
|
99
|
+
<th
|
|
100
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
101
|
+
>
|
|
102
|
+
Ticket
|
|
103
|
+
</th>
|
|
104
|
+
<th
|
|
105
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
106
|
+
>
|
|
107
|
+
Subject
|
|
108
|
+
</th>
|
|
109
|
+
<th
|
|
110
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
111
|
+
>
|
|
112
|
+
SLA Policy
|
|
113
|
+
</th>
|
|
114
|
+
<th
|
|
115
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
116
|
+
>
|
|
117
|
+
Breach Type
|
|
118
|
+
</th>
|
|
119
|
+
<th
|
|
120
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
121
|
+
>
|
|
122
|
+
Created
|
|
123
|
+
</th>
|
|
124
|
+
</tr>
|
|
125
|
+
</thead>
|
|
126
|
+
<tbody class="divide-y divide-[var(--esc-panel-border)]">
|
|
127
|
+
<tr v-for="ticket in breaches" :key="ticket.id" class="hover:bg-[var(--esc-panel-hover)]">
|
|
128
|
+
<td class="px-4 py-3 text-sm font-mono text-[var(--esc-panel-accent)]">
|
|
129
|
+
{{ ticket.reference }}
|
|
130
|
+
</td>
|
|
131
|
+
<td class="max-w-xs truncate px-4 py-3 text-sm text-[var(--esc-panel-text-secondary)]">
|
|
132
|
+
{{ ticket.subject }}
|
|
133
|
+
</td>
|
|
134
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
135
|
+
{{ ticket.sla_policy?.name || '—' }}
|
|
136
|
+
</td>
|
|
137
|
+
<td class="px-4 py-3">
|
|
138
|
+
<div class="flex gap-1.5">
|
|
139
|
+
<span
|
|
140
|
+
v-if="ticket.sla_first_response_breached"
|
|
141
|
+
class="inline-flex rounded-full border border-red-500/20 bg-red-500/10 px-2 py-0.5 text-xs font-medium text-red-400"
|
|
142
|
+
>
|
|
143
|
+
Response
|
|
144
|
+
</span>
|
|
145
|
+
<span
|
|
146
|
+
v-if="ticket.sla_resolution_breached"
|
|
147
|
+
class="inline-flex rounded-full border border-red-500/20 bg-red-500/10 px-2 py-0.5 text-xs font-medium text-red-400"
|
|
148
|
+
>
|
|
149
|
+
Resolution
|
|
150
|
+
</span>
|
|
151
|
+
</div>
|
|
152
|
+
</td>
|
|
153
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-muted)]">
|
|
154
|
+
{{ ticket.created_at ? new Date(ticket.created_at).toLocaleDateString() : '—' }}
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
<tr v-if="!breaches?.length">
|
|
158
|
+
<td colspan="5" class="px-4 py-8 text-center text-sm text-[var(--esc-panel-text-muted)]">
|
|
159
|
+
No SLA breaches in this period.
|
|
160
|
+
</td>
|
|
161
|
+
</tr>
|
|
162
|
+
</tbody>
|
|
163
|
+
</table>
|
|
164
|
+
</div>
|
|
165
|
+
</EscalatedLayout>
|
|
166
|
+
</template>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import EscalatedLayout from '../../components/EscalatedLayout.vue';
|
|
3
3
|
import StatsCard from '../../components/StatsCard.vue';
|
|
4
|
-
import
|
|
4
|
+
import PluginSlot from '../../components/PluginSlot.vue';
|
|
5
|
+
import { router, Link } from '@inertiajs/vue3';
|
|
6
|
+
import { usePluginExtensions } from '../../composables/usePluginExtensions';
|
|
5
7
|
|
|
6
8
|
const props = defineProps({
|
|
7
9
|
period_days: Number,
|
|
@@ -19,17 +21,59 @@ function changePeriod(days) {
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
function renderStars(rating) {
|
|
22
|
-
return Array.from({ length: 5 }, (_, i) => i < Math.round(rating) ? 'filled' : 'empty');
|
|
24
|
+
return Array.from({ length: 5 }, (_, i) => (i < Math.round(rating) ? 'filled' : 'empty'));
|
|
23
25
|
}
|
|
26
|
+
|
|
27
|
+
const { getPageComponents, reportWidgets } = usePluginExtensions();
|
|
24
28
|
</script>
|
|
25
29
|
|
|
26
30
|
<template>
|
|
27
31
|
<EscalatedLayout title="Reports">
|
|
32
|
+
<!-- Sub-report navigation -->
|
|
33
|
+
<div
|
|
34
|
+
class="mb-6 flex items-center gap-3 rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] p-3"
|
|
35
|
+
>
|
|
36
|
+
<span class="text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
37
|
+
>Detailed Reports:</span
|
|
38
|
+
>
|
|
39
|
+
<Link
|
|
40
|
+
:href="route('escalated.admin.reports.dashboard')"
|
|
41
|
+
class="rounded-md px-3 py-1.5 text-sm text-[var(--esc-panel-text-tertiary)] transition-colors hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
42
|
+
>
|
|
43
|
+
Dashboard
|
|
44
|
+
</Link>
|
|
45
|
+
<Link
|
|
46
|
+
:href="route('escalated.admin.reports.agents')"
|
|
47
|
+
class="rounded-md px-3 py-1.5 text-sm text-[var(--esc-panel-text-tertiary)] transition-colors hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
48
|
+
>
|
|
49
|
+
Agent Metrics
|
|
50
|
+
</Link>
|
|
51
|
+
<Link
|
|
52
|
+
:href="route('escalated.admin.reports.sla')"
|
|
53
|
+
class="rounded-md px-3 py-1.5 text-sm text-[var(--esc-panel-text-tertiary)] transition-colors hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
54
|
+
>
|
|
55
|
+
SLA Report
|
|
56
|
+
</Link>
|
|
57
|
+
<Link
|
|
58
|
+
:href="route('escalated.admin.reports.csat')"
|
|
59
|
+
class="rounded-md px-3 py-1.5 text-sm text-[var(--esc-panel-text-tertiary)] transition-colors hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
60
|
+
>
|
|
61
|
+
CSAT Report
|
|
62
|
+
</Link>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
28
65
|
<div class="mb-6 flex gap-2">
|
|
29
|
-
<button
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
66
|
+
<button
|
|
67
|
+
v-for="d in [7, 30, 90]"
|
|
68
|
+
:key="d"
|
|
69
|
+
:class="[
|
|
70
|
+
'rounded-lg px-3.5 py-1.5 text-sm font-medium transition-all',
|
|
71
|
+
period_days === d
|
|
72
|
+
? 'bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] text-white shadow-lg shadow-[var(--esc-panel-bg)]/20'
|
|
73
|
+
: 'border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] text-[var(--esc-panel-text-tertiary)] hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]',
|
|
74
|
+
]"
|
|
75
|
+
@click="changePeriod(d)"
|
|
76
|
+
>
|
|
33
77
|
Last {{ d }} days
|
|
34
78
|
</button>
|
|
35
79
|
</div>
|
|
@@ -40,62 +84,123 @@ function renderStars(rating) {
|
|
|
40
84
|
<StatsCard label="SLA Breaches" :value="sla_breach_count" color="red" />
|
|
41
85
|
</div>
|
|
42
86
|
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
|
|
43
|
-
<div class="rounded-xl border border-
|
|
44
|
-
<h3 class="mb-4 text-sm font-semibold text-
|
|
87
|
+
<div class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-5">
|
|
88
|
+
<h3 class="mb-4 text-sm font-semibold text-[var(--esc-panel-text-secondary)]">By Status</h3>
|
|
45
89
|
<template v-if="by_status && Object.keys(by_status).length">
|
|
46
|
-
<div
|
|
47
|
-
|
|
48
|
-
|
|
90
|
+
<div
|
|
91
|
+
v-for="(count, status) in by_status"
|
|
92
|
+
:key="status"
|
|
93
|
+
class="mb-2.5 flex items-center justify-between"
|
|
94
|
+
>
|
|
95
|
+
<span class="text-sm capitalize text-[var(--esc-panel-text-tertiary)]">{{
|
|
96
|
+
status.replace('_', ' ')
|
|
97
|
+
}}</span>
|
|
98
|
+
<span class="text-sm font-semibold text-[var(--esc-panel-text)]">{{ count }}</span>
|
|
49
99
|
</div>
|
|
50
100
|
</template>
|
|
51
101
|
<div v-else class="flex flex-col items-center py-6 text-center">
|
|
52
|
-
<svg
|
|
53
|
-
|
|
102
|
+
<svg
|
|
103
|
+
class="mb-2 h-8 w-8 text-[var(--esc-panel-text-muted)]"
|
|
104
|
+
fill="none"
|
|
105
|
+
stroke="currentColor"
|
|
106
|
+
stroke-width="1.5"
|
|
107
|
+
viewBox="0 0 24 24"
|
|
108
|
+
>
|
|
109
|
+
<path
|
|
110
|
+
stroke-linecap="round"
|
|
111
|
+
stroke-linejoin="round"
|
|
112
|
+
d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z"
|
|
113
|
+
/>
|
|
114
|
+
</svg>
|
|
115
|
+
<p class="text-sm text-[var(--esc-panel-text-muted)]">No ticket data for this period</p>
|
|
54
116
|
</div>
|
|
55
117
|
</div>
|
|
56
|
-
<div class="rounded-xl border border-
|
|
57
|
-
<h3 class="mb-4 text-sm font-semibold text-
|
|
118
|
+
<div class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-5">
|
|
119
|
+
<h3 class="mb-4 text-sm font-semibold text-[var(--esc-panel-text-secondary)]">By Priority</h3>
|
|
58
120
|
<template v-if="by_priority && Object.keys(by_priority).length">
|
|
59
|
-
<div
|
|
60
|
-
|
|
61
|
-
|
|
121
|
+
<div
|
|
122
|
+
v-for="(count, priority) in by_priority"
|
|
123
|
+
:key="priority"
|
|
124
|
+
class="mb-2.5 flex items-center justify-between"
|
|
125
|
+
>
|
|
126
|
+
<span class="text-sm capitalize text-[var(--esc-panel-text-tertiary)]">{{ priority }}</span>
|
|
127
|
+
<span class="text-sm font-semibold text-[var(--esc-panel-text)]">{{ count }}</span>
|
|
62
128
|
</div>
|
|
63
129
|
</template>
|
|
64
130
|
<div v-else class="flex flex-col items-center py-6 text-center">
|
|
65
|
-
<svg
|
|
66
|
-
|
|
131
|
+
<svg
|
|
132
|
+
class="mb-2 h-8 w-8 text-[var(--esc-panel-text-muted)]"
|
|
133
|
+
fill="none"
|
|
134
|
+
stroke="currentColor"
|
|
135
|
+
stroke-width="1.5"
|
|
136
|
+
viewBox="0 0 24 24"
|
|
137
|
+
>
|
|
138
|
+
<path
|
|
139
|
+
stroke-linecap="round"
|
|
140
|
+
stroke-linejoin="round"
|
|
141
|
+
d="M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"
|
|
142
|
+
/>
|
|
143
|
+
</svg>
|
|
144
|
+
<p class="text-sm text-[var(--esc-panel-text-muted)]">No ticket data for this period</p>
|
|
67
145
|
</div>
|
|
68
146
|
</div>
|
|
69
147
|
<!-- CSAT -->
|
|
70
|
-
<div class="rounded-xl border border-
|
|
71
|
-
<h3 class="mb-4 text-sm font-semibold text-
|
|
148
|
+
<div class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-5">
|
|
149
|
+
<h3 class="mb-4 text-sm font-semibold text-[var(--esc-panel-text-secondary)]">Customer Satisfaction</h3>
|
|
72
150
|
<template v-if="csat?.total > 0">
|
|
73
151
|
<div class="mb-3 flex items-center gap-2">
|
|
74
152
|
<div class="flex items-center gap-0.5">
|
|
75
|
-
<svg
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
153
|
+
<svg
|
|
154
|
+
v-for="(star, i) in renderStars(csat.average)"
|
|
155
|
+
:key="i"
|
|
156
|
+
class="h-5 w-5"
|
|
157
|
+
:class="star === 'filled' ? 'text-amber-400' : 'text-[var(--esc-panel-text-muted)]'"
|
|
158
|
+
fill="currentColor"
|
|
159
|
+
viewBox="0 0 20 20"
|
|
160
|
+
>
|
|
161
|
+
<path
|
|
162
|
+
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
|
|
163
|
+
/>
|
|
79
164
|
</svg>
|
|
80
165
|
</div>
|
|
81
|
-
<span class="text-lg font-bold text-
|
|
82
|
-
<span class="text-sm text-
|
|
166
|
+
<span class="text-lg font-bold text-[var(--esc-panel-text)]">{{ csat.average }}</span>
|
|
167
|
+
<span class="text-sm text-[var(--esc-panel-text-muted)]">({{ csat.total }} ratings)</span>
|
|
83
168
|
</div>
|
|
84
169
|
<div v-if="csat.breakdown && Object.keys(csat.breakdown).length" class="space-y-1.5">
|
|
85
170
|
<div v-for="rating in [5, 4, 3, 2, 1]" :key="rating" class="flex items-center gap-2">
|
|
86
|
-
<span class="w-3 text-xs text-
|
|
87
|
-
<div class="h-2 flex-1 overflow-hidden rounded-full bg-
|
|
88
|
-
<div
|
|
171
|
+
<span class="w-3 text-xs text-[var(--esc-panel-text-muted)]">{{ rating }}</span>
|
|
172
|
+
<div class="h-2 flex-1 overflow-hidden rounded-full bg-[var(--esc-panel-hover)]">
|
|
173
|
+
<div
|
|
174
|
+
class="h-full rounded-full bg-amber-400"
|
|
175
|
+
:style="{
|
|
176
|
+
width: `${csat.total ? ((csat.breakdown[rating] || 0) / csat.total) * 100 : 0}%`,
|
|
177
|
+
}"
|
|
178
|
+
></div>
|
|
89
179
|
</div>
|
|
90
|
-
<span class="w-6 text-right text-xs text-
|
|
180
|
+
<span class="w-6 text-right text-xs text-[var(--esc-panel-text-muted)]">{{
|
|
181
|
+
csat.breakdown[rating] || 0
|
|
182
|
+
}}</span>
|
|
91
183
|
</div>
|
|
92
184
|
</div>
|
|
93
185
|
</template>
|
|
94
186
|
<div v-else class="flex flex-col items-center py-6 text-center">
|
|
95
|
-
<svg
|
|
96
|
-
|
|
187
|
+
<svg
|
|
188
|
+
class="mb-2 h-8 w-8 text-[var(--esc-panel-text-muted)]"
|
|
189
|
+
fill="none"
|
|
190
|
+
stroke="currentColor"
|
|
191
|
+
stroke-width="1.5"
|
|
192
|
+
viewBox="0 0 24 24"
|
|
193
|
+
>
|
|
194
|
+
<path
|
|
195
|
+
stroke-linecap="round"
|
|
196
|
+
stroke-linejoin="round"
|
|
197
|
+
d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"
|
|
198
|
+
/>
|
|
199
|
+
</svg>
|
|
200
|
+
<p class="text-sm text-[var(--esc-panel-text-muted)]">No ratings for this period</p>
|
|
97
201
|
</div>
|
|
98
202
|
</div>
|
|
99
203
|
</div>
|
|
204
|
+
<PluginSlot slot="admin.reports.footer" :components="getPageComponents('admin.reports', 'footer')" />
|
|
100
205
|
</EscalatedLayout>
|
|
101
206
|
</template>
|