@sfxcode/nuxt-ui-mongocamp 1.2.7 → 1.3.1
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 +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/MongocampAccount.vue +10 -0
- package/dist/runtime/components/MongocampBucketFiles.vue +18 -3
- package/dist/runtime/components/MongocampBulkDelete.d.vue.ts +16 -0
- package/dist/runtime/components/MongocampBulkDelete.vue +96 -0
- package/dist/runtime/components/MongocampBulkDelete.vue.d.ts +16 -0
- package/dist/runtime/components/MongocampCollectionData.vue +258 -11
- package/dist/runtime/components/MongocampCollectionInfos.vue +11 -5
- package/dist/runtime/components/MongocampCollections.vue +18 -4
- package/dist/runtime/components/MongocampDashboard.d.vue.ts +25 -0
- package/dist/runtime/components/MongocampDashboard.vue +111 -0
- package/dist/runtime/components/MongocampDashboard.vue.d.ts +25 -0
- package/dist/runtime/components/MongocampDatabases.vue +16 -24
- package/dist/runtime/components/MongocampEmptyState.d.vue.ts +18 -0
- package/dist/runtime/components/MongocampEmptyState.vue +28 -0
- package/dist/runtime/components/MongocampEmptyState.vue.d.ts +18 -0
- package/dist/runtime/components/MongocampErrorAlert.d.vue.ts +15 -0
- package/dist/runtime/components/MongocampErrorAlert.vue +53 -0
- package/dist/runtime/components/MongocampErrorAlert.vue.d.ts +15 -0
- package/dist/runtime/components/MongocampFilterBuilder.d.vue.ts +20 -0
- package/dist/runtime/components/MongocampFilterBuilder.vue +201 -0
- package/dist/runtime/components/MongocampFilterBuilder.vue.d.ts +20 -0
- package/dist/runtime/components/MongocampJobs.vue +44 -8
- package/dist/runtime/components/MongocampLogin.vue +3 -2
- package/dist/runtime/components/MongocampRoleGrants.vue +95 -38
- package/dist/runtime/components/MongocampRoles.vue +153 -8
- package/dist/runtime/components/MongocampUsers.vue +108 -16
- package/dist/runtime/composables/useMongocampBulkDelete.d.ts +5 -0
- package/dist/runtime/composables/useMongocampBulkDelete.js +4 -0
- package/dist/runtime/composables/useMongocampError.d.ts +8 -0
- package/dist/runtime/composables/useMongocampError.js +20 -0
- package/dist/runtime/composables/useMongocampExport.d.ts +5 -0
- package/dist/runtime/composables/useMongocampExport.js +4 -0
- package/dist/runtime/composables/useMongocampExtendedJson.js +1 -4
- package/dist/runtime/composables/useMongocampFilterBuilder.d.ts +12 -0
- package/dist/runtime/composables/useMongocampFilterBuilder.js +13 -0
- package/dist/runtime/composables/useMongocampQuery.d.ts +31 -24
- package/dist/runtime/composables/useMongocampQuery.js +60 -16
- package/dist/runtime/locales/de.json +104 -7
- package/dist/runtime/locales/en.json +104 -7
- package/dist/runtime/utils/bulkDelete.d.ts +8 -0
- package/dist/runtime/utils/bulkDelete.js +23 -0
- package/dist/runtime/utils/createSelectColumn.d.ts +7 -0
- package/dist/runtime/utils/createSelectColumn.js +19 -0
- package/dist/runtime/utils/escapeFieldName.d.ts +5 -0
- package/dist/runtime/utils/escapeFieldName.js +3 -0
- package/dist/runtime/utils/exportRows.d.ts +2 -0
- package/dist/runtime/utils/exportRows.js +18 -0
- package/dist/runtime/utils/filterBuilder.d.ts +31 -0
- package/dist/runtime/utils/filterBuilder.js +120 -0
- package/dist/runtime/utils/isoDate.d.ts +1 -0
- package/dist/runtime/utils/isoDate.js +4 -0
- package/package.json +14 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { h, ref, resolveComponent } from "vue";
|
|
2
|
+
import { computed, h, ref, resolveComponent } from "vue";
|
|
3
3
|
import { useI18n, useMongocampClientApi, useMongocampBucket } from "#imports";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
infoPath: { type: String, required: false },
|
|
@@ -11,8 +11,10 @@ const { collectionApi } = useMongocampClientApi();
|
|
|
11
11
|
const { isBucketCollection, bucketNameFor, bucketActionInFlight, clearBucket, deleteBucket } = useMongocampBucket();
|
|
12
12
|
const collections = ref([]);
|
|
13
13
|
const loading = ref(false);
|
|
14
|
+
const loadError = ref(null);
|
|
14
15
|
async function fetchCollections() {
|
|
15
16
|
loading.value = true;
|
|
17
|
+
loadError.value = null;
|
|
16
18
|
try {
|
|
17
19
|
const names = await collectionApi.listCollections();
|
|
18
20
|
const rows = await Promise.all(
|
|
@@ -27,6 +29,9 @@ async function fetchCollections() {
|
|
|
27
29
|
})
|
|
28
30
|
);
|
|
29
31
|
collections.value = rows;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
loadError.value = e;
|
|
34
|
+
collections.value = [];
|
|
30
35
|
} finally {
|
|
31
36
|
loading.value = false;
|
|
32
37
|
}
|
|
@@ -74,7 +79,7 @@ function sortHeader(column, label) {
|
|
|
74
79
|
onClick: () => column.toggleSorting(isSorted === "asc")
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
|
-
const columns = [
|
|
82
|
+
const columns = computed(() => [
|
|
78
83
|
{
|
|
79
84
|
accessorKey: "name",
|
|
80
85
|
header: ({ column }) => sortHeader(column, t("nuxtUiMongocamp.collections.columnCollection")),
|
|
@@ -151,7 +156,7 @@ const columns = [
|
|
|
151
156
|
return h("div", { class: "flex gap-1 justify-end" }, buttons);
|
|
152
157
|
}
|
|
153
158
|
}
|
|
154
|
-
];
|
|
159
|
+
]);
|
|
155
160
|
fetchCollections();
|
|
156
161
|
</script>
|
|
157
162
|
|
|
@@ -182,13 +187,22 @@ fetchCollections();
|
|
|
182
187
|
</div>
|
|
183
188
|
</div>
|
|
184
189
|
|
|
190
|
+
<MongocampErrorAlert
|
|
191
|
+
:error="loadError"
|
|
192
|
+
@retry="fetchCollections"
|
|
193
|
+
/>
|
|
194
|
+
|
|
185
195
|
<UTable
|
|
186
196
|
v-model:global-filter="globalFilter"
|
|
187
197
|
v-model:sorting="sorting"
|
|
188
198
|
:data="collections"
|
|
189
199
|
:columns="columns"
|
|
190
200
|
:loading="loading"
|
|
191
|
-
|
|
201
|
+
>
|
|
202
|
+
<template #empty>
|
|
203
|
+
<MongocampEmptyState :title="t('nuxtUiMongocamp.empty.collections')" />
|
|
204
|
+
</template>
|
|
205
|
+
</UTable>
|
|
192
206
|
|
|
193
207
|
<UModal
|
|
194
208
|
v-model:open="isClearBucketModalOpen"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
collectionsPath?: string;
|
|
3
|
+
usersPath?: string;
|
|
4
|
+
rolesPath?: string;
|
|
5
|
+
};
|
|
6
|
+
declare function refresh(): Promise<void>;
|
|
7
|
+
declare var __VLS_44: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_44) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
12
|
+
refresh: typeof refresh;
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
|
+
collectionsPath: string;
|
|
15
|
+
usersPath: string;
|
|
16
|
+
rolesPath: string;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { useI18n } from "#imports";
|
|
4
|
+
import { useNuxtApp } from "#app";
|
|
5
|
+
import useMongocampAdmin from "../composables/useMongocampAdmin";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
collectionsPath: { type: String, required: false, default: "/secured/admin/collections" },
|
|
8
|
+
usersPath: { type: String, required: false, default: "/secured/admin/users" },
|
|
9
|
+
rolesPath: { type: String, required: false, default: "/secured/admin/roles" }
|
|
10
|
+
});
|
|
11
|
+
const { t } = useI18n();
|
|
12
|
+
const { $mongocampVersion } = useNuxtApp();
|
|
13
|
+
const { listUsers, listRoles, listCollections } = useMongocampAdmin();
|
|
14
|
+
const version = computed(() => $mongocampVersion.value);
|
|
15
|
+
const stats = ref(null);
|
|
16
|
+
const loading = ref(false);
|
|
17
|
+
const loadError = ref(null);
|
|
18
|
+
async function refresh() {
|
|
19
|
+
loading.value = true;
|
|
20
|
+
loadError.value = null;
|
|
21
|
+
try {
|
|
22
|
+
const [users, roles, collections] = await Promise.all([listUsers(), listRoles(), listCollections()]);
|
|
23
|
+
stats.value = { users: users.length, roles: roles.length, collections: collections.length };
|
|
24
|
+
} catch (e) {
|
|
25
|
+
loadError.value = e;
|
|
26
|
+
stats.value = null;
|
|
27
|
+
} finally {
|
|
28
|
+
loading.value = false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const boxes = computed(() => [
|
|
32
|
+
{ key: "collections", label: t("nuxtUiMongocamp.dashboard.collections"), icon: "i-lucide-database", to: props.collectionsPath },
|
|
33
|
+
{ key: "users", label: t("nuxtUiMongocamp.dashboard.users"), icon: "i-lucide-users", to: props.usersPath },
|
|
34
|
+
{ key: "roles", label: t("nuxtUiMongocamp.dashboard.roles"), icon: "i-lucide-shield", to: props.rolesPath }
|
|
35
|
+
]);
|
|
36
|
+
defineExpose({ refresh });
|
|
37
|
+
refresh();
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div class="flex flex-col gap-8 py-8">
|
|
42
|
+
<div class="flex items-start justify-between">
|
|
43
|
+
<div class="flex flex-col gap-1">
|
|
44
|
+
<h1 class="text-3xl font-bold">
|
|
45
|
+
{{ t("nuxtUiMongocamp.dashboard.heading") }}
|
|
46
|
+
</h1>
|
|
47
|
+
<p class="text-dimmed">
|
|
48
|
+
{{ t("nuxtUiMongocamp.dashboard.subtitle") }}
|
|
49
|
+
<span
|
|
50
|
+
v-if="version"
|
|
51
|
+
class="font-medium text-default"
|
|
52
|
+
>
|
|
53
|
+
{{ version.name }} {{ version.version }}
|
|
54
|
+
</span>
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
57
|
+
<UTooltip :text="t('nuxtUiMongocamp.common.refresh')">
|
|
58
|
+
<UButton
|
|
59
|
+
icon="i-lucide-refresh-cw"
|
|
60
|
+
color="neutral"
|
|
61
|
+
variant="ghost"
|
|
62
|
+
:loading="loading"
|
|
63
|
+
:aria-label="t('nuxtUiMongocamp.common.refresh')"
|
|
64
|
+
@click="refresh"
|
|
65
|
+
/>
|
|
66
|
+
</UTooltip>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<MongocampErrorAlert
|
|
70
|
+
:error="loadError"
|
|
71
|
+
@retry="refresh"
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
|
|
75
|
+
<NuxtLink
|
|
76
|
+
v-for="box in boxes"
|
|
77
|
+
:key="box.key"
|
|
78
|
+
:to="box.to"
|
|
79
|
+
class="group"
|
|
80
|
+
>
|
|
81
|
+
<UCard class="transition-shadow hover:shadow-md">
|
|
82
|
+
<div class="flex items-center gap-4">
|
|
83
|
+
<div class="rounded-lg bg-primary/10 p-3 transition-colors group-hover:bg-primary/20">
|
|
84
|
+
<UIcon
|
|
85
|
+
:name="box.icon"
|
|
86
|
+
class="size-6 text-primary"
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
<div>
|
|
90
|
+
<USkeleton
|
|
91
|
+
v-if="loading && !stats"
|
|
92
|
+
class="h-9 w-12"
|
|
93
|
+
/>
|
|
94
|
+
<div
|
|
95
|
+
v-else
|
|
96
|
+
class="text-3xl font-bold"
|
|
97
|
+
>
|
|
98
|
+
{{ stats?.[box.key] ?? "\u2014" }}
|
|
99
|
+
</div>
|
|
100
|
+
<div class="text-sm text-dimmed">
|
|
101
|
+
{{ box.label }}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</UCard>
|
|
106
|
+
</NuxtLink>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<slot />
|
|
110
|
+
</div>
|
|
111
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
collectionsPath?: string;
|
|
3
|
+
usersPath?: string;
|
|
4
|
+
rolesPath?: string;
|
|
5
|
+
};
|
|
6
|
+
declare function refresh(): Promise<void>;
|
|
7
|
+
declare var __VLS_44: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_44) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
12
|
+
refresh: typeof refresh;
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
|
+
collectionsPath: string;
|
|
15
|
+
usersPath: string;
|
|
16
|
+
rolesPath: string;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { h, ref, resolveComponent } from "vue";
|
|
2
|
+
import { computed, h, ref, resolveComponent } from "vue";
|
|
3
3
|
import { useI18n, useMongocampSystem } from "#imports";
|
|
4
4
|
const { t } = useI18n();
|
|
5
5
|
const { getDatabaseInfos, listCollectionsByDatabase } = useMongocampSystem();
|
|
6
6
|
const databases = ref([]);
|
|
7
7
|
const loading = ref(false);
|
|
8
8
|
const sorting = ref([]);
|
|
9
|
-
const
|
|
9
|
+
const loadError = ref(null);
|
|
10
10
|
async function fetchDatabases() {
|
|
11
11
|
loading.value = true;
|
|
12
|
-
|
|
12
|
+
loadError.value = null;
|
|
13
13
|
try {
|
|
14
14
|
const infos = await getDatabaseInfos();
|
|
15
15
|
const rows = await Promise.all(
|
|
@@ -25,7 +25,8 @@ async function fetchDatabases() {
|
|
|
25
25
|
);
|
|
26
26
|
databases.value = rows;
|
|
27
27
|
} catch (e) {
|
|
28
|
-
|
|
28
|
+
loadError.value = e;
|
|
29
|
+
databases.value = [];
|
|
29
30
|
} finally {
|
|
30
31
|
loading.value = false;
|
|
31
32
|
}
|
|
@@ -43,7 +44,7 @@ function sortHeader(column, label) {
|
|
|
43
44
|
onClick: () => column.toggleSorting(isSorted === "asc")
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
const columns = [
|
|
47
|
+
const columns = computed(() => [
|
|
47
48
|
{
|
|
48
49
|
accessorKey: "name",
|
|
49
50
|
header: ({ column }) => sortHeader(column, t("nuxtUiMongocamp.databases.columnDatabase"))
|
|
@@ -62,7 +63,7 @@ const columns = [
|
|
|
62
63
|
header: t("nuxtUiMongocamp.databases.columnEmpty"),
|
|
63
64
|
cell: ({ row }) => row.original.empty ? h(UBadge, { label: t("nuxtUiMongocamp.databases.emptyBadge"), color: "neutral", variant: "subtle" }) : h("span", { class: "text-dimmed" }, "\u2014")
|
|
64
65
|
}
|
|
65
|
-
];
|
|
66
|
+
]);
|
|
66
67
|
fetchDatabases();
|
|
67
68
|
</script>
|
|
68
69
|
|
|
@@ -84,30 +85,21 @@ fetchDatabases();
|
|
|
84
85
|
</UTooltip>
|
|
85
86
|
</div>
|
|
86
87
|
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
color="error"
|
|
90
|
-
variant="subtle"
|
|
91
|
-
icon="i-lucide-circle-alert"
|
|
88
|
+
<MongocampErrorAlert
|
|
89
|
+
:error="loadError"
|
|
92
90
|
:title="t('nuxtUiMongocamp.databases.loadFailedTitle')"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<template #actions>
|
|
96
|
-
<UButton
|
|
97
|
-
:label="t('nuxtUiMongocamp.common.retry')"
|
|
98
|
-
color="error"
|
|
99
|
-
variant="subtle"
|
|
100
|
-
icon="i-lucide-refresh-cw"
|
|
101
|
-
@click="fetchDatabases"
|
|
102
|
-
/>
|
|
103
|
-
</template>
|
|
104
|
-
</UAlert>
|
|
91
|
+
@retry="fetchDatabases"
|
|
92
|
+
/>
|
|
105
93
|
|
|
106
94
|
<UTable
|
|
107
95
|
v-model:sorting="sorting"
|
|
108
96
|
:data="databases"
|
|
109
97
|
:columns="columns"
|
|
110
98
|
:loading="loading"
|
|
111
|
-
|
|
99
|
+
>
|
|
100
|
+
<template #empty>
|
|
101
|
+
<MongocampEmptyState :title="t('nuxtUiMongocamp.empty.databases')" />
|
|
102
|
+
</template>
|
|
103
|
+
</UTable>
|
|
112
104
|
</div>
|
|
113
105
|
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
icon?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_6: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_6) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useI18n } from "#imports";
|
|
3
|
+
defineProps({
|
|
4
|
+
icon: { type: String, required: false },
|
|
5
|
+
title: { type: String, required: false },
|
|
6
|
+
description: { type: String, required: false }
|
|
7
|
+
});
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="flex flex-col items-center gap-2 py-8 text-center">
|
|
13
|
+
<UIcon
|
|
14
|
+
:name="icon ?? 'i-lucide-inbox'"
|
|
15
|
+
class="size-8 text-dimmed"
|
|
16
|
+
/>
|
|
17
|
+
<p class="font-medium">
|
|
18
|
+
{{ title ?? t("nuxtUiMongocamp.empty.title") }}
|
|
19
|
+
</p>
|
|
20
|
+
<p
|
|
21
|
+
v-if="description"
|
|
22
|
+
class="text-sm text-dimmed"
|
|
23
|
+
>
|
|
24
|
+
{{ description }}
|
|
25
|
+
</p>
|
|
26
|
+
<slot />
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
icon?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_6: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_6) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
error: unknown;
|
|
3
|
+
title?: string;
|
|
4
|
+
loginPath?: string;
|
|
5
|
+
filterRejected?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
retry: () => any;
|
|
9
|
+
clearFilters: () => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onRetry?: (() => any) | undefined;
|
|
12
|
+
onClearFilters?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useI18n, useMongocampError } from "#imports";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
error: { type: null, required: true },
|
|
6
|
+
title: { type: String, required: false },
|
|
7
|
+
loginPath: { type: String, required: false },
|
|
8
|
+
filterRejected: { type: Boolean, required: false }
|
|
9
|
+
});
|
|
10
|
+
const emit = defineEmits(["retry", "clearFilters"]);
|
|
11
|
+
const { t } = useI18n();
|
|
12
|
+
const { describeError } = useMongocampError();
|
|
13
|
+
const described = computed(() => describeError(props.error));
|
|
14
|
+
const sessionGone = computed(() => described.value.kind === "unauthorized");
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<UAlert
|
|
19
|
+
v-if="error"
|
|
20
|
+
color="error"
|
|
21
|
+
variant="subtle"
|
|
22
|
+
icon="i-lucide-circle-alert"
|
|
23
|
+
:title="filterRejected ? t('nuxtUiMongocamp.errors.filterRejectedTitle') : title ?? t('nuxtUiMongocamp.errors.loadFailedTitle')"
|
|
24
|
+
:description="filterRejected ? t('nuxtUiMongocamp.errors.filterRejected') : described.message"
|
|
25
|
+
>
|
|
26
|
+
<template #actions>
|
|
27
|
+
<UButton
|
|
28
|
+
v-if="filterRejected"
|
|
29
|
+
:label="t('nuxtUiMongocamp.errors.clearFilters')"
|
|
30
|
+
color="error"
|
|
31
|
+
variant="subtle"
|
|
32
|
+
icon="i-lucide-filter-x"
|
|
33
|
+
@click="emit('clearFilters')"
|
|
34
|
+
/>
|
|
35
|
+
<UButton
|
|
36
|
+
v-else-if="sessionGone"
|
|
37
|
+
:label="t('nuxtUiMongocamp.errors.loginAgain')"
|
|
38
|
+
:to="loginPath ?? '/'"
|
|
39
|
+
color="error"
|
|
40
|
+
variant="subtle"
|
|
41
|
+
icon="i-lucide-log-in"
|
|
42
|
+
/>
|
|
43
|
+
<UButton
|
|
44
|
+
v-else
|
|
45
|
+
:label="t('nuxtUiMongocamp.common.retry')"
|
|
46
|
+
color="error"
|
|
47
|
+
variant="subtle"
|
|
48
|
+
icon="i-lucide-refresh-cw"
|
|
49
|
+
@click="emit('retry')"
|
|
50
|
+
/>
|
|
51
|
+
</template>
|
|
52
|
+
</UAlert>
|
|
53
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
error: unknown;
|
|
3
|
+
title?: string;
|
|
4
|
+
loginPath?: string;
|
|
5
|
+
filterRejected?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
retry: () => any;
|
|
9
|
+
clearFilters: () => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onRetry?: (() => any) | undefined;
|
|
12
|
+
onClearFilters?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FilterFieldType, FilterGroup } from '../utils/filterBuilder.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
fields: {
|
|
4
|
+
key: string;
|
|
5
|
+
type: FilterFieldType;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
type __VLS_ModelProps = {
|
|
9
|
+
modelValue: FilterGroup;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (value: FilterGroup) => any;
|
|
14
|
+
apply: (query: string) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: FilterGroup) => any) | undefined;
|
|
17
|
+
onApply?: ((query: string) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|