adata-ui 3.1.45 → 3.1.46
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/dist/module.json +1 -1
- package/dist/module.mjs +8 -0
- package/dist/runtime/components/Error.vue +162 -0
- package/dist/runtime/components/Error.vue.d.ts +6 -0
- package/dist/runtime/components/error-template/index.vue +40 -0
- package/dist/runtime/components/error-template/index.vue.d.ts +26 -0
- package/dist/runtime/components/error-template/types.d.ts +19 -0
- package/dist/runtime/components/error-template/types.js +0 -0
- package/dist/runtime/public/401.webp +0 -0
- package/dist/runtime/public/403.webp +0 -0
- package/dist/runtime/public/404.webp +0 -0
- package/dist/runtime/public/500.webp +0 -0
- package/dist/runtime/public/502.webp +0 -0
- package/dist/runtime/public/503.webp +0 -0
- package/dist/runtime/public/504.webp +0 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -23,6 +23,14 @@ const module = defineNuxtModule({
|
|
|
23
23
|
localize: _options.localize
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
|
+
_nuxt.options.nitro = defu(_nuxt.options.nitro || {}, { publicAssets: [] });
|
|
27
|
+
_nuxt.options.nitro.publicAssets.push({
|
|
28
|
+
dir: resolver.resolve("./runtime/public"),
|
|
29
|
+
baseURL: "/adata-ui",
|
|
30
|
+
// чтобы не конфликтовать с корневым /public
|
|
31
|
+
maxAge: 60 * 60 * 24 * 365
|
|
32
|
+
// кэш 1 год (можно убрать/уменьшить)
|
|
33
|
+
});
|
|
26
34
|
if (_nuxt.options.builder === "@nuxt/vite-builder") {
|
|
27
35
|
const plugin = await import('@tailwindcss/vite').then((r) => r.default);
|
|
28
36
|
addVitePlugin(plugin());
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useLocalePath, useI18n, navigateTo, computed } from "#imports";
|
|
3
|
+
import ErrorTemplate from "./error-template/index.vue";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
error: Object
|
|
6
|
+
});
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
const localePath = useLocalePath();
|
|
9
|
+
const errorData = computed(() => {
|
|
10
|
+
const statusCode = props.error?.statusCode;
|
|
11
|
+
switch (statusCode) {
|
|
12
|
+
case 504: {
|
|
13
|
+
return {
|
|
14
|
+
icon: "/adata-ui/504.webp",
|
|
15
|
+
statusCode,
|
|
16
|
+
title: t("errorPage.504.title"),
|
|
17
|
+
content: {
|
|
18
|
+
subTitle: t("errorPage.504.subTitle")
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
case 401:
|
|
23
|
+
return {
|
|
24
|
+
icon: "/adata-ui/401.webp",
|
|
25
|
+
statusCode,
|
|
26
|
+
title: t("errorPage.401.title"),
|
|
27
|
+
content: {
|
|
28
|
+
subTitle: t("errorPage.401.subTitle")
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
case 404:
|
|
32
|
+
return {
|
|
33
|
+
icon: "/adata-ui/404.webp",
|
|
34
|
+
statusCode,
|
|
35
|
+
title: t("errorPage.404.title"),
|
|
36
|
+
content: {
|
|
37
|
+
subTitle: t("errorPage.404.subTitle"),
|
|
38
|
+
subTitleSecond: t("errorPage.404.subTitleSecond")
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
case 403:
|
|
42
|
+
return {
|
|
43
|
+
icon: "/adata-ui/403.webp",
|
|
44
|
+
statusCode,
|
|
45
|
+
title: t("errorPage.403.title"),
|
|
46
|
+
content: {
|
|
47
|
+
subTitle: t("errorPage.403.subTitle"),
|
|
48
|
+
subTitleSecond: t("errorPage.403.subTitleSecond")
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
case 503:
|
|
52
|
+
return {
|
|
53
|
+
icon: "/adata-ui/503.webp",
|
|
54
|
+
statusCode,
|
|
55
|
+
title: t("errorPage.503.title"),
|
|
56
|
+
content: {
|
|
57
|
+
subTitle: t("errorPage.503.subTitle")
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
case 502:
|
|
61
|
+
return {
|
|
62
|
+
icon: "/adata-ui/502.webp",
|
|
63
|
+
statusCode,
|
|
64
|
+
title: t("errorPage.502.title"),
|
|
65
|
+
content: {
|
|
66
|
+
title: "\u0412\u0430\u0440\u0438\u0430\u043D\u0442\u044B \u0440\u0435\u0448\u0435\u043D\u0438\u044F \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B:",
|
|
67
|
+
list: [
|
|
68
|
+
{
|
|
69
|
+
id: 1,
|
|
70
|
+
label: "\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443",
|
|
71
|
+
link: false
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 1,
|
|
75
|
+
label: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0435 \u043A\u044D\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430",
|
|
76
|
+
link: false
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 1,
|
|
80
|
+
label: "\u0421\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u0442\u0435\u0445\u043D\u0438\u0447\u0435\u0441\u043A\u043E\u0439 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u043E\u0439",
|
|
81
|
+
link: true
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
case 500:
|
|
87
|
+
return {
|
|
88
|
+
icon: "/adata-ui/500.webp",
|
|
89
|
+
statusCode,
|
|
90
|
+
title: t("errorPage.500.title"),
|
|
91
|
+
content: {
|
|
92
|
+
subTitle: t("errorPage.500.subTitle")
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
function handleError() {
|
|
98
|
+
navigateTo(`${localePath("/")}`, { external: true });
|
|
99
|
+
}
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<div class="container mx-auto lg:fixed lg:left-[50%] lg:top-[50%] lg:-translate-x-[50%] lg:-translate-y-[50%]">
|
|
104
|
+
<error-template :error="errorData">
|
|
105
|
+
<template #content>
|
|
106
|
+
<div class="body-500 mt-4 flex flex-col gap-4">
|
|
107
|
+
<div
|
|
108
|
+
v-if="errorData?.content"
|
|
109
|
+
class="flex flex-col gap-4 lg:gap-2"
|
|
110
|
+
>
|
|
111
|
+
<p
|
|
112
|
+
v-if="errorData.content?.title"
|
|
113
|
+
class="text-base font-bold"
|
|
114
|
+
>
|
|
115
|
+
{{ errorData.content.title }}
|
|
116
|
+
</p>
|
|
117
|
+
<p
|
|
118
|
+
v-if="errorData.content?.subTitle"
|
|
119
|
+
class="text-sm font-medium lg:max-w-[560px]"
|
|
120
|
+
>
|
|
121
|
+
{{ errorData.content.subTitle }}
|
|
122
|
+
</p>
|
|
123
|
+
<p
|
|
124
|
+
v-if="errorData.content?.subTitleSecond"
|
|
125
|
+
class="text-sm font-medium"
|
|
126
|
+
>
|
|
127
|
+
{{
|
|
128
|
+
errorData.content.subTitleSecond
|
|
129
|
+
}}
|
|
130
|
+
</p>
|
|
131
|
+
<div
|
|
132
|
+
v-for="item in errorData.content?.list"
|
|
133
|
+
:key="item.id"
|
|
134
|
+
class="flex items-center gap-1 text-sm font-medium"
|
|
135
|
+
>
|
|
136
|
+
<i-check-circle class="stroke-blue-600" />
|
|
137
|
+
{{ item.label }}
|
|
138
|
+
<span
|
|
139
|
+
v-if="item.link"
|
|
140
|
+
class="text-blue-700"
|
|
141
|
+
>info@adata.kz</span>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</template>
|
|
146
|
+
<template #default>
|
|
147
|
+
<div class="mt-0 w-full p-4 lg:mt-8 lg:w-fit lg:p-0">
|
|
148
|
+
<adt-button
|
|
149
|
+
v-if="errorData.statusCode !== 502"
|
|
150
|
+
class="w-full lg:w-fit"
|
|
151
|
+
@click="handleError"
|
|
152
|
+
>
|
|
153
|
+
{{t("modals.buttons.goToMainPage")}}
|
|
154
|
+
</adt-button>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
157
|
+
</error-template>
|
|
158
|
+
<span class="hidden">
|
|
159
|
+
{{ error }}
|
|
160
|
+
</span>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
error: () => any;
|
|
3
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
4
|
+
error: () => any;
|
|
5
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
error: { type: Object, required: true }
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="flex items-center justify-center gap-14">
|
|
9
|
+
<slot name="icon">
|
|
10
|
+
<div class="hidden lg:block max-w-[600px]">
|
|
11
|
+
<img
|
|
12
|
+
:src="error.icon"
|
|
13
|
+
class="hidden lg:block"
|
|
14
|
+
alt="error-icon"
|
|
15
|
+
>
|
|
16
|
+
</div>
|
|
17
|
+
</slot>
|
|
18
|
+
<div class="flex min-h-screen flex-col lg:min-h-0">
|
|
19
|
+
<div class="flex-1 px-4 py-8 lg:p-0">
|
|
20
|
+
<slot name="status">
|
|
21
|
+
<p class="mb-6 text-4xl font-bold">
|
|
22
|
+
{{ error.statusCode }}
|
|
23
|
+
</p>
|
|
24
|
+
</slot>
|
|
25
|
+
<slot name="title">
|
|
26
|
+
<h2 class="lg:heading-03 text-2xl font-bold ">
|
|
27
|
+
{{ error.title }}
|
|
28
|
+
</h2>
|
|
29
|
+
</slot>
|
|
30
|
+
<slot
|
|
31
|
+
name="content"
|
|
32
|
+
:data="error"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="sticky bottom-0 z-[10000] lg:static lg:flex">
|
|
36
|
+
<slot name="default" />
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ErrorTemplateData } from './types.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
error: ErrorTemplateData;
|
|
4
|
+
}
|
|
5
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {
|
|
6
|
+
data: any;
|
|
7
|
+
}, __VLS_9: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
icon?: (props: typeof __VLS_1) => any;
|
|
10
|
+
} & {
|
|
11
|
+
status?: (props: typeof __VLS_3) => any;
|
|
12
|
+
} & {
|
|
13
|
+
title?: (props: typeof __VLS_5) => any;
|
|
14
|
+
} & {
|
|
15
|
+
content?: (props: typeof __VLS_7) => any;
|
|
16
|
+
} & {
|
|
17
|
+
default?: (props: typeof __VLS_9) => any;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface List {
|
|
2
|
+
id: number;
|
|
3
|
+
label: string;
|
|
4
|
+
link: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface Content {
|
|
7
|
+
title: string;
|
|
8
|
+
subTitle: string;
|
|
9
|
+
subTitleSecond?: string;
|
|
10
|
+
list: List[];
|
|
11
|
+
}
|
|
12
|
+
export interface ErrorTemplateData {
|
|
13
|
+
icon: string;
|
|
14
|
+
statusCode: number;
|
|
15
|
+
title: string;
|
|
16
|
+
subTitle: string | string[];
|
|
17
|
+
subTitleSecond: string | string[];
|
|
18
|
+
content?: Content;
|
|
19
|
+
}
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|