@mongoosejs/studio 0.0.20 → 0.0.22
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/Dashboard/getDashboards.js +10 -0
- package/backend/actions/Dashboard/index.js +3 -0
- package/backend/actions/Model/createDocument.js +28 -0
- package/backend/actions/Model/getDocuments.js +2 -1
- package/backend/actions/Model/index.js +1 -0
- package/backend/actions/Model/listModels.js +3 -1
- package/backend/actions/Model/updateDocument.js +1 -1
- package/backend/actions/index.js +1 -0
- package/backend/db/dashboardSchema.js +16 -0
- package/backend/index.js +5 -1
- package/frontend/public/app.js +30567 -467
- package/frontend/public/images/json.svg +2 -0
- package/frontend/public/images/table.svg +1 -0
- package/frontend/public/tw.css +197 -22
- package/frontend/src/api.js +16 -0
- package/frontend/src/create-document/create-document.css +0 -0
- package/frontend/src/create-document/create-document.html +6 -0
- package/frontend/src/create-document/create-document.js +75 -0
- package/frontend/src/dashboard/dashboard.html +8 -0
- package/frontend/src/dashboard/dashboard.js +22 -0
- package/frontend/src/dashboard-details/dashboard-details.html +8 -0
- package/frontend/src/dashboard-details/dashboard-details.js +10 -0
- package/frontend/src/document/document.html +2 -1
- package/frontend/src/document/document.js +3 -1
- package/frontend/src/edit-date/edit-date.html +18 -1
- package/frontend/src/edit-date/edit-date.js +12 -0
- package/frontend/src/index.js +4 -0
- package/frontend/src/list-json/list-json.css +3 -0
- package/frontend/src/list-json/list-json.html +4 -0
- package/frontend/src/list-json/list-json.js +40 -0
- package/frontend/src/models/models.css +2 -6
- package/frontend/src/models/models.html +42 -10
- package/frontend/src/models/models.js +26 -1
- package/frontend/src/navbar/navbar.css +9 -0
- package/frontend/src/navbar/navbar.html +11 -3
- package/frontend/src/navbar/navbar.js +6 -1
- package/frontend/src/routes.js +5 -0
- package/package.json +8 -3
- package/tailwind.config.js +27 -1
|
@@ -27,10 +27,6 @@
|
|
|
27
27
|
max-height: calc(100vh - 56px);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.models .documents .documents-container {
|
|
31
|
-
margin-top: 60px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
30
|
.models .documents table {
|
|
35
31
|
/* max-width: -moz-fit-content;
|
|
36
32
|
max-width: fit-content; */
|
|
@@ -97,12 +93,12 @@
|
|
|
97
93
|
.models .documents-menu {
|
|
98
94
|
display: flex;
|
|
99
95
|
margin: 0.25em;
|
|
100
|
-
position: fixed;
|
|
101
96
|
width: calc(100vw - 220px);
|
|
102
97
|
}
|
|
103
98
|
|
|
104
99
|
.models .documents-menu .search-input {
|
|
105
100
|
flex-grow: 1;
|
|
101
|
+
align-items: center;
|
|
106
102
|
}
|
|
107
103
|
|
|
108
104
|
.models .search-input input {
|
|
@@ -130,5 +126,5 @@
|
|
|
130
126
|
.models .documents .buttons {
|
|
131
127
|
display: inline-flex;
|
|
132
128
|
justify-content: space-around;
|
|
133
|
-
align-items:
|
|
129
|
+
align-items: center;
|
|
134
130
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<router-link
|
|
13
13
|
:to="'/model/' + model"
|
|
14
14
|
class="block rounded-md py-2 pr-2 pl-2 text-sm font-semibold text-gray-700"
|
|
15
|
-
:class="model === currentModel ? 'bg-
|
|
15
|
+
:class="model === currentModel ? 'bg-teal-100 font-bold' : 'hover:bg-teal-100'">
|
|
16
16
|
{{model}}
|
|
17
17
|
</router-link>
|
|
18
18
|
</li>
|
|
@@ -26,33 +26,53 @@
|
|
|
26
26
|
<div class="documents" ref="documentsList">
|
|
27
27
|
<div>
|
|
28
28
|
<div class="documents-menu">
|
|
29
|
-
<div class="
|
|
30
|
-
<form @submit.prevent="search">
|
|
31
|
-
<input class="
|
|
29
|
+
<div class="flex flex-row items-center w-full gap-2">
|
|
30
|
+
<form @submit.prevent="search" class="flex-grow m-0">
|
|
31
|
+
<input class="w-full rounded-md p-1 outline-gray-300 text-lg" type="text" placeholder="Filter or text" v-model="searchText" />
|
|
32
32
|
</form>
|
|
33
|
-
|
|
34
|
-
<div class="buttons">
|
|
35
|
-
<div class="mr-2">
|
|
33
|
+
<div>
|
|
36
34
|
<span v-if="status === 'loading'">Loading ...</span>
|
|
37
35
|
<span v-if="status === 'loaded'">{{numDocuments === 1 ? numDocuments+ ' document' : numDocuments + ' documents'}}</span>
|
|
38
36
|
</div>
|
|
39
37
|
<button
|
|
40
38
|
@click="shouldShowExportModal = true"
|
|
41
39
|
type="button"
|
|
42
|
-
class="
|
|
40
|
+
class="rounded bg-teal-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">
|
|
43
41
|
Export
|
|
44
42
|
</button>
|
|
43
|
+
<button
|
|
44
|
+
@click="shouldShowCreateModal = true;"
|
|
45
|
+
type="button"
|
|
46
|
+
class="rounded bg-teal-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">
|
|
47
|
+
Create
|
|
48
|
+
</button>
|
|
45
49
|
<button
|
|
46
50
|
@click="shouldShowFieldModal = true"
|
|
47
51
|
type="button"
|
|
48
|
-
class="rounded bg-
|
|
52
|
+
class="rounded bg-teal-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">
|
|
49
53
|
Fields
|
|
50
54
|
</button>
|
|
55
|
+
<span class="isolate inline-flex rounded-md shadow-sm">
|
|
56
|
+
<button
|
|
57
|
+
@click="outputType = 'table'"
|
|
58
|
+
type="button"
|
|
59
|
+
class="relative inline-flex items-center rounded-none rounded-l-md px-2 py-2 text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-10"
|
|
60
|
+
:class="outputType === 'table' ? 'bg-gray-200' : 'bg-white'">
|
|
61
|
+
<img class="h-5 w-5" src="images/table.svg">
|
|
62
|
+
</button>
|
|
63
|
+
<button
|
|
64
|
+
@click="outputType = 'json'"
|
|
65
|
+
type="button"
|
|
66
|
+
class="relative -ml-px inline-flex items-center rounded-none rounded-r-md px-2 py-2 text-gray-400 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-10"
|
|
67
|
+
:class="outputType === 'json' ? 'bg-gray-200' : 'bg-white'">
|
|
68
|
+
<img class="h-5 w-5" src="images/json.svg">
|
|
69
|
+
</button>
|
|
70
|
+
</span>
|
|
51
71
|
</div>
|
|
52
72
|
</div>
|
|
53
73
|
</div>
|
|
54
74
|
<div class="documents-container">
|
|
55
|
-
<table>
|
|
75
|
+
<table v-if="outputType === 'table'">
|
|
56
76
|
<thead>
|
|
57
77
|
<th v-for="path in filteredPaths">
|
|
58
78
|
{{path.path}}
|
|
@@ -75,6 +95,12 @@
|
|
|
75
95
|
</tr>
|
|
76
96
|
</tbody>
|
|
77
97
|
</table>
|
|
98
|
+
<div v-if="outputType === 'json'">
|
|
99
|
+
<div v-for="document in documents" @click="$router.push('/model/' + currentModel + '/document/' + document._id)" :key="document._id">
|
|
100
|
+
<list-json :value="filterDocument(document)">
|
|
101
|
+
</list-json>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
78
104
|
<div v-if="status === 'loading'" class="loader">
|
|
79
105
|
<img src="images/loader.gif">
|
|
80
106
|
</div>
|
|
@@ -105,5 +131,11 @@
|
|
|
105
131
|
</div>
|
|
106
132
|
</template>
|
|
107
133
|
</modal>
|
|
134
|
+
<modal v-if="shouldShowCreateModal">
|
|
135
|
+
<template v-slot:body>
|
|
136
|
+
<div class="modal-exit" @click="shouldShowCreateModal = false;">×</div>
|
|
137
|
+
<create-document :currentModel="currentModel" :paths="schemaPaths" @close="closeCreationModal"></create-document>
|
|
138
|
+
</template>
|
|
139
|
+
</modal>
|
|
108
140
|
</div>
|
|
109
141
|
</div>
|
|
@@ -5,6 +5,12 @@ const template = require('./models.html');
|
|
|
5
5
|
const mpath = require('mpath');
|
|
6
6
|
const { BSON, EJSON } = require('bson');
|
|
7
7
|
|
|
8
|
+
const { EditorState } = require('@codemirror/state');
|
|
9
|
+
const { lineNumbers } = require('@codemirror/view')
|
|
10
|
+
const { EditorView, basicSetup } = require('codemirror');
|
|
11
|
+
const { javascript } = require('@codemirror/lang-javascript');
|
|
12
|
+
|
|
13
|
+
|
|
8
14
|
const ObjectId = new Proxy(BSON.ObjectId, {
|
|
9
15
|
apply (target, thisArg, argumentsList) {
|
|
10
16
|
return new target(...argumentsList);
|
|
@@ -13,6 +19,7 @@ const ObjectId = new Proxy(BSON.ObjectId, {
|
|
|
13
19
|
|
|
14
20
|
const appendCSS = require('../appendCSS');
|
|
15
21
|
|
|
22
|
+
|
|
16
23
|
appendCSS(require('./models.css'));
|
|
17
24
|
|
|
18
25
|
const limit = 50;
|
|
@@ -35,12 +42,14 @@ module.exports = app => app.component('models', {
|
|
|
35
42
|
filter: null,
|
|
36
43
|
searchText: '',
|
|
37
44
|
shouldShowExportModal: false,
|
|
45
|
+
shouldShowCreateModal: false,
|
|
38
46
|
shouldShowFieldModal: false,
|
|
39
47
|
shouldExport: {},
|
|
40
48
|
sortBy: {},
|
|
41
49
|
query: {},
|
|
42
50
|
scrollHeight: 0,
|
|
43
|
-
interval: null
|
|
51
|
+
interval: null,
|
|
52
|
+
outputType: 'table' // json, table
|
|
44
53
|
}),
|
|
45
54
|
created() {
|
|
46
55
|
this.currentModel = this.model;
|
|
@@ -77,9 +86,25 @@ module.exports = app => app.component('models', {
|
|
|
77
86
|
this.filteredPaths = this.filteredPaths.filter(x => filter.includes(x.path))
|
|
78
87
|
}
|
|
79
88
|
|
|
89
|
+
|
|
80
90
|
this.status = 'loaded';
|
|
81
91
|
},
|
|
82
92
|
methods: {
|
|
93
|
+
async closeCreationModal() {
|
|
94
|
+
this.shouldShowCreateModal = false;
|
|
95
|
+
await this.getDocuments();
|
|
96
|
+
},
|
|
97
|
+
initializeDocumentData() {
|
|
98
|
+
this.shouldShowCreateModal = true;
|
|
99
|
+
},
|
|
100
|
+
filterDocument(doc) {
|
|
101
|
+
const filteredDoc = {};
|
|
102
|
+
console.log(doc, this.filteredPaths)
|
|
103
|
+
for (let i = 0; i < this.filteredPaths.length; i++) {
|
|
104
|
+
filteredDoc[this.filteredPaths[i].path] = doc[this.filteredPaths[i].path];
|
|
105
|
+
}
|
|
106
|
+
return filteredDoc;
|
|
107
|
+
},
|
|
83
108
|
async onScroll() {
|
|
84
109
|
if (this.status === 'loading' || this.loadedAllDocs) {
|
|
85
110
|
return;
|
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
background-color: #eee;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.active {
|
|
7
|
+
text-decoration: underline;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.spacing {
|
|
11
|
+
margin-right: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
.navbar .nav-left {
|
|
7
15
|
float: left;
|
|
8
16
|
line-height: 54px;
|
|
@@ -30,6 +38,7 @@
|
|
|
30
38
|
float: right;
|
|
31
39
|
display: flex;
|
|
32
40
|
flex-direction: row;
|
|
41
|
+
justify-content: space-between;
|
|
33
42
|
font-size: 16px;
|
|
34
43
|
line-height: 54px;
|
|
35
44
|
padding-right: 20px;
|
|
@@ -4,9 +4,17 @@
|
|
|
4
4
|
<img src="images/logo.svg" alt="Mongoose Studio Logo" />
|
|
5
5
|
</router-link>
|
|
6
6
|
</div>
|
|
7
|
-
<div class="nav-right">
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
<div class="nav-right h-full">
|
|
8
|
+
<div class="sm:ml-6 sm:flex sm:space-x-8 h-full">
|
|
9
|
+
<a
|
|
10
|
+
href="#/"
|
|
11
|
+
class="inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
|
|
12
|
+
:class="routeName === 'root' ? 'text-gray-900 border-teal-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'">Documents</a>
|
|
13
|
+
<a
|
|
14
|
+
href="#/dashboards"
|
|
15
|
+
class="inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium"
|
|
16
|
+
:class="routeName === 'dashboards' ? 'text-gray-900 border-teal-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'">Dashboards</a>
|
|
17
|
+
</div>
|
|
10
18
|
</div>
|
|
11
19
|
<div style="clear: both"></div>
|
|
12
20
|
</div>
|
package/frontend/src/routes.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"dependencies": {
|
|
5
|
+
"@codemirror/commands": "^6.5.0",
|
|
6
|
+
"@codemirror/lang-javascript": "^6.2.2",
|
|
7
|
+
"@codemirror/state": "^6.4.1",
|
|
8
|
+
"@codemirror/view": "^6.26.3",
|
|
5
9
|
"archetype": "0.13.0",
|
|
10
|
+
"codemirror": "^6.0.1",
|
|
6
11
|
"csv-stringify": "6.3.0",
|
|
7
12
|
"ejson": "^2.2.3",
|
|
8
|
-
"extrovert": "0.0.
|
|
13
|
+
"extrovert": "0.0.24",
|
|
9
14
|
"openai": "3.2.1",
|
|
10
15
|
"vanillatoasts": "^1.6.0"
|
|
11
16
|
},
|
|
@@ -18,7 +23,7 @@
|
|
|
18
23
|
"axios": "1.2.2",
|
|
19
24
|
"express": "4.x",
|
|
20
25
|
"mocha": "10.2.0",
|
|
21
|
-
"mongoose": "
|
|
26
|
+
"mongoose": "8.x",
|
|
22
27
|
"tailwindcss": "3.4.0",
|
|
23
28
|
"vue": "3.x",
|
|
24
29
|
"webpack": "5.75.0"
|
package/tailwind.config.js
CHANGED
|
@@ -22,7 +22,33 @@ module.exports = {
|
|
|
22
22
|
'800': '#08675f',
|
|
23
23
|
'900': '#0c554e',
|
|
24
24
|
'950': '#003432',
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
'teal': {
|
|
27
|
+
'50': '#eefffc',
|
|
28
|
+
'100': '#c5fffa',
|
|
29
|
+
'200': '#8bfff5',
|
|
30
|
+
'300': '#4afef0',
|
|
31
|
+
'400': '#15ece2',
|
|
32
|
+
'500': '#00d0c9',
|
|
33
|
+
'600': '#00a8a5',
|
|
34
|
+
'700': '#008888',
|
|
35
|
+
'800': '#066769',
|
|
36
|
+
'900': '#0a5757',
|
|
37
|
+
'950': '#003235',
|
|
38
|
+
},
|
|
39
|
+
'navy-blue': {
|
|
40
|
+
'50': '#f1f4ff',
|
|
41
|
+
'100': '#e5e8ff',
|
|
42
|
+
'200': '#ced5ff',
|
|
43
|
+
'300': '#a7b1ff',
|
|
44
|
+
'400': '#767fff',
|
|
45
|
+
'500': '#3f42ff',
|
|
46
|
+
'600': '#2118ff',
|
|
47
|
+
'700': '#1007fa',
|
|
48
|
+
'800': '#0d05d2',
|
|
49
|
+
'900': '#0c06ac',
|
|
50
|
+
'950': '#000088',
|
|
51
|
+
},
|
|
26
52
|
}
|
|
27
53
|
}
|
|
28
54
|
}
|