@geode/opengeodeweb-front 10.4.0-rc.1 → 10.4.0-rc.3
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/app/stores/data.js +37 -25
- package/app/utils/file_import_workflow.js +1 -1
- package/app/utils/local.js +33 -31
- package/internal/database/tables/model_components.js +1 -1
- package/package.json +20 -19
- package/tests/integration/microservices/back/requirements.txt +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +1 -1
package/app/stores/data.js
CHANGED
|
@@ -34,27 +34,32 @@ export const useDataStore = defineStore("data", () => {
|
|
|
34
34
|
|
|
35
35
|
async function formatedMeshComponents(id) {
|
|
36
36
|
const items = await database.model_components.where({ id }).toArray()
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.toArray()
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
id: type,
|
|
47
|
-
title: type,
|
|
48
|
-
children: meshComponents.map((meshComponent) => ({
|
|
49
|
-
id: meshComponent.geode_id,
|
|
50
|
-
title: meshComponent.name,
|
|
51
|
-
category: meshComponent.type,
|
|
52
|
-
})),
|
|
53
|
-
}
|
|
54
|
-
}),
|
|
55
|
-
)
|
|
37
|
+
const componentTitles = {
|
|
38
|
+
Corner: "Corners",
|
|
39
|
+
Line: "Lines",
|
|
40
|
+
Surface: "Surfaces",
|
|
41
|
+
Block: "Blocks",
|
|
42
|
+
}
|
|
56
43
|
|
|
57
|
-
|
|
44
|
+
const componentsByType = items.reduce((accumulator, item) => {
|
|
45
|
+
if (componentTitles[item.type]) {
|
|
46
|
+
if (!accumulator[item.type]) accumulator[item.type] = []
|
|
47
|
+
accumulator[item.type].push(item)
|
|
48
|
+
}
|
|
49
|
+
return accumulator
|
|
50
|
+
}, {})
|
|
51
|
+
|
|
52
|
+
return Object.keys(componentTitles)
|
|
53
|
+
.filter((type) => componentsByType[type])
|
|
54
|
+
.map((type) => ({
|
|
55
|
+
id: type,
|
|
56
|
+
title: componentTitles[type],
|
|
57
|
+
children: componentsByType[type].map((meshComponent) => ({
|
|
58
|
+
id: meshComponent.geode_id,
|
|
59
|
+
title: meshComponent.name,
|
|
60
|
+
category: meshComponent.type,
|
|
61
|
+
})),
|
|
62
|
+
}))
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
async function meshComponentType(id, geode_id) {
|
|
@@ -109,15 +114,22 @@ export const useDataStore = defineStore("data", () => {
|
|
|
109
114
|
await database.model_components.where({ id }).delete()
|
|
110
115
|
}
|
|
111
116
|
|
|
112
|
-
async function
|
|
117
|
+
async function fetchModelComponents(id) {
|
|
113
118
|
const geodeStore = useGeodeStore()
|
|
114
119
|
return await geodeStore.request(
|
|
115
|
-
back_model_schemas.
|
|
120
|
+
back_model_schemas.model_components,
|
|
116
121
|
{ id },
|
|
117
122
|
{
|
|
118
123
|
response_function: async (response) => {
|
|
119
|
-
const
|
|
120
|
-
|
|
124
|
+
const allComponents = [
|
|
125
|
+
...response.mesh_components.map(
|
|
126
|
+
({ boundaries, internals, ...component }) => component,
|
|
127
|
+
),
|
|
128
|
+
...response.collection_components.map(
|
|
129
|
+
({ items, ...component }) => component,
|
|
130
|
+
),
|
|
131
|
+
].map((component) => ({ ...component, id }))
|
|
132
|
+
await addModelComponents(allComponents)
|
|
121
133
|
},
|
|
122
134
|
},
|
|
123
135
|
)
|
|
@@ -178,7 +190,7 @@ export const useDataStore = defineStore("data", () => {
|
|
|
178
190
|
addItem,
|
|
179
191
|
deleteItem,
|
|
180
192
|
updateItem,
|
|
181
|
-
|
|
193
|
+
fetchModelComponents,
|
|
182
194
|
getCornersGeodeIds,
|
|
183
195
|
getLinesGeodeIds,
|
|
184
196
|
getSurfacesGeodeIds,
|
|
@@ -50,7 +50,7 @@ async function importItem(item) {
|
|
|
50
50
|
await dataStyleStore.addDataStyle(item.id, item.geode_object_type)
|
|
51
51
|
|
|
52
52
|
if (item.viewer_type === "model") {
|
|
53
|
-
await dataStore.
|
|
53
|
+
await dataStore.fetchModelComponents(item.id)
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
await dataStyleStore.applyDefaultStyle(item.id)
|
package/app/utils/local.js
CHANGED
|
@@ -3,6 +3,7 @@ import child_process from "node:child_process"
|
|
|
3
3
|
import fs from "node:fs"
|
|
4
4
|
import path from "node:path"
|
|
5
5
|
import { setTimeout } from "timers/promises"
|
|
6
|
+
import { rimraf } from "rimraf"
|
|
6
7
|
|
|
7
8
|
// Third party imports
|
|
8
9
|
import { WebSocket } from "ws"
|
|
@@ -182,7 +183,7 @@ async function delete_folder_recursive(data_folder_path) {
|
|
|
182
183
|
for (let i = 0; i <= MAX_DELETE_FOLDER_RETRIES; i += 1) {
|
|
183
184
|
try {
|
|
184
185
|
console.log(`Deleting folder: ${data_folder_path}`)
|
|
185
|
-
|
|
186
|
+
await rimraf(data_folder_path)
|
|
186
187
|
console.log(`Deleted folder: ${data_folder_path}`)
|
|
187
188
|
return
|
|
188
189
|
} catch (error) {
|
|
@@ -190,6 +191,7 @@ async function delete_folder_recursive(data_folder_path) {
|
|
|
190
191
|
// Wait before retrying
|
|
191
192
|
const DELAY = 1000 * (i + 1)
|
|
192
193
|
await setTimeout(DELAY)
|
|
194
|
+
console.log("Retrying delete folder")
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
197
|
}
|
|
@@ -209,52 +211,52 @@ function kill_back(back_port) {
|
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
return pTimeout(do_kill(), {
|
|
212
|
-
milliseconds:
|
|
214
|
+
milliseconds: 5000,
|
|
213
215
|
message: "Failed to kill back",
|
|
214
216
|
})
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
function kill_viewer(viewer_port) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
220
|
+
function do_kill() {
|
|
221
|
+
return new Promise((resolve) => {
|
|
222
|
+
const socket = new WebSocket("ws://localhost:" + viewer_port + "/ws")
|
|
223
|
+
socket.on("open", () => {
|
|
224
|
+
console.log("Connected to WebSocket server")
|
|
225
|
+
socket.send(
|
|
226
|
+
JSON.stringify({
|
|
227
|
+
id: "system:hello",
|
|
228
|
+
method: "wslink.hello",
|
|
229
|
+
args: [{ secret: "wslink-secret" }],
|
|
230
|
+
}),
|
|
231
|
+
)
|
|
232
|
+
})
|
|
233
|
+
socket.on("message", (data) => {
|
|
232
234
|
const message = data.toString()
|
|
233
235
|
console.log("Received from server:", message)
|
|
234
|
-
|
|
235
236
|
if (message.includes("hello")) {
|
|
236
237
|
socket.send(
|
|
237
238
|
JSON.stringify({
|
|
238
|
-
id:
|
|
239
|
-
method:
|
|
239
|
+
id: "application.exit",
|
|
240
|
+
method: "application.exit",
|
|
240
241
|
}),
|
|
241
242
|
)
|
|
242
|
-
|
|
243
|
+
socket.close()
|
|
244
|
+
resolve()
|
|
243
245
|
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
246
|
+
})
|
|
247
|
+
socket.on("close", () => {
|
|
248
|
+
console.log("Disconnected from WebSocket server")
|
|
249
|
+
resolve()
|
|
250
|
+
})
|
|
251
|
+
socket.on("error", (error) => {
|
|
252
|
+
console.error("WebSocket error:", error)
|
|
251
253
|
socket.close()
|
|
252
|
-
|
|
253
|
-
|
|
254
|
+
resolve()
|
|
255
|
+
})
|
|
256
|
+
})
|
|
254
257
|
}
|
|
255
|
-
|
|
256
258
|
return pTimeout(do_kill(), {
|
|
257
|
-
milliseconds:
|
|
259
|
+
milliseconds: 5000,
|
|
258
260
|
message: "Failed to kill viewer",
|
|
259
261
|
})
|
|
260
262
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
+
"version": "10.4.0-rc.3",
|
|
3
4
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
5
|
+
"homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/Geode-solutions/OpenGeodeWeb-Front/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Geode-solutions",
|
|
12
|
+
"email": "contact@geode-solutions.com",
|
|
13
|
+
"url": "https://geode-solutions.com/"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Geode-solutions/OpenGeodeWeb-Front.git"
|
|
18
|
+
},
|
|
4
19
|
"type": "module",
|
|
5
|
-
"version": "10.4.0-rc.1",
|
|
6
20
|
"main": "./nuxt.config.js",
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
7
24
|
"scripts": {
|
|
8
25
|
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
|
|
9
26
|
"test": "npm run test:unit",
|
|
@@ -31,7 +48,8 @@
|
|
|
31
48
|
"nuxt": "4.2.2",
|
|
32
49
|
"p-timeout": "7.0.1",
|
|
33
50
|
"pinia": "3.0.4",
|
|
34
|
-
"
|
|
51
|
+
"rimraf": "6.1.3",
|
|
52
|
+
"rxjs": "7.8.2",
|
|
35
53
|
"sass": "1.87.0",
|
|
36
54
|
"semver": "7.7.1",
|
|
37
55
|
"uuid": "11.1.0",
|
|
@@ -70,22 +88,5 @@
|
|
|
70
88
|
},
|
|
71
89
|
"overrides": {
|
|
72
90
|
"vue": "latest"
|
|
73
|
-
},
|
|
74
|
-
"repository": {
|
|
75
|
-
"type": "git",
|
|
76
|
-
"url": "git+https://github.com/Geode-solutions/OpenGeodeWeb-Front.git"
|
|
77
|
-
},
|
|
78
|
-
"author": {
|
|
79
|
-
"name": "Geode-solutions",
|
|
80
|
-
"email": "contact@geode-solutions.com",
|
|
81
|
-
"url": "https://geode-solutions.com/"
|
|
82
|
-
},
|
|
83
|
-
"license": "MIT",
|
|
84
|
-
"bugs": {
|
|
85
|
-
"url": "https://github.com/Geode-solutions/OpenGeodeWeb-Front/issues"
|
|
86
|
-
},
|
|
87
|
-
"homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
|
|
88
|
-
"publishConfig": {
|
|
89
|
-
"access": "public"
|
|
90
91
|
}
|
|
91
92
|
}
|