vease 0.1.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.
@@ -0,0 +1,45 @@
1
+ name: CICD
2
+
3
+ on:
4
+ push:
5
+
6
+ env:
7
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8
+
9
+ jobs:
10
+ release:
11
+ runs-on: ${{ matrix.os }}
12
+ if: github.ref == 'refs/heads/next' || github.ref == 'refs/heads/master'
13
+
14
+ strategy:
15
+ matrix:
16
+ os: [windows-latest, ubuntu-latest]
17
+
18
+ steps:
19
+ - name: Check out Git repository
20
+ uses: actions/checkout@v4
21
+
22
+ - name: Semantic Release
23
+ uses: cycjimmy/semantic-release-action@v4
24
+ id: semantic
25
+ env:
26
+ GITHUB_TOKEN: ${{ secrets.TOKEN }}
27
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28
+ - name: Install Node.js, NPM and Yarn
29
+ uses: actions/setup-node@v4
30
+ with:
31
+ node-version: 20
32
+
33
+ - name: Install dependencies
34
+ if: steps.semantic.outputs.new_release_published == 'true'
35
+ run: |
36
+ npm install
37
+ npm run package
38
+ npm run make
39
+ if [[ "$github.ref == 'refs/heads/next'" ]] then
40
+ npm run publish --prerelease
41
+ else
42
+ npm run publish
43
+ fi
44
+ env:
45
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Vease
@@ -0,0 +1,42 @@
1
+ @import url("https://fonts.googleapis.com/css2?family=Michroma&display=swap");
2
+
3
+ * {
4
+ font-family: "Roboto", sans-serif;
5
+ }
6
+
7
+ body {
8
+ overflow: hidden;
9
+ }
10
+
11
+ p {
12
+ color:white;
13
+ }
14
+
15
+ h2 {
16
+ font-family: "Michroma", sans-serif;
17
+ color:white;
18
+
19
+ }
20
+
21
+ .custom-background {
22
+ background: linear-gradient(
23
+ 135deg,
24
+ rgba(56, 157, 133, 1) 0%,
25
+ rgb(60, 153, 131) 50%,
26
+ rgb(20, 19, 19) 100%
27
+ );
28
+ }
29
+
30
+ .icon-style {
31
+ border-radius: 20%;
32
+ background-color: #ffffff26;
33
+ }
34
+
35
+ .icon-style:hover {
36
+ background-color: #ffffff4d;
37
+ }
38
+
39
+ .title-text {
40
+ font-size: 30px;
41
+ font-weight: 100;
42
+ }
Binary file
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <v-file-input
3
+ :value="value"
4
+ :rules="rules"
5
+ :label="label"
6
+ :required="required"
7
+ :prepend-icon="prependIcon"
8
+ :accept="accept"
9
+ @input="$emit('input', $event)"
10
+ @change="$emit('change', $event)"
11
+ ></v-file-input>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ props: {
17
+ value: {
18
+ type: File,
19
+ required: true,
20
+ },
21
+ rules: {
22
+ type: Array,
23
+ default: () => [],
24
+ },
25
+ label: {
26
+ type: String,
27
+ required: true,
28
+ },
29
+ required: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ prependIcon: {
34
+ type: String,
35
+ default: null,
36
+ },
37
+ accept: {
38
+ type: String,
39
+ default: null,
40
+ },
41
+ },
42
+ };
43
+ </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <v-text-field
3
+ :value="value"
4
+ :rules="rules"
5
+ :label="label"
6
+ :required="required"
7
+ :type="showPassword ? 'text' : 'password'"
8
+ :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
9
+ @input="$emit('input', $event)"
10
+ @click:append="toggleVisibility"
11
+ ></v-text-field>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ props: {
17
+ value: {
18
+ type: String,
19
+ required: true,
20
+ },
21
+ rules: {
22
+ type: Array,
23
+ default: () => [],
24
+ },
25
+ label: {
26
+ type: String,
27
+ required: true,
28
+ },
29
+ required: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ toggleVisibility: {
34
+ type: Function,
35
+ required: true,
36
+ },
37
+ },
38
+ data() {
39
+ return {
40
+ showPassword: false,
41
+ };
42
+ },
43
+ };
44
+ </script>
@@ -0,0 +1,154 @@
1
+ <template>
2
+ <v-navigation-drawer
3
+ fixed
4
+ v-model="drawer"
5
+ width="50"
6
+ class="mt-10 ma-2"
7
+ color="#FFFFFF00"
8
+ elevation="0"
9
+ floating
10
+ app
11
+ permanent
12
+ >
13
+ <v-tooltip
14
+ v-for="(item, index) in items"
15
+ :key="item.title"
16
+ :text="item.title"
17
+ >
18
+ <template v-slot:activator="{ props }">
19
+ <v-btn
20
+ v-bind="props"
21
+ flat
22
+ color="#FFFFFF00"
23
+ :class="item.title === 'Back' ? 'mb-8' : 'mb-1'"
24
+ @click="item.click"
25
+ style="border-radius: 20%"
26
+ :icon="item.icon"
27
+ >
28
+ <v-icon
29
+ class="icon-style pa-6"
30
+ :icon="item.icon"
31
+ color="white"
32
+ size="28"
33
+ />
34
+ </v-btn>
35
+ </template>
36
+ </v-tooltip>
37
+ <v-dialog
38
+ v-model="newproject"
39
+ max-width="800px"
40
+ radius="20px"
41
+ class="text-center"
42
+ >
43
+ <v-sheet border="md">
44
+ <v-card color="#3c9983">
45
+ <v-card-title>
46
+ <h3 class="mt-4">New Project</h3>
47
+ </v-card-title>
48
+ <v-card-text>
49
+ <v-container>
50
+ <v-row>
51
+ <v-col>
52
+ <v-text-field label="Project Name" required></v-text-field>
53
+ </v-col>
54
+ </v-row>
55
+ </v-container>
56
+ </v-card-text>
57
+ <v-card-actions justify-center>
58
+ <v-btn
59
+ variant="outlined"
60
+ color="white"
61
+ text
62
+ @click="newproject = false"
63
+ class="ml-8 mb-4"
64
+ >Close</v-btn
65
+ >
66
+ <v-btn
67
+ variant="outlined"
68
+ class="mb-4"
69
+ color="white"
70
+ text
71
+ @click="newproject = false"
72
+ >Create</v-btn
73
+ >
74
+ </v-card-actions>
75
+ </v-card>
76
+ </v-sheet>
77
+ </v-dialog>
78
+ <v-dialog v-model="openproject" max-width="800px" class="text-center">
79
+ <v-sheet border="md">
80
+ <v-card color="#3c9983">
81
+ <v-card-title>
82
+ <h3 class="mt-4">Open Project</h3>
83
+ </v-card-title>
84
+ <v-card-text>
85
+ <v-container>
86
+ <v-row>
87
+ <v-col>
88
+ <v-file-input label="Open Project" required></v-file-input>
89
+ </v-col>
90
+ </v-row>
91
+ </v-container>
92
+ </v-card-text>
93
+ <v-card-actions justify-center>
94
+ <v-btn
95
+ variant="outlined"
96
+ color="white"
97
+ text
98
+ @click="openproject = false"
99
+ class="ml-8 mb-4"
100
+ >Close</v-btn
101
+ >
102
+ <v-btn
103
+ variant="outlined"
104
+ class="mb-4"
105
+ color="white"
106
+ text
107
+ @click="openproject = false"
108
+ >Load</v-btn
109
+ >
110
+ </v-card-actions>
111
+ </v-card>
112
+ </v-sheet>
113
+ </v-dialog>
114
+ </v-navigation-drawer>
115
+ </template>
116
+
117
+ <script setup>
118
+ import { ref } from "vue";
119
+ import { useRouter } from "vue-router";
120
+ const drawer = ref(true);
121
+ const router = useRouter();
122
+ const newproject = ref(false);
123
+ const openproject = ref(false);
124
+ const items = [
125
+ { title: "Back", icon: "mdi-arrow-left", click: () => router.go(-1) },
126
+ { title: "Home", icon: "mdi-home", click: () => router.push("/") },
127
+ {
128
+ title: "New Project",
129
+ icon: "mdi-plus",
130
+ click: () => (newproject.value = true),
131
+ },
132
+ {
133
+ title: "Open Project",
134
+ icon: "mdi-folder-outline",
135
+ click: () => (openproject.value = true),
136
+ },
137
+ {
138
+ title: "Supperposition",
139
+ icon: "mdi-layers",
140
+ click: () => router.push("/supperposition"),
141
+ },
142
+ {
143
+ title: "Download",
144
+ icon: "mdi-upload",
145
+ click: () => router.push("/download"),
146
+ },
147
+ {
148
+ title: "Extensions",
149
+ icon: "mdi-puzzle",
150
+ click: () => router.push("/extensions"),
151
+ },
152
+ { title: "Settings", icon: "mdi-cog", click: () => router.push("/settings") },
153
+ ];
154
+ </script>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <v-text-field
3
+ :value="value"
4
+ :rules="rules"
5
+ :label="label"
6
+ :required="required"
7
+ :counter="counter"
8
+ @input="$emit('input', $event)"
9
+ ></v-text-field>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ props: {
15
+ value: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ rules: {
20
+ type: Array,
21
+ default: () => [],
22
+ },
23
+ label: {
24
+ type: String,
25
+ required: true,
26
+ },
27
+ required: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ counter: {
32
+ type: Number,
33
+ default: null,
34
+ },
35
+ },
36
+ };
37
+ </script>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <v-app-bar flat color="transparent" class="ma-1" height="60" :elevation="0">
3
+ <v-row class="pa-1 ma-1 align-center">
4
+ <v-img
5
+ :src="logo"
6
+ max-height="50"
7
+ max-width="50"
8
+ class="ml-3 mr-0"
9
+ contain
10
+ />
11
+ <h2 style="color: white" class="ml-2 mb-1 title-text">Vease</h2>
12
+ <v-spacer />
13
+ <v-text-field
14
+ prepend-inner-icon="mdi-magnify"
15
+ hide-details
16
+ label="Search"
17
+ style="color: white"
18
+ class="mt-1"
19
+ v-model="search"
20
+ single-line
21
+ ></v-text-field>
22
+ <v-spacer />
23
+ <v-tooltip>
24
+ <template v-slot:activator="{ props }">
25
+ <v-btn
26
+ v-bind="props"
27
+ class="ml-2 mr-8"
28
+ style="border-radius: 20%"
29
+ flat
30
+ icon
31
+ to="/account"
32
+ >
33
+ <v-icon
34
+ v-if="!profileImagePath"
35
+ class="icon-style pa-6"
36
+ icon="mdi-account"
37
+ color="white"
38
+ size="40"
39
+ />
40
+ <v-avatar v-else size="50">
41
+ <v-img :src="getProfileImage(profileImagePath)" />
42
+ </v-avatar>
43
+ </v-btn>
44
+ </template>
45
+ <span>Account</span>
46
+ </v-tooltip>
47
+ </v-row>
48
+ </v-app-bar>
49
+ </template>
50
+
51
+ <script setup>
52
+ import logo from "@/assets/img/logo.png";
53
+
54
+ const search = ref("");
55
+ const links = [{ title: "Account", to: "/account" }];
56
+ const userStore = useUserStore();
57
+ const { profileImagePath } = storeToRefs(userStore);
58
+
59
+ const getProfileImage = (path) => {
60
+ if (path) {
61
+ return URL.createObjectURL(path);
62
+ }
63
+ return "";
64
+ };
65
+ </script>
@@ -0,0 +1,127 @@
1
+ import { app, BrowserWindow, ipcMain, dialog } from "electron";
2
+ import { updateElectronApp } from "update-electron-app";
3
+ import child_process from "child_process";
4
+ import path from "path";
5
+
6
+ const { getPort } = require("get-port-please");
7
+
8
+ // Checks for updates
9
+ updateElectronApp();
10
+
11
+ process.env["ELECTRON_DISABLE_SECURITY_WARNINGS"] = "true";
12
+
13
+ async function getAvailablePort(port) {
14
+ const available_port = await getPort({ port });
15
+ console.log("available_port", available_port);
16
+ return available_port;
17
+ }
18
+
19
+ async function run_script(
20
+ win,
21
+ command,
22
+ args,
23
+ expected_response,
24
+ timeout_seconds = 30
25
+ ) {
26
+ return new Promise((resolve, reject) => {
27
+ setTimeout(() => {
28
+ reject("Timed out after " + timeout_seconds + " seconds");
29
+ }, timeout_seconds * 1000);
30
+ var child = child_process.spawn(command, args, {
31
+ encoding: "utf8",
32
+ shell: true,
33
+ });
34
+
35
+ // You can also use a variable to save the output for when the script closes later
36
+ child.stderr.setEncoding("utf8");
37
+ child.on("error", (error) => {
38
+ dialog.showMessageBox({
39
+ title: "Title",
40
+ type: "warning",
41
+ message: "Error occured.\r\n" + error,
42
+ });
43
+ });
44
+ child.stdout.setEncoding("utf8");
45
+ child.stdout.on("data", (data) => {
46
+ //Here is the output
47
+ data = data.toString();
48
+ if (data.includes(expected_response)) {
49
+ resolve();
50
+ }
51
+ console.log(data);
52
+ });
53
+
54
+ child.stderr.on("data", (data) => {
55
+ // Return some data to the renderer process with the mainprocess-response ID
56
+ win.webContents.send("mainprocess-response", data);
57
+ //Here is the output from the command
58
+ console.log(data);
59
+ });
60
+
61
+ child.on("close", (code) => {
62
+ //Here you can get the exit code of the script
63
+ switch (code) {
64
+ case 0:
65
+ dialog.showMessageBox({
66
+ title: "Title",
67
+ type: "info",
68
+ message: "End process.\r\n",
69
+ });
70
+ break;
71
+ }
72
+ });
73
+ });
74
+ }
75
+
76
+ app.whenReady().then(() => {
77
+ const win = new BrowserWindow({
78
+ title: "Vease - New project",
79
+ icon: "public/favicon.ico",
80
+ center: true,
81
+ webPreferences: {
82
+ nodeIntegrationInWorker: true,
83
+ contextIsolation: true,
84
+ nodeIntegration: true,
85
+ webSecurity: true,
86
+ preload: path.join(__dirname, "preload.js"),
87
+ },
88
+ });
89
+ win.maximize();
90
+ win.setMinimumSize(800, 600);
91
+
92
+ ipcMain.handle("run_back", async (event, ...args) => {
93
+ const port = await getAvailablePort(args[0]);
94
+ console.log("BACK PORT", port);
95
+ await run_script(
96
+ win,
97
+ "./electron-server/dist_back/geodeapp_back",
98
+ ["--port " + port],
99
+ "Serving Flask app"
100
+ );
101
+ return port;
102
+ });
103
+
104
+ ipcMain.handle("run_viewer", async (event, ...args) => {
105
+ const port = await getAvailablePort(args[0]);
106
+ console.log("VIEWER PORT", port);
107
+ await run_script(
108
+ win,
109
+ "./electron-server/dist_viewer/geodeapp_viewer",
110
+ ["--port " + port],
111
+ "Starting factory"
112
+ );
113
+ return port;
114
+ });
115
+
116
+ if (app.isPackaged) {
117
+ win.loadFile("../index.html");
118
+ } else {
119
+ win.loadURL(process.env.VITE_DEV_SERVER_URL);
120
+ win.webContents.openDevTools();
121
+ }
122
+ });
123
+
124
+ // Quit when all windows are closed.
125
+ app.on("window-all-closed", () => {
126
+ app.quit();
127
+ });
@@ -0,0 +1,12 @@
1
+ const { contextBridge, ipcRenderer } = require("electron");
2
+
3
+ contextBridge.exposeInMainWorld("electronAPI", {
4
+ run_back: async (port) => {
5
+ const result = await ipcRenderer.invoke("run_back", port);
6
+ return result;
7
+ },
8
+ run_viewer: async (port) => {
9
+ const result = await ipcRenderer.invoke("run_viewer", port);
10
+ return result;
11
+ },
12
+ });
@@ -0,0 +1,9 @@
1
+ #! /bin/sh
2
+ rm -rf ./electron-server/venv_back ./electron-server/dist_back ./electron-server/build ./electron-server/requirements_back.txt
3
+ python3 -m venv ./electron-server/venv_back
4
+ . ./electron-server/venv_back/bin/activate
5
+ pip install pip-tools
6
+ pip-compile ./electron-server/requirements_back.in
7
+ pip install -r ./electron-server/requirements_back.txt
8
+ pip install pyinstaller
9
+ pyinstaller --onefile --collect-data opengeodeweb_back ./electron-server/venv_back/bin/geodeapp_back --distpath ./electron-server/dist_back
@@ -0,0 +1,9 @@
1
+ #! /bin/sh
2
+ rm -rf ./electron-server/venv_viewer ./electron-server/dist_viewer ./electron-server/build ./electron-server/requirements_viewer.txt
3
+ python3 -m venv ./electron-server/venv_viewer
4
+ . ./electron-server/venv_viewer/bin/activate
5
+ pip install pip-tools
6
+ pip-compile ./electron-server/requirements_viewer.in
7
+ pip install -r ./electron-server/requirements_viewer.txt
8
+ pip install pyinstaller
9
+ pyinstaller --onefile --collect-data opengeodeweb_viewer --collect-all vtkmodules ./electron-server/venv_viewer/bin/geodeapp_viewer --distpath ./electron-server/dist_viewer
@@ -0,0 +1 @@
1
+ geodeapp-back