@geode/opengeodeweb-front 10.34.0-rc.12 → 10.34.0-rc.13
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/.build/shared/utils/fetch_raw.js +6 -6
- package/app/composables/clipping_planes_widget.ts +5 -5
- package/app/composables/clipping_planes_widget_entries.ts +6 -8
- package/app/composables/global_attribute_style.ts +1 -1
- package/app/composables/hover_highlight.ts +3 -3
- package/app/composables/project_manager.ts +1 -1
- package/app/composables/responsive_middle_truncate.ts +3 -3
- package/app/composables/stepper_tree.ts +5 -5
- package/app/composables/tree_filter.ts +3 -7
- package/app/composables/tree_keyboard_nav.ts +8 -8
- package/app/composables/tree_scroll.ts +10 -10
- package/app/composables/use_adaptive_styles.ts +1 -1
- package/app/composables/use_overlapping_picker.ts +10 -13
- package/app/composables/virtual_tree.ts +6 -14
- package/app/plugins/auto_store_register.ts +1 -1
- package/app/stores/app.ts +10 -15
- package/app/stores/back.ts +3 -6
- package/app/stores/camera_manager.ts +2 -5
- package/app/stores/data.ts +16 -16
- package/app/stores/data_helpers/collections.ts +6 -14
- package/app/stores/data_helpers/mesh.ts +6 -8
- package/app/stores/data_style.ts +7 -7
- package/app/stores/hybrid_viewer.ts +1 -1
- package/app/stores/infra.ts +15 -21
- package/app/stores/menu.ts +1 -1
- package/app/stores/treeview.ts +7 -7
- package/app/stores/viewer.ts +4 -4
- package/app/utils/attributes.ts +1 -1
- package/app/utils/clipping_planes.ts +12 -17
- package/app/utils/colormap.ts +1 -1
- package/app/utils/default_styles/meshes.ts +5 -5
- package/app/utils/default_styles/models.ts +4 -4
- package/app/utils/extension.ts +6 -10
- package/app/utils/import_workflow.ts +3 -3
- package/app/utils/log.ts +4 -4
- package/internal/stores/data_style/mesh/cells/index.ts +10 -10
- package/internal/stores/data_style/mesh/edges/index.ts +10 -10
- package/internal/stores/data_style/mesh/points/common.ts +5 -6
- package/internal/stores/data_style/mesh/points/index.ts +8 -8
- package/internal/stores/data_style/mesh/polygons/index.ts +10 -10
- package/internal/stores/data_style/mesh/polyhedra/index.ts +9 -11
- package/internal/stores/data_style/state.ts +12 -15
- package/internal/stores/hybrid_viewer/brightness.ts +6 -13
- package/internal/stores/hybrid_viewer/core.ts +1 -1
- package/package.json +1 -1
- package/server/api/microservice/extensions/download.post.ts +1 -1
- package/server/utils/app_config.ts +1 -1
- package/server/utils/cleanup.ts +6 -8
- package/server/utils/microservices.ts +6 -9
- package/server/utils/scripts.ts +2 -2
- package/server/utils/ws_client.ts +5 -9
- package/shared/utils/call_raw.ts +7 -18
- package/shared/utils/call_schema.ts +5 -5
- package/shared/utils/fetch_raw.ts +18 -18
- package/shared/utils/fetch_schema.ts +4 -11
- package/shared/utils/response_handlers/load.ts +1 -1
- package/shared/utils/types.ts +3 -3
- package/shared/utils/validate_schema.ts +1 -4
package/app/utils/log.ts
CHANGED
|
@@ -4,16 +4,16 @@ interface Loggable {
|
|
|
4
4
|
$id: string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
function startRequestLog(microservice:
|
|
7
|
+
function startRequestLog(microservice: Loggable, schema: JsonRpcSchema): Date {
|
|
8
8
|
console.log(`[${microservice.$id}] Request:`, schema.$id);
|
|
9
9
|
const requestStartingTime = new Date(Date.now());
|
|
10
10
|
return requestStartingTime;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function endRequestLog(
|
|
14
|
-
microservice:
|
|
15
|
-
schema:
|
|
16
|
-
requestStartingTime:
|
|
14
|
+
microservice: Loggable,
|
|
15
|
+
schema: JsonRpcSchema,
|
|
16
|
+
requestStartingTime: Date,
|
|
17
17
|
): void {
|
|
18
18
|
const requestEndingTime = new Date(Date.now());
|
|
19
19
|
console.log(
|
|
@@ -12,16 +12,16 @@ import { useMeshCellsVisibilityStyle } from "./visibility";
|
|
|
12
12
|
// Local constants
|
|
13
13
|
|
|
14
14
|
interface MeshCellsActiveColoringDeps {
|
|
15
|
-
readonly commonStyle:
|
|
16
|
-
readonly colorStyle:
|
|
17
|
-
readonly texturesStyle:
|
|
18
|
-
readonly vertexAttributeStyle:
|
|
19
|
-
readonly cellAttributeStyle:
|
|
15
|
+
readonly commonStyle: ReturnType<typeof useMeshCellsCommonStyle>;
|
|
16
|
+
readonly colorStyle: ReturnType<typeof useMeshCellsColorStyle>;
|
|
17
|
+
readonly texturesStyle: ReturnType<typeof useMeshCellsTexturesStyle>;
|
|
18
|
+
readonly vertexAttributeStyle: ReturnType<typeof useMeshCellsVertexAttributeStyle>;
|
|
19
|
+
readonly cellAttributeStyle: ReturnType<typeof useMeshCellsCellAttributeStyle>;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function handleMeshCellsVertexColoring(
|
|
23
23
|
id: string,
|
|
24
|
-
vertexAttributeStyle:
|
|
24
|
+
vertexAttributeStyle: ReturnType<typeof useMeshCellsVertexAttributeStyle>,
|
|
25
25
|
): Promise<unknown> | undefined {
|
|
26
26
|
const name = vertexAttributeStyle.meshCellsVertexAttributeName(id);
|
|
27
27
|
const item = vertexAttributeStyle.meshCellsVertexAttributeItem(id);
|
|
@@ -36,7 +36,7 @@ function handleMeshCellsVertexColoring(
|
|
|
36
36
|
|
|
37
37
|
function handleMeshCellsCellColoring(
|
|
38
38
|
id: string,
|
|
39
|
-
cellAttributeStyle:
|
|
39
|
+
cellAttributeStyle: ReturnType<typeof useMeshCellsCellAttributeStyle>,
|
|
40
40
|
): Promise<unknown> | undefined {
|
|
41
41
|
const name = cellAttributeStyle.meshCellsCellAttributeName(id);
|
|
42
42
|
const item = cellAttributeStyle.meshCellsCellAttributeItem(id);
|
|
@@ -52,7 +52,7 @@ function handleMeshCellsCellColoring(
|
|
|
52
52
|
async function setMeshCellsActiveColoring(
|
|
53
53
|
id: string,
|
|
54
54
|
type: string | undefined,
|
|
55
|
-
deps:
|
|
55
|
+
deps: MeshCellsActiveColoringDeps,
|
|
56
56
|
): Promise<unknown> {
|
|
57
57
|
await deps.commonStyle.mutateMeshCellsStyle(id, {
|
|
58
58
|
coloring: { active: type },
|
|
@@ -81,9 +81,9 @@ async function setMeshCellsActiveColoring(
|
|
|
81
81
|
|
|
82
82
|
async function applyMeshCellsStyle(
|
|
83
83
|
id: string,
|
|
84
|
-
visibilityStyle:
|
|
84
|
+
visibilityStyle: ReturnType<typeof useMeshCellsVisibilityStyle>,
|
|
85
85
|
activeColoringType: string | undefined,
|
|
86
|
-
deps:
|
|
86
|
+
deps: MeshCellsActiveColoringDeps,
|
|
87
87
|
): Promise<unknown[]> {
|
|
88
88
|
const result = await Promise.all([
|
|
89
89
|
visibilityStyle.setMeshCellsVisibility(id, visibilityStyle.meshCellsVisibility(id)),
|
|
@@ -12,15 +12,15 @@ import { useMeshEdgesWidthStyle } from "./width";
|
|
|
12
12
|
// Local constants
|
|
13
13
|
|
|
14
14
|
interface MeshEdgesActiveColoringDeps {
|
|
15
|
-
readonly commonStyle:
|
|
16
|
-
readonly colorStyle:
|
|
17
|
-
readonly vertexAttributeStyle:
|
|
18
|
-
readonly edgeAttributeStyle:
|
|
15
|
+
readonly commonStyle: ReturnType<typeof useMeshEdgesCommonStyle>;
|
|
16
|
+
readonly colorStyle: ReturnType<typeof useMeshEdgesColorStyle>;
|
|
17
|
+
readonly vertexAttributeStyle: ReturnType<typeof useMeshEdgesVertexAttributeStyle>;
|
|
18
|
+
readonly edgeAttributeStyle: ReturnType<typeof useMeshEdgesEdgeAttributeStyle>;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function handleMeshEdgesVertexColoring(
|
|
22
22
|
id: string,
|
|
23
|
-
vertexAttributeStyle:
|
|
23
|
+
vertexAttributeStyle: ReturnType<typeof useMeshEdgesVertexAttributeStyle>,
|
|
24
24
|
): Promise<unknown> | undefined {
|
|
25
25
|
const name = vertexAttributeStyle.meshEdgesVertexAttributeName(id);
|
|
26
26
|
const item = vertexAttributeStyle.meshEdgesVertexAttributeItem(id);
|
|
@@ -35,7 +35,7 @@ function handleMeshEdgesVertexColoring(
|
|
|
35
35
|
|
|
36
36
|
function handleMeshEdgesEdgeColoring(
|
|
37
37
|
id: string,
|
|
38
|
-
edgeAttributeStyle:
|
|
38
|
+
edgeAttributeStyle: ReturnType<typeof useMeshEdgesEdgeAttributeStyle>,
|
|
39
39
|
): Promise<unknown> | undefined {
|
|
40
40
|
const name = edgeAttributeStyle.meshEdgesEdgeAttributeName(id);
|
|
41
41
|
const item = edgeAttributeStyle.meshEdgesEdgeAttributeItem(id);
|
|
@@ -51,7 +51,7 @@ function handleMeshEdgesEdgeColoring(
|
|
|
51
51
|
async function setMeshEdgesActiveColoring(
|
|
52
52
|
id: string,
|
|
53
53
|
type: string | undefined,
|
|
54
|
-
deps:
|
|
54
|
+
deps: MeshEdgesActiveColoringDeps,
|
|
55
55
|
): Promise<unknown> {
|
|
56
56
|
await deps.commonStyle.mutateMeshEdgesStyle(id, {
|
|
57
57
|
coloring: { active: type },
|
|
@@ -73,10 +73,10 @@ async function setMeshEdgesActiveColoring(
|
|
|
73
73
|
|
|
74
74
|
async function applyMeshEdgesStyle(
|
|
75
75
|
id: string,
|
|
76
|
-
visibilityStyle:
|
|
77
|
-
widthStyle:
|
|
76
|
+
visibilityStyle: ReturnType<typeof useMeshEdgesVisibilityStyle>,
|
|
77
|
+
widthStyle: ReturnType<typeof useMeshEdgesWidthStyle>,
|
|
78
78
|
activeColoringType: string | undefined,
|
|
79
|
-
deps:
|
|
79
|
+
deps: MeshEdgesActiveColoringDeps,
|
|
80
80
|
): Promise<unknown[]> {
|
|
81
81
|
const result = await Promise.all([
|
|
82
82
|
visibilityStyle.setMeshEdgesVisibility(id, visibilityStyle.meshEdgesVisibility(id)),
|
|
@@ -6,9 +6,7 @@ export function useMeshPointsCommonStyle(): {
|
|
|
6
6
|
meshPointsColoring: (id: string) => StyleValues;
|
|
7
7
|
mutateMeshPointsColoring: (id: string, values: StyleValues) => Promise<string>;
|
|
8
8
|
mutateMeshPointsStyle: (id: string, values: StyleValues) => Promise<string>;
|
|
9
|
-
mutateMeshPointsVisibility: (
|
|
10
|
-
response: Readonly<{ id: string; visibility: boolean }>,
|
|
11
|
-
) => Promise<string>;
|
|
9
|
+
mutateMeshPointsVisibility: (response: { id: string; visibility: boolean }) => Promise<string>;
|
|
12
10
|
} {
|
|
13
11
|
const dataStyleState = useDataStyleState();
|
|
14
12
|
|
|
@@ -19,9 +17,10 @@ export function useMeshPointsCommonStyle(): {
|
|
|
19
17
|
return result;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
async function mutateMeshPointsVisibility(
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
async function mutateMeshPointsVisibility(response: {
|
|
21
|
+
id: string;
|
|
22
|
+
visibility: boolean;
|
|
23
|
+
}): Promise<string> {
|
|
25
24
|
const result = await mutateMeshPointsStyle(response.id, { visibility: response.visibility });
|
|
26
25
|
return result;
|
|
27
26
|
}
|
|
@@ -11,14 +11,14 @@ import { useMeshPointsVisibilityStyle } from "./visibility";
|
|
|
11
11
|
// Local constants
|
|
12
12
|
|
|
13
13
|
interface MeshPointsActiveColoringDeps {
|
|
14
|
-
readonly commonStyle:
|
|
15
|
-
readonly colorStyle:
|
|
16
|
-
readonly vertexAttributeStyle:
|
|
14
|
+
readonly commonStyle: ReturnType<typeof useMeshPointsCommonStyle>;
|
|
15
|
+
readonly colorStyle: ReturnType<typeof useMeshPointsColorStyle>;
|
|
16
|
+
readonly vertexAttributeStyle: ReturnType<typeof useMeshPointsVertexAttributeStyle>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function handleMeshPointsVertexColoring(
|
|
20
20
|
id: string,
|
|
21
|
-
vertexAttributeStyle:
|
|
21
|
+
vertexAttributeStyle: ReturnType<typeof useMeshPointsVertexAttributeStyle>,
|
|
22
22
|
): Promise<unknown> | undefined {
|
|
23
23
|
const name = vertexAttributeStyle.meshPointsVertexAttributeName(id);
|
|
24
24
|
const item = vertexAttributeStyle.meshPointsVertexAttributeItem(id);
|
|
@@ -34,7 +34,7 @@ function handleMeshPointsVertexColoring(
|
|
|
34
34
|
async function setMeshPointsActiveColoring(
|
|
35
35
|
id: string,
|
|
36
36
|
type: string | undefined,
|
|
37
|
-
deps:
|
|
37
|
+
deps: MeshPointsActiveColoringDeps,
|
|
38
38
|
): Promise<unknown> {
|
|
39
39
|
await deps.commonStyle.mutateMeshPointsStyle(id, {
|
|
40
40
|
coloring: { active: type },
|
|
@@ -55,10 +55,10 @@ async function setMeshPointsActiveColoring(
|
|
|
55
55
|
|
|
56
56
|
async function applyMeshPointsStyle(
|
|
57
57
|
id: string,
|
|
58
|
-
visibilityStyle:
|
|
59
|
-
sizeStyle:
|
|
58
|
+
visibilityStyle: ReturnType<typeof useMeshPointsVisibilityStyle>,
|
|
59
|
+
sizeStyle: ReturnType<typeof useMeshPointsSizeStyle>,
|
|
60
60
|
activeColoringType: string | undefined,
|
|
61
|
-
deps:
|
|
61
|
+
deps: MeshPointsActiveColoringDeps,
|
|
62
62
|
): Promise<unknown[]> {
|
|
63
63
|
const result = await Promise.all([
|
|
64
64
|
visibilityStyle.setMeshPointsVisibility(id, visibilityStyle.meshPointsVisibility(id)),
|
|
@@ -15,16 +15,16 @@ import { useMeshPolygonsVisibilityStyle } from "./visibility";
|
|
|
15
15
|
// Local constants
|
|
16
16
|
|
|
17
17
|
interface MeshPolygonsActiveColoringDeps {
|
|
18
|
-
readonly commonStyle:
|
|
19
|
-
readonly colorStyle:
|
|
20
|
-
readonly texturesStyle:
|
|
21
|
-
readonly vertexAttributeStyle:
|
|
22
|
-
readonly polygonAttributeStyle:
|
|
18
|
+
readonly commonStyle: ReturnType<typeof useMeshPolygonsCommonStyle>;
|
|
19
|
+
readonly colorStyle: ReturnType<typeof useMeshPolygonsColorStyle>;
|
|
20
|
+
readonly texturesStyle: ReturnType<typeof useMeshPolygonsTexturesStyle>;
|
|
21
|
+
readonly vertexAttributeStyle: ReturnType<typeof useMeshPolygonsVertexAttributeStyle>;
|
|
22
|
+
readonly polygonAttributeStyle: ReturnType<typeof useMeshPolygonsPolygonAttributeStyle>;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
function handleMeshPolygonsVertexColoring(
|
|
26
26
|
id: string,
|
|
27
|
-
vertexAttributeStyle:
|
|
27
|
+
vertexAttributeStyle: ReturnType<typeof useMeshPolygonsVertexAttributeStyle>,
|
|
28
28
|
): Promise<unknown> | undefined {
|
|
29
29
|
const name = vertexAttributeStyle.meshPolygonsVertexAttributeName(id);
|
|
30
30
|
const item = vertexAttributeStyle.meshPolygonsVertexAttributeItem(id);
|
|
@@ -39,7 +39,7 @@ function handleMeshPolygonsVertexColoring(
|
|
|
39
39
|
|
|
40
40
|
function handleMeshPolygonsPolygonColoring(
|
|
41
41
|
id: string,
|
|
42
|
-
polygonAttributeStyle:
|
|
42
|
+
polygonAttributeStyle: ReturnType<typeof useMeshPolygonsPolygonAttributeStyle>,
|
|
43
43
|
): Promise<unknown> | undefined {
|
|
44
44
|
const name = polygonAttributeStyle.meshPolygonsPolygonAttributeName(id);
|
|
45
45
|
const item = polygonAttributeStyle.meshPolygonsPolygonAttributeItem(id);
|
|
@@ -55,7 +55,7 @@ function handleMeshPolygonsPolygonColoring(
|
|
|
55
55
|
async function setMeshPolygonsActiveColoring(
|
|
56
56
|
id: string,
|
|
57
57
|
type: string | undefined,
|
|
58
|
-
deps:
|
|
58
|
+
deps: MeshPolygonsActiveColoringDeps,
|
|
59
59
|
): Promise<unknown> {
|
|
60
60
|
await deps.commonStyle.mutateMeshPolygonsStyle(id, {
|
|
61
61
|
coloring: { active: type },
|
|
@@ -87,9 +87,9 @@ async function setMeshPolygonsActiveColoring(
|
|
|
87
87
|
|
|
88
88
|
async function applyMeshPolygonsStyle(
|
|
89
89
|
id: string,
|
|
90
|
-
visibilityStyle:
|
|
90
|
+
visibilityStyle: ReturnType<typeof useMeshPolygonsVisibilityStyle>,
|
|
91
91
|
activeColoringType: string | undefined,
|
|
92
|
-
deps:
|
|
92
|
+
deps: MeshPolygonsActiveColoringDeps,
|
|
93
93
|
): Promise<unknown[]> {
|
|
94
94
|
const result = await Promise.all([
|
|
95
95
|
visibilityStyle.setMeshPolygonsVisibility(id, visibilityStyle.meshPolygonsVisibility(id)),
|
|
@@ -17,17 +17,15 @@ import { useMeshPolyhedraVisibilityStyle } from "./visibility";
|
|
|
17
17
|
// Local constants
|
|
18
18
|
|
|
19
19
|
interface MeshPolyhedraActiveColoringDeps {
|
|
20
|
-
readonly commonStyle:
|
|
21
|
-
readonly colorStyle:
|
|
22
|
-
readonly vertexAttributeStyle:
|
|
23
|
-
readonly polyhedronAttributeStyle:
|
|
24
|
-
ReturnType<typeof useMeshPolyhedraPolyhedronAttributeStyle>
|
|
25
|
-
>;
|
|
20
|
+
readonly commonStyle: ReturnType<typeof useMeshPolyhedraCommonStyle>;
|
|
21
|
+
readonly colorStyle: ReturnType<typeof useMeshPolyhedraColorStyle>;
|
|
22
|
+
readonly vertexAttributeStyle: ReturnType<typeof useMeshPolyhedraVertexAttributeStyle>;
|
|
23
|
+
readonly polyhedronAttributeStyle: ReturnType<typeof useMeshPolyhedraPolyhedronAttributeStyle>;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
function handleMeshPolyhedraVertexColoring(
|
|
29
27
|
id: string,
|
|
30
|
-
vertexAttributeStyle:
|
|
28
|
+
vertexAttributeStyle: ReturnType<typeof useMeshPolyhedraVertexAttributeStyle>,
|
|
31
29
|
): Promise<unknown> | undefined {
|
|
32
30
|
const name = vertexAttributeStyle.meshPolyhedraVertexAttributeName(id);
|
|
33
31
|
const item = vertexAttributeStyle.meshPolyhedraVertexAttributeItem(id);
|
|
@@ -42,7 +40,7 @@ function handleMeshPolyhedraVertexColoring(
|
|
|
42
40
|
|
|
43
41
|
function handleMeshPolyhedraPolyhedronColoring(
|
|
44
42
|
id: string,
|
|
45
|
-
polyhedronAttributeStyle:
|
|
43
|
+
polyhedronAttributeStyle: ReturnType<typeof useMeshPolyhedraPolyhedronAttributeStyle>,
|
|
46
44
|
): Promise<unknown> | undefined {
|
|
47
45
|
const name = polyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeName(id);
|
|
48
46
|
const item = polyhedronAttributeStyle.meshPolyhedraPolyhedronAttributeItem(id);
|
|
@@ -58,7 +56,7 @@ function handleMeshPolyhedraPolyhedronColoring(
|
|
|
58
56
|
async function setMeshPolyhedraActiveColoring(
|
|
59
57
|
id: string,
|
|
60
58
|
type: string | undefined,
|
|
61
|
-
deps:
|
|
59
|
+
deps: MeshPolyhedraActiveColoringDeps,
|
|
62
60
|
): Promise<unknown> {
|
|
63
61
|
await deps.commonStyle.mutateMeshPolyhedraStyle(id, {
|
|
64
62
|
coloring: { active: type },
|
|
@@ -83,9 +81,9 @@ async function setMeshPolyhedraActiveColoring(
|
|
|
83
81
|
|
|
84
82
|
async function applyMeshPolyhedraStyle(
|
|
85
83
|
id: string,
|
|
86
|
-
visibilityStyle:
|
|
84
|
+
visibilityStyle: ReturnType<typeof useMeshPolyhedraVisibilityStyle>,
|
|
87
85
|
activeColoringType: string | undefined,
|
|
88
|
-
deps:
|
|
86
|
+
deps: MeshPolyhedraActiveColoringDeps,
|
|
89
87
|
): Promise<unknown[]> {
|
|
90
88
|
const result = await Promise.all([
|
|
91
89
|
visibilityStyle.setMeshPolyhedraVisibility(id, visibilityStyle.meshPolyhedraVisibility(id)),
|
|
@@ -18,26 +18,26 @@ interface SharedState {
|
|
|
18
18
|
updateComponentStyleCache: (
|
|
19
19
|
modelId: string,
|
|
20
20
|
componentId: string,
|
|
21
|
-
styleValues:
|
|
21
|
+
styleValues: StyleValues,
|
|
22
22
|
) => void;
|
|
23
23
|
bulkUpdateComponentStyleCache: (
|
|
24
24
|
modelId: string,
|
|
25
25
|
componentStyleUpdates: readonly {
|
|
26
26
|
readonly id_component: string;
|
|
27
|
-
readonly values:
|
|
27
|
+
readonly values: StyleValues;
|
|
28
28
|
}[],
|
|
29
29
|
) => void;
|
|
30
30
|
bulkUpdateComponentStylesCache: (
|
|
31
31
|
modelId: string,
|
|
32
32
|
componentIds: readonly string[],
|
|
33
|
-
styleValues:
|
|
33
|
+
styleValues: StyleValues,
|
|
34
34
|
) => void;
|
|
35
35
|
updateModelComponentTypeStyleCache: (
|
|
36
36
|
modelId: string,
|
|
37
37
|
componentType: string,
|
|
38
|
-
styleValues:
|
|
38
|
+
styleValues: StyleValues,
|
|
39
39
|
) => void;
|
|
40
|
-
updateStyleCache: (objectId: string, styleValues:
|
|
40
|
+
updateStyleCache: (objectId: string, styleValues: StyleValues) => void;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
let sharedState: SharedState | undefined = undefined;
|
|
@@ -100,7 +100,7 @@ function getSharedState(): SharedState {
|
|
|
100
100
|
function updateComponentStyleCache(
|
|
101
101
|
modelId: string,
|
|
102
102
|
componentId: string,
|
|
103
|
-
styleValues:
|
|
103
|
+
styleValues: StyleValues,
|
|
104
104
|
): void {
|
|
105
105
|
const cacheKey = `${modelId}_${componentId}`;
|
|
106
106
|
const existingStyle = componentStyles.value[cacheKey];
|
|
@@ -118,7 +118,7 @@ function getSharedState(): SharedState {
|
|
|
118
118
|
modelId: string,
|
|
119
119
|
componentStyleUpdates: readonly {
|
|
120
120
|
readonly id_component: string;
|
|
121
|
-
readonly values:
|
|
121
|
+
readonly values: StyleValues;
|
|
122
122
|
}[],
|
|
123
123
|
): void {
|
|
124
124
|
const updatedComponentStyles = { ...componentStyles.value };
|
|
@@ -140,7 +140,7 @@ function getSharedState(): SharedState {
|
|
|
140
140
|
function bulkUpdateComponentStylesCache(
|
|
141
141
|
modelId: string,
|
|
142
142
|
componentIds: readonly string[],
|
|
143
|
-
styleValues:
|
|
143
|
+
styleValues: StyleValues,
|
|
144
144
|
): void {
|
|
145
145
|
const updatedComponentStyles = { ...componentStyles.value };
|
|
146
146
|
for (const componentId of componentIds) {
|
|
@@ -161,14 +161,14 @@ function getSharedState(): SharedState {
|
|
|
161
161
|
function updateModelComponentTypeStyleCache(
|
|
162
162
|
modelId: string,
|
|
163
163
|
componentType: string,
|
|
164
|
-
styleValues:
|
|
164
|
+
styleValues: StyleValues,
|
|
165
165
|
): void {
|
|
166
166
|
const cacheKey = `${modelId}_${componentType}`;
|
|
167
167
|
modelComponentTypeStyles.value[cacheKey] ??= { id_model: modelId, type: componentType };
|
|
168
168
|
merge(modelComponentTypeStyles.value[cacheKey], styleValues);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
function updateStyleCache(objectId: string, styleValues:
|
|
171
|
+
function updateStyleCache(objectId: string, styleValues: StyleValues): void {
|
|
172
172
|
styles.value[objectId] ??= { id: objectId };
|
|
173
173
|
merge(styles.value[objectId], styleValues);
|
|
174
174
|
}
|
|
@@ -192,7 +192,7 @@ interface DataStyleStateApi extends SharedState {
|
|
|
192
192
|
getStyle: (objectId: string) => ObjectStyle;
|
|
193
193
|
getComponentStyle: (modelId: string, componentId: string) => ModelComponentStyle;
|
|
194
194
|
getModelComponentTypeStyle: (modelId: string, componentType: string) => ModelComponentTypeStyle;
|
|
195
|
-
mutateStyle: (objectId: string, styleValues:
|
|
195
|
+
mutateStyle: (objectId: string, styleValues: StyleValues) => Promise<string>;
|
|
196
196
|
objectVisibility: ComputedRef<(objectId: string) => boolean | undefined>;
|
|
197
197
|
selectedObjects: ComputedRef<string[]>;
|
|
198
198
|
clear: () => Promise<void>;
|
|
@@ -235,10 +235,7 @@ export function useDataStyleState(): DataStyleStateApi {
|
|
|
235
235
|
return { ...toRaw(style) };
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
async function mutateStyle(
|
|
239
|
-
objectId: string,
|
|
240
|
-
styleValues: Readonly<StyleValues>,
|
|
241
|
-
): Promise<string> {
|
|
238
|
+
async function mutateStyle(objectId: string, styleValues: StyleValues): Promise<string> {
|
|
242
239
|
state.updateStyleCache(objectId, styleValues);
|
|
243
240
|
const currentStyle = getStyle(objectId);
|
|
244
241
|
merge(currentStyle, styleValues);
|
|
@@ -28,11 +28,7 @@ interface RelativeRect {
|
|
|
28
28
|
relH: number;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function mapRect(
|
|
32
|
-
rect: Readonly<Rect>,
|
|
33
|
-
latestImage: Readonly<DrawableImage>,
|
|
34
|
-
canvasRect: Readonly<DOMRect>,
|
|
35
|
-
): RelativeRect {
|
|
31
|
+
function mapRect(rect: Rect, latestImage: DrawableImage, canvasRect: DOMRect): RelativeRect {
|
|
36
32
|
const scaleX = latestImage.width / canvasRect.width;
|
|
37
33
|
const scaleY = latestImage.height / canvasRect.height;
|
|
38
34
|
return {
|
|
@@ -45,8 +41,8 @@ function mapRect(
|
|
|
45
41
|
|
|
46
42
|
function sampleMinBrightness(
|
|
47
43
|
ctx: CanvasRenderingContext2D,
|
|
48
|
-
image:
|
|
49
|
-
relRect:
|
|
44
|
+
image: DrawableImage,
|
|
45
|
+
relRect: RelativeRect,
|
|
50
46
|
): number {
|
|
51
47
|
ctx.drawImage(
|
|
52
48
|
image,
|
|
@@ -70,10 +66,7 @@ function sampleMinBrightness(
|
|
|
70
66
|
return minBrightness;
|
|
71
67
|
}
|
|
72
68
|
|
|
73
|
-
function computeAverageBrightness(
|
|
74
|
-
rect: Readonly<Rect>,
|
|
75
|
-
options: Readonly<BrightnessOptions>,
|
|
76
|
-
): number {
|
|
69
|
+
function computeAverageBrightness(rect: Rect, options: BrightnessOptions): number {
|
|
77
70
|
const { latestImage, offscreenCtx, offscreenCanvas } = options;
|
|
78
71
|
const { genericRenderWindow } = useHybridViewerCore();
|
|
79
72
|
if (!latestImage || !offscreenCtx || !offscreenCanvas || !genericRenderWindow.value) {
|
|
@@ -106,7 +99,7 @@ function computeAverageBrightness(
|
|
|
106
99
|
}
|
|
107
100
|
function useHybridViewerBrightness(): {
|
|
108
101
|
latestImage: Ref<DrawableImage | undefined>;
|
|
109
|
-
getAverageBrightness: (rect:
|
|
102
|
+
getAverageBrightness: (rect: Rect) => number;
|
|
110
103
|
} {
|
|
111
104
|
const latestImage = ref<DrawableImage | undefined>(undefined);
|
|
112
105
|
const offscreenCanvas: HTMLCanvasElement | undefined =
|
|
@@ -116,7 +109,7 @@ function useHybridViewerBrightness(): {
|
|
|
116
109
|
willReadFrequently: true,
|
|
117
110
|
}) ?? undefined)
|
|
118
111
|
: undefined;
|
|
119
|
-
function getAverageBrightness(rect:
|
|
112
|
+
function getAverageBrightness(rect: Rect): number {
|
|
120
113
|
return computeAverageBrightness(rect, {
|
|
121
114
|
latestImage: latestImage.value,
|
|
122
115
|
offscreenCtx,
|
|
@@ -9,7 +9,7 @@ interface GenericRenderWindowHolder {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// `genericRenderWindow.value` is only ever read from these functions after the viewer has been initialized (see app/stores/hybrid_viewer.ts's initHybridViewer), so requireRenderWindow throwing on that path would indicate a real bug rather than an expected state.
|
|
12
|
-
function requireRenderWindow(holder:
|
|
12
|
+
function requireRenderWindow(holder: GenericRenderWindowHolder): VtkGenericRenderWindow {
|
|
13
13
|
if (!holder.value) {
|
|
14
14
|
throw new Error("genericRenderWindow accessed before the viewer was initialized");
|
|
15
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.34.0-rc.
|
|
3
|
+
"version": "10.34.0-rc.13",
|
|
4
4
|
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
5
5
|
"homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
|
|
6
6
|
"bugs": {
|
|
@@ -21,7 +21,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
21
21
|
const body = await readBody<DownloadExtensionBody>(event);
|
|
22
22
|
const { projectName, url, extensionFileName } = body;
|
|
23
23
|
console.log({ projectName, url, extensionFileName });
|
|
24
|
-
const response:
|
|
24
|
+
const response: Response = await fetch(url);
|
|
25
25
|
const fileBuffer = await response.arrayBuffer();
|
|
26
26
|
const filePath = targetExtensionFilePath(projectName, extensionFileName);
|
|
27
27
|
await fs.writeFile(filePath, Buffer.from(fileBuffer));
|
|
@@ -45,7 +45,7 @@ function extensionsConf(projectName: string): ExtensionsConfigSchema["extensions
|
|
|
45
45
|
|
|
46
46
|
function addExtensionToConf(
|
|
47
47
|
projectName: string,
|
|
48
|
-
{ extensionId, extensionPath }:
|
|
48
|
+
{ extensionId, extensionPath }: { extensionId: string; extensionPath: string },
|
|
49
49
|
): void {
|
|
50
50
|
const projectConfig = projectConf(projectName);
|
|
51
51
|
projectConfig.set(`extensions.${extensionId}.path`, extensionPath);
|
package/server/utils/cleanup.ts
CHANGED
|
@@ -53,7 +53,7 @@ function isErrorWithMessage(error: unknown): error is { message: string } {
|
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
async function killHttpMicroservice(microservice:
|
|
56
|
+
async function killHttpMicroservice(microservice: Microservice): Promise<void> {
|
|
57
57
|
console.log("killHttpMicroservice", {
|
|
58
58
|
...microservice,
|
|
59
59
|
});
|
|
@@ -77,7 +77,7 @@ async function killHttpMicroservice(microservice: Readonly<Microservice>): Promi
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
async function killWebsocketMicroservice(microservice:
|
|
80
|
+
async function killWebsocketMicroservice(microservice: Microservice): Promise<void> {
|
|
81
81
|
console.log("killWebsocketMicroservice", {
|
|
82
82
|
...microservice,
|
|
83
83
|
});
|
|
@@ -124,7 +124,7 @@ async function killWebsocketMicroservice(microservice: Readonly<Microservice>):
|
|
|
124
124
|
console.log(successMessage);
|
|
125
125
|
resolve();
|
|
126
126
|
});
|
|
127
|
-
socket.on("error", (error:
|
|
127
|
+
socket.on("error", (error: Error) => {
|
|
128
128
|
console.error("WebSocket error:", error);
|
|
129
129
|
socket.close();
|
|
130
130
|
resolve();
|
|
@@ -137,7 +137,7 @@ async function killWebsocketMicroservice(microservice: Readonly<Microservice>):
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
async function killMicroservice(microservice:
|
|
140
|
+
async function killMicroservice(microservice: Microservice): Promise<void> {
|
|
141
141
|
if (microservice.type === "back") {
|
|
142
142
|
await killHttpMicroservice(microservice);
|
|
143
143
|
} else if (microservice.type === "viewer") {
|
|
@@ -148,9 +148,7 @@ async function killMicroservice(microservice: Readonly<Microservice>): Promise<v
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
async function killMicroservices(
|
|
152
|
-
microservices: readonly Readonly<Microservice>[],
|
|
153
|
-
): Promise<Readonly<Microservice>[]> {
|
|
151
|
+
async function killMicroservices(microservices: readonly Microservice[]): Promise<Microservice[]> {
|
|
154
152
|
console.log("killMicroservices", {
|
|
155
153
|
microservices,
|
|
156
154
|
});
|
|
@@ -203,7 +201,7 @@ async function cleanupBackend(projectFolderPath: string): Promise<void> {
|
|
|
203
201
|
}
|
|
204
202
|
|
|
205
203
|
function getMicroserviceByName(
|
|
206
|
-
microservices: readonly
|
|
204
|
+
microservices: readonly Microservice[],
|
|
207
205
|
name: string,
|
|
208
206
|
): Microservice | undefined {
|
|
209
207
|
const found = microservices.find((microservice) => microservice.name === name);
|
|
@@ -21,7 +21,7 @@ interface RunArgs {
|
|
|
21
21
|
const MILLISECONDS_PER_SECOND = 1000;
|
|
22
22
|
const DEFAULT_TIMEOUT_SECONDS = 45;
|
|
23
23
|
const MAX_PORT_RETRIES = 1;
|
|
24
|
-
const DEFAULT_RUN_ARGS:
|
|
24
|
+
const DEFAULT_RUN_ARGS: RunArgs = { projectFolderPath: "" };
|
|
25
25
|
|
|
26
26
|
async function runScript(
|
|
27
27
|
execPath: string,
|
|
@@ -61,7 +61,7 @@ function isPortInUseError(error: unknown): boolean {
|
|
|
61
61
|
return /EADDRINUSE|address already in use|port already in use/iu.test(String(error));
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function backArgs(args:
|
|
64
|
+
function backArgs(args: RunArgs, port: number): string[] {
|
|
65
65
|
const { projectFolderPath } = args;
|
|
66
66
|
if (!projectFolderPath) {
|
|
67
67
|
throw new Error("projectFolderPath is required");
|
|
@@ -91,7 +91,7 @@ function backArgs(args: Readonly<RunArgs>, port: number): string[] {
|
|
|
91
91
|
async function runBack(
|
|
92
92
|
execName: string,
|
|
93
93
|
execPath: string,
|
|
94
|
-
args:
|
|
94
|
+
args: RunArgs = DEFAULT_RUN_ARGS,
|
|
95
95
|
attempts = 0,
|
|
96
96
|
): Promise<number> {
|
|
97
97
|
let port: number | undefined = undefined;
|
|
@@ -118,7 +118,7 @@ async function runBack(
|
|
|
118
118
|
async function runViewer(
|
|
119
119
|
execName: string,
|
|
120
120
|
execPath: string,
|
|
121
|
-
args:
|
|
121
|
+
args: RunArgs = DEFAULT_RUN_ARGS,
|
|
122
122
|
attempts = 0,
|
|
123
123
|
): Promise<number> {
|
|
124
124
|
const { projectFolderPath } = args;
|
|
@@ -157,7 +157,7 @@ async function runExtension(
|
|
|
157
157
|
extensionId: string,
|
|
158
158
|
execName: string,
|
|
159
159
|
execPath: string,
|
|
160
|
-
args:
|
|
160
|
+
args: RunArgs = DEFAULT_RUN_ARGS,
|
|
161
161
|
attempts = 0,
|
|
162
162
|
): Promise<number> {
|
|
163
163
|
let port: number | undefined = undefined;
|
|
@@ -182,10 +182,7 @@ async function runExtension(
|
|
|
182
182
|
}
|
|
183
183
|
throw new Error(`runExtension failed to run ${extensionId}`);
|
|
184
184
|
}
|
|
185
|
-
function addMicroserviceMetadatas(
|
|
186
|
-
projectFolderPath: string,
|
|
187
|
-
serviceObj: Readonly<Microservice>,
|
|
188
|
-
): void {
|
|
185
|
+
function addMicroserviceMetadatas(projectFolderPath: string, serviceObj: Microservice): void {
|
|
189
186
|
const microservices = projectMicroservices(projectFolderPath);
|
|
190
187
|
let enriched: Microservice = { ...serviceObj };
|
|
191
188
|
if (serviceObj.type === "back") {
|
package/server/utils/scripts.ts
CHANGED
|
@@ -46,7 +46,7 @@ interface NamedChildProcess extends child_process.ChildProcessByStdio<null, Read
|
|
|
46
46
|
async function waitForReady(
|
|
47
47
|
child: NamedChildProcess,
|
|
48
48
|
expectedResponse: string,
|
|
49
|
-
signal?:
|
|
49
|
+
signal?: AbortSignal,
|
|
50
50
|
): Promise<NamedChildProcess> {
|
|
51
51
|
// oxlint-disable-next-line promise/avoid-new
|
|
52
52
|
return new Promise((resolve, reject) => {
|
|
@@ -74,7 +74,7 @@ async function waitForReady(
|
|
|
74
74
|
}
|
|
75
75
|
let onLine: ((line: string) => void) | undefined = undefined;
|
|
76
76
|
let onErrLine: ((line: string) => void) | undefined = undefined;
|
|
77
|
-
let onError: ((err:
|
|
77
|
+
let onError: ((err: Error) => void) | undefined = undefined;
|
|
78
78
|
let onClose: ((code: number | null) => void) | undefined = undefined;
|
|
79
79
|
let onAbort: (() => void) | undefined = undefined;
|
|
80
80
|
|