@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,32 +1,76 @@
|
|
|
1
|
+
import { escapeFieldName } from "../utils/escapeFieldName.js";
|
|
2
|
+
import { isIsoDateTimeString } from "../utils/isoDate.js";
|
|
1
3
|
import { useMongocampQueryBuilder } from "./useMongocampQueryBuilder.js";
|
|
4
|
+
const NUMBER_BOUNDS = { from: "-9223372036854775808", to: "9223372036854775807" };
|
|
5
|
+
const DATE_BOUNDS = { from: "0001-01-01T00:00:00Z", to: "9999-12-31T23:59:59.999Z" };
|
|
6
|
+
const PLAIN_NUMBER_REGEX = /^-?(?:\d+(?:\.\d+)?|\.\d+)$/;
|
|
7
|
+
const DATE_ONLY_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
8
|
+
function boundKind(value) {
|
|
9
|
+
if (PLAIN_NUMBER_REGEX.test(value)) return "number";
|
|
10
|
+
if (isIsoDateTimeString(value)) return "date";
|
|
11
|
+
return "other";
|
|
12
|
+
}
|
|
13
|
+
function boundText(value) {
|
|
14
|
+
if (value == null) return null;
|
|
15
|
+
const text = value.toString().trim();
|
|
16
|
+
return text === "" || text === "*" ? null : text;
|
|
17
|
+
}
|
|
18
|
+
function escapeBound(value) {
|
|
19
|
+
return value.replace(/[\s[\]{}()"\\^~!&|]/g, "\\$&");
|
|
20
|
+
}
|
|
21
|
+
function widenDate(value, edge) {
|
|
22
|
+
return DATE_ONLY_REGEX.test(value) ? `${value}${edge === "from" ? "T00:00:00Z" : "T23:59:59.999Z"}` : value;
|
|
23
|
+
}
|
|
24
|
+
function farBound(kind, edge) {
|
|
25
|
+
if (kind === "number") return NUMBER_BOUNDS[edge];
|
|
26
|
+
if (kind === "date") return DATE_BOUNDS[edge];
|
|
27
|
+
return "*";
|
|
28
|
+
}
|
|
2
29
|
export function useMongocampQuery() {
|
|
3
30
|
const { q } = useMongocampQueryBuilder();
|
|
4
|
-
function
|
|
5
|
-
return q.field(
|
|
31
|
+
function fieldTerm(fieldName, value) {
|
|
32
|
+
return q.field(escapeFieldName(fieldName), value);
|
|
33
|
+
}
|
|
34
|
+
function existsClauses(fieldName, type) {
|
|
35
|
+
const clauses = [];
|
|
36
|
+
if (!type || type === "text") clauses.push(fieldTerm(fieldName, "*"));
|
|
37
|
+
if (!type || type === "number") clauses.push(fieldTerm(fieldName, q.range(NUMBER_BOUNDS.from, NUMBER_BOUNDS.to)));
|
|
38
|
+
if (!type || type === "date") clauses.push(fieldTerm(fieldName, q.range(DATE_BOUNDS.from, DATE_BOUNDS.to)));
|
|
39
|
+
return clauses;
|
|
40
|
+
}
|
|
41
|
+
function exists(fieldName, type) {
|
|
42
|
+
const clauses = existsClauses(fieldName, type);
|
|
43
|
+
return clauses.length === 1 ? clauses[0] : `(${clauses.join(" OR ")})`;
|
|
6
44
|
}
|
|
7
|
-
function notExists(fieldName) {
|
|
8
|
-
|
|
45
|
+
function notExists(fieldName, type) {
|
|
46
|
+
const clauses = existsClauses(fieldName, type).map((clause) => `-${clause}`);
|
|
47
|
+
return clauses.length === 1 ? clauses[0] : and(...clauses);
|
|
9
48
|
}
|
|
10
|
-
function isEmpty(fieldName) {
|
|
11
|
-
return notExists(fieldName);
|
|
49
|
+
function isEmpty(fieldName, type) {
|
|
50
|
+
return notExists(fieldName, type);
|
|
12
51
|
}
|
|
13
|
-
function isNotEmpty(fieldName) {
|
|
14
|
-
return exists(fieldName);
|
|
52
|
+
function isNotEmpty(fieldName, type) {
|
|
53
|
+
return exists(fieldName, type);
|
|
15
54
|
}
|
|
16
55
|
function equals(fieldName, value) {
|
|
17
56
|
if (value == null || value.toString().length === 0) return "";
|
|
18
|
-
return
|
|
57
|
+
return fieldTerm(fieldName, q.terms(value.toString()));
|
|
19
58
|
}
|
|
20
59
|
function notEquals(fieldName, value) {
|
|
21
60
|
const expr = equals(fieldName, value);
|
|
22
61
|
return expr ? `-${expr}` : "";
|
|
23
62
|
}
|
|
24
63
|
function inRange(fieldName, from, to) {
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
64
|
+
const lower = boundText(from);
|
|
65
|
+
const upper = boundText(to);
|
|
66
|
+
if (lower === null && upper === null) return exists(fieldName);
|
|
67
|
+
const kind = boundKind(lower ?? upper);
|
|
68
|
+
const fromStr = lower === null ? farBound(kind, "from") : escapeBound(boundKind(lower) === "date" ? widenDate(lower, "from") : lower);
|
|
69
|
+
const toStr = upper === null ? farBound(kind, "to") : escapeBound(boundKind(upper) === "date" ? widenDate(upper, "to") : upper);
|
|
70
|
+
return fieldTerm(fieldName, q.range(fromStr, toStr));
|
|
28
71
|
}
|
|
29
72
|
function notInRange(fieldName, from, to) {
|
|
73
|
+
if (boundText(from) === null && boundText(to) === null) return notExists(fieldName);
|
|
30
74
|
return `-${inRange(fieldName, from, to)}`;
|
|
31
75
|
}
|
|
32
76
|
function between(fieldName, from, to) {
|
|
@@ -34,21 +78,21 @@ export function useMongocampQuery() {
|
|
|
34
78
|
}
|
|
35
79
|
function like(fieldName, value) {
|
|
36
80
|
const term = value != null && value.toString().length !== 0 ? q.phrase(`*${value}*`) : "*";
|
|
37
|
-
return
|
|
81
|
+
return fieldTerm(fieldName, term);
|
|
38
82
|
}
|
|
39
83
|
function notLike(fieldName, value) {
|
|
40
84
|
return `-${like(fieldName, value)}`;
|
|
41
85
|
}
|
|
42
86
|
function startsWith(fieldName, value) {
|
|
43
87
|
const term = value != null && value.toString().length !== 0 ? q.phrase(`${value}*`) : "*";
|
|
44
|
-
return
|
|
88
|
+
return fieldTerm(fieldName, term);
|
|
45
89
|
}
|
|
46
90
|
function notStartsWith(fieldName, value) {
|
|
47
91
|
return `-${startsWith(fieldName, value)}`;
|
|
48
92
|
}
|
|
49
93
|
function endsWith(fieldName, value) {
|
|
50
94
|
const term = value != null && value.toString().length !== 0 ? q.phrase(`*${value}`) : "*";
|
|
51
|
-
return
|
|
95
|
+
return fieldTerm(fieldName, term);
|
|
52
96
|
}
|
|
53
97
|
function notEndsWith(fieldName, value) {
|
|
54
98
|
return `-${endsWith(fieldName, value)}`;
|
|
@@ -61,7 +105,7 @@ export function useMongocampQuery() {
|
|
|
61
105
|
if (parameter.length === 0) return "";
|
|
62
106
|
const fields = parameter.map(toTerms);
|
|
63
107
|
const inner = fields.length === 1 ? fields[0] : `(${fields.join(" OR ")})`;
|
|
64
|
-
return
|
|
108
|
+
return fieldTerm(fieldName, inner);
|
|
65
109
|
}
|
|
66
110
|
function notInClause(fieldName, parameter) {
|
|
67
111
|
if (parameter.length === 0) return "";
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"editUserTooltip": "Benutzer bearbeiten",
|
|
44
44
|
"deleteUserTooltip": "Benutzer löschen",
|
|
45
45
|
"errorAddUser": "Benutzer konnte nicht hinzugefügt werden",
|
|
46
|
-
"errorEditUser": "Benutzer konnte nicht aktualisiert werden"
|
|
46
|
+
"errorEditUser": "Benutzer konnte nicht aktualisiert werden",
|
|
47
|
+
"errorDelete": "Benutzer konnte nicht gelöscht werden"
|
|
47
48
|
},
|
|
48
49
|
"roles": {
|
|
49
50
|
"heading": "Rollen",
|
|
@@ -60,12 +61,20 @@
|
|
|
60
61
|
"manageGrantsTooltip": "Berechtigungen verwalten",
|
|
61
62
|
"editRoleTooltip": "Rolle bearbeiten",
|
|
62
63
|
"deleteRoleTooltip": "Rolle löschen",
|
|
64
|
+
"cloneRoleTooltip": "Rolle klonen",
|
|
65
|
+
"cloneRoleTitle": "Rolle klonen: {roleName}",
|
|
66
|
+
"cloneRole": "Rolle klonen",
|
|
67
|
+
"cloneRoleHint": "Die neue Rolle erhält eine Kopie des Admin-Flags und aller {count} Berechtigungen.",
|
|
68
|
+
"errorClone": "Rolle konnte nicht geklont werden",
|
|
63
69
|
"errorAddRole": "Rolle konnte nicht hinzugefügt werden",
|
|
64
|
-
"errorEditRole": "Rolle konnte nicht aktualisiert werden"
|
|
70
|
+
"errorEditRole": "Rolle konnte nicht aktualisiert werden",
|
|
71
|
+
"errorDelete": "Rolle konnte nicht gelöscht werden"
|
|
65
72
|
},
|
|
66
73
|
"roleGrants": {
|
|
67
74
|
"heading": "Berechtigungen: {roleName}",
|
|
68
75
|
"addGrant": "Berechtigung hinzufügen",
|
|
76
|
+
"addAllRead": "Alle nur lesend hinzufügen",
|
|
77
|
+
"addAllReadTooltip": "Lesezugriff auf alle Collections ohne Berechtigung geben, außer auf die mc_-Collections von MongoCamp",
|
|
69
78
|
"editGrantTitle": "Berechtigung bearbeiten: {name}",
|
|
70
79
|
"collection": "Collection",
|
|
71
80
|
"read": "Lesen",
|
|
@@ -127,7 +136,8 @@
|
|
|
127
136
|
"deleteIndexTitle": "Index löschen",
|
|
128
137
|
"confirmDeleteIndex": "Möchten Sie den Index \"{indexName}\" wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.",
|
|
129
138
|
"errorCreateIndex": "Fehler beim Erstellen des Index",
|
|
130
|
-
"errorDeleteIndex": "Fehler beim Löschen des Index"
|
|
139
|
+
"errorDeleteIndex": "Fehler beim Löschen des Index",
|
|
140
|
+
"typeStandard": "Standard"
|
|
131
141
|
},
|
|
132
142
|
"collectionData": {
|
|
133
143
|
"filterPlaceholder": "Zeilen filtern...",
|
|
@@ -151,7 +161,15 @@
|
|
|
151
161
|
"viewObject": "Objekt anzeigen",
|
|
152
162
|
"createdByPrefix": "erstellt: ",
|
|
153
163
|
"updatedByPrefix": "aktualisiert: ",
|
|
154
|
-
"byPrefix": "von: "
|
|
164
|
+
"byPrefix": "von: ",
|
|
165
|
+
"columnsTooltip": "Spalten ein-/ausblenden",
|
|
166
|
+
"exportTooltip": "Diese Seite exportieren",
|
|
167
|
+
"exportJson": "Seite als JSON exportieren",
|
|
168
|
+
"exportCsv": "Seite als CSV exportieren",
|
|
169
|
+
"pageSizeLabel": "Zeilen pro Seite",
|
|
170
|
+
"filtersTooltip": "Filter",
|
|
171
|
+
"removeFilter": "Filter {filter} entfernen",
|
|
172
|
+
"clearFilters": "Filter zurücksetzen"
|
|
155
173
|
},
|
|
156
174
|
"bucketFiles": {
|
|
157
175
|
"filterPlaceholder": "Nach Dateiname filtern...",
|
|
@@ -202,7 +220,8 @@
|
|
|
202
220
|
"executionFailedTitle": "Ausführung fehlgeschlagen",
|
|
203
221
|
"executionFailedDescription": "\"{name}\" konnte nicht ausgeführt werden.",
|
|
204
222
|
"errorAdd": "Job konnte nicht registriert werden",
|
|
205
|
-
"errorEdit": "Job konnte nicht aktualisiert werden"
|
|
223
|
+
"errorEdit": "Job konnte nicht aktualisiert werden",
|
|
224
|
+
"errorDelete": "Job konnte nicht gelöscht werden"
|
|
206
225
|
},
|
|
207
226
|
"account": {
|
|
208
227
|
"heading": "Konto",
|
|
@@ -232,8 +251,7 @@
|
|
|
232
251
|
"columnCollections": "Collections",
|
|
233
252
|
"columnEmpty": "Leer",
|
|
234
253
|
"emptyBadge": "Leer",
|
|
235
|
-
"loadFailedTitle": "Datenbanken konnten nicht geladen werden"
|
|
236
|
-
"errorLoad": "Datenbanken konnten nicht geladen werden"
|
|
254
|
+
"loadFailedTitle": "Datenbanken konnten nicht geladen werden"
|
|
237
255
|
},
|
|
238
256
|
"version": {
|
|
239
257
|
"unavailable": "MongoCamp nicht verfügbar"
|
|
@@ -260,6 +278,85 @@
|
|
|
260
278
|
"bucketDeletedTitle": "Bucket gelöscht",
|
|
261
279
|
"bucketDeletedDescription": "Bucket \"{bucketName}\" wurde gelöscht.",
|
|
262
280
|
"deleteFailedBucketFallback": "Bucket \"{bucketName}\" konnte nicht gelöscht werden."
|
|
281
|
+
},
|
|
282
|
+
"errors": {
|
|
283
|
+
"loadFailedTitle": "Daten konnten nicht geladen werden",
|
|
284
|
+
"network": "Der Server ist nicht erreichbar oder deine Sitzung ist abgelaufen. Erneut versuchen oder neu anmelden.",
|
|
285
|
+
"unauthorized": "Deine Sitzung ist abgelaufen. Bitte melde dich erneut an.",
|
|
286
|
+
"forbidden": "Dafür fehlt dir die Berechtigung.",
|
|
287
|
+
"generic": "Etwas ist schiefgelaufen.",
|
|
288
|
+
"loginAgain": "Erneut anmelden",
|
|
289
|
+
"filterRejectedTitle": "Der Filter konnte nicht angewendet werden",
|
|
290
|
+
"filterRejected": "Der Server hat die aktuelle Suche oder die Filter abgelehnt, obwohl die Collection selbst lädt. Setze sie zurück oder entferne die letzte Bedingung und versuche es erneut.",
|
|
291
|
+
"clearFilters": "Filter zurücksetzen"
|
|
292
|
+
},
|
|
293
|
+
"empty": {
|
|
294
|
+
"title": "Keine Daten",
|
|
295
|
+
"users": "Keine Benutzer gefunden",
|
|
296
|
+
"roles": "Keine Rollen gefunden",
|
|
297
|
+
"collections": "Keine Collections gefunden",
|
|
298
|
+
"jobs": "Keine Jobs gefunden",
|
|
299
|
+
"databases": "Keine Datenbanken gefunden",
|
|
300
|
+
"grants": "Noch keine Berechtigungen",
|
|
301
|
+
"files": "Keine Dateien gefunden",
|
|
302
|
+
"documents": "Keine Dokumente gefunden"
|
|
303
|
+
},
|
|
304
|
+
"dashboard": {
|
|
305
|
+
"heading": "Willkommen bei MongoCamp",
|
|
306
|
+
"subtitle": "MongoDB-Datenbank über REST —",
|
|
307
|
+
"collections": "Collections",
|
|
308
|
+
"users": "Benutzer",
|
|
309
|
+
"roles": "Rollen"
|
|
310
|
+
},
|
|
311
|
+
"bulk": {
|
|
312
|
+
"selectedCount": "{count} ausgewählt",
|
|
313
|
+
"deleteSelected": "Auswahl löschen",
|
|
314
|
+
"clearSelection": "Auswahl aufheben",
|
|
315
|
+
"deleteTitle": "{count} ausgewählten Eintrag löschen? | {count} ausgewählte Einträge löschen?",
|
|
316
|
+
"deleteDescription": "Die ausgewählten Einträge werden dauerhaft gelöscht. Diese Aktion kann nicht rückgängig gemacht werden.",
|
|
317
|
+
"moreItems": "…und {count} weitere",
|
|
318
|
+
"confirmDelete": "{count} löschen",
|
|
319
|
+
"selectAll": "Alle Zeilen dieser Seite auswählen",
|
|
320
|
+
"selectRow": "Zeile auswählen",
|
|
321
|
+
"partialFailure": "{failed} von {total} konnten nicht gelöscht werden: {reason}",
|
|
322
|
+
"cannotSelectSelf": "Du kannst dein eigenes Konto nicht löschen"
|
|
323
|
+
},
|
|
324
|
+
"filterBuilder": {
|
|
325
|
+
"matchLabel": "Treffer bei",
|
|
326
|
+
"matchAll": "allen Bedingungen",
|
|
327
|
+
"matchAny": "mindestens einer Bedingung",
|
|
328
|
+
"field": "Feld",
|
|
329
|
+
"operator": "Operator",
|
|
330
|
+
"value": "Wert",
|
|
331
|
+
"valueTo": "Wert bis",
|
|
332
|
+
"and": "und",
|
|
333
|
+
"listPlaceholder": "a, b, c",
|
|
334
|
+
"addCondition": "Bedingung hinzufügen",
|
|
335
|
+
"clearAll": "Alle entfernen",
|
|
336
|
+
"apply": "Filter anwenden",
|
|
337
|
+
"remove": "Bedingung entfernen",
|
|
338
|
+
"query": "Abfrage",
|
|
339
|
+
"noFields": "Noch keine Felder zum Filtern",
|
|
340
|
+
"noConditions": "Noch keine Bedingungen — füge eine hinzu, um zu filtern",
|
|
341
|
+
"ignoredRows": "{count} unvollständige Bedingung wird ignoriert | {count} unvollständige Bedingungen werden ignoriert",
|
|
342
|
+
"operators": {
|
|
343
|
+
"contains": "enthält",
|
|
344
|
+
"equals": "ist gleich",
|
|
345
|
+
"notEquals": "ist ungleich",
|
|
346
|
+
"startsWith": "beginnt mit",
|
|
347
|
+
"endsWith": "endet mit",
|
|
348
|
+
"oneOf": "ist eines von",
|
|
349
|
+
"gte": "ist mindestens",
|
|
350
|
+
"lte": "ist höchstens",
|
|
351
|
+
"between": "liegt zwischen",
|
|
352
|
+
"gteDate": "ist am oder nach",
|
|
353
|
+
"lteDate": "ist am oder vor",
|
|
354
|
+
"betweenDate": "liegt zwischen",
|
|
355
|
+
"isTrue": "ist wahr",
|
|
356
|
+
"isFalse": "ist falsch",
|
|
357
|
+
"isEmpty": "existiert nicht",
|
|
358
|
+
"isNotEmpty": "existiert"
|
|
359
|
+
}
|
|
263
360
|
}
|
|
264
361
|
}
|
|
265
362
|
}
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"editUserTooltip": "Edit user",
|
|
44
44
|
"deleteUserTooltip": "Delete user",
|
|
45
45
|
"errorAddUser": "Failed to add user",
|
|
46
|
-
"errorEditUser": "Failed to update user"
|
|
46
|
+
"errorEditUser": "Failed to update user",
|
|
47
|
+
"errorDelete": "Failed to delete user"
|
|
47
48
|
},
|
|
48
49
|
"roles": {
|
|
49
50
|
"heading": "Roles",
|
|
@@ -60,12 +61,20 @@
|
|
|
60
61
|
"manageGrantsTooltip": "Manage grants",
|
|
61
62
|
"editRoleTooltip": "Edit role",
|
|
62
63
|
"deleteRoleTooltip": "Delete role",
|
|
64
|
+
"cloneRoleTooltip": "Clone role",
|
|
65
|
+
"cloneRoleTitle": "Clone Role: {roleName}",
|
|
66
|
+
"cloneRole": "Clone Role",
|
|
67
|
+
"cloneRoleHint": "The new role gets a copy of the admin flag and all {count} grants.",
|
|
68
|
+
"errorClone": "Failed to clone role",
|
|
63
69
|
"errorAddRole": "Failed to add role",
|
|
64
|
-
"errorEditRole": "Failed to update role"
|
|
70
|
+
"errorEditRole": "Failed to update role",
|
|
71
|
+
"errorDelete": "Failed to delete role"
|
|
65
72
|
},
|
|
66
73
|
"roleGrants": {
|
|
67
74
|
"heading": "Grants: {roleName}",
|
|
68
75
|
"addGrant": "Add Grant",
|
|
76
|
+
"addAllRead": "Add all read-only",
|
|
77
|
+
"addAllReadTooltip": "Grant read access to every collection without a grant, except MongoCamp's own mc_ collections",
|
|
69
78
|
"editGrantTitle": "Edit Grant: {name}",
|
|
70
79
|
"collection": "Collection",
|
|
71
80
|
"read": "Read",
|
|
@@ -127,7 +136,8 @@
|
|
|
127
136
|
"deleteIndexTitle": "Delete Index",
|
|
128
137
|
"confirmDeleteIndex": "Are you sure you want to delete the index \"{indexName}\"? This action cannot be undone.",
|
|
129
138
|
"errorCreateIndex": "Error creating index",
|
|
130
|
-
"errorDeleteIndex": "Error deleting index"
|
|
139
|
+
"errorDeleteIndex": "Error deleting index",
|
|
140
|
+
"typeStandard": "standard"
|
|
131
141
|
},
|
|
132
142
|
"collectionData": {
|
|
133
143
|
"filterPlaceholder": "Filter rows...",
|
|
@@ -151,7 +161,15 @@
|
|
|
151
161
|
"viewObject": "View object",
|
|
152
162
|
"createdByPrefix": "created: ",
|
|
153
163
|
"updatedByPrefix": "updated: ",
|
|
154
|
-
"byPrefix": "by: "
|
|
164
|
+
"byPrefix": "by: ",
|
|
165
|
+
"columnsTooltip": "Show/hide columns",
|
|
166
|
+
"exportTooltip": "Export this page",
|
|
167
|
+
"exportJson": "Export page as JSON",
|
|
168
|
+
"exportCsv": "Export page as CSV",
|
|
169
|
+
"pageSizeLabel": "Rows per page",
|
|
170
|
+
"filtersTooltip": "Filters",
|
|
171
|
+
"removeFilter": "Remove filter {filter}",
|
|
172
|
+
"clearFilters": "Clear filters"
|
|
155
173
|
},
|
|
156
174
|
"bucketFiles": {
|
|
157
175
|
"filterPlaceholder": "Filter by filename...",
|
|
@@ -202,7 +220,8 @@
|
|
|
202
220
|
"executionFailedTitle": "Execution failed",
|
|
203
221
|
"executionFailedDescription": "Could not execute \"{name}\".",
|
|
204
222
|
"errorAdd": "Failed to register job",
|
|
205
|
-
"errorEdit": "Failed to update job"
|
|
223
|
+
"errorEdit": "Failed to update job",
|
|
224
|
+
"errorDelete": "Failed to delete job"
|
|
206
225
|
},
|
|
207
226
|
"account": {
|
|
208
227
|
"heading": "Account",
|
|
@@ -232,8 +251,7 @@
|
|
|
232
251
|
"columnCollections": "Collections",
|
|
233
252
|
"columnEmpty": "Empty",
|
|
234
253
|
"emptyBadge": "Empty",
|
|
235
|
-
"loadFailedTitle": "Failed to load databases"
|
|
236
|
-
"errorLoad": "Failed to load databases"
|
|
254
|
+
"loadFailedTitle": "Failed to load databases"
|
|
237
255
|
},
|
|
238
256
|
"version": {
|
|
239
257
|
"unavailable": "MongoCamp unavailable"
|
|
@@ -260,6 +278,85 @@
|
|
|
260
278
|
"bucketDeletedTitle": "Bucket deleted",
|
|
261
279
|
"bucketDeletedDescription": "Bucket \"{bucketName}\" was deleted.",
|
|
262
280
|
"deleteFailedBucketFallback": "Could not delete bucket \"{bucketName}\"."
|
|
281
|
+
},
|
|
282
|
+
"errors": {
|
|
283
|
+
"loadFailedTitle": "Failed to load data",
|
|
284
|
+
"network": "The server could not be reached, or your session has expired. Try again, or log in again.",
|
|
285
|
+
"unauthorized": "Your session has expired. Please log in again.",
|
|
286
|
+
"forbidden": "You do not have permission to do this.",
|
|
287
|
+
"generic": "Something went wrong.",
|
|
288
|
+
"loginAgain": "Log in again",
|
|
289
|
+
"filterRejectedTitle": "The filter could not be applied",
|
|
290
|
+
"filterRejected": "The server rejected the current search or filters, although the collection itself loads. Clear them, or remove the last condition, and try again.",
|
|
291
|
+
"clearFilters": "Clear filters"
|
|
292
|
+
},
|
|
293
|
+
"empty": {
|
|
294
|
+
"title": "No data",
|
|
295
|
+
"users": "No users found",
|
|
296
|
+
"roles": "No roles found",
|
|
297
|
+
"collections": "No collections found",
|
|
298
|
+
"jobs": "No jobs found",
|
|
299
|
+
"databases": "No databases found",
|
|
300
|
+
"grants": "No grants yet",
|
|
301
|
+
"files": "No files found",
|
|
302
|
+
"documents": "No documents found"
|
|
303
|
+
},
|
|
304
|
+
"dashboard": {
|
|
305
|
+
"heading": "Welcome to MongoCamp",
|
|
306
|
+
"subtitle": "MongoDB Database via REST —",
|
|
307
|
+
"collections": "Collections",
|
|
308
|
+
"users": "Users",
|
|
309
|
+
"roles": "Roles"
|
|
310
|
+
},
|
|
311
|
+
"bulk": {
|
|
312
|
+
"selectedCount": "{count} selected",
|
|
313
|
+
"deleteSelected": "Delete selected",
|
|
314
|
+
"clearSelection": "Clear selection",
|
|
315
|
+
"deleteTitle": "Delete {count} selected item? | Delete {count} selected items?",
|
|
316
|
+
"deleteDescription": "This permanently deletes the selected items. This action cannot be undone.",
|
|
317
|
+
"moreItems": "…and {count} more",
|
|
318
|
+
"confirmDelete": "Delete {count}",
|
|
319
|
+
"selectAll": "Select all rows on this page",
|
|
320
|
+
"selectRow": "Select row",
|
|
321
|
+
"partialFailure": "{failed} of {total} could not be deleted: {reason}",
|
|
322
|
+
"cannotSelectSelf": "You cannot delete your own account"
|
|
323
|
+
},
|
|
324
|
+
"filterBuilder": {
|
|
325
|
+
"matchLabel": "Match",
|
|
326
|
+
"matchAll": "all conditions",
|
|
327
|
+
"matchAny": "any condition",
|
|
328
|
+
"field": "Field",
|
|
329
|
+
"operator": "Operator",
|
|
330
|
+
"value": "Value",
|
|
331
|
+
"valueTo": "Value to",
|
|
332
|
+
"and": "and",
|
|
333
|
+
"listPlaceholder": "a, b, c",
|
|
334
|
+
"addCondition": "Add condition",
|
|
335
|
+
"clearAll": "Clear all",
|
|
336
|
+
"apply": "Apply filters",
|
|
337
|
+
"remove": "Remove condition",
|
|
338
|
+
"query": "Query",
|
|
339
|
+
"noFields": "No fields to filter on yet",
|
|
340
|
+
"noConditions": "No conditions yet — add one to start filtering",
|
|
341
|
+
"ignoredRows": "{count} incomplete condition is ignored | {count} incomplete conditions are ignored",
|
|
342
|
+
"operators": {
|
|
343
|
+
"contains": "contains",
|
|
344
|
+
"equals": "equals",
|
|
345
|
+
"notEquals": "does not equal",
|
|
346
|
+
"startsWith": "starts with",
|
|
347
|
+
"endsWith": "ends with",
|
|
348
|
+
"oneOf": "is one of",
|
|
349
|
+
"gte": "is at least",
|
|
350
|
+
"lte": "is at most",
|
|
351
|
+
"between": "is between",
|
|
352
|
+
"gteDate": "is on or after",
|
|
353
|
+
"lteDate": "is on or before",
|
|
354
|
+
"betweenDate": "is between",
|
|
355
|
+
"isTrue": "is true",
|
|
356
|
+
"isFalse": "is false",
|
|
357
|
+
"isEmpty": "does not exist",
|
|
358
|
+
"isNotEmpty": "exists"
|
|
359
|
+
}
|
|
263
360
|
}
|
|
264
361
|
}
|
|
265
362
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export async function runBulkDelete(items, remove, concurrency = 5) {
|
|
2
|
+
const outcomes = Array.from({ length: items.length });
|
|
3
|
+
let next = 0;
|
|
4
|
+
async function worker() {
|
|
5
|
+
while (next < items.length) {
|
|
6
|
+
const index = next++;
|
|
7
|
+
try {
|
|
8
|
+
await remove(items[index]);
|
|
9
|
+
outcomes[index] = { ok: true };
|
|
10
|
+
} catch (error) {
|
|
11
|
+
outcomes[index] = { ok: false, error };
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, worker));
|
|
16
|
+
const result = { deleted: [], failed: [] };
|
|
17
|
+
items.forEach((item, index) => {
|
|
18
|
+
const outcome = outcomes[index];
|
|
19
|
+
if (outcome.ok) result.deleted.push(item);
|
|
20
|
+
else result.failed.push({ item, error: outcome.error });
|
|
21
|
+
});
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { h } from "vue";
|
|
2
|
+
export function createSelectColumn(checkbox, labels) {
|
|
3
|
+
return {
|
|
4
|
+
id: "select",
|
|
5
|
+
header: ({ table }) => h(checkbox, {
|
|
6
|
+
"modelValue": table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
|
|
7
|
+
"onUpdate:modelValue": (value) => table.toggleAllPageRowsSelected(!!value),
|
|
8
|
+
"aria-label": labels.selectAll
|
|
9
|
+
}),
|
|
10
|
+
cell: ({ row }) => h(checkbox, {
|
|
11
|
+
"modelValue": row.getIsSelected(),
|
|
12
|
+
"disabled": !row.getCanSelect(),
|
|
13
|
+
// a greyed-out checkbox with no explanation looks like a bug
|
|
14
|
+
"title": row.getCanSelect() ? void 0 : labels.unselectable,
|
|
15
|
+
"onUpdate:modelValue": (value) => row.toggleSelected(!!value),
|
|
16
|
+
"aria-label": labels.selectRow
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escapes a field name for use before the `:` of a field query — a name like `first name` would otherwise
|
|
3
|
+
* split into two tokens. Dots are left alone so MongoDB paths (`user.name`) keep working.
|
|
4
|
+
*/
|
|
5
|
+
export declare function escapeFieldName(name: string): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function csvCell(value) {
|
|
2
|
+
if (value === null || value === void 0) return "";
|
|
3
|
+
const text = typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
4
|
+
return /[",\r\n]/.test(text) ? `"${text.replace(/"/g, '""')}"` : text;
|
|
5
|
+
}
|
|
6
|
+
export function rowsToCsv(rows, keys) {
|
|
7
|
+
const lines = [keys.map(csvCell).join(",")];
|
|
8
|
+
for (const row of rows) lines.push(keys.map((key) => csvCell(row[key])).join(","));
|
|
9
|
+
return lines.join("\r\n");
|
|
10
|
+
}
|
|
11
|
+
export function downloadTextFile(filename, content, mimeType) {
|
|
12
|
+
const url = URL.createObjectURL(new Blob([content], { type: `${mimeType};charset=utf-8` }));
|
|
13
|
+
const link = document.createElement("a");
|
|
14
|
+
link.href = url;
|
|
15
|
+
link.download = filename;
|
|
16
|
+
link.click();
|
|
17
|
+
URL.revokeObjectURL(url);
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type FilterFieldType = 'string' | 'number' | 'date-time' | 'boolean' | 'array' | 'object';
|
|
2
|
+
export type FilterOperator = 'contains' | 'equals' | 'notEquals' | 'startsWith' | 'endsWith' | 'oneOf' | 'gte' | 'lte' | 'between' | 'isTrue' | 'isFalse' | 'isEmpty' | 'isNotEmpty';
|
|
3
|
+
export interface FilterCondition {
|
|
4
|
+
id: string;
|
|
5
|
+
field: string;
|
|
6
|
+
operator: FilterOperator;
|
|
7
|
+
/** Raw text from the input. Numbers/dates are validated here, not by the UI. */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Upper bound of `between`. */
|
|
10
|
+
value2?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FilterGroup {
|
|
13
|
+
match: 'all' | 'any';
|
|
14
|
+
conditions: FilterCondition[];
|
|
15
|
+
}
|
|
16
|
+
export declare const FILTER_OPERATORS_BY_TYPE: Record<FilterFieldType, FilterOperator[]>;
|
|
17
|
+
export declare function operatorsFor(type: FilterFieldType): FilterOperator[];
|
|
18
|
+
/** Maps the type names `useMongocampSchema` infers onto the ones the builder understands. */
|
|
19
|
+
export declare function toFilterFieldType(columnType: string): FilterFieldType;
|
|
20
|
+
/** i18n key for an operator's label; date fields read "on or after" instead of "at least". */
|
|
21
|
+
export declare function operatorLabelKey(operator: FilterOperator, type: FilterFieldType): string;
|
|
22
|
+
/** The value part of a row as text for a summary chip: `''`, `a`, or `a – b` for a range. */
|
|
23
|
+
export declare function conditionValueText(condition: FilterCondition): string;
|
|
24
|
+
/** How many value inputs an operator needs (0 = none, 2 = a range). */
|
|
25
|
+
export declare function valueCountFor(operator: FilterOperator): 0 | 1 | 2;
|
|
26
|
+
/** Lucene for one row, or `''` when the row is incomplete/invalid (so it is simply not applied). */
|
|
27
|
+
export declare function buildCondition(condition: FilterCondition, type: FilterFieldType): string;
|
|
28
|
+
/** Combines every valid row with AND (`match: 'all'`) or OR (`'any'`). `''` means "no filter". */
|
|
29
|
+
export declare function buildFilterQuery(group: FilterGroup, fieldTypes: Record<string, FilterFieldType>): string;
|
|
30
|
+
/** Rows that actually contribute to the query — what a "Filters (n)" badge should show. */
|
|
31
|
+
export declare function countActiveConditions(group: FilterGroup, fieldTypes: Record<string, FilterFieldType>): number;
|