@geode/opengeodeweb-front 10.33.3-rc.2 → 10.33.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/app/stores/infra.js +2 -0
- package/package.json +4 -3
- package/server/utils/server.js +38 -21
package/app/stores/infra.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Status } from "@ogw_front/utils/status";
|
|
2
2
|
import { appMode } from "@ogw_shared/app_mode";
|
|
3
3
|
import { registerRunningExtensions } from "@ogw_front/utils/extension";
|
|
4
|
+
import { setAppBaseUrl } from "@ogw_shared/scripts";
|
|
4
5
|
import { useAppStore } from "@ogw_front/stores/app";
|
|
5
6
|
import { useCloudStore } from "@ogw_front/stores/cloud";
|
|
6
7
|
|
|
@@ -63,6 +64,7 @@ export const useInfraStore = defineStore("infra", {
|
|
|
63
64
|
projectFolderPath: appStore.projectFolderPath,
|
|
64
65
|
});
|
|
65
66
|
}
|
|
67
|
+
await setAppBaseUrl(appStore.base_url);
|
|
66
68
|
const microservices_with_launch = this.microservices.filter((store) => store.launch);
|
|
67
69
|
const launch_promises = microservices_with_launch.map((store) =>
|
|
68
70
|
store.launch({ projectFolderPath: appStore.projectFolderPath }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
-
"version": "10.33.3
|
|
3
|
+
"version": "10.33.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": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"build": ""
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@geode/opengeodeweb-back": "
|
|
43
|
-
"@geode/opengeodeweb-viewer": "
|
|
42
|
+
"@geode/opengeodeweb-back": "latest",
|
|
43
|
+
"@geode/opengeodeweb-viewer": "latest",
|
|
44
44
|
"@google-cloud/run": "3.2.0",
|
|
45
45
|
"@kitware/vtk.js": "33.3.0",
|
|
46
46
|
"@mdi/font": "7.4.47",
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"sanitize-filename": "1.6.3",
|
|
68
68
|
"sass": "1.87.0",
|
|
69
69
|
"semver": "7.7.1",
|
|
70
|
+
"tar": "7.5.22",
|
|
70
71
|
"uuid": "11.1.0",
|
|
71
72
|
"vuetify": "3.12.5",
|
|
72
73
|
"vuetify-nuxt-module": "0.18.7",
|
package/server/utils/server.js
CHANGED
|
@@ -4,34 +4,51 @@ import path from "node:path";
|
|
|
4
4
|
|
|
5
5
|
// Third party imports
|
|
6
6
|
import JSZip from "jszip";
|
|
7
|
+
import { extract as extractTar } from "tar";
|
|
8
|
+
|
|
9
|
+
const TAR_ARCHIVE_PATTERN = /\.(?<ext>tar\.gz|tgz|tar)$/u;
|
|
10
|
+
|
|
11
|
+
async function extractZipArchive(zipFilePath, outputDir) {
|
|
12
|
+
const data = await fs.promises.readFile(zipFilePath);
|
|
13
|
+
const zip = await JSZip.loadAsync(data);
|
|
14
|
+
const promises = [];
|
|
15
|
+
|
|
16
|
+
for (const [relativePath, zipEntry] of Object.entries(zip.files)) {
|
|
17
|
+
const outputPath = path.join(outputDir, relativePath);
|
|
18
|
+
|
|
19
|
+
if (zipEntry.dir) {
|
|
20
|
+
promises.push(fs.promises.mkdir(outputPath, { recursive: true }));
|
|
21
|
+
} else {
|
|
22
|
+
promises.push(
|
|
23
|
+
(async () => {
|
|
24
|
+
const content = await zipEntry.async("nodebuffer");
|
|
25
|
+
await fs.promises.mkdir(path.dirname(outputPath), {
|
|
26
|
+
recursive: true,
|
|
27
|
+
});
|
|
28
|
+
await fs.promises.writeFile(outputPath, content);
|
|
29
|
+
})(),
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
await Promise.all(promises);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function extractTarArchive(archivePath, outputDir) {
|
|
38
|
+
await extractTar({ file: archivePath, cwd: outputDir });
|
|
39
|
+
}
|
|
7
40
|
|
|
8
41
|
async function unzipFile(zipFilePath, outputDir = zipFilePath.replace(/\.[^/.]+$/u, "")) {
|
|
9
42
|
console.log("Unzipping file...", zipFilePath, outputDir);
|
|
10
43
|
try {
|
|
11
|
-
const data = await fs.promises.readFile(zipFilePath);
|
|
12
|
-
const zip = await JSZip.loadAsync(data);
|
|
13
44
|
await fs.promises.mkdir(outputDir, { recursive: true });
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (zipEntry.dir) {
|
|
20
|
-
promises.push(fs.promises.mkdir(outputPath, { recursive: true }));
|
|
21
|
-
} else {
|
|
22
|
-
promises.push(
|
|
23
|
-
(async () => {
|
|
24
|
-
const content = await zipEntry.async("nodebuffer");
|
|
25
|
-
await fs.promises.mkdir(path.dirname(outputPath), {
|
|
26
|
-
recursive: true,
|
|
27
|
-
});
|
|
28
|
-
await fs.promises.writeFile(outputPath, content);
|
|
29
|
-
})(),
|
|
30
|
-
);
|
|
31
|
-
}
|
|
45
|
+
|
|
46
|
+
if (TAR_ARCHIVE_PATTERN.test(zipFilePath)) {
|
|
47
|
+
await extractTarArchive(zipFilePath, outputDir);
|
|
48
|
+
} else {
|
|
49
|
+
await extractZipArchive(zipFilePath, outputDir);
|
|
32
50
|
}
|
|
33
51
|
|
|
34
|
-
await Promise.all(promises);
|
|
35
52
|
console.log("Extraction complete!");
|
|
36
53
|
return outputDir;
|
|
37
54
|
} catch (error) {
|