@geode/opengeodeweb-front 9.11.5 → 9.11.6-rc.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/composables/viewer_call.js +3 -3
- package/internal_stores/data_style_state.js +4 -1
- package/internal_stores/mesh/edges.js +30 -35
- package/internal_stores/mesh/index.js +23 -17
- package/package.json +4 -4
- package/stores/data_style.js +3 -3
- package/tests/integration/microservices/back/requirements-internal.in +1 -1
- package/tests/integration/microservices/back/requirements.txt +3 -101
- package/tests/integration/microservices/viewer/requirements-internal.in +1 -1
- package/tests/integration/microservices/viewer/requirements.txt +3 -156
- package/tests/integration/stores/DataStyle/mesh/Edges.nuxt.test.js +3 -4
- package/utils/local.js +168 -53
|
@@ -13,8 +13,8 @@ export function viewer_call(
|
|
|
13
13
|
console.log("schema", schema)
|
|
14
14
|
console.log("params", params)
|
|
15
15
|
}
|
|
16
|
-
feedback_store.add_error(400, schema
|
|
17
|
-
throw new Error(schema.
|
|
16
|
+
feedback_store.add_error(400, schema.$id, "Bad request", error)
|
|
17
|
+
throw new Error(schema.$id.concat(": "))
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const client = viewer_store.client
|
|
@@ -45,7 +45,7 @@ export function viewer_call(
|
|
|
45
45
|
.catch((error) => {
|
|
46
46
|
feedback_store.add_error(
|
|
47
47
|
error.code,
|
|
48
|
-
schema
|
|
48
|
+
schema.$id,
|
|
49
49
|
error.message,
|
|
50
50
|
error.message,
|
|
51
51
|
)
|
|
@@ -4,58 +4,56 @@ const mesh_edges_schemas = viewer_schemas.opengeodeweb_viewer.mesh.edges
|
|
|
4
4
|
export function useMeshEdgesStyle() {
|
|
5
5
|
const dataStyleStore = useDataStyleStore()
|
|
6
6
|
|
|
7
|
+
function edgesStyle(id) {
|
|
8
|
+
return dataStyleStore.getStyle(id).edges
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
function edgesVisibility(id) {
|
|
8
|
-
return
|
|
12
|
+
return edgesStyle(id).visibility
|
|
9
13
|
}
|
|
10
14
|
function setEdgesVisibility(id, visibility) {
|
|
11
|
-
const edges_style =
|
|
15
|
+
const edges_style = edgesStyle(id)
|
|
12
16
|
return viewer_call(
|
|
13
|
-
{
|
|
14
|
-
schema: mesh_edges_schemas.visibility,
|
|
15
|
-
params: { id, visibility },
|
|
16
|
-
},
|
|
17
|
+
{ schema: mesh_edges_schemas.visibility, params: { id, visibility } },
|
|
17
18
|
{
|
|
18
19
|
response_function: () => {
|
|
19
20
|
edges_style.visibility = visibility
|
|
20
|
-
console.log(`${setEdgesVisibility.name} ${
|
|
21
|
+
console.log(`${setEdgesVisibility.name} ${id} ${edgesVisibility(id)}`)
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
)
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
function edgesActiveColoring(id) {
|
|
27
|
-
return
|
|
28
|
+
return edgesStyle(id).coloring.active
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
const coloring =
|
|
31
|
-
if (type == "color") {
|
|
32
|
-
setEdgesColor(id, coloring.color)
|
|
33
|
-
// else if (type == "vertex") {
|
|
34
|
-
// const vertex = coloring.vertex
|
|
35
|
-
// if (vertex !== null) setEdgesVertexAttribute(id, vertex)
|
|
36
|
-
// } else if (type == "edges") {
|
|
37
|
-
// const edges = coloring.edges
|
|
38
|
-
// if (edges !== null) setEdgesEdgeAttribute(id, edges)
|
|
39
|
-
} else throw new Error("Unknown edges coloring type: " + type)
|
|
30
|
+
function setEdgesActiveColoring(id, type) {
|
|
31
|
+
const coloring = edgesStyle(id).coloring
|
|
40
32
|
coloring.active = type
|
|
41
|
-
console.log(
|
|
33
|
+
console.log(
|
|
34
|
+
`${setEdgesActiveColoring.name} ${id} ${edgesActiveColoring(id)}`,
|
|
35
|
+
)
|
|
36
|
+
if (type === "color") {
|
|
37
|
+
return setEdgesColor(id, coloring.color)
|
|
38
|
+
// } else if (type == "vertex" && coloring.vertex !== null) {
|
|
39
|
+
// return setEdgesVertexAttribute(id, coloring.vertex)
|
|
40
|
+
// } else if (type == "edges" && coloring.edges !== null) {
|
|
41
|
+
// return setEdgesEdgeAttribute(id, coloring.edges)
|
|
42
|
+
} else throw new Error("Unknown edges coloring type: " + type)
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
function edgesColor(id) {
|
|
45
|
-
return
|
|
46
|
+
return edgesStyle(id).coloring.color
|
|
46
47
|
}
|
|
47
48
|
function setEdgesColor(id, color) {
|
|
48
|
-
const coloring_style =
|
|
49
|
+
const coloring_style = edgesStyle(id).coloring
|
|
49
50
|
return viewer_call(
|
|
50
|
-
{
|
|
51
|
-
schema: mesh_edges_schemas.color,
|
|
52
|
-
params: { id, color },
|
|
53
|
-
},
|
|
51
|
+
{ schema: mesh_edges_schemas.color, params: { id, color } },
|
|
54
52
|
{
|
|
55
53
|
response_function: () => {
|
|
56
54
|
coloring_style.color = color
|
|
57
55
|
console.log(
|
|
58
|
-
`${setEdgesColor.name} ${JSON.stringify(
|
|
56
|
+
`${setEdgesColor.name} ${id} ${JSON.stringify(edgesColor(id))}`,
|
|
59
57
|
)
|
|
60
58
|
},
|
|
61
59
|
},
|
|
@@ -63,25 +61,22 @@ export function useMeshEdgesStyle() {
|
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
function edgesWidth(id) {
|
|
66
|
-
return
|
|
64
|
+
return edgesStyle(id).size
|
|
67
65
|
}
|
|
68
66
|
function setEdgesWidth(id, width) {
|
|
69
|
-
const edges_style =
|
|
67
|
+
const edges_style = edgesStyle(id)
|
|
70
68
|
return viewer_call(
|
|
71
|
-
{
|
|
72
|
-
schema: mesh_edges_schemas.width,
|
|
73
|
-
params: { id, width },
|
|
74
|
-
},
|
|
69
|
+
{ schema: mesh_edges_schemas.width, params: { id, width } },
|
|
75
70
|
{
|
|
76
71
|
response_function: () => {
|
|
77
72
|
edges_style.width = width
|
|
78
|
-
console.log(`${setEdgesWidth.name} ${
|
|
73
|
+
console.log(`${setEdgesWidth.name} ${id} ${edgesWidth(id)}`)
|
|
79
74
|
},
|
|
80
75
|
},
|
|
81
76
|
)
|
|
82
77
|
}
|
|
83
78
|
|
|
84
|
-
|
|
79
|
+
function applyEdgesStyle(id, style) {
|
|
85
80
|
return Promise.all([
|
|
86
81
|
setEdgesVisibility(id, style.visibility),
|
|
87
82
|
setEdgesActiveColoring(id, style.coloring.active),
|
|
@@ -12,6 +12,9 @@ export default function useMeshStyle() {
|
|
|
12
12
|
const polyhedraStyleStore = useMeshPolyhedraStyle()
|
|
13
13
|
const hybridViewerStore = useHybridViewerStore()
|
|
14
14
|
|
|
15
|
+
function meshVisibility(id) {
|
|
16
|
+
return dataStyleStore.styles[id].visibility
|
|
17
|
+
}
|
|
15
18
|
function setMeshVisibility(id, visibility) {
|
|
16
19
|
return viewer_call(
|
|
17
20
|
{
|
|
@@ -22,32 +25,35 @@ export default function useMeshStyle() {
|
|
|
22
25
|
response_function: () => {
|
|
23
26
|
hybridViewerStore.setVisibility(id, visibility)
|
|
24
27
|
dataStyleStore.styles[id].visibility = visibility
|
|
28
|
+
console.log(`${setMeshVisibility.name} ${id} ${meshVisibility(id)}`)
|
|
25
29
|
},
|
|
26
30
|
},
|
|
27
31
|
)
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
function applyMeshDefaultStyle(id) {
|
|
35
|
+
const style = dataStyleStore.getStyle(id)
|
|
36
|
+
const promise_array = []
|
|
37
|
+
for (const [key, value] of Object.entries(style)) {
|
|
38
|
+
if (key == "visibility") {
|
|
39
|
+
promise_array.push(setMeshVisibility(id, value))
|
|
40
|
+
} else if (key == "points") {
|
|
41
|
+
promise_array.push(pointsStyleStore.applyPointsStyle(id, value))
|
|
42
|
+
} else if (key == "edges") {
|
|
43
|
+
promise_array.push(edgesStyleStore.applyEdgesStyle(id, value))
|
|
44
|
+
} else if (key == "polygons") {
|
|
45
|
+
promise_array.push(polygonsStyleStore.applyPolygonsStyle(id, value))
|
|
46
|
+
} else if (key == "polyhedra") {
|
|
47
|
+
promise_array.push(polyhedraStyleStore.applyPolyhedraStyle(id, value))
|
|
48
|
+
} else {
|
|
49
|
+
throw new Error("Unknown key: " + key)
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
}
|
|
52
|
+
return promise_array
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
return {
|
|
56
|
+
meshVisibility,
|
|
51
57
|
setMeshVisibility,
|
|
52
58
|
applyMeshDefaultStyle,
|
|
53
59
|
...useMeshPointsStyle(),
|
package/package.json
CHANGED
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
},
|
|
41
41
|
"description": "OpenSource Vue/Vuetify framework for web applications",
|
|
42
42
|
"type": "module",
|
|
43
|
-
"version": "9.11.
|
|
43
|
+
"version": "9.11.6-rc.1",
|
|
44
44
|
"main": "./nuxt.config.js",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@geode/opengeodeweb-back": "
|
|
47
|
-
"@geode/opengeodeweb-viewer": "
|
|
46
|
+
"@geode/opengeodeweb-back": "next",
|
|
47
|
+
"@geode/opengeodeweb-viewer": "next",
|
|
48
48
|
"@kitware/vtk.js": "33.3.0",
|
|
49
49
|
"@mdi/font": "7.4.47",
|
|
50
50
|
"@pinia/nuxt": "0.5.4",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"pinia": "3.0.3",
|
|
60
60
|
"sass": "1.87.0",
|
|
61
61
|
"semver": "7.7.1",
|
|
62
|
-
"tree-kill": "1.2.2",
|
|
63
62
|
"uuid": "11.1.0",
|
|
64
63
|
"vue-recaptcha": "2.0.3",
|
|
65
64
|
"vue3-carousel": "0.3.4",
|
|
66
65
|
"vuetify": "3.8.12",
|
|
66
|
+
"ws": "8.18.3",
|
|
67
67
|
"wslink": "1.12.4"
|
|
68
68
|
},
|
|
69
69
|
"repository": {
|
package/stores/data_style.js
CHANGED
|
@@ -13,12 +13,12 @@ export const useDataStyleStore = defineStore("dataStyle", () => {
|
|
|
13
13
|
function addDataStyle(id, geode_object, object_type) {
|
|
14
14
|
dataStyleState.styles[id] = getDefaultStyle(geode_object)
|
|
15
15
|
if (object_type === "mesh") {
|
|
16
|
-
return
|
|
16
|
+
return meshStyleStore.applyMeshDefaultStyle(id)
|
|
17
17
|
} else if (object_type === "model") {
|
|
18
|
-
return
|
|
18
|
+
return [
|
|
19
19
|
modelStyleStore.setMeshComponentsDefaultStyle(id),
|
|
20
20
|
modelStyleStore.applyModelDefaultStyle(id),
|
|
21
|
-
]
|
|
21
|
+
]
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
opengeodeweb-back
|
|
1
|
+
opengeodeweb-back
|
|
@@ -2,105 +2,7 @@
|
|
|
2
2
|
# This file is autogenerated by pip-compile with Python 3.12
|
|
3
3
|
# by the following command:
|
|
4
4
|
#
|
|
5
|
-
# pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements
|
|
5
|
+
# pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in
|
|
6
6
|
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# flask
|
|
10
|
-
# opengeodeweb-back
|
|
11
|
-
blinker~=1.9
|
|
12
|
-
# via
|
|
13
|
-
# flask
|
|
14
|
-
# opengeodeweb-back
|
|
15
|
-
# opengeodeweb-microservice
|
|
16
|
-
click~=8.3
|
|
17
|
-
# via
|
|
18
|
-
# flask
|
|
19
|
-
# opengeodeweb-back
|
|
20
|
-
# opengeodeweb-microservice
|
|
21
|
-
fastjsonschema~=2.21
|
|
22
|
-
# via
|
|
23
|
-
# opengeodeweb-back
|
|
24
|
-
# opengeodeweb-microservice
|
|
25
|
-
flask[async]~=3.0
|
|
26
|
-
# via
|
|
27
|
-
# flask-cors
|
|
28
|
-
# flask-sqlalchemy
|
|
29
|
-
# opengeodeweb-back
|
|
30
|
-
# opengeodeweb-microservice
|
|
31
|
-
flask-cors~=6.0
|
|
32
|
-
# via opengeodeweb-back
|
|
33
|
-
flask-sqlalchemy~=3.1
|
|
34
|
-
# via
|
|
35
|
-
# opengeodeweb-back
|
|
36
|
-
# opengeodeweb-microservice
|
|
37
|
-
geode-common~=33.11
|
|
38
|
-
# via
|
|
39
|
-
# geode-viewables
|
|
40
|
-
# opengeodeweb-back
|
|
41
|
-
geode-viewables~=3.3
|
|
42
|
-
# via opengeodeweb-back
|
|
43
|
-
greenlet~=3.2
|
|
44
|
-
# via
|
|
45
|
-
# opengeodeweb-back
|
|
46
|
-
# opengeodeweb-microservice
|
|
47
|
-
# sqlalchemy
|
|
48
|
-
itsdangerous~=2.2
|
|
49
|
-
# via
|
|
50
|
-
# flask
|
|
51
|
-
# opengeodeweb-back
|
|
52
|
-
# opengeodeweb-microservice
|
|
53
|
-
jinja2~=3.1
|
|
54
|
-
# via
|
|
55
|
-
# flask
|
|
56
|
-
# opengeodeweb-back
|
|
57
|
-
# opengeodeweb-microservice
|
|
58
|
-
markupsafe~=3.0
|
|
59
|
-
# via
|
|
60
|
-
# jinja2
|
|
61
|
-
# opengeodeweb-back
|
|
62
|
-
# opengeodeweb-microservice
|
|
63
|
-
# werkzeug
|
|
64
|
-
opengeode-core~=15.27
|
|
65
|
-
# via
|
|
66
|
-
# geode-common
|
|
67
|
-
# geode-viewables
|
|
68
|
-
# opengeode-geosciences
|
|
69
|
-
# opengeode-geosciencesio
|
|
70
|
-
# opengeode-inspector
|
|
71
|
-
# opengeode-io
|
|
72
|
-
# opengeodeweb-back
|
|
73
|
-
opengeode-geosciences~=9.4
|
|
74
|
-
# via
|
|
75
|
-
# geode-viewables
|
|
76
|
-
# opengeode-geosciencesio
|
|
77
|
-
# opengeodeweb-back
|
|
78
|
-
opengeode-geosciencesio~=5.8
|
|
79
|
-
# via opengeodeweb-back
|
|
80
|
-
opengeode-inspector~=6.8
|
|
81
|
-
# via opengeodeweb-back
|
|
82
|
-
opengeode-io~=7.4
|
|
83
|
-
# via
|
|
84
|
-
# geode-viewables
|
|
85
|
-
# opengeode-geosciencesio
|
|
86
|
-
# opengeodeweb-back
|
|
87
|
-
opengeodeweb-back~=5.10,>=5.10.1
|
|
88
|
-
# via -r tests/integration/microservices/back/requirements-internal.in
|
|
89
|
-
opengeodeweb-microservice~=1.0
|
|
90
|
-
# via opengeodeweb-back
|
|
91
|
-
sqlalchemy~=2.0
|
|
92
|
-
# via
|
|
93
|
-
# flask-sqlalchemy
|
|
94
|
-
# opengeodeweb-back
|
|
95
|
-
# opengeodeweb-microservice
|
|
96
|
-
typing-extensions~=4.15
|
|
97
|
-
# via
|
|
98
|
-
# opengeodeweb-back
|
|
99
|
-
# opengeodeweb-microservice
|
|
100
|
-
# sqlalchemy
|
|
101
|
-
werkzeug~=3.0
|
|
102
|
-
# via
|
|
103
|
-
# flask
|
|
104
|
-
# flask-cors
|
|
105
|
-
# opengeodeweb-back
|
|
106
|
-
# opengeodeweb-microservice
|
|
7
|
+
|
|
8
|
+
opengeodeweb-back==5.*,>=5.10.3rc16
|
|
@@ -1 +1 @@
|
|
|
1
|
-
opengeodeweb-viewer
|
|
1
|
+
opengeodeweb-viewer
|
|
@@ -2,160 +2,7 @@
|
|
|
2
2
|
# This file is autogenerated by pip-compile with Python 3.12
|
|
3
3
|
# by the following command:
|
|
4
4
|
#
|
|
5
|
-
# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements
|
|
5
|
+
# pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in
|
|
6
6
|
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# aiohttp
|
|
10
|
-
# opengeodeweb-viewer
|
|
11
|
-
aiohttp~=3.12
|
|
12
|
-
# via
|
|
13
|
-
# opengeodeweb-viewer
|
|
14
|
-
# wslink
|
|
15
|
-
aiosignal~=1.4
|
|
16
|
-
# via
|
|
17
|
-
# aiohttp
|
|
18
|
-
# opengeodeweb-viewer
|
|
19
|
-
attrs~=25.3
|
|
20
|
-
# via
|
|
21
|
-
# aiohttp
|
|
22
|
-
# opengeodeweb-viewer
|
|
23
|
-
blinker~=1.9
|
|
24
|
-
# via
|
|
25
|
-
# flask
|
|
26
|
-
# opengeodeweb-microservice
|
|
27
|
-
# opengeodeweb-viewer
|
|
28
|
-
click~=8.3
|
|
29
|
-
# via
|
|
30
|
-
# flask
|
|
31
|
-
# opengeodeweb-microservice
|
|
32
|
-
# opengeodeweb-viewer
|
|
33
|
-
contourpy~=1.3
|
|
34
|
-
# via
|
|
35
|
-
# matplotlib
|
|
36
|
-
# opengeodeweb-viewer
|
|
37
|
-
cycler~=0.12
|
|
38
|
-
# via
|
|
39
|
-
# matplotlib
|
|
40
|
-
# opengeodeweb-viewer
|
|
41
|
-
fastjsonschema~=2.21
|
|
42
|
-
# via
|
|
43
|
-
# opengeodeweb-microservice
|
|
44
|
-
# opengeodeweb-viewer
|
|
45
|
-
flask~=3.1
|
|
46
|
-
# via
|
|
47
|
-
# flask-sqlalchemy
|
|
48
|
-
# opengeodeweb-microservice
|
|
49
|
-
# opengeodeweb-viewer
|
|
50
|
-
flask-sqlalchemy~=3.1
|
|
51
|
-
# via
|
|
52
|
-
# opengeodeweb-microservice
|
|
53
|
-
# opengeodeweb-viewer
|
|
54
|
-
fonttools~=4.60
|
|
55
|
-
# via
|
|
56
|
-
# matplotlib
|
|
57
|
-
# opengeodeweb-viewer
|
|
58
|
-
frozenlist~=1.7
|
|
59
|
-
# via
|
|
60
|
-
# aiohttp
|
|
61
|
-
# aiosignal
|
|
62
|
-
# opengeodeweb-viewer
|
|
63
|
-
greenlet~=3.2
|
|
64
|
-
# via
|
|
65
|
-
# opengeodeweb-microservice
|
|
66
|
-
# opengeodeweb-viewer
|
|
67
|
-
# sqlalchemy
|
|
68
|
-
idna==3.10
|
|
69
|
-
# via
|
|
70
|
-
# opengeodeweb-viewer
|
|
71
|
-
# yarl
|
|
72
|
-
itsdangerous~=2.2
|
|
73
|
-
# via
|
|
74
|
-
# flask
|
|
75
|
-
# opengeodeweb-microservice
|
|
76
|
-
# opengeodeweb-viewer
|
|
77
|
-
jinja2~=3.1
|
|
78
|
-
# via
|
|
79
|
-
# flask
|
|
80
|
-
# opengeodeweb-microservice
|
|
81
|
-
# opengeodeweb-viewer
|
|
82
|
-
kiwisolver~=1.4
|
|
83
|
-
# via
|
|
84
|
-
# matplotlib
|
|
85
|
-
# opengeodeweb-viewer
|
|
86
|
-
markupsafe~=3.0
|
|
87
|
-
# via
|
|
88
|
-
# flask
|
|
89
|
-
# jinja2
|
|
90
|
-
# opengeodeweb-microservice
|
|
91
|
-
# opengeodeweb-viewer
|
|
92
|
-
# werkzeug
|
|
93
|
-
matplotlib~=3.10
|
|
94
|
-
# via
|
|
95
|
-
# opengeodeweb-viewer
|
|
96
|
-
# vtk
|
|
97
|
-
multidict~=6.6
|
|
98
|
-
# via
|
|
99
|
-
# aiohttp
|
|
100
|
-
# opengeodeweb-viewer
|
|
101
|
-
# yarl
|
|
102
|
-
numpy~=2.3
|
|
103
|
-
# via
|
|
104
|
-
# contourpy
|
|
105
|
-
# matplotlib
|
|
106
|
-
# opengeodeweb-viewer
|
|
107
|
-
opengeodeweb-microservice~=1.0
|
|
108
|
-
# via opengeodeweb-viewer
|
|
109
|
-
opengeodeweb-viewer[cpu]~=1.11
|
|
110
|
-
# via -r tests/integration/microservices/viewer/requirements-internal.in
|
|
111
|
-
packaging==25.0
|
|
112
|
-
# via
|
|
113
|
-
# matplotlib
|
|
114
|
-
# opengeodeweb-viewer
|
|
115
|
-
pillow~=11.3
|
|
116
|
-
# via
|
|
117
|
-
# matplotlib
|
|
118
|
-
# opengeodeweb-viewer
|
|
119
|
-
propcache~=0.3
|
|
120
|
-
# via
|
|
121
|
-
# aiohttp
|
|
122
|
-
# opengeodeweb-viewer
|
|
123
|
-
# yarl
|
|
124
|
-
pyparsing~=3.2
|
|
125
|
-
# via
|
|
126
|
-
# matplotlib
|
|
127
|
-
# opengeodeweb-viewer
|
|
128
|
-
python-dateutil==2.9.0.post0
|
|
129
|
-
# via
|
|
130
|
-
# matplotlib
|
|
131
|
-
# opengeodeweb-viewer
|
|
132
|
-
six~=1.17
|
|
133
|
-
# via
|
|
134
|
-
# opengeodeweb-viewer
|
|
135
|
-
# python-dateutil
|
|
136
|
-
sqlalchemy~=2.0
|
|
137
|
-
# via
|
|
138
|
-
# flask-sqlalchemy
|
|
139
|
-
# opengeodeweb-microservice
|
|
140
|
-
# opengeodeweb-viewer
|
|
141
|
-
typing-extensions~=4.15
|
|
142
|
-
# via
|
|
143
|
-
# aiosignal
|
|
144
|
-
# opengeodeweb-microservice
|
|
145
|
-
# opengeodeweb-viewer
|
|
146
|
-
# sqlalchemy
|
|
147
|
-
vtk~=9.5
|
|
148
|
-
# via opengeodeweb-viewer
|
|
149
|
-
websocket-client~=1.8
|
|
150
|
-
# via opengeodeweb-viewer
|
|
151
|
-
werkzeug~=3.1
|
|
152
|
-
# via
|
|
153
|
-
# flask
|
|
154
|
-
# opengeodeweb-microservice
|
|
155
|
-
# opengeodeweb-viewer
|
|
156
|
-
wslink~=1.12
|
|
157
|
-
# via opengeodeweb-viewer
|
|
158
|
-
yarl~=1.20
|
|
159
|
-
# via
|
|
160
|
-
# aiohttp
|
|
161
|
-
# opengeodeweb-viewer
|
|
7
|
+
|
|
8
|
+
opengeodeweb-viewer==1.*,>=1.11.3rc7
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
executable_name,
|
|
19
19
|
executable_path,
|
|
20
|
-
|
|
20
|
+
kill_viewer,
|
|
21
21
|
run_viewer,
|
|
22
22
|
} from "@ogw_f/utils/local"
|
|
23
23
|
|
|
@@ -69,7 +69,6 @@ beforeEach(async () => {
|
|
|
69
69
|
const viewerStore = useViewerStore()
|
|
70
70
|
const infraStore = useInfraStore()
|
|
71
71
|
infraStore.app_mode = appMode.appMode.BROWSER
|
|
72
|
-
|
|
73
72
|
const viewer_path = path.join(
|
|
74
73
|
executable_path(
|
|
75
74
|
path.join("tests", "integration", "microservices", "viewer"),
|
|
@@ -80,7 +79,6 @@ beforeEach(async () => {
|
|
|
80
79
|
port: 1234,
|
|
81
80
|
data_folder_path: path.join(__dirname, "..", "..", "..", "data"),
|
|
82
81
|
})
|
|
83
|
-
|
|
84
82
|
viewerStore.default_local_port = viewer_port
|
|
85
83
|
await viewerStore.ws_connect()
|
|
86
84
|
await dataBaseStore.registerObject(id, file_name, object_type)
|
|
@@ -90,7 +88,8 @@ beforeEach(async () => {
|
|
|
90
88
|
|
|
91
89
|
describe("Mesh edges", () => {
|
|
92
90
|
afterEach(async () => {
|
|
93
|
-
|
|
91
|
+
const viewerStore = useViewerStore()
|
|
92
|
+
await kill_viewer(viewerStore.default_local_port)
|
|
94
93
|
})
|
|
95
94
|
|
|
96
95
|
describe("Edges visibility", () => {
|
package/utils/local.js
CHANGED
|
@@ -2,22 +2,15 @@
|
|
|
2
2
|
import fs from "fs"
|
|
3
3
|
import path from "path"
|
|
4
4
|
import child_process from "child_process"
|
|
5
|
+
import WebSocket from "ws"
|
|
5
6
|
|
|
6
7
|
// Third party imports
|
|
7
8
|
import pkg from "electron"
|
|
8
9
|
const { app, dialog } = pkg
|
|
9
10
|
import { getPort } from "get-port-please"
|
|
10
|
-
import kill from "tree-kill"
|
|
11
11
|
import isElectron from "is-electron"
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url) // get the resolved path to the file
|
|
16
|
-
const __dirname = path.dirname(__filename) // get the name of the directory
|
|
17
|
-
console.log("__dirname", __dirname)
|
|
18
|
-
|
|
19
|
-
// Global variables
|
|
20
|
-
var processes = []
|
|
12
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" with { type: "json" }
|
|
13
|
+
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
|
|
21
14
|
|
|
22
15
|
function venv_script_path(root_path, microservice_path) {
|
|
23
16
|
const venv_path = path.join(root_path, microservice_path, "venv")
|
|
@@ -30,15 +23,16 @@ function venv_script_path(root_path, microservice_path) {
|
|
|
30
23
|
return script_path
|
|
31
24
|
}
|
|
32
25
|
|
|
33
|
-
function executable_path(microservice_path
|
|
34
|
-
if (root_path != null) return venv_script_path(root_path, microservice_path)
|
|
26
|
+
function executable_path(microservice_path) {
|
|
35
27
|
if (isElectron()) {
|
|
36
28
|
if (app.isPackaged) {
|
|
37
29
|
return process.resourcesPath
|
|
30
|
+
} else {
|
|
31
|
+
return venv_script_path(app.getAppPath(), microservice_path)
|
|
38
32
|
}
|
|
39
|
-
|
|
33
|
+
} else {
|
|
34
|
+
return venv_script_path(process.cwd(), microservice_path)
|
|
40
35
|
}
|
|
41
|
-
return venv_script_path(process.cwd(), microservice_path)
|
|
42
36
|
}
|
|
43
37
|
|
|
44
38
|
function executable_name(name) {
|
|
@@ -50,40 +44,21 @@ function executable_name(name) {
|
|
|
50
44
|
|
|
51
45
|
function create_path(path) {
|
|
52
46
|
if (!fs.existsSync(path)) {
|
|
53
|
-
fs.
|
|
54
|
-
|
|
55
|
-
return console.error(err)
|
|
56
|
-
}
|
|
57
|
-
console.log(`${path} directory created successfully!`)
|
|
58
|
-
})
|
|
47
|
+
fs.mkdirSync(path, { recursive: true })
|
|
48
|
+
console.log(`${path} directory created successfully!`)
|
|
59
49
|
}
|
|
60
50
|
return path
|
|
61
51
|
}
|
|
62
52
|
|
|
63
53
|
async function get_available_port(port) {
|
|
64
|
-
const available_port = await getPort({
|
|
54
|
+
const available_port = await getPort({
|
|
55
|
+
port,
|
|
56
|
+
host: "localhost",
|
|
57
|
+
})
|
|
65
58
|
console.log("available_port", available_port)
|
|
66
59
|
return available_port
|
|
67
60
|
}
|
|
68
61
|
|
|
69
|
-
async function kill_processes() {
|
|
70
|
-
console.log("kill_processes", processes)
|
|
71
|
-
await processes.forEach(async function (proc) {
|
|
72
|
-
console.log(`Process ${proc} will be killed!`)
|
|
73
|
-
try {
|
|
74
|
-
kill(proc)
|
|
75
|
-
} catch (error) {
|
|
76
|
-
console.log(`${error} Process ${proc} could not be killed!`)
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function register_process(proc) {
|
|
82
|
-
if (!processes.includes(proc.pid)) {
|
|
83
|
-
processes.push(proc.pid)
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
62
|
async function run_script(
|
|
88
63
|
command,
|
|
89
64
|
args,
|
|
@@ -98,7 +73,6 @@ async function run_script(
|
|
|
98
73
|
encoding: "utf8",
|
|
99
74
|
shell: true,
|
|
100
75
|
})
|
|
101
|
-
register_process(child)
|
|
102
76
|
|
|
103
77
|
// You can also use a variable to save the output for when the script closes later
|
|
104
78
|
child.stderr.setEncoding("utf8")
|
|
@@ -118,7 +92,7 @@ async function run_script(
|
|
|
118
92
|
}
|
|
119
93
|
console.log(data)
|
|
120
94
|
})
|
|
121
|
-
|
|
95
|
+
|
|
122
96
|
child.stderr.on("data", (data) => {
|
|
123
97
|
console.log(data)
|
|
124
98
|
})
|
|
@@ -131,28 +105,27 @@ async function run_script(
|
|
|
131
105
|
console.log("Child Process killed")
|
|
132
106
|
})
|
|
133
107
|
child.name = command.replace(/^.*[\\/]/, "")
|
|
108
|
+
return child
|
|
134
109
|
})
|
|
135
110
|
}
|
|
136
111
|
|
|
137
|
-
async function run_back(port, data_folder_path) {
|
|
112
|
+
async function run_back(command, args = { port, data_folder_path }) {
|
|
138
113
|
return new Promise(async (resolve, reject) => {
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
executable_name("vease-back"),
|
|
142
|
-
)
|
|
143
|
-
const back_port = await get_available_port(port)
|
|
114
|
+
const back_port = await get_available_port(args.port)
|
|
115
|
+
const upload_folder_path = path.join(args.data_folder_path, "uploads")
|
|
144
116
|
const back_args = [
|
|
145
117
|
"--port " + back_port,
|
|
146
|
-
"--data_folder_path " + data_folder_path,
|
|
118
|
+
"--data_folder_path " + args.data_folder_path,
|
|
119
|
+
"--upload_folder_path " + upload_folder_path,
|
|
147
120
|
"--allowed_origin http://localhost:*",
|
|
148
121
|
"--timeout " + 0,
|
|
149
122
|
]
|
|
150
|
-
await run_script(
|
|
123
|
+
await run_script(command, back_args, "Serving Flask app")
|
|
151
124
|
resolve(back_port)
|
|
152
125
|
})
|
|
153
126
|
}
|
|
154
127
|
|
|
155
|
-
async function run_viewer(
|
|
128
|
+
async function run_viewer(command, args = { port, data_folder_path }) {
|
|
156
129
|
return new Promise(async (resolve, reject) => {
|
|
157
130
|
const viewer_port = await get_available_port(args.port)
|
|
158
131
|
const viewer_args = [
|
|
@@ -160,19 +133,161 @@ async function run_viewer(viewer_path, args = { port, data_folder_path }) {
|
|
|
160
133
|
"--data_folder_path " + args.data_folder_path,
|
|
161
134
|
"--timeout " + 0,
|
|
162
135
|
]
|
|
163
|
-
await run_script(
|
|
136
|
+
await run_script(command, viewer_args, "Starting factory")
|
|
164
137
|
resolve(viewer_port)
|
|
165
138
|
})
|
|
166
139
|
}
|
|
167
140
|
|
|
141
|
+
function delete_folder_recursive(data_folder_path) {
|
|
142
|
+
if (!fs.existsSync(data_folder_path)) {
|
|
143
|
+
console.log(`Folder ${data_folder_path} does not exist.`)
|
|
144
|
+
return
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
fs.rmSync(data_folder_path, { recursive: true, force: true })
|
|
148
|
+
console.log(`Deleted folder: ${data_folder_path}`)
|
|
149
|
+
} catch (err) {
|
|
150
|
+
console.error(`Error deleting folder ${data_folder_path}:`, err)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function kill_back(back_port) {
|
|
155
|
+
return new Promise((resolve, reject) => {
|
|
156
|
+
console.log("back_schemas", back_schemas)
|
|
157
|
+
|
|
158
|
+
fetch(
|
|
159
|
+
"http://localhost:" +
|
|
160
|
+
back_port +
|
|
161
|
+
"/" +
|
|
162
|
+
back_schemas.opengeodeweb_back.kill.$id,
|
|
163
|
+
{
|
|
164
|
+
method: back_schemas.opengeodeweb_back.kill.methods[0],
|
|
165
|
+
},
|
|
166
|
+
)
|
|
167
|
+
.then(() => {
|
|
168
|
+
console.log("Back not killed")
|
|
169
|
+
reject()
|
|
170
|
+
})
|
|
171
|
+
.catch(() => {
|
|
172
|
+
console.log("Back closed")
|
|
173
|
+
resolve()
|
|
174
|
+
})
|
|
175
|
+
})
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function kill_viewer(viewer_port) {
|
|
179
|
+
return new Promise((resolve, reject) => {
|
|
180
|
+
const socket = new WebSocket("ws://localhost:" + viewer_port + "/ws")
|
|
181
|
+
socket.on("open", () => {
|
|
182
|
+
console.log("Connected to WebSocket server")
|
|
183
|
+
socket.send(
|
|
184
|
+
JSON.stringify({
|
|
185
|
+
id: "system:hello",
|
|
186
|
+
method: "wslink.hello",
|
|
187
|
+
args: [{ secret: "wslink-secret" }],
|
|
188
|
+
}),
|
|
189
|
+
)
|
|
190
|
+
})
|
|
191
|
+
socket.on("message", (data) => {
|
|
192
|
+
const message = data.toString()
|
|
193
|
+
console.log("Received from server:", message)
|
|
194
|
+
if (message.includes("hello")) {
|
|
195
|
+
try {
|
|
196
|
+
console.log("viewer_schemas", viewer_schemas)
|
|
197
|
+
socket.send(
|
|
198
|
+
JSON.stringify({
|
|
199
|
+
id: viewer_schemas.opengeodeweb_viewer.kill.$id,
|
|
200
|
+
method: viewer_schemas.opengeodeweb_viewer.kill.$id,
|
|
201
|
+
}),
|
|
202
|
+
)
|
|
203
|
+
} catch (error) {
|
|
204
|
+
console.error("WebSocket error:", error)
|
|
205
|
+
resolve()
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
socket.on("close", () => {
|
|
210
|
+
console.log("Disconnected from WebSocket server")
|
|
211
|
+
resolve()
|
|
212
|
+
})
|
|
213
|
+
socket.on("error", (error) => {
|
|
214
|
+
console.error("WebSocket error:", error)
|
|
215
|
+
resolve()
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
async function run_browser(
|
|
221
|
+
script_name,
|
|
222
|
+
microservices_options = {
|
|
223
|
+
back: { command, args: { port: 5000, data_folder_path } },
|
|
224
|
+
viewer: { command, args: { port: 1234, data_folder_path } },
|
|
225
|
+
},
|
|
226
|
+
) {
|
|
227
|
+
console.log("microservices_options", microservices_options)
|
|
228
|
+
const back_promise = run_back(microservices_options.back.command, {
|
|
229
|
+
...microservices_options.back.args,
|
|
230
|
+
})
|
|
231
|
+
console.log("back_promise", back_promise)
|
|
232
|
+
|
|
233
|
+
const viewer_promise = run_viewer(microservices_options.viewer.command, {
|
|
234
|
+
...microservices_options.viewer.args,
|
|
235
|
+
})
|
|
236
|
+
console.log("viewer_promise", viewer_promise)
|
|
237
|
+
|
|
238
|
+
const [back_port, viewer_port] = await Promise.all([
|
|
239
|
+
back_promise,
|
|
240
|
+
viewer_promise,
|
|
241
|
+
])
|
|
242
|
+
process.env.GEODE_PORT = back_port
|
|
243
|
+
process.env.VIEWER_PORT = viewer_port
|
|
244
|
+
console.log("back_port", back_port)
|
|
245
|
+
console.log("viewer_port", viewer_port)
|
|
246
|
+
|
|
247
|
+
process.env.BROWSER = true
|
|
248
|
+
process.on("SIGINT", async () => {
|
|
249
|
+
console.log("Shutting down microservices")
|
|
250
|
+
await Promise.all([
|
|
251
|
+
kill_back(process.env.GEODE_PORT),
|
|
252
|
+
kill_viewer(process.env.VIEWER_PORT),
|
|
253
|
+
])
|
|
254
|
+
console.log("Quitting App...")
|
|
255
|
+
process.exit(0)
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
const nuxt_port = await get_available_port()
|
|
259
|
+
console.log("nuxt_port", nuxt_port)
|
|
260
|
+
|
|
261
|
+
process.env.NUXT_PORT = nuxt_port
|
|
262
|
+
const nuxt_process = child_process.spawn("npm", ["run", script_name], {
|
|
263
|
+
shell: true,
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
return new Promise((resolve, reject) => {
|
|
267
|
+
nuxt_process.stdout.on("data", function (data) {
|
|
268
|
+
const output = data.toString()
|
|
269
|
+
const portMatch = output.match(
|
|
270
|
+
/Accepting\ connections\ at\ http:\/\/localhost:(\d+)/,
|
|
271
|
+
)
|
|
272
|
+
console.log("Nuxt: ", output)
|
|
273
|
+
if (portMatch) {
|
|
274
|
+
resolve(portMatch[1])
|
|
275
|
+
return
|
|
276
|
+
}
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
}
|
|
280
|
+
|
|
168
281
|
export {
|
|
169
282
|
create_path,
|
|
283
|
+
delete_folder_recursive,
|
|
170
284
|
executable_name,
|
|
171
285
|
executable_path,
|
|
172
286
|
get_available_port,
|
|
173
|
-
|
|
174
|
-
|
|
287
|
+
kill_back,
|
|
288
|
+
kill_viewer,
|
|
175
289
|
run_script,
|
|
176
290
|
run_back,
|
|
177
291
|
run_viewer,
|
|
292
|
+
run_browser,
|
|
178
293
|
}
|