@sfxcode/nuxt-ui-mongocamp 1.5.0 → 1.5.2
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.d.mts +6 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +24 -4
- package/dist/runtime/assets/formkit.css +1 -0
- package/dist/runtime/components/MongocampAccount.vue +4 -4
- package/dist/runtime/components/MongocampBucketFiles.d.vue.ts +21 -1
- package/dist/runtime/components/MongocampBucketFiles.vue +17 -5
- package/dist/runtime/components/MongocampBucketFiles.vue.d.ts +21 -1
- package/dist/runtime/components/MongocampChart.vue +1 -4
- package/dist/runtime/components/MongocampCollectionData.d.vue.ts +22 -1
- package/dist/runtime/components/MongocampCollectionData.vue +27 -6
- package/dist/runtime/components/MongocampCollectionData.vue.d.ts +22 -1
- package/dist/runtime/components/MongocampCollectionInfos.vue +12 -12
- package/dist/runtime/components/MongocampCollections.d.vue.ts +19 -1
- package/dist/runtime/components/MongocampCollections.vue +13 -3
- package/dist/runtime/components/MongocampCollections.vue.d.ts +19 -1
- package/dist/runtime/components/MongocampDashboard.d.vue.ts +3 -0
- package/dist/runtime/components/MongocampDashboard.vue +11 -5
- package/dist/runtime/components/MongocampDashboard.vue.d.ts +3 -0
- package/dist/runtime/components/MongocampDatabases.d.vue.ts +20 -1
- package/dist/runtime/components/MongocampDatabases.vue +15 -2
- package/dist/runtime/components/MongocampDatabases.vue.d.ts +20 -1
- package/dist/runtime/components/MongocampIndexes.vue +1 -1
- package/dist/runtime/components/MongocampJobs.d.vue.ts +23 -1
- package/dist/runtime/components/MongocampJobs.vue +18 -4
- package/dist/runtime/components/MongocampJobs.vue.d.ts +23 -1
- package/dist/runtime/components/MongocampLogin.d.vue.ts +16 -1
- package/dist/runtime/components/MongocampLogin.vue +13 -5
- package/dist/runtime/components/MongocampLogin.vue.d.ts +16 -1
- package/dist/runtime/components/MongocampPermissionMatrix.d.vue.ts +19 -1
- package/dist/runtime/components/MongocampPermissionMatrix.vue +11 -3
- package/dist/runtime/components/MongocampPermissionMatrix.vue.d.ts +19 -1
- package/dist/runtime/components/MongocampRoleGrants.d.vue.ts +22 -1
- package/dist/runtime/components/MongocampRoleGrants.vue +16 -4
- package/dist/runtime/components/MongocampRoleGrants.vue.d.ts +22 -1
- package/dist/runtime/components/MongocampRoles.d.vue.ts +22 -1
- package/dist/runtime/components/MongocampRoles.vue +19 -3
- package/dist/runtime/components/MongocampRoles.vue.d.ts +22 -1
- package/dist/runtime/components/MongocampServerInfo.d.vue.ts +24 -0
- package/dist/runtime/components/MongocampServerInfo.vue +341 -0
- package/dist/runtime/components/MongocampServerInfo.vue.d.ts +24 -0
- package/dist/runtime/components/MongocampServerOverview.d.vue.ts +18 -1
- package/dist/runtime/components/MongocampServerOverview.vue +25 -15
- package/dist/runtime/components/MongocampServerOverview.vue.d.ts +18 -1
- package/dist/runtime/components/MongocampSettings.d.vue.ts +1 -1
- package/dist/runtime/components/MongocampSettings.vue.d.ts +1 -1
- package/dist/runtime/components/MongocampUsers.d.vue.ts +24 -1
- package/dist/runtime/components/MongocampUsers.vue +22 -4
- package/dist/runtime/components/MongocampUsers.vue.d.ts +24 -1
- package/dist/runtime/components/MongocampVersion.d.vue.ts +7 -1
- package/dist/runtime/components/MongocampVersion.vue +49 -19
- package/dist/runtime/components/MongocampVersion.vue.d.ts +7 -1
- package/dist/runtime/composables/useMongocampSystem.d.ts +10 -1
- package/dist/runtime/composables/useMongocampSystem.js +11 -1
- package/dist/runtime/formkit.config.d.ts +3 -0
- package/dist/runtime/formkit.config.js +9 -0
- package/dist/runtime/locales/de.json +35 -0
- package/dist/runtime/locales/en.json +35 -0
- package/dist/runtime/plugin.d.ts +2 -2
- package/dist/runtime/utils/serverInfo.d.ts +8 -0
- package/dist/runtime/utils/serverInfo.js +21 -0
- package/package.json +7 -7
|
@@ -3,13 +3,31 @@ type __VLS_Props = {
|
|
|
3
3
|
dataPath?: string;
|
|
4
4
|
bucketFilesPath?: string;
|
|
5
5
|
canManage?: boolean;
|
|
6
|
+
hideHeading?: boolean;
|
|
7
|
+
hideRefresh?: boolean;
|
|
6
8
|
};
|
|
7
|
-
declare
|
|
9
|
+
declare function fetchCollections(): Promise<void>;
|
|
10
|
+
declare const __VLS_template: () => {
|
|
11
|
+
__VLS_Slots: {
|
|
12
|
+
toolbar?: (props: {}) => any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
17
|
+
refresh: typeof fetchCollections;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
19
|
changed: () => any;
|
|
9
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
21
|
onChanged?: (() => any) | undefined;
|
|
11
22
|
}>, {
|
|
12
23
|
canManage: boolean;
|
|
24
|
+
hideHeading: boolean;
|
|
13
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
27
|
declare const _default: typeof __VLS_export;
|
|
15
28
|
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -3,6 +3,8 @@ type __VLS_Props = {
|
|
|
3
3
|
usersPath?: string;
|
|
4
4
|
rolesPath?: string;
|
|
5
5
|
autoRefresh?: number;
|
|
6
|
+
hideHeading?: boolean;
|
|
7
|
+
hideRefresh?: boolean;
|
|
6
8
|
};
|
|
7
9
|
declare function refresh(): Promise<void>;
|
|
8
10
|
declare const __VLS_template: () => {
|
|
@@ -14,6 +16,7 @@ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
|
14
16
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
15
17
|
refresh: typeof refresh;
|
|
16
18
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
hideHeading: boolean;
|
|
17
20
|
usersPath: string;
|
|
18
21
|
collectionsPath: string;
|
|
19
22
|
rolesPath: string;
|
|
@@ -9,7 +9,9 @@ const props = defineProps({
|
|
|
9
9
|
collectionsPath: { type: String, required: false, default: "/secured/admin/collections" },
|
|
10
10
|
usersPath: { type: String, required: false, default: "/secured/admin/users" },
|
|
11
11
|
rolesPath: { type: String, required: false, default: "/secured/admin/roles" },
|
|
12
|
-
autoRefresh: { type: Number, required: false, default: 0 }
|
|
12
|
+
autoRefresh: { type: Number, required: false, default: 0 },
|
|
13
|
+
hideHeading: { type: Boolean, required: false, default: false },
|
|
14
|
+
hideRefresh: { type: Boolean, required: false }
|
|
13
15
|
});
|
|
14
16
|
const { t } = useI18n();
|
|
15
17
|
const { $mongocampVersion } = useNuxtApp();
|
|
@@ -59,9 +61,12 @@ if (!blocked.value) refresh();
|
|
|
59
61
|
</script>
|
|
60
62
|
|
|
61
63
|
<template>
|
|
62
|
-
<div class="flex flex-col gap-8
|
|
64
|
+
<div class="flex flex-col gap-8">
|
|
63
65
|
<div class="flex items-start justify-between">
|
|
64
|
-
<div
|
|
66
|
+
<div
|
|
67
|
+
v-if="!hideHeading"
|
|
68
|
+
class="flex flex-col gap-1"
|
|
69
|
+
>
|
|
65
70
|
<h1 class="text-3xl font-bold">
|
|
66
71
|
{{ t("nuxtUiMongocamp.dashboard.heading") }}
|
|
67
72
|
</h1>
|
|
@@ -76,7 +81,8 @@ if (!blocked.value) refresh();
|
|
|
76
81
|
</p>
|
|
77
82
|
</div>
|
|
78
83
|
<UTooltip
|
|
79
|
-
v-if="!blocked"
|
|
84
|
+
v-if="!blocked && !hideRefresh"
|
|
85
|
+
class="ml-auto"
|
|
80
86
|
:text="t('nuxtUiMongocamp.common.refresh')"
|
|
81
87
|
>
|
|
82
88
|
<UButton
|
|
@@ -127,7 +133,7 @@ if (!blocked.value) refresh();
|
|
|
127
133
|
/>
|
|
128
134
|
<div
|
|
129
135
|
v-else
|
|
130
|
-
class="text-3xl font-bold"
|
|
136
|
+
class="tabular-nums text-3xl font-bold"
|
|
131
137
|
>
|
|
132
138
|
{{ stats?.[box.key] ?? "\u2014" }}
|
|
133
139
|
</div>
|
|
@@ -3,6 +3,8 @@ type __VLS_Props = {
|
|
|
3
3
|
usersPath?: string;
|
|
4
4
|
rolesPath?: string;
|
|
5
5
|
autoRefresh?: number;
|
|
6
|
+
hideHeading?: boolean;
|
|
7
|
+
hideRefresh?: boolean;
|
|
6
8
|
};
|
|
7
9
|
declare function refresh(): Promise<void>;
|
|
8
10
|
declare const __VLS_template: () => {
|
|
@@ -14,6 +16,7 @@ type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
|
14
16
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
15
17
|
refresh: typeof refresh;
|
|
16
18
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
hideHeading: boolean;
|
|
17
20
|
usersPath: string;
|
|
18
21
|
collectionsPath: string;
|
|
19
22
|
rolesPath: string;
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
hideHeading?: boolean;
|
|
3
|
+
hideRefresh?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare function fetchDatabases(): Promise<void>;
|
|
6
|
+
declare const __VLS_template: () => {
|
|
7
|
+
__VLS_Slots: {
|
|
8
|
+
toolbar?: (props: {}) => any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
13
|
+
refresh: typeof fetchDatabases;
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
2
16
|
declare const _default: typeof __VLS_export;
|
|
3
17
|
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -4,6 +4,10 @@ import { useI18n, useMongocampSystem } from "#imports";
|
|
|
4
4
|
import { formatBytes } from "../utils/formatBytes";
|
|
5
5
|
import { shortenLabel } from "../utils/chartData";
|
|
6
6
|
import { useMongocampAdminGate } from "../composables/useMongocampAdminGate";
|
|
7
|
+
defineProps({
|
|
8
|
+
hideHeading: { type: Boolean, required: false },
|
|
9
|
+
hideRefresh: { type: Boolean, required: false }
|
|
10
|
+
});
|
|
7
11
|
const { t } = useI18n();
|
|
8
12
|
const { getDatabaseInfos, listCollectionsByDatabase } = useMongocampSystem();
|
|
9
13
|
const databases = ref([]);
|
|
@@ -70,6 +74,7 @@ const columns = computed(() => [
|
|
|
70
74
|
}
|
|
71
75
|
]);
|
|
72
76
|
if (!blocked.value) fetchDatabases();
|
|
77
|
+
defineExpose({ refresh: fetchDatabases });
|
|
73
78
|
</script>
|
|
74
79
|
|
|
75
80
|
<template>
|
|
@@ -84,10 +89,17 @@ if (!blocked.value) fetchDatabases();
|
|
|
84
89
|
class="flex flex-col gap-4"
|
|
85
90
|
>
|
|
86
91
|
<div class="flex items-center justify-between gap-4">
|
|
87
|
-
<h2
|
|
92
|
+
<h2
|
|
93
|
+
v-if="!hideHeading"
|
|
94
|
+
class="text-xl font-semibold"
|
|
95
|
+
>
|
|
88
96
|
{{ t("nuxtUiMongocamp.databases.heading") }}
|
|
89
97
|
</h2>
|
|
90
|
-
<UTooltip
|
|
98
|
+
<UTooltip
|
|
99
|
+
v-if="!hideRefresh"
|
|
100
|
+
class="ml-auto"
|
|
101
|
+
:text="t('nuxtUiMongocamp.common.refresh')"
|
|
102
|
+
>
|
|
91
103
|
<UButton
|
|
92
104
|
icon="i-lucide-refresh-cw"
|
|
93
105
|
color="neutral"
|
|
@@ -97,6 +109,7 @@ if (!blocked.value) fetchDatabases();
|
|
|
97
109
|
@click="fetchDatabases"
|
|
98
110
|
/>
|
|
99
111
|
</UTooltip>
|
|
112
|
+
<slot name="toolbar" />
|
|
100
113
|
</div>
|
|
101
114
|
|
|
102
115
|
<MongocampErrorAlert
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
hideHeading?: boolean;
|
|
3
|
+
hideRefresh?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare function fetchDatabases(): Promise<void>;
|
|
6
|
+
declare const __VLS_template: () => {
|
|
7
|
+
__VLS_Slots: {
|
|
8
|
+
toolbar?: (props: {}) => any;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
13
|
+
refresh: typeof fetchDatabases;
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
2
16
|
declare const _default: typeof __VLS_export;
|
|
3
17
|
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -117,7 +117,7 @@ const columns = computed(() => [
|
|
|
117
117
|
{
|
|
118
118
|
accessorKey: "size",
|
|
119
119
|
header: t("nuxtUiMongocamp.indexes.columnSize"),
|
|
120
|
-
cell: ({ row }) => h("span", row.original.size === void 0 ? "\u2014" : formatBytes(row.original.size))
|
|
120
|
+
cell: ({ row }) => h("span", { class: "tabular-nums" }, row.original.size === void 0 ? "\u2014" : formatBytes(row.original.size))
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
id: "usage",
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
autoRefresh?: number;
|
|
3
|
+
hideHeading?: boolean;
|
|
4
|
+
hideRefresh?: boolean;
|
|
3
5
|
};
|
|
4
|
-
declare
|
|
6
|
+
declare function fetchJobs(): Promise<void>;
|
|
7
|
+
declare const __VLS_template: () => {
|
|
8
|
+
__VLS_Slots: {
|
|
9
|
+
toolbar?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
14
|
+
refresh: typeof fetchJobs;
|
|
15
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
changed: () => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onChanged?: (() => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
hideHeading: boolean;
|
|
5
21
|
autoRefresh: number;
|
|
6
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
24
|
declare const _default: typeof __VLS_export;
|
|
8
25
|
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -4,8 +4,11 @@ import { useI18n, useMongocampError, useMongocampJobs, useToast } from "#imports
|
|
|
4
4
|
import { useMongocampAutoRefresh } from "../composables/useMongocampAutoRefresh";
|
|
5
5
|
import { useMongocampAdminGate } from "../composables/useMongocampAdminGate";
|
|
6
6
|
const props = defineProps({
|
|
7
|
-
autoRefresh: { type: Number, required: false, default: 0 }
|
|
7
|
+
autoRefresh: { type: Number, required: false, default: 0 },
|
|
8
|
+
hideHeading: { type: Boolean, required: false, default: false },
|
|
9
|
+
hideRefresh: { type: Boolean, required: false }
|
|
8
10
|
});
|
|
11
|
+
const emit = defineEmits(["changed"]);
|
|
9
12
|
const { t } = useI18n();
|
|
10
13
|
const { describeServerError } = useMongocampError();
|
|
11
14
|
const { listJobs, listPossibleJobs, registerJob, updateJob, executeJob, deleteJob } = useMongocampJobs();
|
|
@@ -145,6 +148,7 @@ async function handleAddJob() {
|
|
|
145
148
|
await registerJob({ ...newJob.value, className });
|
|
146
149
|
isAddModalOpen.value = false;
|
|
147
150
|
await fetchJobs();
|
|
151
|
+
emit("changed");
|
|
148
152
|
} catch (e) {
|
|
149
153
|
errorMessage.value = e instanceof Error ? e.message : t("nuxtUiMongocamp.jobs.errorAdd");
|
|
150
154
|
}
|
|
@@ -169,6 +173,7 @@ async function handleEditJob() {
|
|
|
169
173
|
await updateJob(editJobOriginal.value.group, editJobOriginal.value.name, jobConfig);
|
|
170
174
|
isEditModalOpen.value = false;
|
|
171
175
|
await fetchJobs();
|
|
176
|
+
emit("changed");
|
|
172
177
|
} catch (e) {
|
|
173
178
|
errorMessage.value = e instanceof Error ? e.message : t("nuxtUiMongocamp.jobs.errorEdit");
|
|
174
179
|
}
|
|
@@ -188,6 +193,7 @@ async function handleDeleteJob() {
|
|
|
188
193
|
await deleteJob(jobToDelete.value.group, jobToDelete.value.name);
|
|
189
194
|
isDeleteModalOpen.value = false;
|
|
190
195
|
await fetchJobs();
|
|
196
|
+
emit("changed");
|
|
191
197
|
} catch (e) {
|
|
192
198
|
deleteError.value = (await describeServerError(e, "nuxtUiMongocamp.jobs.errorDelete")).message;
|
|
193
199
|
} finally {
|
|
@@ -285,6 +291,7 @@ const columns = computed(() => [
|
|
|
285
291
|
}
|
|
286
292
|
]);
|
|
287
293
|
if (!blocked.value) fetchJobs();
|
|
294
|
+
defineExpose({ refresh: fetchJobs });
|
|
288
295
|
</script>
|
|
289
296
|
|
|
290
297
|
<template>
|
|
@@ -299,11 +306,17 @@ if (!blocked.value) fetchJobs();
|
|
|
299
306
|
class="flex flex-col gap-4"
|
|
300
307
|
>
|
|
301
308
|
<div class="flex items-center justify-between gap-4">
|
|
302
|
-
<h2
|
|
309
|
+
<h2
|
|
310
|
+
v-if="!hideHeading"
|
|
311
|
+
class="text-xl font-semibold"
|
|
312
|
+
>
|
|
303
313
|
{{ t("nuxtUiMongocamp.jobs.heading") }}
|
|
304
314
|
</h2>
|
|
305
|
-
<div class="flex items-center gap-2">
|
|
306
|
-
<UTooltip
|
|
315
|
+
<div class="ml-auto flex items-center gap-2">
|
|
316
|
+
<UTooltip
|
|
317
|
+
v-if="!hideRefresh"
|
|
318
|
+
:text="t('nuxtUiMongocamp.common.refresh')"
|
|
319
|
+
>
|
|
307
320
|
<UButton
|
|
308
321
|
icon="i-lucide-refresh-cw"
|
|
309
322
|
color="neutral"
|
|
@@ -313,6 +326,7 @@ if (!blocked.value) fetchJobs();
|
|
|
313
326
|
@click="fetchJobs"
|
|
314
327
|
/>
|
|
315
328
|
</UTooltip>
|
|
329
|
+
<slot name="toolbar" />
|
|
316
330
|
<UButton
|
|
317
331
|
icon="i-lucide-plus"
|
|
318
332
|
:label="t('nuxtUiMongocamp.jobs.addJob')"
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
autoRefresh?: number;
|
|
3
|
+
hideHeading?: boolean;
|
|
4
|
+
hideRefresh?: boolean;
|
|
3
5
|
};
|
|
4
|
-
declare
|
|
6
|
+
declare function fetchJobs(): Promise<void>;
|
|
7
|
+
declare const __VLS_template: () => {
|
|
8
|
+
__VLS_Slots: {
|
|
9
|
+
toolbar?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
14
|
+
refresh: typeof fetchJobs;
|
|
15
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
changed: () => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onChanged?: (() => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
hideHeading: boolean;
|
|
5
21
|
autoRefresh: number;
|
|
6
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
24
|
declare const _default: typeof __VLS_export;
|
|
8
25
|
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
redirectPath?: string;
|
|
3
|
+
hideHeading?: boolean;
|
|
3
4
|
};
|
|
4
|
-
declare const
|
|
5
|
+
declare const __VLS_template: () => {
|
|
6
|
+
__VLS_Slots: {
|
|
7
|
+
header?: (props: {}) => any;
|
|
8
|
+
} & {
|
|
9
|
+
footer?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
13
|
+
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>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
15
|
declare const _default: typeof __VLS_export;
|
|
6
16
|
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -4,7 +4,8 @@ import { ref, reactive } from "vue";
|
|
|
4
4
|
import { useI18n, useMongocampAuth } from "#imports";
|
|
5
5
|
import { navigateTo, useCookie, useNuxtApp } from "#app";
|
|
6
6
|
const props = defineProps({
|
|
7
|
-
redirectPath: { type: String, required: false }
|
|
7
|
+
redirectPath: { type: String, required: false },
|
|
8
|
+
hideHeading: { type: Boolean, required: false }
|
|
8
9
|
});
|
|
9
10
|
const { t } = useI18n();
|
|
10
11
|
const { login } = useMongocampAuth();
|
|
@@ -12,24 +13,27 @@ const errorMessage = ref("");
|
|
|
12
13
|
const nuxtApp = useNuxtApp();
|
|
13
14
|
const loginMail = useCookie("mongocamp_login", { maxAge: 30 * 24 * 60 * 60 });
|
|
14
15
|
const data = ref({ userId: loginMail.value, password: "" });
|
|
16
|
+
const fullWidth = { outerClass: "w-full", innerClass: "w-full", class: "w-full" };
|
|
15
17
|
const schema = reactive(
|
|
16
18
|
[
|
|
17
|
-
{
|
|
19
|
+
...props.hideHeading ? [] : [{
|
|
18
20
|
$el: "h3",
|
|
19
21
|
children: t("nuxtUiMongocamp.login.heading")
|
|
20
|
-
},
|
|
22
|
+
}],
|
|
21
23
|
{
|
|
22
24
|
$formkit: "nuxtUIInput",
|
|
23
25
|
name: "userId",
|
|
24
26
|
label: t("nuxtUiMongocamp.login.email"),
|
|
25
|
-
validation: "required|email"
|
|
27
|
+
validation: "required|email",
|
|
28
|
+
...fullWidth
|
|
26
29
|
},
|
|
27
30
|
{
|
|
28
31
|
$formkit: "nuxtUIInput",
|
|
29
32
|
name: "password",
|
|
30
33
|
label: t("nuxtUiMongocamp.login.password"),
|
|
31
34
|
inputType: "password",
|
|
32
|
-
validation: "required|length:3"
|
|
35
|
+
validation: "required|length:3",
|
|
36
|
+
...fullWidth
|
|
33
37
|
}
|
|
34
38
|
]
|
|
35
39
|
);
|
|
@@ -50,6 +54,8 @@ async function actionLogin() {
|
|
|
50
54
|
<template>
|
|
51
55
|
<div class="flex flex-col items-center justify-center gap-4 p-4 w-full">
|
|
52
56
|
<UPageCard class="w-full max-w-md">
|
|
57
|
+
<!-- above the form: a logo, a title, a hint -->
|
|
58
|
+
<slot name="header" />
|
|
53
59
|
<FUDataEdit
|
|
54
60
|
:data="data"
|
|
55
61
|
:schema="schema"
|
|
@@ -63,6 +69,8 @@ async function actionLogin() {
|
|
|
63
69
|
>
|
|
64
70
|
{{ errorMessage }}
|
|
65
71
|
</div>
|
|
72
|
+
<!-- below the form and its error: links, legal text -->
|
|
73
|
+
<slot name="footer" />
|
|
66
74
|
</UPageCard>
|
|
67
75
|
</div>
|
|
68
76
|
</template>
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
redirectPath?: string;
|
|
3
|
+
hideHeading?: boolean;
|
|
3
4
|
};
|
|
4
|
-
declare const
|
|
5
|
+
declare const __VLS_template: () => {
|
|
6
|
+
__VLS_Slots: {
|
|
7
|
+
header?: (props: {}) => any;
|
|
8
|
+
} & {
|
|
9
|
+
footer?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
13
|
+
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>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
15
|
declare const _default: typeof __VLS_export;
|
|
6
16
|
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -2,11 +2,29 @@ type __VLS_Props = {
|
|
|
2
2
|
grantsPath?: string;
|
|
3
3
|
maxCollections?: number;
|
|
4
4
|
maxUsers?: number;
|
|
5
|
+
hideHeading?: boolean;
|
|
6
|
+
hideRefresh?: boolean;
|
|
5
7
|
};
|
|
6
|
-
declare
|
|
8
|
+
declare function load(): Promise<void>;
|
|
9
|
+
declare const __VLS_template: () => {
|
|
10
|
+
__VLS_Slots: {
|
|
11
|
+
toolbar?: (props: {}) => any;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
16
|
+
refresh: typeof load;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
|
+
hideHeading: boolean;
|
|
7
19
|
grantsPath: string;
|
|
8
20
|
maxCollections: number;
|
|
9
21
|
maxUsers: number;
|
|
10
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
24
|
declare const _default: typeof __VLS_export;
|
|
12
25
|
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -16,7 +16,9 @@ import { isBucketMemberCollection } from "../utils/collectionProtection";
|
|
|
16
16
|
const props = defineProps({
|
|
17
17
|
grantsPath: { type: String, required: false, default: "/secured/admin/roles" },
|
|
18
18
|
maxCollections: { type: Number, required: false, default: 60 },
|
|
19
|
-
maxUsers: { type: Number, required: false, default: 200 }
|
|
19
|
+
maxUsers: { type: Number, required: false, default: 200 },
|
|
20
|
+
hideHeading: { type: Boolean, required: false, default: false },
|
|
21
|
+
hideRefresh: { type: Boolean, required: false }
|
|
20
22
|
});
|
|
21
23
|
const { t } = useI18n();
|
|
22
24
|
const { listUsers, listRoles, listCollections } = useMongocampAdmin();
|
|
@@ -89,6 +91,7 @@ function exportCsv() {
|
|
|
89
91
|
const { keys, rows } = matrixToCsvRows({ ...shown.value, users: users.value, collections: collections.value });
|
|
90
92
|
downloadTextFile(`permissions-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, rowsToCsv(rows, keys), "text/csv");
|
|
91
93
|
}
|
|
94
|
+
defineExpose({ refresh: load });
|
|
92
95
|
</script>
|
|
93
96
|
|
|
94
97
|
<template>
|
|
@@ -97,7 +100,10 @@ function exportCsv() {
|
|
|
97
100
|
data-test="permission-matrix"
|
|
98
101
|
>
|
|
99
102
|
<div class="flex flex-wrap items-start justify-between gap-2">
|
|
100
|
-
<div
|
|
103
|
+
<div
|
|
104
|
+
v-if="!hideHeading"
|
|
105
|
+
class="flex flex-col gap-1"
|
|
106
|
+
>
|
|
101
107
|
<h2 class="text-xl font-semibold">
|
|
102
108
|
{{ t("nuxtUiMongocamp.permissionMatrix.heading") }}
|
|
103
109
|
</h2>
|
|
@@ -105,7 +111,7 @@ function exportCsv() {
|
|
|
105
111
|
{{ t("nuxtUiMongocamp.permissionMatrix.subtitle") }}
|
|
106
112
|
</p>
|
|
107
113
|
</div>
|
|
108
|
-
<div class="flex items-center gap-1">
|
|
114
|
+
<div class="ml-auto flex items-center gap-1">
|
|
109
115
|
<UButton
|
|
110
116
|
icon="i-lucide-arrow-left-right"
|
|
111
117
|
color="neutral"
|
|
@@ -124,6 +130,7 @@ function exportCsv() {
|
|
|
124
130
|
@click="exportCsv"
|
|
125
131
|
/>
|
|
126
132
|
<UButton
|
|
133
|
+
v-if="!hideRefresh"
|
|
127
134
|
icon="i-lucide-refresh-cw"
|
|
128
135
|
color="neutral"
|
|
129
136
|
variant="ghost"
|
|
@@ -131,6 +138,7 @@ function exportCsv() {
|
|
|
131
138
|
:aria-label="t('nuxtUiMongocamp.permissionMatrix.refresh')"
|
|
132
139
|
@click="load"
|
|
133
140
|
/>
|
|
141
|
+
<slot name="toolbar" />
|
|
134
142
|
</div>
|
|
135
143
|
</div>
|
|
136
144
|
|
|
@@ -2,11 +2,29 @@ type __VLS_Props = {
|
|
|
2
2
|
grantsPath?: string;
|
|
3
3
|
maxCollections?: number;
|
|
4
4
|
maxUsers?: number;
|
|
5
|
+
hideHeading?: boolean;
|
|
6
|
+
hideRefresh?: boolean;
|
|
5
7
|
};
|
|
6
|
-
declare
|
|
8
|
+
declare function load(): Promise<void>;
|
|
9
|
+
declare const __VLS_template: () => {
|
|
10
|
+
__VLS_Slots: {
|
|
11
|
+
toolbar?: (props: {}) => any;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
16
|
+
refresh: typeof load;
|
|
17
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
|
+
hideHeading: boolean;
|
|
7
19
|
grantsPath: string;
|
|
8
20
|
maxCollections: number;
|
|
9
21
|
maxUsers: number;
|
|
10
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
24
|
declare const _default: typeof __VLS_export;
|
|
12
25
|
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
roleName: string;
|
|
3
|
+
hideHeading?: boolean;
|
|
4
|
+
hideRefresh?: boolean;
|
|
3
5
|
};
|
|
4
|
-
declare
|
|
6
|
+
declare function fetchRole(): Promise<void>;
|
|
7
|
+
declare const __VLS_template: () => {
|
|
8
|
+
__VLS_Slots: {
|
|
9
|
+
toolbar?: (props: {}) => any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
14
|
+
refresh: typeof fetchRole;
|
|
15
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
changed: () => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onChanged?: (() => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
21
|
declare const _default: typeof __VLS_export;
|
|
6
22
|
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|