@geode/opengeodeweb-front 10.22.1-rc.1 → 10.22.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/app/components/CrsSelector.vue +7 -4
- package/app/components/ExtensionSelector.vue +2 -4
- package/app/components/FileSelector.vue +1 -1
- package/app/components/Inspector/InspectionButton.vue +10 -7
- package/app/components/MissingFilesSelector.vue +8 -9
- package/app/components/ObjectSelector.vue +9 -5
- package/app/components/PackagesVersions.vue +1 -2
- package/app/components/RemoteRenderingView.vue +3 -4
- package/app/components/Screenshot.vue +8 -4
- package/app/components/ViewToolbar.vue +6 -2
- package/app/components/Viewer/Options/AttributeSelector.vue +2 -2
- package/app/components/Viewer/Options/TextureItem.vue +9 -10
- package/app/composables/hover_highlight.js +2 -2
- package/app/composables/project_manager.js +3 -6
- package/app/composables/use_overlapping_picker.js +6 -3
- package/app/stores/app.js +10 -7
- package/app/stores/back.js +13 -11
- package/app/stores/camera_manager.js +3 -3
- package/app/stores/cloud.js +21 -18
- package/app/stores/data.js +6 -2
- package/app/stores/hybrid_viewer.js +13 -10
- package/app/stores/viewer.js +18 -16
- package/app/utils/extension.js +1 -1
- package/app/utils/import_workflow.js +4 -3
- package/internal/stores/data_style/mesh/cells/cell.js +19 -6
- package/internal/stores/data_style/mesh/cells/color.js +6 -3
- package/internal/stores/data_style/mesh/cells/textures.js +6 -3
- package/internal/stores/data_style/mesh/cells/vertex.js +10 -6
- package/internal/stores/data_style/mesh/cells/visibility.js +6 -3
- package/internal/stores/data_style/mesh/edges/color.js +6 -3
- package/internal/stores/data_style/mesh/edges/edge.js +13 -6
- package/internal/stores/data_style/mesh/edges/vertex.js +10 -6
- package/internal/stores/data_style/mesh/edges/visibility.js +6 -3
- package/internal/stores/data_style/mesh/edges/width.js +6 -3
- package/internal/stores/data_style/mesh/index.js +12 -4
- package/internal/stores/data_style/mesh/points/color.js +6 -3
- package/internal/stores/data_style/mesh/points/size.js +6 -3
- package/internal/stores/data_style/mesh/points/vertex.js +11 -6
- package/internal/stores/data_style/mesh/points/visibility.js +6 -3
- package/internal/stores/data_style/mesh/polygons/color.js +6 -3
- package/internal/stores/data_style/mesh/polygons/polygon.js +9 -6
- package/internal/stores/data_style/mesh/polygons/textures.js +6 -3
- package/internal/stores/data_style/mesh/polygons/vertex.js +10 -6
- package/internal/stores/data_style/mesh/polygons/visibility.js +6 -3
- package/internal/stores/data_style/mesh/polyhedra/color.js +6 -3
- package/internal/stores/data_style/mesh/polyhedra/polyhedron.js +14 -6
- package/internal/stores/data_style/mesh/polyhedra/vertex.js +14 -6
- package/internal/stores/data_style/mesh/polyhedra/visibility.js +6 -3
- package/internal/stores/data_style/model/common.js +24 -22
- package/internal/stores/data_style/model/edges/visibility.js +3 -3
- package/internal/stores/data_style/model/points/size.js +6 -3
- package/internal/stores/data_style/model/points/visibility.js +3 -3
- package/internal/stores/data_style/model/visibility.js +3 -2
- package/internal/stores/hybrid_viewer.js +27 -33
- package/internal/stores/hybrid_viewer_camera.js +9 -6
- package/internal/stores/hybrid_viewer_constants.js +21 -0
- package/internal/stores/hybrid_viewer_highlight.js +2 -1
- package/internal/utils/api_fetch.js +2 -1
- package/internal/utils/viewer_call.js +2 -2
- package/package.json +3 -3
- package/tests/integration/stores/data_style/mesh/cells.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/mesh/edges.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/mesh/index.nuxt.test.js +3 -2
- package/tests/integration/stores/data_style/mesh/points.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/mesh/polygons.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/mesh/polyhedra.nuxt.test.js +12 -8
- package/tests/integration/stores/data_style/model/blocks.nuxt.test.js +6 -13
- package/tests/integration/stores/data_style/model/corners.nuxt.test.js +6 -13
- package/tests/integration/stores/data_style/model/edges.nuxt.test.js +3 -2
- package/tests/integration/stores/data_style/model/index.nuxt.test.js +3 -2
- package/tests/integration/stores/data_style/model/lines.nuxt.test.js +6 -13
- package/tests/integration/stores/data_style/model/points.nuxt.test.js +6 -4
- package/tests/integration/stores/data_style/model/surfaces.nuxt.test.js +6 -13
- package/tests/integration/stores/viewer.nuxt.test.js +1 -2
- package/tests/unit/components/CrsSelector.nuxt.test.js +1 -1
- package/tests/unit/components/Inspector/InspectionButton.nuxt.test.js +1 -1
- package/tests/unit/components/MissingFilesSelector.nuxt.test.js +1 -1
- package/tests/unit/composables/api_fetch.nuxt.test.js +5 -6
- package/tests/vitest.config.js +0 -1
|
@@ -38,11 +38,14 @@ function get_selected_crs(crs_code) {
|
|
|
38
38
|
async function get_crs_table() {
|
|
39
39
|
const params = { geode_object_type };
|
|
40
40
|
toggle_loading();
|
|
41
|
-
await backStore.request(
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
await backStore.request(
|
|
42
|
+
{ schema, params },
|
|
43
|
+
{
|
|
44
|
+
response_function: (response) => {
|
|
45
|
+
crs_list.value = response.crs_list;
|
|
46
|
+
},
|
|
44
47
|
},
|
|
45
|
-
|
|
48
|
+
);
|
|
46
49
|
toggle_loading();
|
|
47
50
|
}
|
|
48
51
|
|
|
@@ -22,10 +22,8 @@ async function get_output_file_extensions() {
|
|
|
22
22
|
const backStore = useBackStore();
|
|
23
23
|
const values = await Promise.all(
|
|
24
24
|
filenames.map(async (filename) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
filename,
|
|
28
|
-
});
|
|
25
|
+
const params = { geode_object_type, filename };
|
|
26
|
+
const response = await backStore.request({ schema, params });
|
|
29
27
|
return response.geode_objects_and_output_extensions;
|
|
30
28
|
}),
|
|
31
29
|
);
|
|
@@ -47,7 +47,7 @@ function files_uploaded_event(value) {
|
|
|
47
47
|
async function get_allowed_files() {
|
|
48
48
|
toggle_loading();
|
|
49
49
|
const backStore = useBackStore();
|
|
50
|
-
const response = await backStore.request(schema
|
|
50
|
+
const response = await backStore.request({ schema });
|
|
51
51
|
accept.value = response.extensions.map((extension) => `.${extension}`).join(",");
|
|
52
52
|
toggle_loading();
|
|
53
53
|
}
|
|
@@ -20,14 +20,17 @@ async function get_inspection_results() {
|
|
|
20
20
|
};
|
|
21
21
|
const backStore = useBackStore();
|
|
22
22
|
|
|
23
|
-
await backStore.request(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
await backStore.request(
|
|
24
|
+
{ schema, params },
|
|
25
|
+
{
|
|
26
|
+
response_function: (response) => {
|
|
27
|
+
emit("update_values", {
|
|
28
|
+
inspection_result: [response.inspection_result],
|
|
29
|
+
});
|
|
30
|
+
emit("increment_step");
|
|
31
|
+
},
|
|
29
32
|
},
|
|
30
|
-
|
|
33
|
+
);
|
|
31
34
|
toggle_loading();
|
|
32
35
|
}
|
|
33
36
|
</script>
|
|
@@ -28,6 +28,10 @@ function files_uploaded_event(value) {
|
|
|
28
28
|
emit("increment_step");
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
function isCsvFile(filename) {
|
|
32
|
+
return filename.toLowerCase().endsWith(".csv") || filename.toLowerCase().endsWith(".csv.json");
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
async function missing_files() {
|
|
32
36
|
toggle_loading();
|
|
33
37
|
has_missing_files.value = false;
|
|
@@ -36,16 +40,15 @@ async function missing_files() {
|
|
|
36
40
|
const backStore = useBackStore();
|
|
37
41
|
|
|
38
42
|
const promise_array = filenames.map((filename) => {
|
|
39
|
-
|
|
40
|
-
filename.toLowerCase().endsWith(".csv") || filename.toLowerCase().endsWith(".csv.json");
|
|
41
|
-
if (isCsvFile) {
|
|
43
|
+
if (isCsvFile(filename)) {
|
|
42
44
|
return Promise.resolve({
|
|
43
45
|
has_missing_files: false,
|
|
44
46
|
mandatory_files: [],
|
|
45
47
|
additional_files: [],
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
|
-
|
|
50
|
+
const params = { geode_object_type, filename };
|
|
51
|
+
return backStore.request({ schema, params });
|
|
49
52
|
});
|
|
50
53
|
const values = await Promise.all(promise_array);
|
|
51
54
|
for (const value of values) {
|
|
@@ -55,11 +58,7 @@ async function missing_files() {
|
|
|
55
58
|
mandatory_files.value = [...mandatory_files.value, ...value.mandatory_files];
|
|
56
59
|
additional_files.value = [...additional_files.value, ...value.additional_files];
|
|
57
60
|
}
|
|
58
|
-
const unconfigured_csvs = files.filter(
|
|
59
|
-
(file) =>
|
|
60
|
-
(file.name.toLowerCase().endsWith(".csv") || file.name.toLowerCase().endsWith(".csv.json")) &&
|
|
61
|
-
!file.isConfigured,
|
|
62
|
-
);
|
|
61
|
+
const unconfigured_csvs = files.filter((file) => isCsvFile(file.name) && !file.isConfigured);
|
|
63
62
|
if (unconfigured_csvs.length > 0) {
|
|
64
63
|
has_missing_files.value = true;
|
|
65
64
|
if (accept.value === "") {
|
|
@@ -49,12 +49,19 @@ function select_geode_object(object_map) {
|
|
|
49
49
|
return undefined;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
function isCsvFile(filename) {
|
|
53
|
+
return filename.toLowerCase().endsWith(".csv") || filename.toLowerCase().endsWith(".csv.json");
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
async function get_allowed_objects() {
|
|
53
57
|
toggle_loading();
|
|
54
58
|
allowed_objects.value = {};
|
|
55
59
|
multiple_files_no_common.value = false;
|
|
56
60
|
|
|
57
|
-
const promise_array = filenames.map((filename) =>
|
|
61
|
+
const promise_array = filenames.map((filename) => {
|
|
62
|
+
const params = { filename };
|
|
63
|
+
return backStore.request({ schema, params });
|
|
64
|
+
});
|
|
58
65
|
const responses = await Promise.all(promise_array);
|
|
59
66
|
const allowed_objects_list = responses.map((response) => response.allowed_objects);
|
|
60
67
|
const all_keys = [...new Set(allowed_objects_list.flatMap((obj) => Object.keys(obj)))];
|
|
@@ -75,10 +82,7 @@ async function get_allowed_objects() {
|
|
|
75
82
|
final_object[key].object_priority = Math.max(...priorities);
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
|
-
const isCsv = filenames.some(
|
|
79
|
-
(filename) =>
|
|
80
|
-
filename.toLowerCase().endsWith(".csv") || filename.toLowerCase().endsWith(".csv.json"),
|
|
81
|
-
);
|
|
85
|
+
const isCsv = filenames.some((filename) => isCsvFile(filename));
|
|
82
86
|
if (isCsv && !final_object["PointSet3D"]) {
|
|
83
87
|
final_object["PointSet3D"] = { is_loadable: 1, object_priority: 100 };
|
|
84
88
|
}
|
|
@@ -20,10 +20,9 @@ function get_x_y(event) {
|
|
|
20
20
|
if (viewerStore.picking_mode.value === true) {
|
|
21
21
|
const { offsetX, offsetY } = event;
|
|
22
22
|
viewerStore.set_picked_point(offsetX, offsetY);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
23
|
+
const schema = viewer_schemas.opengeodeweb_viewer.viewer.get_point_position;
|
|
24
|
+
const params = { x: offsetX, y: offsetY };
|
|
25
|
+
viewerStore.request({ schema, params });
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -23,12 +23,16 @@ async function takeScreenshot() {
|
|
|
23
23
|
const viewerStore = useViewerStore();
|
|
24
24
|
const feedbackStore = useFeedbackStore();
|
|
25
25
|
const current_filename = screenshot_type.value === "file" ? filename.value : "screenshot";
|
|
26
|
+
const schema = viewer_schemas.opengeodeweb_viewer.viewer.take_screenshot;
|
|
27
|
+
const params = {
|
|
28
|
+
filename: current_filename,
|
|
29
|
+
output_extension: output_extension.value,
|
|
30
|
+
include_background: include_background.value,
|
|
31
|
+
};
|
|
26
32
|
await viewerStore.request(
|
|
27
|
-
viewer_schemas.opengeodeweb_viewer.viewer.take_screenshot,
|
|
28
33
|
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
include_background: include_background.value,
|
|
34
|
+
schema,
|
|
35
|
+
params,
|
|
32
36
|
},
|
|
33
37
|
{
|
|
34
38
|
response_function: async (response) => {
|
|
@@ -118,9 +118,13 @@ const camera_options = computed(() => [
|
|
|
118
118
|
icon: "mdi-ruler-square",
|
|
119
119
|
color: grid_scale.value ? "primary" : undefined,
|
|
120
120
|
action: () => {
|
|
121
|
+
const schema = schemas.opengeodeweb_viewer.viewer.grid_scale;
|
|
122
|
+
const params = { visibility: !grid_scale.value };
|
|
121
123
|
viewerStore.request(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
{
|
|
125
|
+
schema,
|
|
126
|
+
params,
|
|
127
|
+
},
|
|
124
128
|
{
|
|
125
129
|
response_function: () => {
|
|
126
130
|
grid_scale.value = !grid_scale.value;
|
|
@@ -25,9 +25,10 @@ onMounted(() => {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
function getTextureCoordinates() {
|
|
28
|
+
const schema = back_schemas.opengeodeweb_back.texture_coordinates;
|
|
29
|
+
const params = { id };
|
|
28
30
|
backStore.request(
|
|
29
|
-
|
|
30
|
-
{ id },
|
|
31
|
+
{ schema, params },
|
|
31
32
|
{
|
|
32
33
|
response_function: (response) => {
|
|
33
34
|
texture_coordinates.value = response.texture_coordinates;
|
|
@@ -38,15 +39,13 @@ function getTextureCoordinates() {
|
|
|
38
39
|
|
|
39
40
|
async function files_uploaded_event(value) {
|
|
40
41
|
if (value.length > 0) {
|
|
42
|
+
const schema = back_schemas.opengeodeweb_back.save_viewable_file;
|
|
43
|
+
const params = {
|
|
44
|
+
geode_object_type: "RasterImage2D",
|
|
45
|
+
filename: value[0].name,
|
|
46
|
+
};
|
|
41
47
|
await backStore.request(
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
schema: back_schemas.opengeodeweb_back.save_viewable_file,
|
|
45
|
-
params: {
|
|
46
|
-
geode_object_type: "RasterImage2D",
|
|
47
|
-
filename: value[0].name,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
48
|
+
{ schema, params },
|
|
50
49
|
{
|
|
51
50
|
response_function: (response) => {
|
|
52
51
|
texture_id.value = response.id;
|
|
@@ -41,7 +41,7 @@ export function useHoverhighlight() {
|
|
|
41
41
|
...(type === "model" && { block_ids }),
|
|
42
42
|
};
|
|
43
43
|
try {
|
|
44
|
-
await viewerStore.request(schema, params);
|
|
44
|
+
await viewerStore.request({ schema, params });
|
|
45
45
|
} catch (error) {
|
|
46
46
|
console.error(`Highlight failed for ${type} ${id}:`, error);
|
|
47
47
|
}
|
|
@@ -67,7 +67,7 @@ export function useHoverhighlight() {
|
|
|
67
67
|
...(currentType === "model" && { block_ids: [] }),
|
|
68
68
|
};
|
|
69
69
|
try {
|
|
70
|
-
viewerStore.request(schema, params);
|
|
70
|
+
viewerStore.request({ schema, params });
|
|
71
71
|
} catch (error) {
|
|
72
72
|
console.error(`Unhighlight failed for ${currentType} ${id}:`, error);
|
|
73
73
|
}
|
|
@@ -43,12 +43,9 @@ async function importProject(file) {
|
|
|
43
43
|
if (client && client.getConnection && client.getConnection().getSession) {
|
|
44
44
|
await client.getConnection().getSession().call("opengeodeweb_viewer.release_database", [{}]);
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{},
|
|
50
|
-
undefined,
|
|
51
|
-
);
|
|
46
|
+
const schema = viewer_schemas.opengeodeweb_viewer.viewer.reset_visualization;
|
|
47
|
+
const timeout = undefined;
|
|
48
|
+
await viewerStore.request({ schema, timeout });
|
|
52
49
|
|
|
53
50
|
treeviewStore.clear();
|
|
54
51
|
dataStore.clear();
|
|
@@ -69,10 +69,13 @@ export function useOverlappingPicker() {
|
|
|
69
69
|
|
|
70
70
|
const result = { id: undefined, viewer_id: undefined };
|
|
71
71
|
let pickedResponse = undefined;
|
|
72
|
-
|
|
72
|
+
const schema = viewer_schemas.opengeodeweb_viewer.viewer.picked_ids;
|
|
73
|
+
const params = { x, y, ids };
|
|
73
74
|
await viewerStore.request(
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
{
|
|
76
|
+
schema,
|
|
77
|
+
params,
|
|
78
|
+
},
|
|
76
79
|
{
|
|
77
80
|
response_function: (response) => {
|
|
78
81
|
pickedResponse = response;
|
package/app/stores/app.js
CHANGED
|
@@ -217,13 +217,13 @@ export const useAppStore = defineStore("app", () => {
|
|
|
217
217
|
);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
function request(schema, params, callbacks = {}) {
|
|
220
|
+
function request({ schema, params }, callbacks = {}) {
|
|
221
221
|
console.log("[APP] Request:", schema.$id);
|
|
222
222
|
|
|
223
223
|
const store = useAppStore();
|
|
224
224
|
return api_fetch(
|
|
225
225
|
store,
|
|
226
|
-
{ schema, params },
|
|
226
|
+
{ schema, params, headers: {} },
|
|
227
227
|
{
|
|
228
228
|
...callbacks,
|
|
229
229
|
response_function: async (response) => {
|
|
@@ -256,12 +256,15 @@ export const useAppStore = defineStore("app", () => {
|
|
|
256
256
|
additionalProperties: true,
|
|
257
257
|
};
|
|
258
258
|
const params = { PROJECT };
|
|
259
|
-
return request(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
return request(
|
|
260
|
+
{ schema, params },
|
|
261
|
+
{
|
|
262
|
+
response_function: (response) => {
|
|
263
|
+
console.log(`[APP] ${response.projectFolderPath} created`);
|
|
264
|
+
projectFolderPath.value = response.projectFolderPath;
|
|
265
|
+
},
|
|
263
266
|
},
|
|
264
|
-
|
|
267
|
+
);
|
|
265
268
|
}
|
|
266
269
|
|
|
267
270
|
return {
|
package/app/stores/back.js
CHANGED
|
@@ -51,9 +51,9 @@ export const useBackStore = defineStore("back", {
|
|
|
51
51
|
},
|
|
52
52
|
ping() {
|
|
53
53
|
const feedbackStore = useFeedbackStore();
|
|
54
|
+
const schema = back_schemas.opengeodeweb_back.ping;
|
|
54
55
|
return this.request(
|
|
55
|
-
|
|
56
|
-
{},
|
|
56
|
+
{ schema },
|
|
57
57
|
{
|
|
58
58
|
request_error_function: () => {
|
|
59
59
|
feedbackStore.$patch({ server_error: true });
|
|
@@ -94,25 +94,28 @@ export const useBackStore = defineStore("back", {
|
|
|
94
94
|
const params = { COMMAND_BACK, NUXT_ROOT_PATH, args };
|
|
95
95
|
|
|
96
96
|
console.log("[GEODE] params", params);
|
|
97
|
-
return appStore.request(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
return appStore.request(
|
|
98
|
+
{ schema, params },
|
|
99
|
+
{
|
|
100
|
+
response_function: (response) => {
|
|
101
|
+
console.log(`[GEODE] Back launched on port ${response.port}`);
|
|
102
|
+
this.default_local_port = response.port;
|
|
103
|
+
},
|
|
101
104
|
},
|
|
102
|
-
|
|
105
|
+
);
|
|
103
106
|
},
|
|
104
107
|
connect() {
|
|
105
108
|
console.log("[GEODE] Connecting to geode microservice...");
|
|
106
109
|
this.set_ping();
|
|
107
110
|
return Promise.resolve();
|
|
108
111
|
},
|
|
109
|
-
request(schema, params, callbacks = {}) {
|
|
112
|
+
request({ schema, params = {} }, callbacks = {}) {
|
|
110
113
|
console.log("[GEODE] Request:", schema.$id);
|
|
111
114
|
const start = Date.now();
|
|
112
115
|
|
|
113
116
|
return api_fetch(
|
|
114
117
|
this,
|
|
115
|
-
{ schema, params },
|
|
118
|
+
{ schema, params, headers: {} },
|
|
116
119
|
{
|
|
117
120
|
...callbacks,
|
|
118
121
|
response_function: async (response) => {
|
|
@@ -154,8 +157,7 @@ export const useBackStore = defineStore("back", {
|
|
|
154
157
|
return;
|
|
155
158
|
}
|
|
156
159
|
return this.request(
|
|
157
|
-
schema,
|
|
158
|
-
{},
|
|
160
|
+
{ schema },
|
|
159
161
|
{
|
|
160
162
|
response_function: (response) => {
|
|
161
163
|
this.version = response.microservice_version;
|
|
@@ -32,9 +32,9 @@ export const useCameraManagerStore = defineStore("camera_manager", () => {
|
|
|
32
32
|
async function restoreCameraPosition(id) {
|
|
33
33
|
const position = await camera_positions_db.get(id);
|
|
34
34
|
if (position) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
35
|
+
const schema = viewer_schemas.opengeodeweb_viewer.viewer.update_camera;
|
|
36
|
+
const params = { camera_options: position.camera_options };
|
|
37
|
+
await viewerStore.request({ schema, params });
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
package/app/stores/cloud.js
CHANGED
|
@@ -31,25 +31,28 @@ export const useCloudStore = defineStore("cloud", {
|
|
|
31
31
|
console.log("[CLOUD] params", params);
|
|
32
32
|
const appStore = useAppStore();
|
|
33
33
|
const feedbackStore = useFeedbackStore();
|
|
34
|
-
return appStore.request(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
return appStore.request(
|
|
35
|
+
{ schema, params },
|
|
36
|
+
{
|
|
37
|
+
request_error_function: () => {
|
|
38
|
+
feedbackStore.$patch({ server_error: true });
|
|
39
|
+
this.status = Status.NOT_CONNECTED;
|
|
40
|
+
},
|
|
41
|
+
response_function: (response) => {
|
|
42
|
+
feedbackStore.$patch({ server_error: false });
|
|
43
|
+
console.log(`[CLOUD] Cloud launched on ${response.url}`);
|
|
44
|
+
this.status = Status.CONNECTED;
|
|
45
|
+
const infraStore = useInfraStore();
|
|
46
|
+
infraStore.$patch({
|
|
47
|
+
domain_name: response.url,
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
response_error_function: () => {
|
|
51
|
+
feedbackStore.$patch({ server_error: true });
|
|
52
|
+
this.status = Status.NOT_CONNECTED;
|
|
53
|
+
},
|
|
38
54
|
},
|
|
39
|
-
|
|
40
|
-
feedbackStore.$patch({ server_error: false });
|
|
41
|
-
console.log(`[CLOUD] Cloud launched on ${response.url}`);
|
|
42
|
-
this.status = Status.CONNECTED;
|
|
43
|
-
const infraStore = useInfraStore();
|
|
44
|
-
infraStore.$patch({
|
|
45
|
-
domain_name: response.url,
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
response_error_function: () => {
|
|
49
|
-
feedbackStore.$patch({ server_error: true });
|
|
50
|
-
this.status = Status.NOT_CONNECTED;
|
|
51
|
-
},
|
|
52
|
-
});
|
|
55
|
+
);
|
|
53
56
|
},
|
|
54
57
|
connect() {
|
|
55
58
|
console.log("[CLOUD] Cloud connected");
|
package/app/stores/data.js
CHANGED
|
@@ -74,11 +74,15 @@ export const useDataStore = defineStore("data", () => {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
async function registerObject(id) {
|
|
77
|
-
|
|
77
|
+
const schema = viewer_generic_schemas.register;
|
|
78
|
+
const params = { id };
|
|
79
|
+
return await viewerStore.request({ schema, params });
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
async function deregisterObject(id) {
|
|
81
|
-
|
|
83
|
+
const schema = viewer_generic_schemas.deregister;
|
|
84
|
+
const params = { id };
|
|
85
|
+
return await viewerStore.request({ schema, params });
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
function addItem(new_item) {
|
|
@@ -2,6 +2,16 @@ import {
|
|
|
2
2
|
ACTOR_COLOR,
|
|
3
3
|
BACKGROUND_COLOR,
|
|
4
4
|
WHEEL_TIME_OUT_MS,
|
|
5
|
+
} from "@ogw_internal/stores/hybrid_viewer_constants";
|
|
6
|
+
import {
|
|
7
|
+
applySnapshot,
|
|
8
|
+
getCameraOptions,
|
|
9
|
+
performCameraOrientation,
|
|
10
|
+
performFocusCameraOnObject,
|
|
11
|
+
performSetCamera,
|
|
12
|
+
performSyncRemoteCamera,
|
|
13
|
+
} from "@ogw_internal/stores/hybrid_viewer_camera";
|
|
14
|
+
import {
|
|
5
15
|
computeAverageBrightness,
|
|
6
16
|
performAddItem,
|
|
7
17
|
performClear,
|
|
@@ -12,14 +22,6 @@ import {
|
|
|
12
22
|
performSetVisibility,
|
|
13
23
|
performSetZScaling,
|
|
14
24
|
} from "@ogw_internal/stores/hybrid_viewer";
|
|
15
|
-
import {
|
|
16
|
-
applySnapshot,
|
|
17
|
-
getCameraOptions,
|
|
18
|
-
performCameraOrientation,
|
|
19
|
-
performFocusCameraOnObject,
|
|
20
|
-
performSetCamera,
|
|
21
|
-
performSyncRemoteCamera,
|
|
22
|
-
} from "@ogw_internal/stores/hybrid_viewer_camera";
|
|
23
25
|
import {
|
|
24
26
|
createClearHoverData,
|
|
25
27
|
createHoverHighlight,
|
|
@@ -35,7 +37,7 @@ import { useViewerStore } from "@ogw_front/stores/viewer";
|
|
|
35
37
|
|
|
36
38
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
|
|
37
39
|
|
|
38
|
-
// oxlint-disable max-lines-per-function max-statements
|
|
40
|
+
// oxlint-disable max-lines-per-function, max-statements
|
|
39
41
|
export const useHybridViewerStore = defineStore("hybridViewer", () => {
|
|
40
42
|
const dataStore = useDataStore();
|
|
41
43
|
const hybridDb = reactive({});
|
|
@@ -183,7 +185,8 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
|
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
function remoteRender() {
|
|
186
|
-
|
|
188
|
+
const schema = viewer_schemas.opengeodeweb_viewer.viewer.render;
|
|
189
|
+
return viewerStore.request({ schema });
|
|
187
190
|
}
|
|
188
191
|
|
|
189
192
|
const hoverTimeoutRef = ref(undefined);
|
package/app/stores/viewer.js
CHANGED
|
@@ -20,7 +20,7 @@ const request_timeout = MS_PER_SECOND * SECONDS_PER_REQUEST;
|
|
|
20
20
|
|
|
21
21
|
export const useViewerStore = defineStore(
|
|
22
22
|
"viewer",
|
|
23
|
-
// oxlint-disable-next-line max-lines-per-function max-statements
|
|
23
|
+
// oxlint-disable-next-line max-lines-per-function, max-statements
|
|
24
24
|
() => {
|
|
25
25
|
const infraStore = useInfraStore();
|
|
26
26
|
const default_local_port = ref("1234");
|
|
@@ -63,10 +63,9 @@ export const useViewerStore = defineStore(
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
async function set_picked_point(x, y) {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
66
|
+
const schema = schemas.opengeodeweb_viewer.viewer.get_point_position;
|
|
67
|
+
const params = { x: Math.round(x), y: Math.round(y) };
|
|
68
|
+
const response = await request({ schema, params });
|
|
70
69
|
const { x: world_x, y: world_y, z: world_z } = response;
|
|
71
70
|
picked_point.value = { x: world_x, y: world_y, z: world_z };
|
|
72
71
|
}
|
|
@@ -108,7 +107,9 @@ export const useViewerStore = defineStore(
|
|
|
108
107
|
});
|
|
109
108
|
connectImageStream(client.value.getConnection().getSession());
|
|
110
109
|
client.value.endBusy();
|
|
111
|
-
|
|
110
|
+
const schema = schemas.opengeodeweb_viewer.viewer.reset_visualization;
|
|
111
|
+
const timeout = undefined;
|
|
112
|
+
await request({ schema, timeout });
|
|
112
113
|
status.value = Status.CONNECTED;
|
|
113
114
|
} catch (error) {
|
|
114
115
|
console.error("ws_connect error", error);
|
|
@@ -143,12 +144,15 @@ export const useViewerStore = defineStore(
|
|
|
143
144
|
const params = { COMMAND_VIEWER, NUXT_ROOT_PATH, args };
|
|
144
145
|
console.log("[VIEWER] params", params);
|
|
145
146
|
|
|
146
|
-
return appStore.request(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
return appStore.request(
|
|
148
|
+
{ schema, params },
|
|
149
|
+
{
|
|
150
|
+
response_function: (response) => {
|
|
151
|
+
console.log(`[VIEWER] Viewer launched on port ${response.port}`);
|
|
152
|
+
default_local_port.value = response.port;
|
|
153
|
+
},
|
|
150
154
|
},
|
|
151
|
-
|
|
155
|
+
);
|
|
152
156
|
}
|
|
153
157
|
|
|
154
158
|
async function connect() {
|
|
@@ -157,7 +161,7 @@ export const useViewerStore = defineStore(
|
|
|
157
161
|
console.log("[VIEWER] Viewer connected successfully");
|
|
158
162
|
}
|
|
159
163
|
|
|
160
|
-
function request(schema, params = {},
|
|
164
|
+
function request({ schema, params = {}, timeout = request_timeout }, callbacks = {}) {
|
|
161
165
|
console.log("[VIEWER] Request:", schema.$id);
|
|
162
166
|
const start = Date.now();
|
|
163
167
|
|
|
@@ -166,7 +170,7 @@ export const useViewerStore = defineStore(
|
|
|
166
170
|
|
|
167
171
|
return viewer_call(
|
|
168
172
|
store,
|
|
169
|
-
{ schema, params },
|
|
173
|
+
{ schema, params, timeout },
|
|
170
174
|
{
|
|
171
175
|
...callbacks,
|
|
172
176
|
response_function: async (response) => {
|
|
@@ -182,7 +186,6 @@ export const useViewerStore = defineStore(
|
|
|
182
186
|
}
|
|
183
187
|
},
|
|
184
188
|
},
|
|
185
|
-
timeout,
|
|
186
189
|
);
|
|
187
190
|
}
|
|
188
191
|
|
|
@@ -191,8 +194,7 @@ export const useViewerStore = defineStore(
|
|
|
191
194
|
return;
|
|
192
195
|
}
|
|
193
196
|
return request(
|
|
194
|
-
schema,
|
|
195
|
-
{},
|
|
197
|
+
{ schema },
|
|
196
198
|
{
|
|
197
199
|
response_function: (response) => {
|
|
198
200
|
version.value = response.microservice_version;
|
package/app/utils/extension.js
CHANGED
|
@@ -83,11 +83,12 @@ async function importItem(item) {
|
|
|
83
83
|
|
|
84
84
|
async function importFile(filename, geode_object_type) {
|
|
85
85
|
const backStore = useBackStore();
|
|
86
|
-
const
|
|
86
|
+
const schema = back_schemas.opengeodeweb_back.save_viewable_file;
|
|
87
|
+
const params = {
|
|
87
88
|
geode_object_type,
|
|
88
89
|
filename,
|
|
89
|
-
}
|
|
90
|
-
|
|
90
|
+
};
|
|
91
|
+
const response = await backStore.request({ schema, params });
|
|
91
92
|
const item = buildImportItemFromPayloadApi(response, geode_object_type);
|
|
92
93
|
return importItem(item);
|
|
93
94
|
}
|