@escalated-dev/escalated 0.11.4 → 0.11.5
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/package.json +1 -1
- package/pages.json +2 -1
- package/src/pages/Error.vue +69 -0
package/package.json
CHANGED
package/pages.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "Generated by scripts/generate-page-manifest.js from src/pages. Every name here resolves to a component; a name a backend renders that is not here is a blank screen.",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.5",
|
|
4
4
|
"pages": [
|
|
5
5
|
"Escalated/Admin/ApiTokens/Index",
|
|
6
6
|
"Escalated/Admin/AuditLog/Index",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"Escalated/Customer/KnowledgeBase/Article",
|
|
90
90
|
"Escalated/Customer/KnowledgeBase/Index",
|
|
91
91
|
"Escalated/Customer/Show",
|
|
92
|
+
"Escalated/Error",
|
|
92
93
|
"Escalated/Guest/Create",
|
|
93
94
|
"Escalated/Guest/Show",
|
|
94
95
|
"Escalated/Plugin/Page"
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Link } from '@inertiajs/vue3';
|
|
3
|
+
import { computed } from 'vue';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The refusal and not-found screen.
|
|
7
|
+
*
|
|
8
|
+
* Backends render this instead of an HTML error page so a 403 or a 404 inside
|
|
9
|
+
* the panel stays inside the panel. It deliberately does not use
|
|
10
|
+
* EscalatedLayout: the most common reason to arrive here is that the viewer was
|
|
11
|
+
* refused, and the layout's navigation is a list of places they may equally not
|
|
12
|
+
* be allowed to go. Rendering it would offer a menu that mostly leads back
|
|
13
|
+
* here.
|
|
14
|
+
*
|
|
15
|
+
* The message comes from the backend, already translated. The headings below
|
|
16
|
+
* are the fallback for a status arriving with no message at all.
|
|
17
|
+
*/
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
status: { type: [Number, String], default: 500 },
|
|
20
|
+
message: { type: String, default: '' },
|
|
21
|
+
|
|
22
|
+
// Where "back" goes. A host mounts Escalated under its own prefix, and this
|
|
23
|
+
// page is reached without a layout to resolve one.
|
|
24
|
+
home: { type: String, default: '' },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const code = computed(() => String(props.status));
|
|
28
|
+
|
|
29
|
+
const title = computed(
|
|
30
|
+
() =>
|
|
31
|
+
({
|
|
32
|
+
403: 'Not allowed',
|
|
33
|
+
404: 'Not found',
|
|
34
|
+
419: 'Session expired',
|
|
35
|
+
429: 'Too many requests',
|
|
36
|
+
500: 'Something went wrong',
|
|
37
|
+
503: 'Temporarily unavailable',
|
|
38
|
+
})[code.value] || 'Something went wrong',
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const explanation = computed(
|
|
42
|
+
() =>
|
|
43
|
+
({
|
|
44
|
+
403: 'Your account does not have access to this.',
|
|
45
|
+
404: 'That page does not exist, or it has been removed.',
|
|
46
|
+
419: 'Your session expired. Sign in again to continue.',
|
|
47
|
+
429: 'Too many requests in a short space of time. Wait a moment and try again.',
|
|
48
|
+
503: 'The service is down for maintenance. Try again shortly.',
|
|
49
|
+
})[code.value] || 'The request could not be completed.',
|
|
50
|
+
);
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div class="flex min-h-screen items-center justify-center bg-[var(--esc-panel-bg)] px-4">
|
|
55
|
+
<div class="w-full max-w-md text-center">
|
|
56
|
+
<p class="font-mono text-sm tracking-widest text-[var(--esc-panel-text-muted)]">{{ code }}</p>
|
|
57
|
+
<h1 class="mt-2 text-xl font-semibold text-[var(--esc-panel-text-secondary)]">{{ title }}</h1>
|
|
58
|
+
<p class="mt-3 text-sm text-[var(--esc-panel-text-muted)]">{{ message || explanation }}</p>
|
|
59
|
+
|
|
60
|
+
<Link
|
|
61
|
+
v-if="home"
|
|
62
|
+
:href="home"
|
|
63
|
+
class="mt-6 inline-block rounded-lg border border-[var(--esc-panel-border)] px-4 py-2 text-sm text-[var(--esc-panel-text-tertiary)] transition-colors hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
64
|
+
>
|
|
65
|
+
Back to the panel
|
|
66
|
+
</Link>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|