@escalated-dev/escalated 0.2.1 → 0.4.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.
Files changed (45) hide show
  1. package/package.json +1 -1
  2. package/src/components/ActivityTimeline.vue +8 -4
  3. package/src/components/AssigneeSelect.vue +6 -2
  4. package/src/components/AttachmentList.vue +9 -3
  5. package/src/components/BulkActionBar.vue +97 -0
  6. package/src/components/EscalatedLayout.vue +101 -94
  7. package/src/components/FileDropzone.vue +9 -4
  8. package/src/components/FollowButton.vue +63 -0
  9. package/src/components/KeyboardShortcutHelp.vue +123 -0
  10. package/src/components/MacroDropdown.vue +90 -0
  11. package/src/components/PinnedNotes.vue +87 -0
  12. package/src/components/PresenceIndicator.vue +103 -0
  13. package/src/components/PriorityBadge.vue +20 -2
  14. package/src/components/QuickFilters.vue +49 -0
  15. package/src/components/ReplyComposer.vue +52 -3
  16. package/src/components/ReplyThread.vue +60 -30
  17. package/src/components/SatisfactionRating.vue +128 -0
  18. package/src/components/SlaTimer.vue +12 -6
  19. package/src/components/StatsCard.vue +26 -6
  20. package/src/components/StatusBadge.vue +24 -2
  21. package/src/components/TagSelect.vue +8 -4
  22. package/src/components/TicketFilters.vue +69 -52
  23. package/src/components/TicketList.vue +193 -51
  24. package/src/components/TicketSidebar.vue +99 -70
  25. package/src/composables/useKeyboardShortcuts.js +46 -0
  26. package/src/index.js +11 -0
  27. package/src/pages/Admin/CannedResponses/Index.vue +29 -17
  28. package/src/pages/Admin/Departments/Form.vue +12 -11
  29. package/src/pages/Admin/Departments/Index.vue +26 -18
  30. package/src/pages/Admin/EscalationRules/Form.vue +21 -20
  31. package/src/pages/Admin/EscalationRules/Index.vue +26 -18
  32. package/src/pages/Admin/Macros/Index.vue +287 -0
  33. package/src/pages/Admin/Reports.vue +101 -52
  34. package/src/pages/Admin/Settings.vue +260 -0
  35. package/src/pages/Admin/SlaPolicies/Form.vue +21 -20
  36. package/src/pages/Admin/SlaPolicies/Index.vue +28 -20
  37. package/src/pages/Admin/Tags/Index.vue +48 -23
  38. package/src/pages/Admin/Tickets/Index.vue +39 -0
  39. package/src/pages/Admin/Tickets/Show.vue +145 -0
  40. package/src/pages/Agent/Dashboard.vue +156 -51
  41. package/src/pages/Agent/TicketIndex.vue +38 -21
  42. package/src/pages/Agent/TicketShow.vue +144 -108
  43. package/src/pages/Customer/Show.vue +63 -55
  44. package/src/pages/Guest/Create.vue +97 -0
  45. package/src/pages/Guest/Show.vue +93 -0
@@ -1,52 +1,101 @@
1
- <script setup>
2
- import EscalatedLayout from '../../components/EscalatedLayout.vue';
3
- import StatsCard from '../../components/StatsCard.vue';
4
- import { router } from '@inertiajs/vue3';
5
-
6
- const props = defineProps({
7
- period_days: Number,
8
- total_tickets: Number,
9
- resolved_tickets: Number,
10
- avg_first_response_hours: Number,
11
- sla_breach_count: Number,
12
- by_status: Object,
13
- by_priority: Object,
14
- });
15
-
16
- function changePeriod(days) {
17
- router.get(route('escalated.admin.reports'), { days }, { preserveState: true });
18
- }
19
- </script>
20
-
21
- <template>
22
- <EscalatedLayout title="Reports">
23
- <div class="mb-6 flex gap-2">
24
- <button v-for="d in [7, 30, 90]" :key="d" @click="changePeriod(d)"
25
- :class="['rounded-lg px-3 py-1.5 text-sm', period_days === d ? 'bg-indigo-600 text-white' : 'bg-white text-gray-700 border border-gray-300 hover:bg-gray-50']">
26
- Last {{ d }} days
27
- </button>
28
- </div>
29
- <div class="mb-8 grid grid-cols-2 gap-4 md:grid-cols-4">
30
- <StatsCard title="Total Tickets" :value="total_tickets" color="indigo" />
31
- <StatsCard title="Resolved" :value="resolved_tickets" color="green" />
32
- <StatsCard title="Avg First Response" :value="`${avg_first_response_hours}h`" color="yellow" />
33
- <StatsCard title="SLA Breaches" :value="sla_breach_count" color="red" />
34
- </div>
35
- <div class="grid grid-cols-1 gap-6 md:grid-cols-2">
36
- <div class="rounded-lg border border-gray-200 bg-white p-4">
37
- <h3 class="mb-3 text-sm font-medium text-gray-700">By Status</h3>
38
- <div v-for="(count, status) in by_status" :key="status" class="mb-2 flex items-center justify-between">
39
- <span class="text-sm capitalize text-gray-600">{{ status.replace('_', ' ') }}</span>
40
- <span class="text-sm font-medium text-gray-900">{{ count }}</span>
41
- </div>
42
- </div>
43
- <div class="rounded-lg border border-gray-200 bg-white p-4">
44
- <h3 class="mb-3 text-sm font-medium text-gray-700">By Priority</h3>
45
- <div v-for="(count, priority) in by_priority" :key="priority" class="mb-2 flex items-center justify-between">
46
- <span class="text-sm capitalize text-gray-600">{{ priority }}</span>
47
- <span class="text-sm font-medium text-gray-900">{{ count }}</span>
48
- </div>
49
- </div>
50
- </div>
51
- </EscalatedLayout>
52
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../components/EscalatedLayout.vue';
3
+ import StatsCard from '../../components/StatsCard.vue';
4
+ import { router } from '@inertiajs/vue3';
5
+
6
+ const props = defineProps({
7
+ period_days: Number,
8
+ total_tickets: Number,
9
+ resolved_tickets: Number,
10
+ avg_first_response_hours: Number,
11
+ sla_breach_count: Number,
12
+ by_status: Object,
13
+ by_priority: Object,
14
+ csat: { type: Object, default: () => ({}) },
15
+ });
16
+
17
+ function changePeriod(days) {
18
+ router.get(route('escalated.admin.reports'), { days }, { preserveState: true });
19
+ }
20
+
21
+ function renderStars(rating) {
22
+ return Array.from({ length: 5 }, (_, i) => i < Math.round(rating) ? 'filled' : 'empty');
23
+ }
24
+ </script>
25
+
26
+ <template>
27
+ <EscalatedLayout title="Reports">
28
+ <div class="mb-6 flex gap-2">
29
+ <button v-for="d in [7, 30, 90]" :key="d" @click="changePeriod(d)"
30
+ :class="['rounded-lg px-3.5 py-1.5 text-sm font-medium transition-all', period_days === d
31
+ ? 'bg-gradient-to-r from-cyan-500 to-violet-500 text-white shadow-lg shadow-black/20'
32
+ : 'border border-white/10 bg-white/[0.03] text-neutral-400 hover:bg-white/[0.06] hover:text-neutral-200']">
33
+ Last {{ d }} days
34
+ </button>
35
+ </div>
36
+ <div class="mb-8 grid grid-cols-2 gap-4 md:grid-cols-4">
37
+ <StatsCard label="Total Tickets" :value="total_tickets" color="indigo" />
38
+ <StatsCard label="Resolved" :value="resolved_tickets" color="green" />
39
+ <StatsCard label="Avg First Response" :value="`${avg_first_response_hours}h`" color="yellow" />
40
+ <StatsCard label="SLA Breaches" :value="sla_breach_count" color="red" />
41
+ </div>
42
+ <div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
43
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
44
+ <h3 class="mb-4 text-sm font-semibold text-neutral-200">By Status</h3>
45
+ <template v-if="by_status && Object.keys(by_status).length">
46
+ <div v-for="(count, status) in by_status" :key="status" class="mb-2.5 flex items-center justify-between">
47
+ <span class="text-sm capitalize text-neutral-400">{{ status.replace('_', ' ') }}</span>
48
+ <span class="text-sm font-semibold text-white">{{ count }}</span>
49
+ </div>
50
+ </template>
51
+ <div v-else class="flex flex-col items-center py-6 text-center">
52
+ <svg class="mb-2 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" 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" /></svg>
53
+ <p class="text-sm text-neutral-500">No ticket data for this period</p>
54
+ </div>
55
+ </div>
56
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
57
+ <h3 class="mb-4 text-sm font-semibold text-neutral-200">By Priority</h3>
58
+ <template v-if="by_priority && Object.keys(by_priority).length">
59
+ <div v-for="(count, priority) in by_priority" :key="priority" class="mb-2.5 flex items-center justify-between">
60
+ <span class="text-sm capitalize text-neutral-400">{{ priority }}</span>
61
+ <span class="text-sm font-semibold text-white">{{ count }}</span>
62
+ </div>
63
+ </template>
64
+ <div v-else class="flex flex-col items-center py-6 text-center">
65
+ <svg class="mb-2 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12" /></svg>
66
+ <p class="text-sm text-neutral-500">No ticket data for this period</p>
67
+ </div>
68
+ </div>
69
+ <!-- CSAT -->
70
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-5">
71
+ <h3 class="mb-4 text-sm font-semibold text-neutral-200">Customer Satisfaction</h3>
72
+ <template v-if="csat?.total > 0">
73
+ <div class="mb-3 flex items-center gap-2">
74
+ <div class="flex items-center gap-0.5">
75
+ <svg v-for="(star, i) in renderStars(csat.average)" :key="i"
76
+ class="h-5 w-5" :class="star === 'filled' ? 'text-amber-400' : 'text-neutral-700'"
77
+ fill="currentColor" viewBox="0 0 20 20">
78
+ <path 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" />
79
+ </svg>
80
+ </div>
81
+ <span class="text-lg font-bold text-white">{{ csat.average }}</span>
82
+ <span class="text-sm text-neutral-500">({{ csat.total }} ratings)</span>
83
+ </div>
84
+ <div v-if="csat.breakdown && Object.keys(csat.breakdown).length" class="space-y-1.5">
85
+ <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-neutral-500">{{ rating }}</span>
87
+ <div class="h-2 flex-1 overflow-hidden rounded-full bg-white/[0.06]">
88
+ <div class="h-full rounded-full bg-amber-400" :style="{ width: `${csat.total ? ((csat.breakdown[rating] || 0) / csat.total) * 100 : 0}%` }"></div>
89
+ </div>
90
+ <span class="w-6 text-right text-xs text-neutral-500">{{ csat.breakdown[rating] || 0 }}</span>
91
+ </div>
92
+ </div>
93
+ </template>
94
+ <div v-else class="flex flex-col items-center py-6 text-center">
95
+ <svg class="mb-2 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" 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" /></svg>
96
+ <p class="text-sm text-neutral-500">No ratings for this period</p>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </EscalatedLayout>
101
+ </template>
@@ -0,0 +1,260 @@
1
+ <script setup>
2
+ import EscalatedLayout from '../../components/EscalatedLayout.vue';
3
+ import { useForm, usePage } from '@inertiajs/vue3';
4
+ import { computed } from 'vue';
5
+
6
+ const props = defineProps({ settings: Object });
7
+ const page = usePage();
8
+
9
+ const form = useForm({
10
+ guest_tickets_enabled: props.settings.guest_tickets_enabled,
11
+ allow_customer_close: props.settings.allow_customer_close,
12
+ auto_close_resolved_after_days: props.settings.auto_close_resolved_after_days,
13
+ max_attachments_per_reply: props.settings.max_attachments_per_reply,
14
+ max_attachment_size_kb: props.settings.max_attachment_size_kb,
15
+ ticket_reference_prefix: props.settings.ticket_reference_prefix,
16
+ inbound_email_enabled: props.settings.inbound_email_enabled ?? false,
17
+ inbound_email_adapter: props.settings.inbound_email_adapter ?? 'mailgun',
18
+ inbound_email_address: props.settings.inbound_email_address ?? '',
19
+ mailgun_signing_key: props.settings.mailgun_signing_key ?? '',
20
+ postmark_inbound_token: props.settings.postmark_inbound_token ?? '',
21
+ ses_region: props.settings.ses_region ?? '',
22
+ ses_topic_arn: props.settings.ses_topic_arn ?? '',
23
+ imap_host: props.settings.imap_host ?? '',
24
+ imap_port: props.settings.imap_port ?? 993,
25
+ imap_encryption: props.settings.imap_encryption ?? 'ssl',
26
+ imap_username: props.settings.imap_username ?? '',
27
+ imap_password: props.settings.imap_password ?? '',
28
+ imap_mailbox: props.settings.imap_mailbox ?? 'INBOX',
29
+ });
30
+
31
+ const webhookBaseUrl = computed(() => {
32
+ const prefix = page.props.escalated?.prefix || 'support';
33
+ const origin = typeof window !== 'undefined' ? window.location.origin : '';
34
+ return `${origin}/${prefix}/inbound`;
35
+ });
36
+
37
+ function submit() {
38
+ form.post(route('escalated.admin.settings.update'));
39
+ }
40
+ </script>
41
+
42
+ <template>
43
+ <EscalatedLayout title="Settings">
44
+ <form @submit.prevent="submit" class="mx-auto max-w-2xl space-y-6">
45
+ <!-- General -->
46
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
47
+ <h3 class="mb-5 text-sm font-semibold text-white">General</h3>
48
+ <div class="space-y-5">
49
+ <label class="flex items-center justify-between">
50
+ <div>
51
+ <span class="text-sm font-medium text-neutral-200">Guest Tickets</span>
52
+ <p class="mt-0.5 text-xs text-neutral-500">Allow visitors to submit tickets without signing in</p>
53
+ </div>
54
+ <button type="button" @click="form.guest_tickets_enabled = !form.guest_tickets_enabled"
55
+ :class="['relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors',
56
+ form.guest_tickets_enabled ? 'bg-emerald-500' : 'bg-neutral-700']">
57
+ <span :class="['pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition-transform',
58
+ form.guest_tickets_enabled ? 'translate-x-5' : 'translate-x-0']" />
59
+ </button>
60
+ </label>
61
+
62
+ <label class="flex items-center justify-between">
63
+ <div>
64
+ <span class="text-sm font-medium text-neutral-200">Allow Customer Close</span>
65
+ <p class="mt-0.5 text-xs text-neutral-500">Let customers close their own tickets</p>
66
+ </div>
67
+ <button type="button" @click="form.allow_customer_close = !form.allow_customer_close"
68
+ :class="['relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors',
69
+ form.allow_customer_close ? 'bg-emerald-500' : 'bg-neutral-700']">
70
+ <span :class="['pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition-transform',
71
+ form.allow_customer_close ? 'translate-x-5' : 'translate-x-0']" />
72
+ </button>
73
+ </label>
74
+
75
+ <div>
76
+ <label class="block text-sm font-medium text-neutral-200">Auto-close resolved tickets after</label>
77
+ <p class="mt-0.5 text-xs text-neutral-500">Days after resolution before auto-closing (0 to disable)</p>
78
+ <div class="mt-2 flex items-center gap-2">
79
+ <input v-model.number="form.auto_close_resolved_after_days" type="number" min="0" max="365"
80
+ class="w-24 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
81
+ <span class="text-sm text-neutral-500">days</span>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <!-- Limits -->
88
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
89
+ <h3 class="mb-5 text-sm font-semibold text-white">Limits</h3>
90
+ <div class="space-y-5">
91
+ <div>
92
+ <label class="block text-sm font-medium text-neutral-200">Max attachments per reply</label>
93
+ <input v-model.number="form.max_attachments_per_reply" type="number" min="1" max="20"
94
+ class="mt-2 w-24 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
95
+ </div>
96
+ <div>
97
+ <label class="block text-sm font-medium text-neutral-200">Max attachment size</label>
98
+ <div class="mt-2 flex items-center gap-2">
99
+ <input v-model.number="form.max_attachment_size_kb" type="number" min="512" max="102400" step="512"
100
+ class="w-32 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
101
+ <span class="text-sm text-neutral-500">KB ({{ Math.round(form.max_attachment_size_kb / 1024) }} MB)</span>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ </div>
106
+
107
+ <!-- Tickets -->
108
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
109
+ <h3 class="mb-5 text-sm font-semibold text-white">Tickets</h3>
110
+ <div class="space-y-5">
111
+ <div>
112
+ <label class="block text-sm font-medium text-neutral-200">Reference Prefix</label>
113
+ <p class="mt-0.5 text-xs text-neutral-500">Prefix for ticket references (e.g. ESC produces ESC-00001)</p>
114
+ <input v-model="form.ticket_reference_prefix" type="text" maxlength="10"
115
+ class="mt-2 w-32 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 uppercase focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
116
+ </div>
117
+ </div>
118
+ </div>
119
+
120
+ <!-- Inbound Email -->
121
+ <div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
122
+ <h3 class="mb-5 text-sm font-semibold text-white">Inbound Email</h3>
123
+ <div class="space-y-5">
124
+ <label class="flex items-center justify-between">
125
+ <div>
126
+ <span class="text-sm font-medium text-neutral-200">Inbound Email</span>
127
+ <p class="mt-0.5 text-xs text-neutral-500">Allow creating and replying to tickets via email</p>
128
+ </div>
129
+ <button type="button" @click="form.inbound_email_enabled = !form.inbound_email_enabled"
130
+ :class="['relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors',
131
+ form.inbound_email_enabled ? 'bg-emerald-500' : 'bg-neutral-700']">
132
+ <span :class="['pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition-transform',
133
+ form.inbound_email_enabled ? 'translate-x-5' : 'translate-x-0']" />
134
+ </button>
135
+ </label>
136
+
137
+ <template v-if="form.inbound_email_enabled">
138
+ <div>
139
+ <label class="block text-sm font-medium text-neutral-200">Email Provider</label>
140
+ <p class="mt-0.5 text-xs text-neutral-500">How inbound emails are received</p>
141
+ <select v-model="form.inbound_email_adapter"
142
+ class="mt-2 w-48 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10">
143
+ <option value="mailgun">Mailgun</option>
144
+ <option value="postmark">Postmark</option>
145
+ <option value="ses">AWS SES</option>
146
+ <option value="imap">IMAP</option>
147
+ </select>
148
+ </div>
149
+
150
+ <div>
151
+ <label class="block text-sm font-medium text-neutral-200">Support Email Address</label>
152
+ <p class="mt-0.5 text-xs text-neutral-500">The email address customers will send emails to (e.g. support@example.com)</p>
153
+ <input v-model="form.inbound_email_address" type="email" placeholder="support@example.com"
154
+ class="mt-2 w-full max-w-sm rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
155
+ </div>
156
+
157
+ <!-- Mailgun -->
158
+ <template v-if="form.inbound_email_adapter === 'mailgun'">
159
+ <div>
160
+ <label class="block text-sm font-medium text-neutral-200">Signing Key</label>
161
+ <input v-model="form.mailgun_signing_key" type="password"
162
+ class="mt-2 w-full max-w-sm rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
163
+ </div>
164
+ <div>
165
+ <label class="block text-sm font-medium text-neutral-200">Webhook URL</label>
166
+ <p class="mt-0.5 text-xs text-neutral-500">Configure this URL in your Mailgun dashboard</p>
167
+ <input :value="`${webhookBaseUrl}/mailgun`" type="text" readonly
168
+ class="mt-2 w-full max-w-lg rounded-lg border border-white/10 bg-neutral-950/50 px-3 py-2 text-sm text-neutral-400 select-all cursor-default focus:outline-none" />
169
+ </div>
170
+ </template>
171
+
172
+ <!-- Postmark -->
173
+ <template v-if="form.inbound_email_adapter === 'postmark'">
174
+ <div>
175
+ <label class="block text-sm font-medium text-neutral-200">Inbound Token</label>
176
+ <input v-model="form.postmark_inbound_token" type="password"
177
+ class="mt-2 w-full max-w-sm rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
178
+ </div>
179
+ <div>
180
+ <label class="block text-sm font-medium text-neutral-200">Webhook URL</label>
181
+ <p class="mt-0.5 text-xs text-neutral-500">Configure this URL in your Postmark server settings</p>
182
+ <input :value="`${webhookBaseUrl}/postmark`" type="text" readonly
183
+ class="mt-2 w-full max-w-lg rounded-lg border border-white/10 bg-neutral-950/50 px-3 py-2 text-sm text-neutral-400 select-all cursor-default focus:outline-none" />
184
+ </div>
185
+ </template>
186
+
187
+ <!-- AWS SES -->
188
+ <template v-if="form.inbound_email_adapter === 'ses'">
189
+ <div>
190
+ <label class="block text-sm font-medium text-neutral-200">Region</label>
191
+ <input v-model="form.ses_region" type="text" placeholder="us-east-1"
192
+ class="mt-2 w-48 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
193
+ </div>
194
+ <div>
195
+ <label class="block text-sm font-medium text-neutral-200">Topic ARN</label>
196
+ <input v-model="form.ses_topic_arn" type="text" placeholder="arn:aws:sns:us-east-1:123456789:ses-inbound"
197
+ class="mt-2 w-full max-w-lg rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
198
+ </div>
199
+ <div>
200
+ <label class="block text-sm font-medium text-neutral-200">Webhook URL</label>
201
+ <p class="mt-0.5 text-xs text-neutral-500">Configure this URL as your SNS subscription endpoint</p>
202
+ <input :value="`${webhookBaseUrl}/ses`" type="text" readonly
203
+ class="mt-2 w-full max-w-lg rounded-lg border border-white/10 bg-neutral-950/50 px-3 py-2 text-sm text-neutral-400 select-all cursor-default focus:outline-none" />
204
+ </div>
205
+ </template>
206
+
207
+ <!-- IMAP -->
208
+ <template v-if="form.inbound_email_adapter === 'imap'">
209
+ <div>
210
+ <label class="block text-sm font-medium text-neutral-200">Host</label>
211
+ <input v-model="form.imap_host" type="text" placeholder="imap.example.com"
212
+ class="mt-2 w-full max-w-sm rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
213
+ </div>
214
+ <div class="flex items-end gap-4">
215
+ <div>
216
+ <label class="block text-sm font-medium text-neutral-200">Port</label>
217
+ <input v-model.number="form.imap_port" type="number" min="1" max="65535"
218
+ class="mt-2 w-24 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
219
+ </div>
220
+ <div>
221
+ <label class="block text-sm font-medium text-neutral-200">Encryption</label>
222
+ <select v-model="form.imap_encryption"
223
+ class="mt-2 w-28 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10">
224
+ <option value="ssl">SSL</option>
225
+ <option value="tls">TLS</option>
226
+ <option value="none">None</option>
227
+ </select>
228
+ </div>
229
+ </div>
230
+ <div>
231
+ <label class="block text-sm font-medium text-neutral-200">Username</label>
232
+ <input v-model="form.imap_username" type="text"
233
+ class="mt-2 w-full max-w-sm rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
234
+ </div>
235
+ <div>
236
+ <label class="block text-sm font-medium text-neutral-200">Password</label>
237
+ <input v-model="form.imap_password" type="password"
238
+ class="mt-2 w-full max-w-sm rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
239
+ </div>
240
+ <div>
241
+ <label class="block text-sm font-medium text-neutral-200">Mailbox</label>
242
+ <input v-model="form.imap_mailbox" type="text" placeholder="INBOX"
243
+ class="mt-2 w-48 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
244
+ </div>
245
+ </template>
246
+ </template>
247
+ </div>
248
+ </div>
249
+
250
+ <!-- Submit -->
251
+ <div class="flex items-center justify-end gap-3">
252
+ <span v-if="form.recentlySuccessful" class="text-sm text-emerald-400">Saved.</span>
253
+ <button type="submit" :disabled="form.processing"
254
+ class="rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-5 py-2 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400 disabled:opacity-50">
255
+ {{ form.processing ? 'Saving...' : 'Save Settings' }}
256
+ </button>
257
+ </div>
258
+ </form>
259
+ </EscalatedLayout>
260
+ </template>
@@ -25,47 +25,48 @@ function submit() {
25
25
 
26
26
  <template>
27
27
  <EscalatedLayout :title="policy ? 'Edit SLA Policy' : 'New SLA Policy'">
28
- <form @submit.prevent="submit" class="mx-auto max-w-lg space-y-4 rounded-lg border border-gray-200 bg-white p-6">
28
+ <form @submit.prevent="submit" class="mx-auto max-w-lg space-y-5 rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
29
29
  <div>
30
- <label class="block text-sm font-medium text-gray-700">Name</label>
31
- <input v-model="form.name" type="text" required class="mt-1 w-full rounded-lg border-gray-300 shadow-sm" />
30
+ <label class="block text-sm font-medium text-neutral-300">Name</label>
31
+ <input v-model="form.name" type="text" required class="mt-1 w-full rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
32
32
  </div>
33
33
  <div>
34
- <label class="block text-sm font-medium text-gray-700">Description</label>
35
- <textarea v-model="form.description" rows="2" class="mt-1 w-full rounded-lg border-gray-300 shadow-sm"></textarea>
34
+ <label class="block text-sm font-medium text-neutral-300">Description</label>
35
+ <textarea v-model="form.description" rows="2" class="mt-1 w-full rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10"></textarea>
36
36
  </div>
37
37
  <div>
38
- <h3 class="mb-2 text-sm font-medium text-gray-700">First Response Hours (by priority)</h3>
39
- <div class="grid grid-cols-2 gap-2">
38
+ <h3 class="mb-2 text-sm font-medium text-neutral-300">First Response Hours (by priority)</h3>
39
+ <div class="grid grid-cols-2 gap-3">
40
40
  <div v-for="p in priorities" :key="p">
41
- <label class="text-xs capitalize text-gray-500">{{ p }}</label>
42
- <input v-model.number="form.first_response_hours[p]" type="number" step="0.5" min="0" class="w-full rounded border-gray-300 text-sm" />
41
+ <label class="text-xs capitalize text-neutral-400">{{ p }}</label>
42
+ <input v-model.number="form.first_response_hours[p]" type="number" step="0.5" min="0" class="w-full rounded-lg border border-white/10 bg-neutral-950 px-2 py-1.5 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
43
43
  </div>
44
44
  </div>
45
45
  </div>
46
46
  <div>
47
- <h3 class="mb-2 text-sm font-medium text-gray-700">Resolution Hours (by priority)</h3>
48
- <div class="grid grid-cols-2 gap-2">
47
+ <h3 class="mb-2 text-sm font-medium text-neutral-300">Resolution Hours (by priority)</h3>
48
+ <div class="grid grid-cols-2 gap-3">
49
49
  <div v-for="p in priorities" :key="p">
50
- <label class="text-xs capitalize text-gray-500">{{ p }}</label>
51
- <input v-model.number="form.resolution_hours[p]" type="number" step="0.5" min="0" class="w-full rounded border-gray-300 text-sm" />
50
+ <label class="text-xs capitalize text-neutral-400">{{ p }}</label>
51
+ <input v-model.number="form.resolution_hours[p]" type="number" step="0.5" min="0" class="w-full rounded-lg border border-white/10 bg-neutral-950 px-2 py-1.5 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
52
52
  </div>
53
53
  </div>
54
54
  </div>
55
55
  <label class="flex items-center gap-2">
56
- <input v-model="form.business_hours_only" type="checkbox" class="rounded border-gray-300" />
57
- <span class="text-sm text-gray-700">Business hours only</span>
56
+ <input v-model="form.business_hours_only" type="checkbox" class="rounded border-white/20 bg-neutral-900 text-white focus:ring-white/10" />
57
+ <span class="text-sm text-neutral-300">Business hours only</span>
58
58
  </label>
59
59
  <label class="flex items-center gap-2">
60
- <input v-model="form.is_default" type="checkbox" class="rounded border-gray-300" />
61
- <span class="text-sm text-gray-700">Default policy</span>
60
+ <input v-model="form.is_default" type="checkbox" class="rounded border-white/20 bg-neutral-900 text-white focus:ring-white/10" />
61
+ <span class="text-sm text-neutral-300">Default policy</span>
62
62
  </label>
63
63
  <label class="flex items-center gap-2">
64
- <input v-model="form.is_active" type="checkbox" class="rounded border-gray-300" />
65
- <span class="text-sm text-gray-700">Active</span>
64
+ <input v-model="form.is_active" type="checkbox" class="rounded border-white/20 bg-neutral-900 text-white focus:ring-white/10" />
65
+ <span class="text-sm text-neutral-300">Active</span>
66
66
  </label>
67
67
  <div class="flex justify-end">
68
- <button type="submit" :disabled="form.processing" class="rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 disabled:opacity-50">
68
+ <button type="submit" :disabled="form.processing"
69
+ class="rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-5 py-2 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400 disabled:opacity-50">
69
70
  {{ policy ? 'Update' : 'Create' }}
70
71
  </button>
71
72
  </div>
@@ -14,34 +14,42 @@ function destroy(id) {
14
14
  <template>
15
15
  <EscalatedLayout title="SLA Policies">
16
16
  <div class="mb-4 flex justify-end">
17
- <Link :href="route('escalated.admin.sla-policies.create')" class="rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700">
17
+ <Link :href="route('escalated.admin.sla-policies.create')"
18
+ class="rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-4 py-2 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400">
18
19
  Add Policy
19
20
  </Link>
20
21
  </div>
21
- <div class="overflow-hidden rounded-lg border border-gray-200 bg-white">
22
- <table class="min-w-full divide-y divide-gray-200">
23
- <thead class="bg-gray-50">
24
- <tr>
25
- <th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500">Name</th>
26
- <th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500">Default</th>
27
- <th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500">Business Hours</th>
28
- <th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500">Tickets</th>
29
- <th class="px-4 py-3 text-left text-xs font-medium uppercase text-gray-500">Active</th>
30
- <th class="px-4 py-3 text-right text-xs font-medium uppercase text-gray-500">Actions</th>
22
+ <div class="overflow-hidden rounded-xl border border-white/[0.06] bg-neutral-900/60">
23
+ <table class="min-w-full divide-y divide-white/[0.06]">
24
+ <thead>
25
+ <tr class="bg-white/[0.02]">
26
+ <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Name</th>
27
+ <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Default</th>
28
+ <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Business Hours</th>
29
+ <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Tickets</th>
30
+ <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Active</th>
31
+ <th class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Actions</th>
31
32
  </tr>
32
33
  </thead>
33
- <tbody class="divide-y divide-gray-200">
34
- <tr v-for="policy in policies" :key="policy.id">
35
- <td class="px-4 py-3 text-sm font-medium text-gray-900">{{ policy.name }}</td>
36
- <td class="px-4 py-3 text-sm">{{ policy.is_default ? 'Yes' : 'No' }}</td>
37
- <td class="px-4 py-3 text-sm">{{ policy.business_hours_only ? 'Yes' : 'No' }}</td>
38
- <td class="px-4 py-3 text-sm text-gray-500">{{ policy.tickets_count }}</td>
34
+ <tbody class="divide-y divide-white/[0.04]">
35
+ <tr v-if="!policies?.length">
36
+ <td colspan="6" class="px-4 py-12 text-center">
37
+ <svg class="mx-auto mb-3 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
38
+ <p class="text-sm text-neutral-500">No SLA policies yet</p>
39
+ <p class="mt-1 text-xs text-neutral-600">Define response and resolution time targets</p>
40
+ </td>
41
+ </tr>
42
+ <tr v-for="policy in policies" :key="policy.id" class="transition-colors hover:bg-white/[0.03]">
43
+ <td class="px-4 py-3 text-sm font-medium text-neutral-200">{{ policy.name }}</td>
44
+ <td class="px-4 py-3 text-sm text-neutral-400">{{ policy.is_default ? 'Yes' : 'No' }}</td>
45
+ <td class="px-4 py-3 text-sm text-neutral-400">{{ policy.business_hours_only ? 'Yes' : 'No' }}</td>
46
+ <td class="px-4 py-3 text-sm text-neutral-400">{{ policy.tickets_count }}</td>
39
47
  <td class="px-4 py-3 text-sm">
40
- <span :class="policy.is_active ? 'text-green-600' : 'text-gray-400'">{{ policy.is_active ? 'Yes' : 'No' }}</span>
48
+ <span :class="policy.is_active ? 'text-emerald-400' : 'text-neutral-500'">{{ policy.is_active ? 'Yes' : 'No' }}</span>
41
49
  </td>
42
50
  <td class="px-4 py-3 text-right text-sm">
43
- <Link :href="route('escalated.admin.sla-policies.edit', policy.id)" class="text-indigo-600 hover:text-indigo-900">Edit</Link>
44
- <button @click="destroy(policy.id)" class="ml-3 text-red-600 hover:text-red-900">Delete</button>
51
+ <Link :href="route('escalated.admin.sla-policies.edit', policy.id)" class="text-neutral-300 hover:text-white">Edit</Link>
52
+ <button @click="destroy(policy.id)" class="ml-3 text-rose-400 hover:text-rose-300">Delete</button>
45
53
  </td>
46
54
  </tr>
47
55
  </tbody>