@geode/opengeodeweb-front 10.35.0-rc.5 → 10.35.0
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/app_config.js +4 -3
- package/.build/server/utils/cleanup.js +17 -16
- package/.build/server/utils/cloud.js +2 -1
- package/.build/server/utils/microservices.js +12 -11
- package/.build/server/utils/path.js +12 -11
- package/.build/server/utils/scripts.js +12 -11
- package/.build/server/utils/server.js +4 -3
- package/.build/shared/scripts.js +6 -5
- package/.build/shared/utils/call_schema.js +2 -1
- package/.build/shared/utils/fetch_schema.js +2 -1
- package/.build/shared/utils/file.js +2 -1
- package/app/components/InfraConnected.vue +0 -1
- package/app/components/Viewer/ContextMenu/InfoCard.vue +2 -1
- package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +2 -1
- package/app/composables/hover_highlight.ts +3 -2
- package/app/composables/project_manager.ts +0 -1
- package/app/composables/run_function_when_microservices_connected.ts +0 -2
- package/app/composables/use_adaptive_styles.ts +2 -1
- package/app/composables/use_quick_colormap.ts +2 -1
- package/app/plugins/consola_plain_logs.client.ts +46 -0
- package/app/stores/api.ts +3 -2
- package/app/stores/app.ts +3 -1
- package/app/stores/app_helpers/extension.ts +8 -7
- package/app/stores/treeview.ts +3 -2
- package/app/utils/cloud.ts +4 -2
- package/app/utils/extension.ts +7 -6
- package/app/utils/import_workflow.ts +3 -2
- package/app/utils/log.ts +3 -2
- package/internal/utils/api_fetch.ts +2 -1
- package/internal/utils/upload_file.ts +2 -1
- package/internal/utils/ws_client.ts +3 -2
- package/nuxt.config.ts +2 -0
- package/package.json +5 -4
- package/server/api/cloud/extensions/run.post.ts +3 -2
- package/server/api/local/app/kill.post.ts +2 -1
- package/server/api/local/app/project_folder_path.post.ts +2 -1
- package/server/api/local/app/run_back.post.ts +2 -1
- package/server/api/local/app/run_viewer.post.ts +2 -1
- package/server/api/local/extensions/kill.post.ts +3 -2
- package/server/api/local/extensions/run.post.ts +2 -2
- package/server/api/microservice/app/get_is_app_ready.get.ts +3 -2
- package/server/api/microservice/app/set_app_base_url.post.ts +3 -2
- package/server/api/microservice/app/set_back_base_url.post.ts +2 -1
- package/server/api/microservice/app/set_is_app_ready.post.ts +3 -2
- package/server/api/microservice/app/set_viewer_base_url.post.ts +2 -1
- package/server/api/microservice/extensions/download.post.ts +3 -2
- package/server/utils/app_config.ts +4 -3
- package/server/utils/cleanup.ts +17 -16
- package/server/utils/cloud.ts +3 -1
- package/server/utils/extension.ts +4 -3
- package/server/utils/microservices.ts +12 -11
- package/server/utils/path.ts +12 -11
- package/server/utils/scripts.ts +12 -11
- package/server/utils/server.ts +4 -3
- package/shared/scripts.ts +6 -5
- package/shared/utils/call_schema.ts +2 -1
- package/shared/utils/fetch_schema.ts +3 -1
- package/shared/utils/file.ts +2 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type LogObject, consola } from "consola";
|
|
2
|
+
|
|
3
|
+
const WARN_LEVEL = 1;
|
|
4
|
+
|
|
5
|
+
function consoleMethod(level: number): "error" | "warn" | "log" {
|
|
6
|
+
if (level < WARN_LEVEL) {
|
|
7
|
+
return "error";
|
|
8
|
+
}
|
|
9
|
+
if (level === WARN_LEVEL) {
|
|
10
|
+
return "warn";
|
|
11
|
+
}
|
|
12
|
+
return "log";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function formatArgument(argument: unknown): string {
|
|
16
|
+
if (typeof argument === "string") {
|
|
17
|
+
return argument;
|
|
18
|
+
}
|
|
19
|
+
if (argument instanceof Error) {
|
|
20
|
+
return argument.stack ?? argument.message;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
return JSON.stringify(argument) ?? String(argument);
|
|
24
|
+
} catch {
|
|
25
|
+
return String(argument);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function plainLog(logObject: LogObject): void {
|
|
30
|
+
const line = `[${logObject.type}] ${logObject.args.map(formatArgument).join(" ")}`;
|
|
31
|
+
// Consola's browser reporter emits %c CSS that Electron and Playwright forward unformatted, so CI logs get this plain line instead.
|
|
32
|
+
// oxlint-disable-next-line no-console
|
|
33
|
+
console[consoleMethod(logObject.level)](line);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Enabled at runtime through NUXT_PUBLIC_PLAIN_LOGS=true (set by the e2e harness on CI) rather than at build time, so release builds keep the styled DevTools output.
|
|
37
|
+
export default defineNuxtPlugin({
|
|
38
|
+
name: "consola-plain-logs",
|
|
39
|
+
enforce: "pre",
|
|
40
|
+
setup() {
|
|
41
|
+
// Nitro parses NUXT_PUBLIC_* env overrides, so "true" arrives here as the boolean true
|
|
42
|
+
if (useRuntimeConfig().public.PLAIN_LOGS) {
|
|
43
|
+
consola.setReporters([{ log: plainLog }]);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
});
|
package/app/stores/api.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RequestHandlers } from "@ogw_shared/utils/types";
|
|
2
2
|
import { api_fetch } from "@ogw_internal/utils/api_fetch";
|
|
3
|
+
import { consola } from "consola";
|
|
3
4
|
|
|
4
5
|
interface ApiSchema {
|
|
5
6
|
$id: string;
|
|
@@ -34,7 +35,7 @@ export const useAPIStore = defineStore("api", () => {
|
|
|
34
35
|
}: { schema: ApiSchema; params?: Record<string, unknown>; headers?: Record<string, string> },
|
|
35
36
|
callbacks: ApiCallbacks = {},
|
|
36
37
|
): Promise<TResult> {
|
|
37
|
-
|
|
38
|
+
consola.info("[API] Request:", schema.$id);
|
|
38
39
|
const start = Date.now();
|
|
39
40
|
|
|
40
41
|
const result = await api_fetch(
|
|
@@ -43,7 +44,7 @@ export const useAPIStore = defineStore("api", () => {
|
|
|
43
44
|
{
|
|
44
45
|
...callbacks,
|
|
45
46
|
response_function: async (response: unknown) => {
|
|
46
|
-
|
|
47
|
+
consola.info(
|
|
47
48
|
"[API] Request completed:",
|
|
48
49
|
schema.$id,
|
|
49
50
|
"in",
|
package/app/stores/app.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { consola } from "consola";
|
|
2
|
+
|
|
1
3
|
// Local imports
|
|
2
4
|
import { getRestApiPort, getRestApiProtocol, isCloudMode } from "@ogw_front/utils/stores.js";
|
|
3
5
|
import { Status } from "@ogw_front/utils/status";
|
|
@@ -122,7 +124,7 @@ export const useAppStore = defineStore("app", () => {
|
|
|
122
124
|
);
|
|
123
125
|
|
|
124
126
|
if (missingStoreIds.length > 0) {
|
|
125
|
-
|
|
127
|
+
consola.warn(`Stores not found in snapshot: ${missingStoreIds.join(", ")}`);
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { consola } from "consola";
|
|
1
2
|
import { killExtension } from "@ogw_front/utils/extension.js";
|
|
2
3
|
import { useInfraStore } from "@ogw_front/stores/infra";
|
|
3
4
|
|
|
@@ -89,7 +90,7 @@ export function useAppExtensions(): {
|
|
|
89
90
|
const extensionId = extensionModule.metadata.id;
|
|
90
91
|
|
|
91
92
|
if (loadedExtensions.value.has(extensionId)) {
|
|
92
|
-
|
|
93
|
+
consola.warn(`[AppStore] Extension "${extensionId}" is already loaded`);
|
|
93
94
|
throw new Error(`Extension "${extensionId}" is already loaded.`);
|
|
94
95
|
}
|
|
95
96
|
|
|
@@ -114,10 +115,10 @@ export function useAppExtensions(): {
|
|
|
114
115
|
};
|
|
115
116
|
loadedExtensions.value.set(extensionId, extensionData);
|
|
116
117
|
|
|
117
|
-
|
|
118
|
+
consola.info(`[AppStore] Extension loaded successfully: ${extensionId}`);
|
|
118
119
|
return extensionModule;
|
|
119
120
|
} catch (error) {
|
|
120
|
-
|
|
121
|
+
consola.error(`[AppStore] Failed to load extension from ${path}:`, error);
|
|
121
122
|
throw error;
|
|
122
123
|
}
|
|
123
124
|
}
|
|
@@ -127,13 +128,13 @@ export function useAppExtensions(): {
|
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
async function unloadExtension(extensionId: string): Promise<boolean> {
|
|
130
|
-
|
|
131
|
+
consola.info(`[AppStore] Unloading extension: ${extensionId}`);
|
|
131
132
|
const infraStore = useInfraStore();
|
|
132
133
|
infraStore.unregister_microservice(extensionId);
|
|
133
134
|
await killExtension(extensionId);
|
|
134
135
|
|
|
135
136
|
loadedExtensions.value.delete(extensionId);
|
|
136
|
-
|
|
137
|
+
consola.info(`[AppStore] Extension unloaded: ${extensionId}`);
|
|
137
138
|
return true;
|
|
138
139
|
}
|
|
139
140
|
|
|
@@ -143,7 +144,7 @@ export function useAppExtensions(): {
|
|
|
143
144
|
return false;
|
|
144
145
|
}
|
|
145
146
|
extensionData.enabled = !extensionData.enabled;
|
|
146
|
-
|
|
147
|
+
consola.info(
|
|
147
148
|
`[AppStore] Extension ${extensionData.enabled ? "enabled" : "disabled"}: ${extensionId}`,
|
|
148
149
|
);
|
|
149
150
|
return extensionData.enabled;
|
|
@@ -155,7 +156,7 @@ export function useAppExtensions(): {
|
|
|
155
156
|
return false;
|
|
156
157
|
}
|
|
157
158
|
extensionData.enabled = enabled;
|
|
158
|
-
|
|
159
|
+
consola.info(`[AppStore] Extension ${enabled ? "enabled" : "disabled"}: ${extensionId}`);
|
|
159
160
|
return true;
|
|
160
161
|
}
|
|
161
162
|
|
package/app/stores/treeview.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { consola } from "consola";
|
|
2
|
+
|
|
1
3
|
// Not auto-fixable (eslint's sort-imports core rule has no autofixer) and this file's import order doesn't match its syntax-kind-then-alphabetical requirement - left as-is rather than manually reordered across the codebase for a purely cosmetic rule.
|
|
2
4
|
// oxlint-disable eslint/sort-imports, eslint/max-lines
|
|
3
5
|
import { defineStore } from "pinia";
|
|
@@ -108,8 +110,7 @@ export const useTreeviewStore = defineStore("treeview", () => {
|
|
|
108
110
|
rowHeights.value = config.rowHeights;
|
|
109
111
|
}
|
|
110
112
|
} catch (error) {
|
|
111
|
-
|
|
112
|
-
console.error("Failed to load treeview config:", error);
|
|
113
|
+
consola.error("Failed to load treeview config:", error);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
// oxlint-disable-next-line typescript/no-floating-promises -- loadConfig catches its own errors internally.
|
package/app/utils/cloud.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { consola } from "consola";
|
|
2
|
+
|
|
1
3
|
const CLOUD_URL_PARAM = "cloud_url";
|
|
2
4
|
const CLOUD_RUN_HOST_SUFFIX = ".run.app";
|
|
3
5
|
|
|
@@ -12,11 +14,11 @@ function getCloudUrlParam(): string | undefined {
|
|
|
12
14
|
try {
|
|
13
15
|
({ hostname } = new URL(url_string));
|
|
14
16
|
} catch {
|
|
15
|
-
|
|
17
|
+
consola.warn(`[Cloud] Invalid ${CLOUD_URL_PARAM}:`, value);
|
|
16
18
|
return undefined;
|
|
17
19
|
}
|
|
18
20
|
if (!hostname.endsWith(CLOUD_RUN_HOST_SUFFIX)) {
|
|
19
|
-
|
|
21
|
+
consola.warn(`[Cloud] Ignoring ${CLOUD_URL_PARAM}, not a Cloud Run host:`, hostname);
|
|
20
22
|
return undefined;
|
|
21
23
|
}
|
|
22
24
|
return hostname;
|
package/app/utils/extension.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// Local imports
|
|
6
6
|
import type { RegisterableStore, useAppStore } from "@ogw_front/stores/app";
|
|
7
7
|
import type { Microservice } from "@ogw_front/stores/infra";
|
|
8
|
+
import { consola } from "consola";
|
|
8
9
|
import { isCloudMode } from "@ogw_front/utils/stores";
|
|
9
10
|
import opengeodeweb_front_schemas from "@geode/opengeodeweb-front/opengeodeweb_front_schemas.json" with { type: "json" };
|
|
10
11
|
|
|
@@ -92,18 +93,18 @@ async function registerRunningExtensions(): Promise<RegisteredExtension[]> {
|
|
|
92
93
|
});
|
|
93
94
|
const blobUrl = URL.createObjectURL(blob);
|
|
94
95
|
const extensionModule = await appStore.loadExtension(blobUrl, port);
|
|
95
|
-
|
|
96
|
+
consola.info("[ExtensionManager] Extension loaded:", id);
|
|
96
97
|
const storeFactory = extensionModule.metadata.store;
|
|
97
98
|
const store = storeFactory();
|
|
98
99
|
appStore.registerStore(store);
|
|
99
|
-
|
|
100
|
+
consola.info("[ExtensionManager] Store registered:", store.$id);
|
|
100
101
|
// Extension-provided stores are expected to satisfy the fuller
|
|
101
102
|
// Microservice contract (connect, etc.) even though the loader's own
|
|
102
103
|
// RegisterableStore type only models what app.ts itself needs.
|
|
103
104
|
if (isMicroservice(store)) {
|
|
104
105
|
infraStore.register_microservice(store);
|
|
105
106
|
} else {
|
|
106
|
-
|
|
107
|
+
consola.warn("[ExtensionManager] Store does not implement Microservice:", store.$id);
|
|
107
108
|
}
|
|
108
109
|
return {
|
|
109
110
|
name,
|
|
@@ -127,10 +128,10 @@ async function importExtensionURL(url: DownloadExtensionParams): Promise<Registe
|
|
|
127
128
|
async function unloadExtension(extensionId: string): Promise<boolean> {
|
|
128
129
|
const { useAppStore } = await import("@ogw_front/stores/app");
|
|
129
130
|
const appStore = useAppStore();
|
|
130
|
-
|
|
131
|
+
consola.info("[ExtensionManager] Unloading extension:", extensionId);
|
|
131
132
|
const extensionData = appStore.getExtension(extensionId);
|
|
132
133
|
if (!extensionData) {
|
|
133
|
-
|
|
134
|
+
consola.warn("[ExtensionManager] Extension not found:", extensionId);
|
|
134
135
|
return false;
|
|
135
136
|
}
|
|
136
137
|
|
|
@@ -146,7 +147,7 @@ async function unloadExtension(extensionId: string): Promise<boolean> {
|
|
|
146
147
|
|
|
147
148
|
// Unload from AppStore
|
|
148
149
|
await appStore.unloadExtension(extensionId);
|
|
149
|
-
|
|
150
|
+
consola.info("[ExtensionManager] Extension unloaded:", extensionId);
|
|
150
151
|
return true;
|
|
151
152
|
}
|
|
152
153
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// oxlint-disable promise/prefer-await-to-then
|
|
2
2
|
// Third party imports
|
|
3
3
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json";
|
|
4
|
+
import { consola } from "consola";
|
|
4
5
|
|
|
5
6
|
// Local imports
|
|
6
7
|
import { type NewDataItem, useDataStore } from "@ogw_front/stores/data";
|
|
@@ -108,7 +109,7 @@ async function importWorkflow(files: readonly FileToImport[]): Promise<string[]>
|
|
|
108
109
|
|
|
109
110
|
// NewDataItem has mutable array fields (mesh_components, collection_components), so a readonly array of it can't satisfy prefer-readonly-parameter-types deeply; left unfixed (same pattern as app/plugins/auto_store_register.ts).
|
|
110
111
|
async function importWorkflowFromSnapshot(items: readonly NewDataItem[]): Promise<string[]> {
|
|
111
|
-
|
|
112
|
+
consola.debug("[importWorkflowFromSnapshot] start", { count: items?.length });
|
|
112
113
|
const hybridViewerStore = useHybridViewerStore();
|
|
113
114
|
const chunk_size = 5;
|
|
114
115
|
const chunks: NewDataItem[][] = [];
|
|
@@ -132,7 +133,7 @@ async function importWorkflowFromSnapshot(items: readonly NewDataItem[]): Promis
|
|
|
132
133
|
}
|
|
133
134
|
await processChunk(0);
|
|
134
135
|
await hybridViewerStore.remoteRender();
|
|
135
|
-
|
|
136
|
+
consola.debug("[importWorkflowFromSnapshot] done", {
|
|
136
137
|
ids,
|
|
137
138
|
});
|
|
138
139
|
return ids;
|
package/app/utils/log.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { JsonRpcSchema } from "@ogw_shared/utils/types.js";
|
|
2
|
+
import { consola } from "consola";
|
|
2
3
|
|
|
3
4
|
interface Loggable {
|
|
4
5
|
$id: string;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
function startRequestLog(microservice: Loggable, schema: JsonRpcSchema): Date {
|
|
8
|
-
|
|
9
|
+
consola.info(`[${microservice.$id}] Request:`, schema.$id);
|
|
9
10
|
const requestStartingTime = new Date(Date.now());
|
|
10
11
|
return requestStartingTime;
|
|
11
12
|
}
|
|
@@ -16,7 +17,7 @@ function endRequestLog(
|
|
|
16
17
|
requestStartingTime: Date,
|
|
17
18
|
): void {
|
|
18
19
|
const requestEndingTime = new Date(Date.now());
|
|
19
|
-
|
|
20
|
+
consola.info(
|
|
20
21
|
`[${microservice.$id}] Request completed:`,
|
|
21
22
|
schema.$id,
|
|
22
23
|
"in",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { JsonRpcSchema, RequestHandlersWithValidation } from "@ogw_shared/utils/types.js";
|
|
2
2
|
import { endRequestLog, startRequestLog } from "@ogw_front/utils/log";
|
|
3
|
+
import { consola } from "consola";
|
|
3
4
|
import { fetchSchema } from "@ogw_shared/utils/fetch_schema";
|
|
4
5
|
import { useFeedbackStore } from "@ogw_front/stores/feedback";
|
|
5
6
|
|
|
@@ -69,7 +70,7 @@ async function api_fetch(
|
|
|
69
70
|
skip_feedback_error,
|
|
70
71
|
}: RequestHandlersWithValidation & { timeout?: number; skip_feedback_error?: boolean } = {},
|
|
71
72
|
): Promise<unknown> {
|
|
72
|
-
|
|
73
|
+
consola.info("[API] Fetching", microservice.base_url);
|
|
73
74
|
const feedbackStore = useFeedbackStore();
|
|
74
75
|
microservice.start_request();
|
|
75
76
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { JsonRpcSchema, RequestHandlers } from "@ogw_shared/utils/types.js";
|
|
2
2
|
import { CHUNK_SIZE_BYTES } from "@ogw_shared/utils/file.js";
|
|
3
3
|
import type { Microservice } from "./api_fetch.js";
|
|
4
|
+
import { consola } from "consola";
|
|
4
5
|
import { fetchRaw } from "@ogw_shared/utils/fetch_raw.js";
|
|
5
6
|
import { useFeedbackStore } from "@ogw_front/stores/feedback.js";
|
|
6
7
|
|
|
@@ -38,7 +39,7 @@ async function upload_file(
|
|
|
38
39
|
{ schema, file, params = {} }: UploadFileParams,
|
|
39
40
|
{ request_error_function, response_function, response_error_function }: RequestHandlers = {},
|
|
40
41
|
): Promise<unknown> {
|
|
41
|
-
|
|
42
|
+
consola.debug("[UPLOAD_FILE] Uploading file", { schema, file });
|
|
42
43
|
const feedbackStore = useFeedbackStore();
|
|
43
44
|
|
|
44
45
|
if (!(file instanceof File)) {
|
|
@@ -4,6 +4,7 @@ import vtkWSLinkClient, {
|
|
|
4
4
|
newInstance,
|
|
5
5
|
} from "@kitware/vtk.js/IO/Core/WSLinkClient";
|
|
6
6
|
import SmartConnect from "wslink/src/SmartConnect";
|
|
7
|
+
import { consola } from "consola";
|
|
7
8
|
|
|
8
9
|
interface WsClientCallbacks {
|
|
9
10
|
onConnectionClose?: () => void;
|
|
@@ -34,12 +35,12 @@ async function initWebSocketClient(
|
|
|
34
35
|
|
|
35
36
|
client.onConnectionError((httpReq: WsConnectionEvent) => {
|
|
36
37
|
const message = httpReq.response?.error ?? "Connection error";
|
|
37
|
-
|
|
38
|
+
consola.error(message);
|
|
38
39
|
});
|
|
39
40
|
client.onConnectionClose((httpReq: WsConnectionEvent) => {
|
|
40
41
|
const message = httpReq.response?.error ?? "Connection close";
|
|
41
42
|
onConnectionClose?.();
|
|
42
|
-
|
|
43
|
+
consola.error(message);
|
|
43
44
|
});
|
|
44
45
|
|
|
45
46
|
client.beginBusy();
|
package/nuxt.config.ts
CHANGED
|
@@ -89,6 +89,8 @@ export default defineNuxtConfig({
|
|
|
89
89
|
PROJECT: "",
|
|
90
90
|
BRANCH: process.env.NETLIFY_BRANCH ?? "next",
|
|
91
91
|
CLOUD_API_URL: process.env.CLOUD_API_URL ?? "",
|
|
92
|
+
// Runtime-only (NUXT_PUBLIC_PLAIN_LOGS=true): plain, unstyled browser logs for CI output
|
|
93
|
+
PLAIN_LOGS: false,
|
|
92
94
|
},
|
|
93
95
|
},
|
|
94
96
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.35.0
|
|
3
|
+
"version": "10.35.0",
|
|
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": {
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"prepublishOnly": "npm run build"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@geode/cloud-api": "
|
|
67
|
-
"@geode/opengeodeweb-back": "
|
|
68
|
-
"@geode/opengeodeweb-viewer": "
|
|
66
|
+
"@geode/cloud-api": "latest",
|
|
67
|
+
"@geode/opengeodeweb-back": "latest",
|
|
68
|
+
"@geode/opengeodeweb-viewer": "latest",
|
|
69
69
|
"@kitware/vtk.js": "33.3.0",
|
|
70
70
|
"@mdi/font": "7.4.47",
|
|
71
71
|
"@pinia/nuxt": "1.0.1",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"ajv": "8.17.1",
|
|
80
80
|
"busboy": "1.6.0",
|
|
81
81
|
"conf": "15.1.0",
|
|
82
|
+
"consola": "3.4.2",
|
|
82
83
|
"dexie": "4.2.1",
|
|
83
84
|
"get-port-please": "3.2.0",
|
|
84
85
|
"js-file-download": "0.4.12",
|
|
@@ -3,6 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
|
|
4
4
|
// Third party imports
|
|
5
5
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
6
|
+
import { consola } from "consola";
|
|
6
7
|
|
|
7
8
|
// Local imports
|
|
8
9
|
import {
|
|
@@ -27,7 +28,7 @@ interface RunExtensionsBody {
|
|
|
27
28
|
|
|
28
29
|
export default defineEventHandler(async (event: H3Event) => {
|
|
29
30
|
try {
|
|
30
|
-
|
|
31
|
+
consola.debug("NITRO: runExtensions", event);
|
|
31
32
|
const { projectFolderPath, projectName } = await readBody<RunExtensionsBody>(event);
|
|
32
33
|
const extensionsConfig = extensionsConf(projectName);
|
|
33
34
|
const extensionsArray = await Promise.all(
|
|
@@ -67,7 +68,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
67
68
|
extensionsArray,
|
|
68
69
|
};
|
|
69
70
|
} catch (error) {
|
|
70
|
-
|
|
71
|
+
consola.error("Error running extensions:", error);
|
|
71
72
|
throw createError({
|
|
72
73
|
statusCode: 500,
|
|
73
74
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// Node imports
|
|
2
2
|
|
|
3
3
|
// Third party imports
|
|
4
|
+
import { consola } from "consola";
|
|
4
5
|
import { defineEventHandler } from "h3";
|
|
5
6
|
|
|
6
7
|
// Local imports
|
|
7
8
|
|
|
8
9
|
export default defineEventHandler(() => {
|
|
9
|
-
|
|
10
|
+
consola.info("Killing node server process");
|
|
10
11
|
// oxlint-disable-next-line no-process-exit
|
|
11
12
|
process.exit();
|
|
12
13
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Third party imports
|
|
4
4
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
5
|
+
import { consola } from "consola";
|
|
5
6
|
|
|
6
7
|
// Local imports
|
|
7
8
|
import {
|
|
@@ -24,7 +25,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
24
25
|
projectFolderPath,
|
|
25
26
|
};
|
|
26
27
|
} catch (error) {
|
|
27
|
-
|
|
28
|
+
consola.error(error);
|
|
28
29
|
throw createError({
|
|
29
30
|
statusCode: 500,
|
|
30
31
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Third party imports
|
|
4
4
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
5
|
+
import { consola } from "consola";
|
|
5
6
|
|
|
6
7
|
// Local imports
|
|
7
8
|
import {
|
|
@@ -30,7 +31,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
30
31
|
port,
|
|
31
32
|
};
|
|
32
33
|
} catch (error) {
|
|
33
|
-
|
|
34
|
+
consola.error(error);
|
|
34
35
|
throw createError({
|
|
35
36
|
statusCode: 500,
|
|
36
37
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Third party imports
|
|
4
4
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
5
|
+
import { consola } from "consola";
|
|
5
6
|
|
|
6
7
|
// Local imports
|
|
7
8
|
import {
|
|
@@ -30,7 +31,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
30
31
|
port,
|
|
31
32
|
};
|
|
32
33
|
} catch (error) {
|
|
33
|
-
|
|
34
|
+
consola.error(error);
|
|
34
35
|
throw createError({
|
|
35
36
|
statusCode: 500,
|
|
36
37
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Third party imports
|
|
4
4
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
5
|
+
import { consola } from "consola";
|
|
5
6
|
|
|
6
7
|
// Local imports
|
|
7
8
|
import {
|
|
@@ -24,7 +25,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
24
25
|
const body = await readBody<KillExtensionBody>(event);
|
|
25
26
|
const { projectFolderPath, projectName, extensionId } = body;
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
consola.debug({ projectFolderPath, projectName, extensionId });
|
|
28
29
|
|
|
29
30
|
const microservices = projectMicroservices(projectFolderPath);
|
|
30
31
|
const microservice = getMicroserviceByName(microservices, extensionId);
|
|
@@ -40,7 +41,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
40
41
|
statusCode: 200,
|
|
41
42
|
};
|
|
42
43
|
} catch (error) {
|
|
43
|
-
|
|
44
|
+
consola.error("Error killing extension:", error);
|
|
44
45
|
throw createError({
|
|
45
46
|
statusCode: 500,
|
|
46
47
|
|
|
@@ -3,6 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
|
|
4
4
|
// Third party imports
|
|
5
5
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
6
|
+
import { consola } from "consola";
|
|
6
7
|
|
|
7
8
|
// Local imports
|
|
8
9
|
import {
|
|
@@ -27,7 +28,6 @@ interface RunExtensionsBody {
|
|
|
27
28
|
|
|
28
29
|
export default defineEventHandler(async (event: H3Event) => {
|
|
29
30
|
try {
|
|
30
|
-
console.log("NITRO: runExtensions", event);
|
|
31
31
|
const { projectFolderPath, projectName } = await readBody<RunExtensionsBody>(event);
|
|
32
32
|
const extensionsConfig = extensionsConf(projectName);
|
|
33
33
|
const extensionsArray = await Promise.all(
|
|
@@ -67,7 +67,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
67
67
|
extensionsArray,
|
|
68
68
|
};
|
|
69
69
|
} catch (error) {
|
|
70
|
-
|
|
70
|
+
consola.error("Error running extensions:", error);
|
|
71
71
|
throw createError({
|
|
72
72
|
statusCode: 500,
|
|
73
73
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
import { createError, defineEventHandler } from "h3";
|
|
3
|
+
import { consola } from "consola";
|
|
3
4
|
|
|
4
5
|
// Local imports
|
|
5
6
|
import { getIsAppReady } from "@geode/opengeodeweb-front/server/utils/server_config.ts";
|
|
@@ -7,10 +8,10 @@ import { getIsAppReady } from "@geode/opengeodeweb-front/server/utils/server_con
|
|
|
7
8
|
export default defineEventHandler(() => {
|
|
8
9
|
try {
|
|
9
10
|
const isReady = getIsAppReady();
|
|
10
|
-
|
|
11
|
+
consola.info(`IS_APP_READY is ${isReady}`);
|
|
11
12
|
return { statusCode: 200, isReady };
|
|
12
13
|
} catch (error) {
|
|
13
|
-
|
|
14
|
+
consola.error(error);
|
|
14
15
|
throw createError({
|
|
15
16
|
statusCode: 500,
|
|
16
17
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
3
|
+
import { consola } from "consola";
|
|
3
4
|
|
|
4
5
|
// Local imports
|
|
5
6
|
import { setAppBaseUrl } from "@geode/opengeodeweb-front/server/utils/server_config.ts";
|
|
@@ -16,11 +17,11 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
setAppBaseUrl(baseUrl);
|
|
19
|
-
|
|
20
|
+
consola.info(`Updated APP_BASE_URL to ${baseUrl}`);
|
|
20
21
|
|
|
21
22
|
return { statusCode: 200, baseUrl };
|
|
22
23
|
} catch (error) {
|
|
23
|
-
|
|
24
|
+
consola.error(error);
|
|
24
25
|
throw createError({
|
|
25
26
|
statusCode: 500,
|
|
26
27
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
3
|
+
import { consola } from "consola";
|
|
3
4
|
|
|
4
5
|
// Local imports
|
|
5
6
|
import { setBackBaseUrl } from "@geode/opengeodeweb-front/server/utils/server_config.ts";
|
|
@@ -17,7 +18,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
17
18
|
setBackBaseUrl(baseUrl);
|
|
18
19
|
return { statusCode: 200, baseUrl };
|
|
19
20
|
} catch (error) {
|
|
20
|
-
|
|
21
|
+
consola.error(error);
|
|
21
22
|
throw createError({
|
|
22
23
|
statusCode: 500,
|
|
23
24
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
3
|
+
import { consola } from "consola";
|
|
3
4
|
|
|
4
5
|
// Local imports
|
|
5
6
|
import { setIsAppReady } from "@geode/opengeodeweb-front/server/utils/server_config.ts";
|
|
@@ -16,11 +17,11 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
setIsAppReady(isReady);
|
|
19
|
-
|
|
20
|
+
consola.info(`Updated IS_APP_READY to ${isReady}`);
|
|
20
21
|
|
|
21
22
|
return { statusCode: 200, isReady };
|
|
22
23
|
} catch (error) {
|
|
23
|
-
|
|
24
|
+
consola.error(error);
|
|
24
25
|
throw createError({
|
|
25
26
|
statusCode: 500,
|
|
26
27
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Third party imports
|
|
2
2
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
3
|
+
import { consola } from "consola";
|
|
3
4
|
|
|
4
5
|
// Local imports
|
|
5
6
|
import { setViewerBaseUrl } from "@geode/opengeodeweb-front/server/utils/server_config.ts";
|
|
@@ -17,7 +18,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
17
18
|
setViewerBaseUrl(baseUrl);
|
|
18
19
|
return { statusCode: 200, baseUrl };
|
|
19
20
|
} catch (error) {
|
|
20
|
-
|
|
21
|
+
consola.error(error);
|
|
21
22
|
throw createError({
|
|
22
23
|
statusCode: 500,
|
|
23
24
|
statusMessage: error instanceof Error ? error.message : String(error),
|
|
@@ -3,6 +3,7 @@ import { promises as fs } from "node:fs";
|
|
|
3
3
|
|
|
4
4
|
// Third party imports
|
|
5
5
|
import { type H3Event, createError, defineEventHandler, readBody } from "h3";
|
|
6
|
+
import { consola } from "consola";
|
|
6
7
|
|
|
7
8
|
// Local imports
|
|
8
9
|
import {
|
|
@@ -20,7 +21,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
20
21
|
try {
|
|
21
22
|
const body = await readBody<DownloadExtensionBody>(event);
|
|
22
23
|
const { projectName, url, extensionFileName } = body;
|
|
23
|
-
|
|
24
|
+
consola.debug({ projectName, url, extensionFileName });
|
|
24
25
|
const response: Response = await fetch(url);
|
|
25
26
|
const fileBuffer = await response.arrayBuffer();
|
|
26
27
|
const filePath = targetExtensionFilePath(projectName, extensionFileName);
|
|
@@ -30,7 +31,7 @@ export default defineEventHandler(async (event: H3Event) => {
|
|
|
30
31
|
statusCode: 200,
|
|
31
32
|
};
|
|
32
33
|
} catch (error) {
|
|
33
|
-
|
|
34
|
+
consola.error("Error downloading extension:", error);
|
|
34
35
|
throw createError({
|
|
35
36
|
statusCode: 500,
|
|
36
37
|
statusMessage: error instanceof Error ? error.message : String(error),
|