@mongoosejs/studio 0.0.137 → 0.0.139
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/backend/actions/Model/updateDocument.js +2 -2
- package/backend/actions/Model/updateDocuments.js +2 -2
- package/express.js +3 -2
- package/frontend/index.js +2 -2
- package/frontend/public/app.js +396 -72
- package/frontend/public/tw.css +111 -0
- package/frontend/src/document-details/document-details.js +3 -3
- package/frontend/src/list-json/list-json.html +17 -3
- package/frontend/src/list-json/list-json.js +350 -25
- package/frontend/src/models/models.css +1 -0
- package/frontend/src/models/models.html +17 -2
- package/frontend/src/models/models.js +38 -27
- package/frontend/src/navbar/navbar.html +9 -0
- package/package.json +1 -1
- package/frontend/src/list-json/list-json.css +0 -3
|
@@ -567,41 +567,52 @@ module.exports = app => app.component('models', {
|
|
|
567
567
|
},
|
|
568
568
|
handleDocumentClick(document, event) {
|
|
569
569
|
if (this.selectMultiple) {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
570
|
+
this.handleDocumentSelection(document, event);
|
|
571
|
+
} else {
|
|
572
|
+
this.openDocument(document);
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
handleDocumentContainerClick(document, event) {
|
|
576
|
+
if (this.selectMultiple) {
|
|
577
|
+
this.handleDocumentSelection(document, event);
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
handleDocumentSelection(document, event) {
|
|
581
|
+
const documentIndex = this.documents.findIndex(doc => doc._id.toString() == document._id.toString());
|
|
582
|
+
if (event?.shiftKey && this.selectedDocuments.length > 0) {
|
|
583
|
+
const anchorIndex = this.lastSelectedIndex;
|
|
584
|
+
if (anchorIndex != null && anchorIndex !== -1 && documentIndex !== -1) {
|
|
585
|
+
const start = Math.min(anchorIndex, documentIndex);
|
|
586
|
+
const end = Math.max(anchorIndex, documentIndex);
|
|
587
|
+
const selectedDocumentIds = new Set(this.selectedDocuments.map(doc => doc._id.toString()));
|
|
588
|
+
for (let i = start; i <= end; i++) {
|
|
589
|
+
const docInRange = this.documents[i];
|
|
590
|
+
const existsInRange = selectedDocumentIds.has(docInRange._id.toString());
|
|
591
|
+
if (!existsInRange) {
|
|
592
|
+
this.selectedDocuments.push(docInRange);
|
|
583
593
|
}
|
|
584
|
-
this.lastSelectedIndex = documentIndex;
|
|
585
|
-
return;
|
|
586
594
|
}
|
|
595
|
+
this.lastSelectedIndex = documentIndex;
|
|
596
|
+
return;
|
|
587
597
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
const lastDoc = this.selectedDocuments[this.selectedDocuments.length - 1];
|
|
595
|
-
this.lastSelectedIndex = this.documents.findIndex(doc => doc._id.toString() == lastDoc._id.toString());
|
|
596
|
-
}
|
|
598
|
+
}
|
|
599
|
+
const index = this.selectedDocuments.findIndex(x => x._id.toString() == document._id.toString());
|
|
600
|
+
if (index !== -1) {
|
|
601
|
+
this.selectedDocuments.splice(index, 1);
|
|
602
|
+
if (this.selectedDocuments.length === 0) {
|
|
603
|
+
this.lastSelectedIndex = null;
|
|
597
604
|
} else {
|
|
598
|
-
this.selectedDocuments.
|
|
599
|
-
this.lastSelectedIndex =
|
|
605
|
+
const lastDoc = this.selectedDocuments[this.selectedDocuments.length - 1];
|
|
606
|
+
this.lastSelectedIndex = this.documents.findIndex(doc => doc._id.toString() == lastDoc._id.toString());
|
|
600
607
|
}
|
|
601
608
|
} else {
|
|
602
|
-
this
|
|
609
|
+
this.selectedDocuments.push(document);
|
|
610
|
+
this.lastSelectedIndex = documentIndex;
|
|
603
611
|
}
|
|
604
612
|
},
|
|
613
|
+
openDocument(document) {
|
|
614
|
+
this.$router.push('/model/' + this.currentModel + '/document/' + document._id);
|
|
615
|
+
},
|
|
605
616
|
async deleteDocuments() {
|
|
606
617
|
const documentIds = this.selectedDocuments.map(x => x._id);
|
|
607
618
|
await api.Model.deleteDocuments({
|
|
@@ -39,6 +39,15 @@
|
|
|
39
39
|
<path fill-rule="evenodd" d="M10 2a4 4 0 00-4 4v2H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-1V6a4 4 0 00-4-4zm-3 6V6a3 3 0 116 0v2H7z" clip-rule="evenodd" />
|
|
40
40
|
</svg>
|
|
41
41
|
</span>
|
|
42
|
+
<a
|
|
43
|
+
href="https://studio.mongoosejs.io/docs"
|
|
44
|
+
target="_blank"
|
|
45
|
+
rel="noopener noreferrer"
|
|
46
|
+
class="inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 border-transparent"
|
|
47
|
+
>
|
|
48
|
+
Docs
|
|
49
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="ml-1 h-4 w-4" viewBox="0 -960 960 960" fill="currentColor"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"/></svg>
|
|
50
|
+
</a>
|
|
42
51
|
|
|
43
52
|
<div class="h-full flex items-center" v-if="!user && hasAPIKey">
|
|
44
53
|
<button
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.139",
|
|
4
4
|
"description": "A sleek, powerful MongoDB UI with built-in dashboarding and auth, seamlessly integrated with your Express, Vercel, or Netlify app.",
|
|
5
5
|
"homepage": "https://studio.mongoosejs.io/",
|
|
6
6
|
"repository": {
|