@geode/opengeodeweb-front 10.44.0-rc.1 → 10.44.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/.build/server/utils/cleanup.js +7 -2
- package/.build/server/utils/microservices.js +5 -1
- package/.build/server/utils/typed_handler.js +5 -1
- package/.build/server/utils/ws_client.js +7 -2
- package/.build/shared/utils/fetch_raw.js +2 -2
- package/.build/shared/utils/parse_boolean.js +2 -1
- package/app/components/ClippingPlanes.vue +14 -4
- package/app/components/DragAndDrop.vue +18 -8
- package/app/components/FileSelector.vue +9 -6
- package/app/components/HybridViewerTooltip.vue +8 -2
- package/app/components/MissingFilesSelector.vue +10 -6
- package/app/components/ObjectSelector.vue +6 -3
- package/app/components/Screenshot.vue +9 -2
- package/app/components/ThresholdFilter.vue +5 -1
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +14 -12
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +14 -12
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +15 -15
- package/app/components/Viewer/Generic/Model/ModelCardTabs.vue +35 -0
- package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +34 -25
- package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +34 -25
- package/app/components/Viewer/Generic/Model/ModelStyleCard.vue +17 -5
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +16 -12
- package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +4 -1
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +6 -1
- package/app/components/Viewer/Options/AttributeRangeSelector.vue +11 -4
- package/app/components/Viewer/Options/AttributeSelector.vue +24 -13
- package/app/components/Viewer/Options/ColorPicker.vue +4 -1
- package/app/components/Viewer/Options/ColormapQuickPicker.vue +13 -7
- package/app/components/csv-preview/CsvPreviewer.vue +4 -1
- package/app/composables/attribute_coloring_style.ts +8 -2
- package/app/composables/global_attribute_style.ts +4 -3
- package/app/composables/hover_highlight.ts +6 -5
- package/app/composables/model_tabs.ts +86 -0
- package/app/composables/project_manager.ts +5 -5
- package/app/composables/stepper_tree.ts +10 -2
- package/app/composables/tree_filter.ts +11 -2
- package/app/composables/tree_keyboard_nav.ts +4 -2
- package/app/composables/use_overlapping_picker.ts +5 -5
- package/app/composables/virtual_tree.ts +14 -7
- package/app/stores/app_helpers/extension.ts +1 -1
- package/app/stores/feedback.ts +2 -2
- package/app/stores/hybrid_viewer.ts +1 -1
- package/app/stores/treeview.ts +17 -10
- package/app/utils/clipping_planes.ts +4 -3
- package/app/utils/extension.ts +1 -1
- package/app/utils/import_workflow.ts +6 -4
- package/app/utils/upload_path.ts +15 -9
- package/internal/database/database.ts +4 -1
- package/internal/stores/data_style/model/blocks/polyhedron.ts +14 -10
- package/internal/stores/data_style/model/blocks/vertex.ts +14 -10
- package/internal/stores/data_style/model/corners/vertex.ts +14 -10
- package/internal/stores/data_style/model/lines/edge.ts +14 -10
- package/internal/stores/data_style/model/lines/vertex.ts +14 -10
- package/internal/stores/data_style/model/surfaces/polygon.ts +14 -10
- package/internal/stores/data_style/model/surfaces/vertex.ts +14 -10
- package/internal/stores/hybrid_viewer/brightness.ts +8 -2
- package/internal/stores/hybrid_viewer/camera_animation.ts +4 -3
- package/internal/stores/hybrid_viewer/highlight.ts +10 -9
- package/internal/stores/hybrid_viewer/ruler.ts +4 -3
- package/internal/utils/ws_client.ts +8 -1
- package/package.json +2 -2
- package/server/api/local/extensions/run.post.ts +6 -4
- package/server/utils/cleanup.ts +12 -2
- package/server/utils/microservices.ts +11 -4
- package/server/utils/typed_handler.ts +8 -1
- package/server/utils/ws_client.ts +15 -2
- package/shared/utils/fetch_raw.ts +2 -2
- package/shared/utils/parse_boolean.ts +4 -1
- package/app/components/Viewer/Options/OptionsSection.vue +0 -76
|
@@ -97,13 +97,19 @@ function computeAverageBrightness(rect: Rect, options: BrightnessOptions): numbe
|
|
|
97
97
|
return BACKGROUND_GREY_VALUE / RGB_MAX;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
function createOffscreenCanvas(): HTMLCanvasElement | undefined {
|
|
101
|
+
if (typeof document === "undefined") {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
return document.createElement("canvas");
|
|
105
|
+
}
|
|
106
|
+
|
|
100
107
|
function useHybridViewerBrightness(): {
|
|
101
108
|
latestImage: Ref<DrawableImage | undefined>;
|
|
102
109
|
getAverageBrightness: (rect: Rect) => number;
|
|
103
110
|
} {
|
|
104
111
|
const latestImage = ref<DrawableImage | undefined>(undefined);
|
|
105
|
-
const offscreenCanvas: HTMLCanvasElement | undefined =
|
|
106
|
-
typeof document === "undefined" ? undefined : document.createElement("canvas");
|
|
112
|
+
const offscreenCanvas: HTMLCanvasElement | undefined = createOffscreenCanvas();
|
|
107
113
|
const offscreenCtx: CanvasRenderingContext2D | undefined = offscreenCanvas
|
|
108
114
|
? (offscreenCanvas.getContext("2d", {
|
|
109
115
|
willReadFrequently: true,
|
|
@@ -37,9 +37,10 @@ function slerp(from: Vector3, target: Vector3, ratio: number, mid?: Vector3): Ve
|
|
|
37
37
|
]);
|
|
38
38
|
}
|
|
39
39
|
if (dotProduct < -SLERP_LINEAR_THRESHOLD && mid) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
if (ratio < MID_ANIMATION_RATIO) {
|
|
41
|
+
return slerp(normFrom, mid, ratio * 2);
|
|
42
|
+
}
|
|
43
|
+
return slerp(mid, normTarget, (ratio - MID_ANIMATION_RATIO) * 2);
|
|
43
44
|
}
|
|
44
45
|
const theta = Math.acos(dotProduct);
|
|
45
46
|
const sinTheta = Math.sin(theta);
|
|
@@ -70,15 +70,16 @@ const useHybridViewerHighlight = createSharedComposable(() => {
|
|
|
70
70
|
const hoverHighlight = useDebounceFn((event: MouseEvent) => {
|
|
71
71
|
const { genericRenderWindow } = useHybridViewerCore();
|
|
72
72
|
const containerElement = genericRenderWindow.value?.getContainer();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
let relativeMousePosition = {
|
|
74
|
+
x: event.clientX,
|
|
75
|
+
y: event.clientY,
|
|
76
|
+
};
|
|
77
|
+
if (containerElement) {
|
|
78
|
+
relativeMousePosition = {
|
|
79
|
+
x: event.clientX - containerElement.getBoundingClientRect().left,
|
|
80
|
+
y: event.clientY - containerElement.getBoundingClientRect().top,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
82
83
|
requestHoverHighlight(event, async (response) => {
|
|
83
84
|
if (
|
|
84
85
|
!is_hover_highlight.value ||
|
|
@@ -59,9 +59,10 @@ function useHybridViewerRuler(): {
|
|
|
59
59
|
if (!ruler_point1.value) {
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const points =
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
const points = [ruler_point1.value];
|
|
63
|
+
if (ruler_point2.value) {
|
|
64
|
+
points.push(ruler_point2.value);
|
|
65
|
+
}
|
|
65
66
|
const { remoteRender } = useHybridViewerCore();
|
|
66
67
|
const viewerStore = useViewerStore();
|
|
67
68
|
const schema = viewer_schemas.opengeodeweb_viewer.viewer.ruler;
|
|
@@ -25,13 +25,20 @@ function isVtkWSLinkClient(value: unknown): value is VtkWSLinkClient {
|
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
function resolveClient(initialClient: unknown): VtkWSLinkClient {
|
|
29
|
+
if (isVtkWSLinkClient(initialClient)) {
|
|
30
|
+
return initialClient;
|
|
31
|
+
}
|
|
32
|
+
return newInstance();
|
|
33
|
+
}
|
|
34
|
+
|
|
28
35
|
async function initWebSocketClient(
|
|
29
36
|
baseUrl: string,
|
|
30
37
|
initialClient: unknown = {},
|
|
31
38
|
{ onConnectionClose }: WsClientCallbacks = {},
|
|
32
39
|
): Promise<VtkWSLinkClient> {
|
|
33
40
|
vtkWSLinkClient.setSmartConnectClass(SmartConnect);
|
|
34
|
-
const client =
|
|
41
|
+
const client = resolveClient(initialClient);
|
|
35
42
|
|
|
36
43
|
client.onConnectionError((httpReq: WsConnectionEvent) => {
|
|
37
44
|
const message = httpReq.response?.error ?? "Connection error";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.44.0-rc.
|
|
3
|
+
"version": "10.44.0-rc.3",
|
|
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": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"lint": "oxlint --fix .",
|
|
53
|
-
"prepare:types": "cross-env MODE=BROWSER nuxi prepare",
|
|
53
|
+
"prepare:types": "cross-env MODE=BROWSER npx nuxi prepare",
|
|
54
54
|
"build:back": "npx opengeodeweb-microservice-pyinstaller ../OpenGeodeWeb-Back",
|
|
55
55
|
"build:viewer": "npx opengeodeweb-microservice-pyinstaller ../OpenGeodeWeb-Viewer",
|
|
56
56
|
"build:microservices": "concurrently \"npm run build:back\" \"npm run build:viewer\"",
|
|
@@ -55,10 +55,12 @@ async function runSingleExtension(
|
|
|
55
55
|
port,
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
let serverPort: number | undefined = undefined;
|
|
59
|
+
if (server !== undefined) {
|
|
60
|
+
serverPort = await runExtensionServer(
|
|
61
|
+
extensionServerEntryPath(unzippedExtensionPath, server.entry),
|
|
62
|
+
);
|
|
63
|
+
}
|
|
62
64
|
if (serverPort !== undefined) {
|
|
63
65
|
setExtensionServerPort(id, serverPort);
|
|
64
66
|
}
|
package/server/utils/cleanup.ts
CHANGED
|
@@ -56,6 +56,13 @@ function isErrorWithMessage(error: unknown): error is { message: string } {
|
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
function describeError(error: unknown): string {
|
|
60
|
+
if (isErrorWithMessage(error)) {
|
|
61
|
+
return error.message;
|
|
62
|
+
}
|
|
63
|
+
return String(error);
|
|
64
|
+
}
|
|
65
|
+
|
|
59
66
|
async function killHttpMicroservice(microservice: Microservice): Promise<void> {
|
|
60
67
|
consola.debug("killHttpMicroservice", {
|
|
61
68
|
...microservice,
|
|
@@ -70,7 +77,7 @@ async function killHttpMicroservice(microservice: Microservice): Promise<void> {
|
|
|
70
77
|
method: microservice.method,
|
|
71
78
|
});
|
|
72
79
|
} catch (error) {
|
|
73
|
-
const message =
|
|
80
|
+
const message = describeError(error);
|
|
74
81
|
consola.info(`Expected error during kill of ${microservice.name}:`, message);
|
|
75
82
|
}
|
|
76
83
|
}
|
|
@@ -180,7 +187,10 @@ function getMicroserviceByName(
|
|
|
180
187
|
name: string,
|
|
181
188
|
): Microservice | undefined {
|
|
182
189
|
const found = microservices.find((microservice) => microservice.name === name);
|
|
183
|
-
|
|
190
|
+
if (found === undefined) {
|
|
191
|
+
return undefined;
|
|
192
|
+
}
|
|
193
|
+
return { ...found };
|
|
184
194
|
}
|
|
185
195
|
|
|
186
196
|
export {
|
|
@@ -63,15 +63,22 @@ function isPortInUseError(error: unknown): boolean {
|
|
|
63
63
|
return /EADDRINUSE|address already in use|port already in use/iu.test(String(error));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
function resolveUploadFolderPath(
|
|
67
|
+
projectFolderPath: string,
|
|
68
|
+
uploadFolderPath: string | undefined,
|
|
69
|
+
): string {
|
|
70
|
+
if (uploadFolderPath !== undefined && uploadFolderPath !== "") {
|
|
71
|
+
return uploadFolderPath;
|
|
72
|
+
}
|
|
73
|
+
return path.join(projectFolderPath, "uploads");
|
|
74
|
+
}
|
|
75
|
+
|
|
66
76
|
function backArgs(args: RunArgs, port: number): string[] {
|
|
67
77
|
const { projectFolderPath } = args;
|
|
68
78
|
if (!projectFolderPath) {
|
|
69
79
|
throw new Error("projectFolderPath is required");
|
|
70
80
|
}
|
|
71
|
-
const uploadFolderPath =
|
|
72
|
-
args.uploadFolderPath !== undefined && args.uploadFolderPath !== ""
|
|
73
|
-
? args.uploadFolderPath
|
|
74
|
-
: path.join(projectFolderPath, "uploads");
|
|
81
|
+
const uploadFolderPath = resolveUploadFolderPath(projectFolderPath, args.uploadFolderPath);
|
|
75
82
|
const executableArgs = [
|
|
76
83
|
"--port",
|
|
77
84
|
String(port),
|
|
@@ -27,6 +27,13 @@ const INTERNAL_SERVER_ERROR = 500;
|
|
|
27
27
|
type RouteSchema = JsonRpcSchema & { readonly response?: object };
|
|
28
28
|
|
|
29
29
|
// Same body as the Flask microservices' errors, so the client reads every error the same way
|
|
30
|
+
function describeError(error: unknown): string {
|
|
31
|
+
if (error instanceof Error) {
|
|
32
|
+
return error.message;
|
|
33
|
+
}
|
|
34
|
+
return String(error);
|
|
35
|
+
}
|
|
36
|
+
|
|
30
37
|
function toErrorResponse(error: unknown): ErrorResponse {
|
|
31
38
|
if (isError(error)) {
|
|
32
39
|
return {
|
|
@@ -38,7 +45,7 @@ function toErrorResponse(error: unknown): ErrorResponse {
|
|
|
38
45
|
return {
|
|
39
46
|
code: INTERNAL_SERVER_ERROR,
|
|
40
47
|
name: "Internal Server Error",
|
|
41
|
-
description:
|
|
48
|
+
description: describeError(error),
|
|
42
49
|
};
|
|
43
50
|
}
|
|
44
51
|
|
|
@@ -31,7 +31,20 @@ function rawDataToBlob(raw: WebSocket.RawData): Blob {
|
|
|
31
31
|
if (raw instanceof ArrayBuffer) {
|
|
32
32
|
return new Blob([raw]);
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
if (Array.isArray(raw)) {
|
|
35
|
+
return new Blob([Uint8Array.from(Buffer.concat(raw))]);
|
|
36
|
+
}
|
|
37
|
+
return new Blob([Uint8Array.from(raw)]);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function findPendingCall(
|
|
41
|
+
pending: ReadonlyMap<string, PendingCall>,
|
|
42
|
+
id: string | undefined,
|
|
43
|
+
): PendingCall | undefined {
|
|
44
|
+
if (id === undefined) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
return pending.get(id);
|
|
35
48
|
}
|
|
36
49
|
|
|
37
50
|
interface ServerWsRpcClient {
|
|
@@ -98,7 +111,7 @@ function createServerWsRpcClient(baseUrl: string): ServerWsRpcClient {
|
|
|
98
111
|
return;
|
|
99
112
|
}
|
|
100
113
|
|
|
101
|
-
const entry =
|
|
114
|
+
const entry = findPendingCall(pending, message.id);
|
|
102
115
|
if (!entry || message.id === undefined) {
|
|
103
116
|
return;
|
|
104
117
|
}
|
|
@@ -58,8 +58,8 @@ async function performFetch({
|
|
|
58
58
|
baseURL,
|
|
59
59
|
method,
|
|
60
60
|
headers,
|
|
61
|
-
...(hasBody(params)
|
|
62
|
-
...(max_retry
|
|
61
|
+
...(hasBody(params) && { body: params }),
|
|
62
|
+
...(max_retry !== undefined && { retry: max_retry }),
|
|
63
63
|
async onRequestError({ error }: { error: unknown }) {
|
|
64
64
|
if (request_error_function) {
|
|
65
65
|
await request_error_function(error);
|
|
@@ -2,7 +2,10 @@ const TRUTHY_VALUES = new Set([true, 1, "1", "true", "yes"]);
|
|
|
2
2
|
const FALSY_VALUES = new Set([false, 0, "0", "false", "no"]);
|
|
3
3
|
|
|
4
4
|
function parseBoolean(value: string | number | boolean): boolean {
|
|
5
|
-
|
|
5
|
+
let normalized: string | number | boolean = value;
|
|
6
|
+
if (typeof value === "string") {
|
|
7
|
+
normalized = value.trim().toLowerCase();
|
|
8
|
+
}
|
|
6
9
|
|
|
7
10
|
if (TRUTHY_VALUES.has(normalized)) {
|
|
8
11
|
return true;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
interface Props {
|
|
3
|
-
title: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
const { title } = defineProps<Props>();
|
|
7
|
-
|
|
8
|
-
const isCollapsed = ref<boolean>(false);
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<div class="options-section">
|
|
13
|
-
<div class="section-badge" @click="isCollapsed = !isCollapsed">
|
|
14
|
-
{{ title }}
|
|
15
|
-
<v-icon class="collapse-icon" :class="{ rotated: isCollapsed }" size="12">
|
|
16
|
-
mdi-chevron-down
|
|
17
|
-
</v-icon>
|
|
18
|
-
</div>
|
|
19
|
-
<v-container v-show="!isCollapsed" class="pa-0">
|
|
20
|
-
<slot />
|
|
21
|
-
</v-container>
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<style scoped>
|
|
26
|
-
.options-section {
|
|
27
|
-
position: relative;
|
|
28
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
29
|
-
border-radius: 8px;
|
|
30
|
-
padding: 8px 4px 6px 4px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.section-badge {
|
|
34
|
-
position: absolute;
|
|
35
|
-
top: -10px;
|
|
36
|
-
left: 12px;
|
|
37
|
-
background-color: rgba(255, 255, 255, 0.1);
|
|
38
|
-
backdrop-filter: blur(8px);
|
|
39
|
-
padding: 1px 8px;
|
|
40
|
-
font-size: 0.65rem;
|
|
41
|
-
font-weight: 700;
|
|
42
|
-
text-transform: uppercase;
|
|
43
|
-
letter-spacing: 0.5px;
|
|
44
|
-
color: white;
|
|
45
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
46
|
-
border-radius: 20px;
|
|
47
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
user-select: none;
|
|
50
|
-
display: flex;
|
|
51
|
-
align-items: center;
|
|
52
|
-
gap: 4px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.section-badge:hover {
|
|
56
|
-
background-color: rgba(255, 255, 255, 0.2);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.collapse-icon {
|
|
60
|
-
transition: transform 0.2s ease;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.collapse-icon.rotated {
|
|
64
|
-
transform: rotate(-90deg);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.v-theme--light .options-section {
|
|
68
|
-
border-color: rgba(0, 0, 0, 0.12);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.v-theme--light .section-badge {
|
|
72
|
-
background-color: white;
|
|
73
|
-
color: #444;
|
|
74
|
-
border-color: rgba(0, 0, 0, 0.12);
|
|
75
|
-
}
|
|
76
|
-
</style>
|