@mongoosejs/studio 0.0.16 → 0.0.18

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.
@@ -7,17 +7,32 @@
7
7
  </div>
8
8
 
9
9
  <div class="right">
10
- <button v-if="!editting" @click="editting = true">
11
- <img src="images/edit.svg" /> Edit
10
+ <button
11
+ v-if="!editting"
12
+ @click="editting = true"
13
+ type="button"
14
+ class="rounded-md bg-puerto-rico-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-puerto-rico-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-puerto-rico-600">
15
+ <img src="images/edit.svg" class="inline" /> Edit
12
16
  </button>
13
- <button v-if="editting" class="grey" @click="editting = false">
17
+ <button
18
+ v-if="editting"
19
+ @click="save"
20
+ type="button"
21
+ class="rounded-md bg-slate-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-slate-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-slate-600">
14
22
  &times; Cancel
15
23
  </button>
16
- <button v-if="editting" class="green" @click="save">
17
- <img src="images/save.svg" /> Save
24
+ <button
25
+ v-if="editting"
26
+ @click="save"
27
+ type="button"
28
+ class="rounded-md bg-green-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-green-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-green-600">
29
+ <img src="images/save.svg" class="inline" /> Save
18
30
  </button>
19
- <button class="red" @click="remove">
20
- <img src="images/delete.svg" /> Delete
31
+ <button
32
+ @click="remove"
33
+ type="button"
34
+ class="rounded-md bg-red-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-red-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600">
35
+ <img src="images/delete.svg" class="inline" /> Delete
21
36
  </button>
22
37
  </div>
23
38
  </div>
@@ -18,8 +18,18 @@
18
18
 
19
19
  </div>
20
20
  <div class="buttons">
21
- <button @click="shouldShowExportModal = true">Export</button>
22
- <button @click="shouldShowFieldModal = true">Fields</button>
21
+ <button
22
+ @click="shouldShowExportModal = true"
23
+ type="button"
24
+ class="rounded bg-puerto-rico-600 px-2 py-1 text-sm font-semibold text-white shadow-sm hover:bg-puerto-rico-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-puerto-rico-600">
25
+ Export
26
+ </button>
27
+ <button
28
+ @click="shouldShowFieldModal = true"
29
+ type="button"
30
+ class="rounded bg-puerto-rico-600 px-2 py-1 text-sm font-semibold text-white shadow-sm hover:bg-puerto-rico-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-puerto-rico-600">
31
+ Fields
32
+ </button>
23
33
  </div>
24
34
  </div>
25
35
  </div>
@@ -54,6 +54,7 @@ module.exports = app => app.component('models', {
54
54
  if (this.currentModel == null && this.models.length > 0) {
55
55
  this.currentModel = this.models[0];
56
56
  }
57
+
57
58
  this.query = Object.assign({}, this.$route.query); // important that this is here before the if statements
58
59
  if (this.$route.query?.search) {
59
60
  this.searchText = this.$route.query.search;
@@ -70,20 +71,28 @@ module.exports = app => app.component('models', {
70
71
  if (this.currentModel != null) {
71
72
  await this.getDocuments();
72
73
  }
73
-
74
- const hashUrl = window.location.hash.replace(/^#/, '');
75
- if (hashUrl.indexOf('?') !== -1) {
76
- const searchParams = new URLSearchParams(
77
- hashUrl.slice(hashUrl.indexOf('?') + 1)
78
- );
79
- if (searchParams.has('fields')) {
80
- this.filteredPaths = searchParams.get('fields').split(',').map(path => ({ path }));
81
- }
82
- }
74
+ this.applyQueryParams();
83
75
 
84
76
  this.status = 'loaded';
85
77
  },
86
78
  methods: {
79
+ applyQueryParams() {
80
+ const hashUrl = window.location.hash.replace(/^#/, '');
81
+ if (hashUrl.indexOf('?') !== -1) {
82
+ const searchParams = new URLSearchParams(
83
+ hashUrl.slice(hashUrl.indexOf('?') + 1)
84
+ );
85
+ if (searchParams.has('fields')) {
86
+ const filter = searchParams.get('fields').split(',');
87
+ this.filteredPaths = this.filteredPaths.filter(x => filter.includes(x.path))
88
+ }
89
+ if (searchParams.has('search')) {
90
+ this.searchText = searchParams.get('search');
91
+ this.filter = eval(`(${this.searchText})`);
92
+ this.filter = EJSON.stringify(this.filter);
93
+ }
94
+ }
95
+ },
87
96
  async onScroll() {
88
97
  if (this.status === 'loading' || this.loadedAllDocs) {
89
98
  return;
@@ -120,20 +129,31 @@ module.exports = app => app.component('models', {
120
129
  this.query.sort = `{${path}:${num}}`
121
130
  this.$router.push({ query: this.query });
122
131
  }
123
- await this.getDocuments();
132
+ await this.loadMoreDocuments();
124
133
  },
125
134
  async search() {
126
135
  if (this.searchText && Object.keys(this.searchText).length) {
127
136
  this.filter = eval(`(${this.searchText})`);
128
137
  this.filter = EJSON.stringify(this.filter);
129
138
  this.query.search = this.searchText;
130
- this.$router.push({ path: this.$route.path, query: this.query })
131
139
  } else {
132
140
  this.filter = {};
133
141
  delete this.query.search;
134
- this.$router.push({ path: this.$route.path, query: this.query });
135
142
  }
136
- await this.getDocuments();
143
+
144
+ const hashUrl = window.location.hash.replace(/^#/, '');
145
+ if (hashUrl.indexOf('?') === -1) {
146
+ window.history.pushState({}, '', window.location.pathname + '#' + hashUrl + '?search=' + this.query.search);
147
+ } else {
148
+ const searchParams = new URLSearchParams(
149
+ hashUrl.indexOf('?') === -1 ? '' : hashUrl.slice(hashUrl.indexOf('?') + 1)
150
+ );
151
+ const hashUrlWithoutSearchParams = hashUrl.slice(0, hashUrl.indexOf('?'));
152
+
153
+ searchParams.set('search', this.query.search);
154
+ window.history.pushState({}, '', window.location.pathname + '#' + hashUrlWithoutSearchParams + '?' + searchParams);
155
+ }
156
+ await this.loadMoreDocuments();
137
157
  },
138
158
  async getDocuments() {
139
159
  const { docs, schemaPaths, numDocs } = await api.Model.getDocuments({
@@ -165,6 +185,18 @@ module.exports = app => app.component('models', {
165
185
  this.filteredPaths = [...this.schemaPaths];
166
186
  this.selectedPaths = [...this.schemaPaths];
167
187
  },
188
+ async loadMoreDocuments() {
189
+ const { docs } = await api.Model.getDocuments({
190
+ model: this.currentModel,
191
+ filter: this.filter,
192
+ sort: this.sortBy,
193
+ limit
194
+ });
195
+ this.documents = docs;
196
+ if (docs.length < limit) {
197
+ this.loadedAllDocs = true;
198
+ }
199
+ },
168
200
  addOrRemove(path) {
169
201
  const exists = this.selectedPaths.findIndex(x => x.path == path.path);
170
202
  if (exists > 0) { // remove
@@ -186,7 +218,7 @@ module.exports = app => app.component('models', {
186
218
  this.filteredPaths = [...this.selectedPaths];
187
219
  this.shouldShowFieldModal = false;
188
220
  const selectedParams = this.filteredPaths.map(x => x.path).join(',');
189
-
221
+ // sets the query params
190
222
  const hashUrl = window.location.hash.replace(/^#/, '');
191
223
  if (hashUrl.indexOf('?') === -1) {
192
224
  window.history.pushState({}, '', window.location.pathname + '#' + hashUrl + '?fields=' + selectedParams);
@@ -0,0 +1,8 @@
1
+ 2023-05-24 15:41:20 INFO Username and password provided but auth provider not specified, inferring PlainTextAuthProvider
2
+ 2023-05-24 15:41:20 INFO A cloud secure connect bundle was provided: ignoring all explicit contact points.
3
+ 2023-05-24 15:41:20 INFO Operation directory: /home/val/Workspace/meanIT/admin/logs/COUNT_20230524-154120-151469
4
+ 2023-05-24 15:41:25 ERROR Operation COUNT_20230524-154120-151469 failed: When schema.query is not defined, then either schema.keyspace or schema.graph must be defined, and either schema.table, schema.vertex or schema.edge must be defined.
5
+ java.lang.IllegalArgumentException: When schema.query is not defined, then either schema.keyspace or schema.graph must be defined, and either schema.table, schema.vertex or schema.edge must be defined
6
+ at com.datastax.oss.dsbulk.workflow.commons.settings.SchemaSettings.init(SchemaSettings.java:329)
7
+ at com.datastax.oss.dsbulk.workflow.count.CountWorkflow.init(CountWorkflow.java:120)
8
+ at com.datastax.oss.dsbulk.runner.WorkflowThread.run(WorkflowThread.java:52)
@@ -0,0 +1,22 @@
1
+ 2023-05-24 15:44:08 INFO Username and password provided but auth provider not specified, inferring PlainTextAuthProvider
2
+ 2023-05-24 15:44:08 INFO A cloud secure connect bundle was provided: ignoring all explicit contact points.
3
+ 2023-05-24 15:44:08 INFO Operation directory: /home/val/Workspace/meanIT/admin/logs/COUNT_20230524-154408-077670
4
+ 2023-05-24 15:44:08 ERROR Operation COUNT_20230524-154408-077670 failed: DriverExecutionException (no message).
5
+ Caused by: Server returned HTTP response code: 401 for URL: https://54be87f5-14f5-4bf1-a5be-155e78347c97-us-east1.db.astra.datastax.com:29080/metadata.
6
+ com.datastax.oss.driver.api.core.DriverExecutionException: null
7
+ at com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures.getUninterruptibly(CompletableFutures.java:152)
8
+ at com.datastax.oss.driver.api.core.session.SessionBuilder.build(SessionBuilder.java:835)
9
+ at com.datastax.oss.dsbulk.workflow.commons.settings.DriverSettings.newSession(DriverSettings.java:560)
10
+ at com.datastax.oss.dsbulk.workflow.count.CountWorkflow.init(CountWorkflow.java:117)
11
+ at com.datastax.oss.dsbulk.runner.WorkflowThread.run(WorkflowThread.java:52)
12
+ Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://54be87f5-14f5-4bf1-a5be-155e78347c97-us-east1.db.astra.datastax.com:29080/metadata
13
+ at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:2000)
14
+ at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
15
+ at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
16
+ at com.datastax.oss.driver.internal.core.config.cloud.CloudConfigFactory.fetchProxyMetadata(CloudConfigFactory.java:232)
17
+ at com.datastax.oss.driver.internal.core.config.cloud.CloudConfigFactory.createCloudConfig(CloudConfigFactory.java:133)
18
+ at com.datastax.oss.driver.api.core.session.SessionBuilder.buildDefaultSessionAsync(SessionBuilder.java:876)
19
+ at com.datastax.oss.driver.api.core.session.SessionBuilder.buildAsync(SessionBuilder.java:817)
20
+ at com.datastax.oss.driver.api.core.session.SessionBuilder.build(SessionBuilder.java:835)
21
+ at com.datastax.oss.dsbulk.workflow.commons.settings.DriverSettings.newSession(DriverSettings.java:560)
22
+ at com.datastax.oss.dsbulk.workflow.count.CountWorkflow.init(CountWorkflow.java:117)
@@ -0,0 +1,8 @@
1
+ 2023-05-24 15:44:14 INFO Username and password provided but auth provider not specified, inferring PlainTextAuthProvider
2
+ 2023-05-24 15:44:14 INFO A cloud secure connect bundle was provided: ignoring all explicit contact points.
3
+ 2023-05-24 15:44:14 INFO Operation directory: /home/val/Workspace/meanIT/admin/logs/COUNT_20230524-154414-431706
4
+ 2023-05-24 15:44:19 ERROR Operation COUNT_20230524-154414-431706 failed: When schema.query is not defined, then either schema.keyspace or schema.graph must be defined, and either schema.table, schema.vertex or schema.edge must be defined.
5
+ java.lang.IllegalArgumentException: When schema.query is not defined, then either schema.keyspace or schema.graph must be defined, and either schema.table, schema.vertex or schema.edge must be defined
6
+ at com.datastax.oss.dsbulk.workflow.commons.settings.SchemaSettings.init(SchemaSettings.java:329)
7
+ at com.datastax.oss.dsbulk.workflow.count.CountWorkflow.init(CountWorkflow.java:120)
8
+ at com.datastax.oss.dsbulk.runner.WorkflowThread.run(WorkflowThread.java:52)
@@ -0,0 +1,8 @@
1
+ 2023-05-24 15:50:00 INFO Username and password provided but auth provider not specified, inferring PlainTextAuthProvider
2
+ 2023-05-24 15:50:00 INFO A cloud secure connect bundle was provided: ignoring all explicit contact points.
3
+ 2023-05-24 15:50:00 INFO Operation directory: /home/val/Workspace/meanIT/admin/logs/COUNT_20230524-155000-297076
4
+ 2023-05-24 15:50:02 ERROR Operation COUNT_20230524-155000-297076 failed: When schema.query is not defined, then either schema.keyspace or schema.graph must be defined, and either schema.table, schema.vertex or schema.edge must be defined.
5
+ java.lang.IllegalArgumentException: When schema.query is not defined, then either schema.keyspace or schema.graph must be defined, and either schema.table, schema.vertex or schema.edge must be defined
6
+ at com.datastax.oss.dsbulk.workflow.commons.settings.SchemaSettings.init(SchemaSettings.java:329)
7
+ at com.datastax.oss.dsbulk.workflow.count.CountWorkflow.init(CountWorkflow.java:120)
8
+ at com.datastax.oss.dsbulk.runner.WorkflowThread.run(WorkflowThread.java:52)
@@ -0,0 +1 @@
1
+ https://raw.githubusercontent.com/awesome-astra/docs/main/docs/assets/cities.csv;1;148266;1:148266;
@@ -0,0 +1,23 @@
1
+ 2023-05-24 15:58:32 INFO Username and password provided but auth provider not specified, inferring PlainTextAuthProvider
2
+ 2023-05-24 15:58:32 INFO A cloud secure connect bundle was provided: ignoring all explicit contact points.
3
+ 2023-05-24 15:58:32 INFO A cloud secure connect bundle was provided and selected operation performs writes: changing default consistency level to LOCAL_QUORUM.
4
+ 2023-05-24 15:58:32 INFO Operation directory: /home/val/Workspace/meanIT/admin/logs/LOAD_20230524-155832-351763
5
+ 2023-05-24 15:58:35 INFO Setting executor.maxPerSecond not set when connecting to DataStax Astra: applying a limit of 9,000 ops/second based on the number of coordinators (3).
6
+ 2023-05-24 15:58:35 INFO If your Astra database has higher limits, please define executor.maxPerSecond explicitly.
7
+ 2023-05-24 15:58:52 INFO Operation LOAD_20230524-155832-351763 completed successfully in 15 seconds.
8
+ 2023-05-24 15:58:52 INFO Records: total: 148,266, successful: 148,266, failed: 0
9
+ 2023-05-24 15:58:52 INFO Batches: total: 4,801, size: 31.02 mean, 1 min, 32 max
10
+ 2023-05-24 15:58:52 INFO Memory usage: used: 245 MB, free: 138 MB, allocated: 384 MB, available: 3,946 MB, total gc count: 25, total gc time: 59 ms
11
+ 2023-05-24 15:58:52 INFO Writes: total: 148,266, successful: 148,266, failed: 0, in-flight: 0
12
+ 2023-05-24 15:58:52 INFO Throughput: 8,972 writes/second
13
+ 2023-05-24 15:58:52 INFO Latencies: mean 61.26, 75p 74.97, 99p 297.80, 999p 557.84 milliseconds
14
+ 2023-05-24 15:58:54 INFO Final stats:
15
+ 2023-05-24 15:58:54 INFO Records: total: 148,266, successful: 148,266, failed: 0
16
+ 2023-05-24 15:58:54 INFO Batches: total: 4,801, size: 31.02 mean, 1 min, 32 max
17
+ 2023-05-24 15:58:54 INFO Memory usage: used: 248 MB, free: 135 MB, allocated: 384 MB, available: 3,946 MB, total gc count: 25, total gc time: 59 ms
18
+ 2023-05-24 15:58:54 INFO Writes: total: 148,266, successful: 148,266, failed: 0, in-flight: 0
19
+ 2023-05-24 15:58:54 INFO Throughput: 7,998 writes/second
20
+ 2023-05-24 15:58:54 INFO Latencies: mean 61.26, 75p 74.97, 99p 297.80, 999p 557.84 milliseconds
21
+ 2023-05-24 15:58:54 INFO Checkpoints for the current operation were written to checkpoint.csv.
22
+ 2023-05-24 15:58:54 INFO To resume the current operation, re-run it with the same settings, and add the following command line flag:
23
+ 2023-05-24 15:58:54 INFO --dsbulk.log.checkpoint.file=/home/val/Workspace/meanIT/admin/logs/LOAD_20230524-155832-351763/checkpoint.csv
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongoosejs/studio",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "dependencies": {
5
5
  "archetype": "0.13.0",
6
6
  "csv-stringify": "6.3.0",
@@ -19,7 +19,12 @@
19
19
  "express": "4.x",
20
20
  "mocha": "10.2.0",
21
21
  "mongoose": "7.x",
22
+ "tailwindcss": "3.4.0",
22
23
  "vue": "3.x",
23
24
  "webpack": "5.75.0"
25
+ },
26
+ "scripts": {
27
+ "tailwind": "tailwindcss -o ./frontend/public/tw.css",
28
+ "tailwind:watch": "tailwindcss -o ./frontend/public/tw.css --watch"
24
29
  }
25
30
  }
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ mode: 'jit',
5
+ content: ['./frontend/src/**/*.html', './frontend/src/**/*.js'],
6
+ corePlugins: {
7
+ container: true
8
+ },
9
+ plugins: [],
10
+ theme: {
11
+ extend: {
12
+ colors: {
13
+ 'puerto-rico': {
14
+ '50': '#eefffb',
15
+ '100': '#c6fff3',
16
+ '200': '#8effe8',
17
+ '300': '#4dfbdb',
18
+ '400': '#15d4b7',
19
+ '500': '#00ccb0',
20
+ '600': '#00a491',
21
+ '700': '#038276',
22
+ '800': '#08675f',
23
+ '900': '#0c554e',
24
+ '950': '#003432',
25
+ }
26
+ }
27
+ }
28
+ }
29
+ };