@sfxcode/nuxt-ui-mongocamp 1.5.6 → 1.5.8
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.d.mts +26 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +5 -0
- package/dist/runtime/components/MongocampAccount.vue +12 -14
- package/dist/runtime/components/MongocampAggregationBuilder.vue +27 -43
- package/dist/runtime/components/MongocampAggregationChart.vue +7 -5
- package/dist/runtime/components/MongocampAggregationStagePreview.vue +1 -1
- package/dist/runtime/components/MongocampBucketFiles.vue +25 -34
- package/dist/runtime/components/MongocampBulkDelete.d.vue.ts +2 -2
- package/dist/runtime/components/MongocampBulkDelete.vue +8 -9
- package/dist/runtime/components/MongocampBulkDelete.vue.d.ts +2 -2
- package/dist/runtime/components/MongocampBulkEdit.vue +5 -4
- package/dist/runtime/components/MongocampChart.vue +1 -1
- package/dist/runtime/components/MongocampCollectionCharts.vue +6 -5
- package/dist/runtime/components/MongocampCollectionCopy.d.vue.ts +2 -2
- package/dist/runtime/components/MongocampCollectionCopy.vue +6 -6
- package/dist/runtime/components/MongocampCollectionCopy.vue.d.ts +2 -2
- package/dist/runtime/components/MongocampCollectionData.vue +37 -62
- package/dist/runtime/components/MongocampCollectionInfos.vue +18 -23
- package/dist/runtime/components/MongocampCollectionRename.d.vue.ts +2 -2
- package/dist/runtime/components/MongocampCollectionRename.vue +5 -4
- package/dist/runtime/components/MongocampCollectionRename.vue.d.ts +2 -2
- package/dist/runtime/components/MongocampCollections.vue +24 -33
- package/dist/runtime/components/MongocampCommandPalette.d.vue.ts +2 -2
- package/dist/runtime/components/MongocampCommandPalette.vue +3 -1
- package/dist/runtime/components/MongocampCommandPalette.vue.d.ts +2 -2
- package/dist/runtime/components/MongocampConfirmByName.vue +5 -4
- package/dist/runtime/components/MongocampDashboard.vue +5 -3
- package/dist/runtime/components/MongocampDatabases.vue +14 -8
- package/dist/runtime/components/MongocampDocumentCompare.vue +6 -4
- package/dist/runtime/components/MongocampDocumentView.vue +6 -8
- package/dist/runtime/components/MongocampEmptyState.vue +4 -1
- package/dist/runtime/components/MongocampErrorAlert.vue +8 -7
- package/dist/runtime/components/MongocampExportAll.vue +7 -7
- package/dist/runtime/components/MongocampFilePreview.vue +7 -6
- package/dist/runtime/components/MongocampFilterBuilder.vue +12 -16
- package/dist/runtime/components/MongocampGrantList.vue +6 -2
- package/dist/runtime/components/MongocampImport.vue +29 -28
- package/dist/runtime/components/MongocampIndexes.vue +15 -17
- package/dist/runtime/components/MongocampJobs.vue +20 -20
- package/dist/runtime/components/MongocampLogin.vue +2 -1
- package/dist/runtime/components/MongocampPermissionMatrix.vue +14 -11
- package/dist/runtime/components/MongocampQueryBar.vue +18 -32
- package/dist/runtime/components/MongocampRoleGrants.vue +21 -17
- package/dist/runtime/components/MongocampRoles.vue +28 -32
- package/dist/runtime/components/MongocampServerInfo.vue +17 -12
- package/dist/runtime/components/MongocampServerOverview.vue +16 -12
- package/dist/runtime/components/MongocampServerStatus.vue +2 -1
- package/dist/runtime/components/MongocampSettings.vue +15 -11
- package/dist/runtime/components/MongocampUserAccess.vue +11 -6
- package/dist/runtime/components/MongocampUsers.vue +32 -35
- package/dist/runtime/components/MongocampVersion.vue +6 -4
- package/dist/runtime/composables/useMongocampAdmin.d.ts +4 -4
- package/dist/runtime/composables/useMongocampClientApi.d.ts +13 -1
- package/dist/runtime/composables/useMongocampConnection.d.ts +25 -0
- package/dist/runtime/composables/useMongocampConnection.js +33 -0
- package/dist/runtime/composables/useMongocampRoles.d.ts +5 -5
- package/dist/runtime/composables/useMongocampUi.d.ts +8 -0
- package/dist/runtime/composables/useMongocampUi.js +7 -0
- package/dist/runtime/plugin.d.ts +5 -1
- package/dist/runtime/plugin.js +62 -2
- package/dist/runtime/publicUtils.d.ts +1 -0
- package/dist/runtime/publicUtils.js +1 -0
- package/dist/runtime/utils/compactSession.d.ts +13 -0
- package/dist/runtime/utils/compactSession.js +12 -0
- package/dist/runtime/utils/connection.d.ts +23 -0
- package/dist/runtime/utils/connection.js +31 -0
- package/dist/runtime/utils/sessionGuard.d.ts +1 -0
- package/dist/runtime/utils/sessionGuard.js +8 -0
- package/dist/runtime/utils/uiTheme.d.ts +65 -0
- package/dist/runtime/utils/uiTheme.js +47 -0
- package/package.json +13 -13
|
@@ -8,12 +8,14 @@ import { useMongocampPermissions } from "../composables/useMongocampPermissions"
|
|
|
8
8
|
import MongocampCollectionCharts from "./MongocampCollectionCharts.vue";
|
|
9
9
|
import { useMongocampQuery } from "../composables/useMongocampQuery";
|
|
10
10
|
import { parseMetadataJson } from "../utils/filePreview";
|
|
11
|
+
import { useMongocampUi } from "../composables/useMongocampUi";
|
|
11
12
|
const props = defineProps({
|
|
12
13
|
bucketName: { type: String, required: true },
|
|
13
14
|
hideRefresh: { type: Boolean, required: false }
|
|
14
15
|
});
|
|
15
16
|
const emit = defineEmits(["changed"]);
|
|
16
17
|
const { t } = useI18n();
|
|
18
|
+
const ui = useMongocampUi();
|
|
17
19
|
const { pagination, total } = useMongocampCollection();
|
|
18
20
|
const {
|
|
19
21
|
listFiles,
|
|
@@ -112,8 +114,7 @@ function withTooltip(text, node) {
|
|
|
112
114
|
function sortHeader(column, label) {
|
|
113
115
|
const isSorted = column.getIsSorted();
|
|
114
116
|
return h(UButton, {
|
|
115
|
-
|
|
116
|
-
variant: "ghost",
|
|
117
|
+
...ui.value.sortHeader,
|
|
117
118
|
label,
|
|
118
119
|
icon: isSorted === "asc" ? "i-lucide-arrow-up-narrow-wide" : isSorted === "desc" ? "i-lucide-arrow-down-wide-narrow" : "i-lucide-arrow-up-down",
|
|
119
120
|
class: "-mx-2.5",
|
|
@@ -151,9 +152,7 @@ function makeMetadataCell() {
|
|
|
151
152
|
const label = keys.length === 1 ? t("nuxtUiMongocamp.bucketFiles.keyCount") : t("nuxtUiMongocamp.bucketFiles.keysCount", { count: keys.length });
|
|
152
153
|
return withTooltip(t("nuxtUiMongocamp.bucketFiles.viewMetadataTooltip"), h(UButton, {
|
|
153
154
|
"icon": "i-lucide-braces",
|
|
154
|
-
|
|
155
|
-
"variant": "ghost",
|
|
156
|
-
"size": "xs",
|
|
155
|
+
...ui.value.compactButton,
|
|
157
156
|
label,
|
|
158
157
|
// Starts with the visible text, so voice control ("click 1 key") still finds it
|
|
159
158
|
"aria-label": `${label}: ${t("nuxtUiMongocamp.bucketFiles.viewMetadataTooltip")}`,
|
|
@@ -218,38 +217,31 @@ function makeActionsColumn() {
|
|
|
218
217
|
header: "",
|
|
219
218
|
cell: ({ row }) => {
|
|
220
219
|
const file = row.original;
|
|
221
|
-
return h("div", { class: "flex gap-1 justify-end" }, [
|
|
220
|
+
return h("div", { "class": "flex gap-1 justify-end", "data-mongocamp-part": "row-actions" }, [
|
|
222
221
|
withTooltip(t("nuxtUiMongocamp.bucketFiles.previewTooltip"), h(UButton, {
|
|
223
222
|
"icon": "i-lucide-eye",
|
|
224
|
-
|
|
225
|
-
"variant": "ghost",
|
|
226
|
-
"size": "sm",
|
|
223
|
+
...ui.value.iconButton,
|
|
227
224
|
"aria-label": t("nuxtUiMongocamp.bucketFiles.previewTooltip"),
|
|
228
225
|
"onClick": () => openPreview(file)
|
|
229
226
|
})),
|
|
230
227
|
withTooltip(t("nuxtUiMongocamp.bucketFiles.downloadFileTooltip"), h(UButton, {
|
|
231
228
|
"icon": "i-lucide-download",
|
|
232
|
-
|
|
233
|
-
"variant": "ghost",
|
|
234
|
-
"size": "sm",
|
|
229
|
+
...ui.value.iconButton,
|
|
235
230
|
"aria-label": t("nuxtUiMongocamp.bucketFiles.downloadFileTooltip"),
|
|
236
231
|
"loading": downloadingFileIds.value.has(file.id),
|
|
237
232
|
"onClick": () => downloadFile(props.bucketName, file.id)
|
|
238
233
|
})),
|
|
239
234
|
withTooltip(t("nuxtUiMongocamp.bucketFiles.renameTooltip"), h(UButton, {
|
|
240
235
|
"icon": "i-lucide-pencil",
|
|
241
|
-
|
|
242
|
-
"variant": "ghost",
|
|
243
|
-
"size": "sm",
|
|
236
|
+
...ui.value.iconButton,
|
|
244
237
|
"aria-label": t("nuxtUiMongocamp.bucketFiles.renameTooltip"),
|
|
245
238
|
"loading": fileActionInFlight.value.has(file.id),
|
|
246
239
|
"onClick": () => openRename(file)
|
|
247
240
|
})),
|
|
248
241
|
withTooltip(t("nuxtUiMongocamp.bucketFiles.deleteFileTooltip"), h(UButton, {
|
|
249
242
|
"icon": "i-lucide-trash-2",
|
|
243
|
+
...ui.value.iconButton,
|
|
250
244
|
"color": "error",
|
|
251
|
-
"variant": "ghost",
|
|
252
|
-
"size": "sm",
|
|
253
245
|
"aria-label": t("nuxtUiMongocamp.bucketFiles.deleteFileTooltip"),
|
|
254
246
|
"loading": fileActionInFlight.value.has(file.id),
|
|
255
247
|
"onClick": () => confirmDeleteFile(file)
|
|
@@ -339,7 +331,7 @@ defineExpose({ refresh: init });
|
|
|
339
331
|
|
|
340
332
|
<template>
|
|
341
333
|
<div
|
|
342
|
-
class="relative flex flex-col gap-4"
|
|
334
|
+
class="mongocamp-bucket-files relative flex flex-col gap-4"
|
|
343
335
|
@dragenter.prevent="onDragEnter"
|
|
344
336
|
@dragover.prevent
|
|
345
337
|
@dragleave.prevent="onDragLeave"
|
|
@@ -357,20 +349,21 @@ defineExpose({ refresh: init });
|
|
|
357
349
|
v-model="filterText"
|
|
358
350
|
icon="i-lucide-search"
|
|
359
351
|
:placeholder="t('nuxtUiMongocamp.bucketFiles.filterPlaceholder')"
|
|
360
|
-
size="
|
|
352
|
+
:size="ui.controlSize"
|
|
361
353
|
class="flex-1 max-w-xs"
|
|
362
354
|
@input="onFilterInput"
|
|
363
355
|
/>
|
|
364
|
-
<div
|
|
356
|
+
<div
|
|
357
|
+
data-mongocamp-part="toolbar"
|
|
358
|
+
class="flex items-center gap-2"
|
|
359
|
+
>
|
|
365
360
|
<span class="text-sm text-muted shrink-0">
|
|
366
361
|
{{ t("nuxtUiMongocamp.bucketFiles.filesCount", { count: total }) }}
|
|
367
362
|
</span>
|
|
368
363
|
<UTooltip :text="t('nuxtUiMongocamp.bucketFiles.uploadFileTooltip')">
|
|
369
364
|
<UButton
|
|
370
365
|
icon="i-lucide-upload"
|
|
371
|
-
|
|
372
|
-
variant="ghost"
|
|
373
|
-
size="sm"
|
|
366
|
+
v-bind="{ ...ui.iconButton, color: 'primary' }"
|
|
374
367
|
:loading="uploading"
|
|
375
368
|
:aria-label="t('nuxtUiMongocamp.bucketFiles.uploadFileTooltip')"
|
|
376
369
|
@click="openFilePicker"
|
|
@@ -389,8 +382,7 @@ defineExpose({ refresh: init });
|
|
|
389
382
|
>
|
|
390
383
|
<UButton
|
|
391
384
|
icon="i-lucide-refresh-cw"
|
|
392
|
-
|
|
393
|
-
variant="ghost"
|
|
385
|
+
v-bind="ui.toolbarButton"
|
|
394
386
|
:loading="loading"
|
|
395
387
|
:aria-label="t('nuxtUiMongocamp.bucketFiles.reloadTooltip')"
|
|
396
388
|
@click="init"
|
|
@@ -408,7 +400,7 @@ defineExpose({ refresh: init });
|
|
|
408
400
|
<UAlert
|
|
409
401
|
v-if="uploadProgress"
|
|
410
402
|
color="neutral"
|
|
411
|
-
variant="
|
|
403
|
+
:variant="ui.alert.variant"
|
|
412
404
|
icon="i-lucide-upload"
|
|
413
405
|
:title="t('nuxtUiMongocamp.bucketFiles.uploadProgress', { done: uploadProgress.done, total: uploadProgress.total })"
|
|
414
406
|
:description="uploadProgress.current"
|
|
@@ -416,7 +408,7 @@ defineExpose({ refresh: init });
|
|
|
416
408
|
<UAlert
|
|
417
409
|
v-else-if="uploadResult"
|
|
418
410
|
:color="uploadResult.failed.length ? 'warning' : 'success'"
|
|
419
|
-
variant="
|
|
411
|
+
:variant="ui.alert.variant"
|
|
420
412
|
:icon="uploadResult.failed.length ? 'i-lucide-triangle-alert' : 'i-lucide-circle-check'"
|
|
421
413
|
:title="t('nuxtUiMongocamp.bucketFiles.uploadSummary', { uploaded: uploadResult.uploaded, failed: uploadResult.failed.length })"
|
|
422
414
|
close
|
|
@@ -443,6 +435,7 @@ defineExpose({ refresh: init });
|
|
|
443
435
|
|
|
444
436
|
<UTable
|
|
445
437
|
v-model:sorting="sorting"
|
|
438
|
+
data-mongocamp-part="table"
|
|
446
439
|
:sorting-options="{ manualSorting: true }"
|
|
447
440
|
:data="files"
|
|
448
441
|
:columns="columns"
|
|
@@ -465,7 +458,7 @@ defineExpose({ refresh: init });
|
|
|
465
458
|
<UModal
|
|
466
459
|
v-model:open="isRenameModalOpen"
|
|
467
460
|
:title="t('nuxtUiMongocamp.bucketFiles.renameTitle')"
|
|
468
|
-
:ui="{ footer:
|
|
461
|
+
:ui="{ footer: ui.modal.footer }"
|
|
469
462
|
>
|
|
470
463
|
<template #body>
|
|
471
464
|
<div class="flex flex-col gap-4">
|
|
@@ -492,8 +485,7 @@ defineExpose({ refresh: init });
|
|
|
492
485
|
<template #footer>
|
|
493
486
|
<UButton
|
|
494
487
|
:label="t('nuxtUiMongocamp.common.cancel')"
|
|
495
|
-
|
|
496
|
-
variant="ghost"
|
|
488
|
+
v-bind="ui.dialogCancel"
|
|
497
489
|
@click="isRenameModalOpen = false"
|
|
498
490
|
/>
|
|
499
491
|
<UButton
|
|
@@ -551,7 +543,7 @@ defineExpose({ refresh: init });
|
|
|
551
543
|
<UModal
|
|
552
544
|
v-model:open="isDeleteModalOpen"
|
|
553
545
|
:title="t('nuxtUiMongocamp.bucketFiles.deleteFileTitle')"
|
|
554
|
-
:ui="{ footer:
|
|
546
|
+
:ui="{ footer: ui.modal.footer }"
|
|
555
547
|
>
|
|
556
548
|
<template #body>
|
|
557
549
|
<p>{{ t("nuxtUiMongocamp.bucketFiles.confirmDeleteFile") }}</p>
|
|
@@ -559,13 +551,12 @@ defineExpose({ refresh: init });
|
|
|
559
551
|
<template #footer>
|
|
560
552
|
<UButton
|
|
561
553
|
:label="t('nuxtUiMongocamp.common.cancel')"
|
|
562
|
-
|
|
563
|
-
variant="ghost"
|
|
554
|
+
v-bind="ui.dialogCancel"
|
|
564
555
|
@click="isDeleteModalOpen = false"
|
|
565
556
|
/>
|
|
566
557
|
<UButton
|
|
567
558
|
:label="t('nuxtUiMongocamp.common.delete')"
|
|
568
|
-
|
|
559
|
+
v-bind="ui.dangerAction"
|
|
569
560
|
icon="i-lucide-trash-2"
|
|
570
561
|
@click="handleDeleteFile"
|
|
571
562
|
/>
|
|
@@ -17,13 +17,13 @@ declare const __VLS_template: () => {
|
|
|
17
17
|
};
|
|
18
18
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
19
19
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
-
clear: () => any;
|
|
21
20
|
open: () => any;
|
|
21
|
+
clear: () => any;
|
|
22
22
|
confirm: () => any;
|
|
23
23
|
selectAll: () => any;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
-
onClear?: (() => any) | undefined;
|
|
26
25
|
onOpen?: (() => any) | undefined;
|
|
26
|
+
onClear?: (() => any) | undefined;
|
|
27
27
|
onConfirm?: (() => any) | undefined;
|
|
28
28
|
onSelectAll?: (() => any) | undefined;
|
|
29
29
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, ref, watch } from "vue";
|
|
3
3
|
import { useI18n } from "#imports";
|
|
4
|
+
import { useMongocampUi } from "../composables/useMongocampUi";
|
|
4
5
|
const PREVIEW_LIMIT = 5;
|
|
5
6
|
const props = defineProps({
|
|
6
7
|
selected: { type: Array, required: true },
|
|
@@ -16,6 +17,7 @@ const props = defineProps({
|
|
|
16
17
|
});
|
|
17
18
|
const emit = defineEmits(["confirm", "clear", "open", "selectAll"]);
|
|
18
19
|
const { t } = useI18n();
|
|
20
|
+
const ui = useMongocampUi();
|
|
19
21
|
const isOpen = ref(false);
|
|
20
22
|
const typed = ref("");
|
|
21
23
|
const confirmed = computed(() => !props.confirmName || typed.value.trim() === props.confirmName);
|
|
@@ -38,7 +40,7 @@ watch(() => props.deleting, (now, before) => {
|
|
|
38
40
|
<template>
|
|
39
41
|
<div
|
|
40
42
|
v-if="count > 0 || counting || note"
|
|
41
|
-
class="flex flex-col gap-1"
|
|
43
|
+
class="mongocamp-bulk-delete flex flex-col gap-1"
|
|
42
44
|
>
|
|
43
45
|
<div
|
|
44
46
|
v-if="count > 0"
|
|
@@ -57,9 +59,7 @@ watch(() => props.deleting, (now, before) => {
|
|
|
57
59
|
/>
|
|
58
60
|
<slot name="actions" />
|
|
59
61
|
<UButton
|
|
60
|
-
|
|
61
|
-
variant="ghost"
|
|
62
|
-
size="sm"
|
|
62
|
+
v-bind="ui.iconButton"
|
|
63
63
|
:label="t('nuxtUiMongocamp.bulk.clearSelection')"
|
|
64
64
|
@click="emit('clear')"
|
|
65
65
|
/>
|
|
@@ -104,7 +104,7 @@ watch(() => props.deleting, (now, before) => {
|
|
|
104
104
|
<UModal
|
|
105
105
|
v-model:open="isOpen"
|
|
106
106
|
:title="t('nuxtUiMongocamp.bulk.deleteTitle', { count }, count)"
|
|
107
|
-
:ui="{
|
|
107
|
+
:ui="{ content: 'mongocamp-bulk-delete', footer: ui.modal.footer }"
|
|
108
108
|
>
|
|
109
109
|
<template #body>
|
|
110
110
|
<p>{{ t("nuxtUiMongocamp.bulk.deleteDescription") }}</p>
|
|
@@ -141,7 +141,7 @@ watch(() => props.deleting, (now, before) => {
|
|
|
141
141
|
v-if="error"
|
|
142
142
|
class="mt-3"
|
|
143
143
|
color="error"
|
|
144
|
-
variant="
|
|
144
|
+
:variant="ui.alert.variant"
|
|
145
145
|
icon="i-lucide-circle-alert"
|
|
146
146
|
:description="error"
|
|
147
147
|
/>
|
|
@@ -149,14 +149,13 @@ watch(() => props.deleting, (now, before) => {
|
|
|
149
149
|
<template #footer>
|
|
150
150
|
<UButton
|
|
151
151
|
:label="t('nuxtUiMongocamp.common.cancel')"
|
|
152
|
-
|
|
153
|
-
variant="ghost"
|
|
152
|
+
v-bind="ui.dialogCancel"
|
|
154
153
|
:disabled="deleting"
|
|
155
154
|
@click="isOpen = false"
|
|
156
155
|
/>
|
|
157
156
|
<UButton
|
|
158
157
|
:label="t('nuxtUiMongocamp.bulk.confirmDelete', { count })"
|
|
159
|
-
|
|
158
|
+
v-bind="ui.dangerAction"
|
|
160
159
|
:loading="deleting"
|
|
161
160
|
:disabled="!confirmed"
|
|
162
161
|
@click="emit('confirm')"
|
|
@@ -17,13 +17,13 @@ declare const __VLS_template: () => {
|
|
|
17
17
|
};
|
|
18
18
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
19
19
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
-
clear: () => any;
|
|
21
20
|
open: () => any;
|
|
21
|
+
clear: () => any;
|
|
22
22
|
confirm: () => any;
|
|
23
23
|
selectAll: () => any;
|
|
24
24
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
25
|
-
onClear?: (() => any) | undefined;
|
|
26
25
|
onOpen?: (() => any) | undefined;
|
|
26
|
+
onClear?: (() => any) | undefined;
|
|
27
27
|
onConfirm?: (() => any) | undefined;
|
|
28
28
|
onSelectAll?: (() => any) | undefined;
|
|
29
29
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed, ref, watch } from "vue";
|
|
3
3
|
import { useI18n } from "#imports";
|
|
4
4
|
import { coerceRow } from "../utils/importRows";
|
|
5
|
+
import { useMongocampUi } from "../composables/useMongocampUi";
|
|
5
6
|
const props = defineProps({
|
|
6
7
|
selected: { type: Number, required: true },
|
|
7
8
|
fields: { type: Array, required: true },
|
|
@@ -11,6 +12,7 @@ const props = defineProps({
|
|
|
11
12
|
const emit = defineEmits(["apply"]);
|
|
12
13
|
const isOpen = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
13
14
|
const { t } = useI18n();
|
|
15
|
+
const ui = useMongocampUi();
|
|
14
16
|
const field = ref("");
|
|
15
17
|
const type = ref("string");
|
|
16
18
|
const text = ref("");
|
|
@@ -92,7 +94,7 @@ watch(() => props.saving, (now, before) => {
|
|
|
92
94
|
<UModal
|
|
93
95
|
v-model:open="isOpen"
|
|
94
96
|
:title="t('nuxtUiMongocamp.bulk.editTitle', { count: selected }, selected)"
|
|
95
|
-
:ui="{
|
|
97
|
+
:ui="{ content: 'mongocamp-bulk-edit', footer: ui.modal.footer }"
|
|
96
98
|
>
|
|
97
99
|
<template #body>
|
|
98
100
|
<div class="flex flex-col gap-3">
|
|
@@ -151,7 +153,7 @@ watch(() => props.saving, (now, before) => {
|
|
|
151
153
|
<UAlert
|
|
152
154
|
v-if="error"
|
|
153
155
|
color="error"
|
|
154
|
-
variant="
|
|
156
|
+
:variant="ui.alert.variant"
|
|
155
157
|
icon="i-lucide-circle-alert"
|
|
156
158
|
:description="error"
|
|
157
159
|
/>
|
|
@@ -160,8 +162,7 @@ watch(() => props.saving, (now, before) => {
|
|
|
160
162
|
<template #footer>
|
|
161
163
|
<UButton
|
|
162
164
|
:label="t('nuxtUiMongocamp.common.cancel')"
|
|
163
|
-
|
|
164
|
-
variant="ghost"
|
|
165
|
+
v-bind="ui.dialogCancel"
|
|
165
166
|
:disabled="saving"
|
|
166
167
|
@click="isOpen = false"
|
|
167
168
|
/>
|
|
@@ -4,6 +4,7 @@ import { useI18n } from "#imports";
|
|
|
4
4
|
import { useMongocampAggregation } from "../composables/useMongocampAggregation";
|
|
5
5
|
import { dominantKindOfField } from "../utils/fieldDetails";
|
|
6
6
|
import { chartKindFor, chartRequest, chartTypeFor, DEFAULT_BUCKETS, DEFAULT_TOP, highestPoint, MAX_PERIODS, rowsToPoints } from "../utils/collectionChart";
|
|
7
|
+
import { useMongocampUi } from "../composables/useMongocampUi";
|
|
7
8
|
const props = defineProps({
|
|
8
9
|
collectionName: { type: String, required: true },
|
|
9
10
|
field: { type: String, required: true },
|
|
@@ -13,6 +14,7 @@ const props = defineProps({
|
|
|
13
14
|
filter: { type: String, required: false, default: void 0 }
|
|
14
15
|
});
|
|
15
16
|
const { t } = useI18n();
|
|
17
|
+
const ui = useMongocampUi();
|
|
16
18
|
const { runAggregation, listFieldDetails, describeAggregationError } = useMongocampAggregation();
|
|
17
19
|
const status = ref("loading");
|
|
18
20
|
const current = ref(void 0);
|
|
@@ -97,7 +99,7 @@ const unsupportedType = computed(() => t(`nuxtUiMongocamp.charts.type${(detected
|
|
|
97
99
|
|
|
98
100
|
<template>
|
|
99
101
|
<div
|
|
100
|
-
class="flex flex-col gap-3"
|
|
102
|
+
class="mongocamp-collection-charts flex flex-col gap-3"
|
|
101
103
|
data-test="collection-chart"
|
|
102
104
|
>
|
|
103
105
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
|
@@ -112,7 +114,7 @@ const unsupportedType = computed(() => t(`nuxtUiMongocamp.charts.type${(detected
|
|
|
112
114
|
<USelect
|
|
113
115
|
v-model="unit"
|
|
114
116
|
:items="unitItems"
|
|
115
|
-
size="
|
|
117
|
+
:size="ui.controlSize"
|
|
116
118
|
class="w-28"
|
|
117
119
|
:aria-label="t('nuxtUiMongocamp.charts.unitLabel')"
|
|
118
120
|
/>
|
|
@@ -131,7 +133,7 @@ const unsupportedType = computed(() => t(`nuxtUiMongocamp.charts.type${(detected
|
|
|
131
133
|
<UAlert
|
|
132
134
|
v-else-if="status === 'error' && error"
|
|
133
135
|
color="error"
|
|
134
|
-
variant="
|
|
136
|
+
:variant="ui.alert.variant"
|
|
135
137
|
icon="i-lucide-circle-alert"
|
|
136
138
|
:title="t('nuxtUiMongocamp.charts.failedTitle')"
|
|
137
139
|
:description="error.message"
|
|
@@ -140,8 +142,7 @@ const unsupportedType = computed(() => t(`nuxtUiMongocamp.charts.type${(detected
|
|
|
140
142
|
<template #actions>
|
|
141
143
|
<UButton
|
|
142
144
|
:label="t('nuxtUiMongocamp.charts.retry')"
|
|
143
|
-
|
|
144
|
-
variant="subtle"
|
|
145
|
+
v-bind="{ ...ui.alertAction, color: 'error' }"
|
|
145
146
|
icon="i-lucide-refresh-cw"
|
|
146
147
|
@click="load"
|
|
147
148
|
/>
|
|
@@ -7,17 +7,17 @@ type __VLS_ModelProps = {
|
|
|
7
7
|
};
|
|
8
8
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:open": (value: boolean) => any;
|
|
10
11
|
done: (payload: {
|
|
11
12
|
target: string;
|
|
12
13
|
copied: number;
|
|
13
14
|
}) => any;
|
|
14
|
-
"update:open": (value: boolean) => any;
|
|
15
15
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
16
17
|
onDone?: ((payload: {
|
|
17
18
|
target: string;
|
|
18
19
|
copied: number;
|
|
19
20
|
}) => any) | undefined;
|
|
20
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
21
21
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|
|
@@ -3,6 +3,7 @@ import { computed, ref, watch } from "vue";
|
|
|
3
3
|
import { useI18n, useMongocampError } from "#imports";
|
|
4
4
|
import { useMongocampCollectionCopy } from "../composables/useMongocampCollectionCopy";
|
|
5
5
|
import { backupName, canCopyCollection, MAX_COLLECTION_NAME_LENGTH, validateTargetName } from "../utils/collectionCopy";
|
|
6
|
+
import { useMongocampUi } from "../composables/useMongocampUi";
|
|
6
7
|
const props = defineProps({
|
|
7
8
|
source: { type: String, required: true },
|
|
8
9
|
filter: { type: String, required: false }
|
|
@@ -10,6 +11,7 @@ const props = defineProps({
|
|
|
10
11
|
const emit = defineEmits(["done"]);
|
|
11
12
|
const isOpen = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
12
13
|
const { t } = useI18n();
|
|
14
|
+
const ui = useMongocampUi();
|
|
13
15
|
const { describeServerError } = useMongocampError();
|
|
14
16
|
const { copyCollection, backupCollection, listCollectionNames, countDocuments } = useMongocampCollectionCopy();
|
|
15
17
|
const step = ref("form");
|
|
@@ -78,7 +80,7 @@ async function start(quick = false) {
|
|
|
78
80
|
v-model:open="isOpen"
|
|
79
81
|
:title="filter ? t('nuxtUiMongocamp.collectionCopy.titleFiltered', { source }) : t('nuxtUiMongocamp.collectionCopy.title', { source })"
|
|
80
82
|
:dismissible="step !== 'running'"
|
|
81
|
-
:ui="{
|
|
83
|
+
:ui="{ content: 'mongocamp-collection-copy', footer: ui.modal.footer }"
|
|
82
84
|
>
|
|
83
85
|
<template #body>
|
|
84
86
|
<div
|
|
@@ -153,7 +155,7 @@ async function start(quick = false) {
|
|
|
153
155
|
>
|
|
154
156
|
<UAlert
|
|
155
157
|
color="success"
|
|
156
|
-
variant="
|
|
158
|
+
:variant="ui.alert.variant"
|
|
157
159
|
icon="i-lucide-circle-check"
|
|
158
160
|
:title="t('nuxtUiMongocamp.collectionCopy.doneTitle', { count: result?.count ?? 0, target: result?.target ?? targetName }, result?.count ?? 0)"
|
|
159
161
|
/>
|
|
@@ -172,16 +174,14 @@ async function start(quick = false) {
|
|
|
172
174
|
<template v-else-if="step === 'done'">
|
|
173
175
|
<UButton
|
|
174
176
|
:label="t('nuxtUiMongocamp.collectionCopy.close')"
|
|
175
|
-
|
|
176
|
-
variant="ghost"
|
|
177
|
+
v-bind="ui.dialogCancel"
|
|
177
178
|
@click="isOpen = false"
|
|
178
179
|
/>
|
|
179
180
|
</template>
|
|
180
181
|
<template v-else>
|
|
181
182
|
<UButton
|
|
182
183
|
:label="t('nuxtUiMongocamp.common.cancel')"
|
|
183
|
-
|
|
184
|
-
variant="ghost"
|
|
184
|
+
v-bind="ui.dialogCancel"
|
|
185
185
|
@click="isOpen = false"
|
|
186
186
|
/>
|
|
187
187
|
<UButton
|
|
@@ -7,17 +7,17 @@ type __VLS_ModelProps = {
|
|
|
7
7
|
};
|
|
8
8
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:open": (value: boolean) => any;
|
|
10
11
|
done: (payload: {
|
|
11
12
|
target: string;
|
|
12
13
|
copied: number;
|
|
13
14
|
}) => any;
|
|
14
|
-
"update:open": (value: boolean) => any;
|
|
15
15
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
16
17
|
onDone?: ((payload: {
|
|
17
18
|
target: string;
|
|
18
19
|
copied: number;
|
|
19
20
|
}) => any) | undefined;
|
|
20
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
21
21
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|