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.
- package/.github/workflows/CICD.yaml +45 -0
- package/README.md +1 -0
- package/assets/css/main.css +42 -0
- package/assets/img/logo.png +0 -0
- package/components/FileInput.vue +43 -0
- package/components/PasswordField.vue +44 -0
- package/components/SideBar.vue +154 -0
- package/components/TextField.vue +37 -0
- package/components/TopBar.vue +65 -0
- package/electron/main.js +127 -0
- package/electron/preload.js +12 -0
- package/electron-server/install_back.sh +9 -0
- package/electron-server/install_viewer.sh +9 -0
- package/electron-server/requirements_back.in +1 -0
- package/electron-server/requirements_back.txt +174 -0
- package/electron-server/requirements_viewer.in +1 -0
- package/electron-server/requirements_viewer.txt +140 -0
- package/forge.config.cjs +32 -0
- package/layouts/default.vue +9 -0
- package/nuxt.config.js +65 -0
- package/package.json +65 -0
- package/pages/account.vue +212 -0
- package/pages/download.vue +1 -0
- package/pages/extensions.vue +1 -0
- package/pages/index.vue +27 -0
- package/pages/new-project.vue +1 -0
- package/pages/settings.vue +1 -0
- package/pages/supperposition.vue +1 -0
- package/public/favicon.ico +0 -0
- package/server/api/upload.post.js +77 -0
- package/stores/userStore.js +13 -0
- package/tsconfig.json +4 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is autogenerated by pip-compile with Python 3.10
|
|
3
|
+
# by the following command:
|
|
4
|
+
#
|
|
5
|
+
# pip-compile ./electron-server/requirements_back.in
|
|
6
|
+
#
|
|
7
|
+
asgiref==3.8.1
|
|
8
|
+
# via
|
|
9
|
+
# flask
|
|
10
|
+
# geodeapp-back
|
|
11
|
+
# opengeodeweb-back
|
|
12
|
+
attrs==23.2.0
|
|
13
|
+
# via
|
|
14
|
+
# geodeapp-back
|
|
15
|
+
# jsonschema
|
|
16
|
+
# opengeodeweb-back
|
|
17
|
+
# referencing
|
|
18
|
+
blinker==1.8.2
|
|
19
|
+
# via
|
|
20
|
+
# flask
|
|
21
|
+
# geodeapp-back
|
|
22
|
+
# opengeodeweb-back
|
|
23
|
+
click==8.1.7
|
|
24
|
+
# via
|
|
25
|
+
# flask
|
|
26
|
+
# geodeapp-back
|
|
27
|
+
# opengeodeweb-back
|
|
28
|
+
flask[async]==3.0.3
|
|
29
|
+
# via
|
|
30
|
+
# flask-cors
|
|
31
|
+
# geodeapp-back
|
|
32
|
+
# opengeodeweb-back
|
|
33
|
+
flask-cors==4.0.1
|
|
34
|
+
# via
|
|
35
|
+
# geodeapp-back
|
|
36
|
+
# opengeodeweb-back
|
|
37
|
+
geode-background==7.12.0
|
|
38
|
+
# via
|
|
39
|
+
# geode-explicit
|
|
40
|
+
# geode-implicit
|
|
41
|
+
# geode-simplex
|
|
42
|
+
# geodeapp-back
|
|
43
|
+
# opengeodeweb-back
|
|
44
|
+
geode-common==31.2.1
|
|
45
|
+
# via
|
|
46
|
+
# geode-background
|
|
47
|
+
# geode-explicit
|
|
48
|
+
# geode-implicit
|
|
49
|
+
# geode-numerics
|
|
50
|
+
# geode-simplex
|
|
51
|
+
# geode-viewables
|
|
52
|
+
# geodeapp-back
|
|
53
|
+
# opengeodeweb-back
|
|
54
|
+
geode-conversion==5.4.1
|
|
55
|
+
# via
|
|
56
|
+
# geode-explicit
|
|
57
|
+
# geode-implicit
|
|
58
|
+
# geodeapp-back
|
|
59
|
+
# opengeodeweb-back
|
|
60
|
+
geode-explicit==4.8.3
|
|
61
|
+
# via
|
|
62
|
+
# geode-implicit
|
|
63
|
+
# geodeapp-back
|
|
64
|
+
# opengeodeweb-back
|
|
65
|
+
geode-implicit==2.8.7
|
|
66
|
+
# via
|
|
67
|
+
# geodeapp-back
|
|
68
|
+
# opengeodeweb-back
|
|
69
|
+
geode-numerics==4.4.0
|
|
70
|
+
# via
|
|
71
|
+
# geode-implicit
|
|
72
|
+
# geode-simplex
|
|
73
|
+
# geodeapp-back
|
|
74
|
+
# opengeodeweb-back
|
|
75
|
+
geode-simplex==6.8.3
|
|
76
|
+
# via
|
|
77
|
+
# geodeapp-back
|
|
78
|
+
# opengeodeweb-back
|
|
79
|
+
geode-viewables==2.2.3
|
|
80
|
+
# via
|
|
81
|
+
# geodeapp-back
|
|
82
|
+
# opengeodeweb-back
|
|
83
|
+
geodeapp-back==0.1.0
|
|
84
|
+
# via -r ./electron-server/requirements_back.in
|
|
85
|
+
itsdangerous==2.2.0
|
|
86
|
+
# via
|
|
87
|
+
# flask
|
|
88
|
+
# geodeapp-back
|
|
89
|
+
# opengeodeweb-back
|
|
90
|
+
jinja2==3.1.4
|
|
91
|
+
# via
|
|
92
|
+
# flask
|
|
93
|
+
# geodeapp-back
|
|
94
|
+
# opengeodeweb-back
|
|
95
|
+
jsonschema==4.22.0
|
|
96
|
+
# via
|
|
97
|
+
# geodeapp-back
|
|
98
|
+
# opengeodeweb-back
|
|
99
|
+
jsonschema-specifications==2023.12.1
|
|
100
|
+
# via
|
|
101
|
+
# geodeapp-back
|
|
102
|
+
# jsonschema
|
|
103
|
+
# opengeodeweb-back
|
|
104
|
+
markupsafe==2.1.5
|
|
105
|
+
# via
|
|
106
|
+
# geodeapp-back
|
|
107
|
+
# jinja2
|
|
108
|
+
# opengeodeweb-back
|
|
109
|
+
# werkzeug
|
|
110
|
+
opengeode-core==14.21.3
|
|
111
|
+
# via
|
|
112
|
+
# geode-background
|
|
113
|
+
# geode-common
|
|
114
|
+
# geode-conversion
|
|
115
|
+
# geode-explicit
|
|
116
|
+
# geode-implicit
|
|
117
|
+
# geode-numerics
|
|
118
|
+
# geode-simplex
|
|
119
|
+
# geode-viewables
|
|
120
|
+
# geodeapp-back
|
|
121
|
+
# opengeode-geosciences
|
|
122
|
+
# opengeode-geosciencesio
|
|
123
|
+
# opengeode-inspector
|
|
124
|
+
# opengeode-io
|
|
125
|
+
# opengeodeweb-back
|
|
126
|
+
opengeode-geosciences==7.7.0
|
|
127
|
+
# via
|
|
128
|
+
# geode-implicit
|
|
129
|
+
# geode-viewables
|
|
130
|
+
# geodeapp-back
|
|
131
|
+
# opengeode-geosciencesio
|
|
132
|
+
# opengeodeweb-back
|
|
133
|
+
opengeode-geosciencesio==4.7.7
|
|
134
|
+
# via
|
|
135
|
+
# geode-implicit
|
|
136
|
+
# geodeapp-back
|
|
137
|
+
# opengeodeweb-back
|
|
138
|
+
opengeode-inspector==5.1.4
|
|
139
|
+
# via
|
|
140
|
+
# geode-explicit
|
|
141
|
+
# geode-implicit
|
|
142
|
+
# geode-simplex
|
|
143
|
+
# geodeapp-back
|
|
144
|
+
# opengeodeweb-back
|
|
145
|
+
opengeode-io==6.5.1
|
|
146
|
+
# via
|
|
147
|
+
# geode-implicit
|
|
148
|
+
# geode-viewables
|
|
149
|
+
# geodeapp-back
|
|
150
|
+
# opengeode-geosciencesio
|
|
151
|
+
# opengeodeweb-back
|
|
152
|
+
opengeodeweb-back==4.2.1
|
|
153
|
+
# via geodeapp-back
|
|
154
|
+
python-dotenv==1.0.1
|
|
155
|
+
# via geodeapp-back
|
|
156
|
+
referencing==0.35.1
|
|
157
|
+
# via
|
|
158
|
+
# geodeapp-back
|
|
159
|
+
# jsonschema
|
|
160
|
+
# jsonschema-specifications
|
|
161
|
+
# opengeodeweb-back
|
|
162
|
+
rpds-py==0.18.1
|
|
163
|
+
# via
|
|
164
|
+
# geodeapp-back
|
|
165
|
+
# jsonschema
|
|
166
|
+
# opengeodeweb-back
|
|
167
|
+
# referencing
|
|
168
|
+
typing-extensions==4.12.2
|
|
169
|
+
# via asgiref
|
|
170
|
+
werkzeug==3.0.3
|
|
171
|
+
# via
|
|
172
|
+
# flask
|
|
173
|
+
# geodeapp-back
|
|
174
|
+
# opengeodeweb-back
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
geodeapp-viewer[gpu]
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This file is autogenerated by pip-compile with Python 3.10
|
|
3
|
+
# by the following command:
|
|
4
|
+
#
|
|
5
|
+
# pip-compile ./electron-server/requirements_viewer.in
|
|
6
|
+
#
|
|
7
|
+
aiohttp==3.9.3
|
|
8
|
+
# via
|
|
9
|
+
# geodeapp-viewer
|
|
10
|
+
# opengeodeweb-viewer
|
|
11
|
+
# wslink
|
|
12
|
+
aiosignal==1.3.1
|
|
13
|
+
# via
|
|
14
|
+
# aiohttp
|
|
15
|
+
# geodeapp-viewer
|
|
16
|
+
# opengeodeweb-viewer
|
|
17
|
+
async-timeout==4.0.3
|
|
18
|
+
# via
|
|
19
|
+
# aiohttp
|
|
20
|
+
# geodeapp-viewer
|
|
21
|
+
# opengeodeweb-viewer
|
|
22
|
+
attrs==23.2.0
|
|
23
|
+
# via
|
|
24
|
+
# aiohttp
|
|
25
|
+
# geodeapp-viewer
|
|
26
|
+
# jsonschema
|
|
27
|
+
# opengeodeweb-viewer
|
|
28
|
+
# referencing
|
|
29
|
+
contourpy==1.2.0
|
|
30
|
+
# via
|
|
31
|
+
# geodeapp-viewer
|
|
32
|
+
# matplotlib
|
|
33
|
+
cycler==0.12.1
|
|
34
|
+
# via
|
|
35
|
+
# geodeapp-viewer
|
|
36
|
+
# matplotlib
|
|
37
|
+
fonttools==4.50.0
|
|
38
|
+
# via
|
|
39
|
+
# geodeapp-viewer
|
|
40
|
+
# matplotlib
|
|
41
|
+
frozenlist==1.4.1
|
|
42
|
+
# via
|
|
43
|
+
# aiohttp
|
|
44
|
+
# aiosignal
|
|
45
|
+
# geodeapp-viewer
|
|
46
|
+
# opengeodeweb-viewer
|
|
47
|
+
geodeapp-viewer[gpu]==0.1.0
|
|
48
|
+
# via -r ./electron-server/requirements_viewer.in
|
|
49
|
+
idna==3.6
|
|
50
|
+
# via
|
|
51
|
+
# geodeapp-viewer
|
|
52
|
+
# opengeodeweb-viewer
|
|
53
|
+
# yarl
|
|
54
|
+
importlib-resources==6.4.0
|
|
55
|
+
# via geodeapp-viewer
|
|
56
|
+
jsonschema==4.21.1
|
|
57
|
+
# via
|
|
58
|
+
# geodeapp-viewer
|
|
59
|
+
# opengeodeweb-viewer
|
|
60
|
+
jsonschema-specifications==2023.12.1
|
|
61
|
+
# via
|
|
62
|
+
# geodeapp-viewer
|
|
63
|
+
# jsonschema
|
|
64
|
+
# opengeodeweb-viewer
|
|
65
|
+
kiwisolver==1.4.5
|
|
66
|
+
# via
|
|
67
|
+
# geodeapp-viewer
|
|
68
|
+
# matplotlib
|
|
69
|
+
matplotlib==3.8.3
|
|
70
|
+
# via
|
|
71
|
+
# geodeapp-viewer
|
|
72
|
+
# vtk
|
|
73
|
+
multidict==6.0.5
|
|
74
|
+
# via
|
|
75
|
+
# aiohttp
|
|
76
|
+
# geodeapp-viewer
|
|
77
|
+
# opengeodeweb-viewer
|
|
78
|
+
# yarl
|
|
79
|
+
numpy==1.26.4
|
|
80
|
+
# via
|
|
81
|
+
# contourpy
|
|
82
|
+
# geodeapp-viewer
|
|
83
|
+
# matplotlib
|
|
84
|
+
opengeodeweb-viewer[gpu]==0.1.1
|
|
85
|
+
# via geodeapp-viewer
|
|
86
|
+
packaging==24.0
|
|
87
|
+
# via
|
|
88
|
+
# geodeapp-viewer
|
|
89
|
+
# matplotlib
|
|
90
|
+
pillow==10.3.0
|
|
91
|
+
# via
|
|
92
|
+
# geodeapp-viewer
|
|
93
|
+
# matplotlib
|
|
94
|
+
pyparsing==3.1.2
|
|
95
|
+
# via
|
|
96
|
+
# geodeapp-viewer
|
|
97
|
+
# matplotlib
|
|
98
|
+
python-dateutil==2.9.0.post0
|
|
99
|
+
# via
|
|
100
|
+
# geodeapp-viewer
|
|
101
|
+
# matplotlib
|
|
102
|
+
python-dotenv==1.0.1
|
|
103
|
+
# via
|
|
104
|
+
# geodeapp-viewer
|
|
105
|
+
# opengeodeweb-viewer
|
|
106
|
+
referencing==0.33.0
|
|
107
|
+
# via
|
|
108
|
+
# geodeapp-viewer
|
|
109
|
+
# jsonschema
|
|
110
|
+
# jsonschema-specifications
|
|
111
|
+
# opengeodeweb-viewer
|
|
112
|
+
rpds-py==0.18.0
|
|
113
|
+
# via
|
|
114
|
+
# geodeapp-viewer
|
|
115
|
+
# jsonschema
|
|
116
|
+
# opengeodeweb-viewer
|
|
117
|
+
# referencing
|
|
118
|
+
six==1.16.0
|
|
119
|
+
# via
|
|
120
|
+
# geodeapp-viewer
|
|
121
|
+
# python-dateutil
|
|
122
|
+
vtk==9.3.0
|
|
123
|
+
# via
|
|
124
|
+
# geodeapp-viewer
|
|
125
|
+
# opengeodeweb-viewer
|
|
126
|
+
websocket-client==1.7.0
|
|
127
|
+
# via
|
|
128
|
+
# geodeapp-viewer
|
|
129
|
+
# opengeodeweb-viewer
|
|
130
|
+
wslink==1.12.4
|
|
131
|
+
# via
|
|
132
|
+
# geodeapp-viewer
|
|
133
|
+
# opengeodeweb-viewer
|
|
134
|
+
yarl==1.9.4
|
|
135
|
+
# via
|
|
136
|
+
# aiohttp
|
|
137
|
+
# geodeapp-viewer
|
|
138
|
+
# opengeodeweb-viewer
|
|
139
|
+
zipp==3.18.1
|
|
140
|
+
# via geodeapp-viewer
|
package/forge.config.cjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
packagerConfig: {
|
|
3
|
+
asar: false,
|
|
4
|
+
extraResource: [
|
|
5
|
+
"./.output/public/.",
|
|
6
|
+
"./dist-electron",
|
|
7
|
+
"./electron-server/dist_viewer/geodeapp_viewer",
|
|
8
|
+
"./electron-server/dist_back/geodeapp_back",
|
|
9
|
+
],
|
|
10
|
+
icon: "./favicon.ico",
|
|
11
|
+
},
|
|
12
|
+
rebuildConfig: {},
|
|
13
|
+
|
|
14
|
+
makers: [
|
|
15
|
+
{
|
|
16
|
+
name: "@electron-forge/maker-zip",
|
|
17
|
+
config: {},
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
publishers: [
|
|
21
|
+
{
|
|
22
|
+
name: "@electron-forge/publisher-github",
|
|
23
|
+
config: {
|
|
24
|
+
repository: {
|
|
25
|
+
owner: "Geode-solutions",
|
|
26
|
+
name: "GeodeApp",
|
|
27
|
+
},
|
|
28
|
+
draft: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
package/nuxt.config.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export default defineNuxtConfig({
|
|
2
|
+
extends: ["@geode/opengeodeweb-front"],
|
|
3
|
+
modules: [
|
|
4
|
+
"nuxt-electron",
|
|
5
|
+
"vuetify-nuxt-module",
|
|
6
|
+
[
|
|
7
|
+
"@pinia/nuxt",
|
|
8
|
+
{
|
|
9
|
+
autoImports: ["storeToRefs", "defineStore"],
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
"@nuxt/devtools",
|
|
13
|
+
"@vueuse/nuxt",
|
|
14
|
+
],
|
|
15
|
+
electron: {
|
|
16
|
+
build: [
|
|
17
|
+
{
|
|
18
|
+
// Main-Process entry file of the Electron App.
|
|
19
|
+
entry: "electron/main.js",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
entry: "electron/preload.js",
|
|
23
|
+
onstart(args) {
|
|
24
|
+
args.reload();
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
app: {
|
|
32
|
+
head: {
|
|
33
|
+
titleTemplate: "Vease",
|
|
34
|
+
meta: [
|
|
35
|
+
{ charset: "utf-8" },
|
|
36
|
+
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
|
37
|
+
{
|
|
38
|
+
hid: "description",
|
|
39
|
+
name: "description",
|
|
40
|
+
content: "Platform for geological data visualization",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
link: [{ rel: "icon", type: "image/ico", href: "/favicon.ico" }],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
imports: {
|
|
48
|
+
dirs: ["stores", "@geode/opengeodeweb-front/stores"],
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
vue: {
|
|
52
|
+
compilerOptions: {
|
|
53
|
+
isCustomElement: (tag) => ["md-linedivider"].includes(tag),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
devtools: {
|
|
57
|
+
enabled: process.env.NODE_ENV === "production" ? false : true,
|
|
58
|
+
},
|
|
59
|
+
css: ["assets/css/main.css"],
|
|
60
|
+
vite: {
|
|
61
|
+
optimizeDeps: {
|
|
62
|
+
include: ["@geode/opengeodeweb-front"],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vease",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Basic app",
|
|
5
|
+
"main": "dist-electron/main.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "nuxi dev",
|
|
8
|
+
"generate": "nuxt generate",
|
|
9
|
+
"install_back": "./electron-server/install_back.sh",
|
|
10
|
+
"install_viewer": "./electron-server/install_viewer.sh",
|
|
11
|
+
"build": "nuxi build --prerender",
|
|
12
|
+
"test": "vitest",
|
|
13
|
+
"start": "npm run build && electron-forge start",
|
|
14
|
+
"package": "npm run build && electron-forge package",
|
|
15
|
+
"make": "electron-forge make",
|
|
16
|
+
"publish": "electron-forge publish",
|
|
17
|
+
"postinstall": "npm run install_back && npm run install_viewer"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/Geode-solutions/GeodeApp.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"Geology",
|
|
25
|
+
"Visualization",
|
|
26
|
+
"Web",
|
|
27
|
+
"Desktop",
|
|
28
|
+
"Meshing"
|
|
29
|
+
],
|
|
30
|
+
"author": "Geode-solutions",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/Geode-solutions/GeodeApp/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/Geode-solutions/GeodeApp#readme",
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@electron-forge/cli": "^7.3.1",
|
|
38
|
+
"@electron-forge/maker-squirrel": "^7.3.1",
|
|
39
|
+
"@electron-forge/maker-zip": "^7.3.1",
|
|
40
|
+
"@electron-forge/plugin-auto-unpack-natives": "^7.3.1",
|
|
41
|
+
"@electron-forge/publisher-github": "^7.3.1",
|
|
42
|
+
"electron": "^28.2.7",
|
|
43
|
+
"electron-builder": "^24.13.3",
|
|
44
|
+
"nuxt-electron": "^0.7.0",
|
|
45
|
+
"vite-plugin-electron": "^0.28.4",
|
|
46
|
+
"vite-plugin-electron-renderer": "^0.14.5"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@geode/opengeodeweb-front": "^8.0.1",
|
|
50
|
+
"@nuxtjs/tailwindcss": "^6.8.0",
|
|
51
|
+
"@pinia/nuxt": "^0.5.1",
|
|
52
|
+
"@vueuse/nuxt": "^10.9.0",
|
|
53
|
+
"draggable": "^4.2.0",
|
|
54
|
+
"get-port-please": "^3.1.2",
|
|
55
|
+
"h3-formidable": "^1.0.0",
|
|
56
|
+
"nuxt": "^3.7.4",
|
|
57
|
+
"pinia": "^2.1.7",
|
|
58
|
+
"update-electron-app": "^3.0.0",
|
|
59
|
+
"vue": "^3.4.21",
|
|
60
|
+
"vue-cropperjs": "^5.0.0",
|
|
61
|
+
"vue-router": "^4.3.0",
|
|
62
|
+
"vuedraggable": "^2.24.3",
|
|
63
|
+
"vuetify-nuxt-module": "^0.12.0"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container fluid fill-height>
|
|
3
|
+
<v-row align="center" justify="center">
|
|
4
|
+
<v-col cols="12" md="6">
|
|
5
|
+
<v-card color="#277a67" class="custom-card">
|
|
6
|
+
<v-card-title class="text-center">
|
|
7
|
+
<h2 class="mb-6">Profil Management</h2>
|
|
8
|
+
</v-card-title>
|
|
9
|
+
<v-card-text>
|
|
10
|
+
<v-form
|
|
11
|
+
ref="form"
|
|
12
|
+
v-model="valid"
|
|
13
|
+
lazy-validation
|
|
14
|
+
enctype="multipart/form-data"
|
|
15
|
+
@submit.prevent="updateProfile"
|
|
16
|
+
>
|
|
17
|
+
<v-text-field
|
|
18
|
+
v-model="firstName"
|
|
19
|
+
:rules="nameRules"
|
|
20
|
+
label="First name"
|
|
21
|
+
required
|
|
22
|
+
:counter="50"
|
|
23
|
+
class="mb-2"
|
|
24
|
+
></v-text-field>
|
|
25
|
+
<v-text-field
|
|
26
|
+
v-model="lastName"
|
|
27
|
+
:rules="nameRules"
|
|
28
|
+
label="Name"
|
|
29
|
+
required
|
|
30
|
+
:counter="50"
|
|
31
|
+
class="mb-2"
|
|
32
|
+
></v-text-field>
|
|
33
|
+
<v-text-field
|
|
34
|
+
v-model="email"
|
|
35
|
+
:rules="emailRules"
|
|
36
|
+
label="E-mail"
|
|
37
|
+
class="mb-2"
|
|
38
|
+
required
|
|
39
|
+
></v-text-field>
|
|
40
|
+
<v-text-field
|
|
41
|
+
v-model="password"
|
|
42
|
+
:type="showPassword ? 'text' : 'password'"
|
|
43
|
+
:rules="passwordRules"
|
|
44
|
+
label="Password"
|
|
45
|
+
class="mb-2"
|
|
46
|
+
required
|
|
47
|
+
@click:append="togglePasswordVisibility"
|
|
48
|
+
></v-text-field>
|
|
49
|
+
<v-text-field
|
|
50
|
+
:type="showPassword ? 'text' : 'password'"
|
|
51
|
+
:rules="confirmPasswordRules"
|
|
52
|
+
label="Confirm Password"
|
|
53
|
+
class="mb-2"
|
|
54
|
+
required
|
|
55
|
+
:append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'"
|
|
56
|
+
@click:append="togglePasswordVisibility"
|
|
57
|
+
></v-text-field>
|
|
58
|
+
<form
|
|
59
|
+
class="mt-4 flex flex-col space-y-4"
|
|
60
|
+
@submit.prevent="uploadImage"
|
|
61
|
+
>
|
|
62
|
+
<div class="flex items-center space-x-4">
|
|
63
|
+
<div class="flex items-center justify-center h-40 w-40">
|
|
64
|
+
<label
|
|
65
|
+
for="dropzone-file"
|
|
66
|
+
class="flex flex-col items-center justify-center border-2 h-40 w-40 border-gray-300 rounded-full cursor-pointer bg-gray-50 hover:bg-gray-100"
|
|
67
|
+
><v-file-input
|
|
68
|
+
prepend-icon="mdi-camera"
|
|
69
|
+
label="Profil Picture"
|
|
70
|
+
ref="files"
|
|
71
|
+
accept="image/*"
|
|
72
|
+
id="dropzone-file"
|
|
73
|
+
type="file"
|
|
74
|
+
class="hidden"
|
|
75
|
+
@change="onFileChange"
|
|
76
|
+
/>
|
|
77
|
+
<div
|
|
78
|
+
v-if="!image"
|
|
79
|
+
class="flex flex-col items-center justify-center pt-5 pb-6"
|
|
80
|
+
></div>
|
|
81
|
+
<img
|
|
82
|
+
v-else
|
|
83
|
+
:src="image"
|
|
84
|
+
class="rounded-full object-fill"
|
|
85
|
+
:width="250"
|
|
86
|
+
aspect-ratio="16/19"
|
|
87
|
+
cover
|
|
88
|
+
/>
|
|
89
|
+
</label>
|
|
90
|
+
</div>
|
|
91
|
+
<v-btn type="submit" class="mb-6"> Upload Image </v-btn>
|
|
92
|
+
</div>
|
|
93
|
+
<span
|
|
94
|
+
v-if="success || error"
|
|
95
|
+
:class="{
|
|
96
|
+
'text-green-600': success,
|
|
97
|
+
'text-red-600': error,
|
|
98
|
+
}"
|
|
99
|
+
class="font-medium mb-6"
|
|
100
|
+
>{{ success || error }}</span
|
|
101
|
+
>
|
|
102
|
+
</form>
|
|
103
|
+
<v-btn
|
|
104
|
+
:disabled="!valid || !imageUploaded"
|
|
105
|
+
color="#277a67"
|
|
106
|
+
block
|
|
107
|
+
class="icon-style custom-button"
|
|
108
|
+
type="submit"
|
|
109
|
+
>
|
|
110
|
+
Update profile
|
|
111
|
+
</v-btn>
|
|
112
|
+
</v-form>
|
|
113
|
+
</v-card-text>
|
|
114
|
+
</v-card>
|
|
115
|
+
</v-col>
|
|
116
|
+
</v-row>
|
|
117
|
+
</v-container>
|
|
118
|
+
</template>
|
|
119
|
+
|
|
120
|
+
<style scoped>
|
|
121
|
+
.custom-card {
|
|
122
|
+
border: 1px solid white;
|
|
123
|
+
border-radius: 20px;
|
|
124
|
+
padding: 20px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.custom-button {
|
|
128
|
+
border: 1px solid white;
|
|
129
|
+
padding: 25px;
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
132
|
+
|
|
133
|
+
<script setup>
|
|
134
|
+
const valid = ref(true);
|
|
135
|
+
const showPassword = ref(false);
|
|
136
|
+
const userStore = useUserStore();
|
|
137
|
+
|
|
138
|
+
const { firstName, lastName, email, password, profileImage } = userStore;
|
|
139
|
+
|
|
140
|
+
const files = ref();
|
|
141
|
+
const image = ref();
|
|
142
|
+
const success = ref();
|
|
143
|
+
const error = ref();
|
|
144
|
+
const imageUploaded = ref(false);
|
|
145
|
+
|
|
146
|
+
const nameRules = [
|
|
147
|
+
(v) => !!v || "Name is required",
|
|
148
|
+
(v) => /^[\p{L}\p{M}\s]*$/u.test(v) || "Use only letters and spaces",
|
|
149
|
+
(v) => (v && v.length <= 50) || "Name must be less than 50 characters",
|
|
150
|
+
];
|
|
151
|
+
|
|
152
|
+
const emailRules = [
|
|
153
|
+
(v) => !!v || "E-mail is required",
|
|
154
|
+
(v) =>
|
|
155
|
+
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
|
|
156
|
+
v
|
|
157
|
+
) || "E-mail should be valid",
|
|
158
|
+
];
|
|
159
|
+
|
|
160
|
+
const passwordRules = [
|
|
161
|
+
(v) => !!v || "Password is required",
|
|
162
|
+
(v) => (v && v.length >= 12) || "Password must be at least 12 characters",
|
|
163
|
+
];
|
|
164
|
+
|
|
165
|
+
const confirmPasswordRules = [
|
|
166
|
+
(v) => !!v || "Confirm password is required",
|
|
167
|
+
(v) => v === password || "Passwords are different",
|
|
168
|
+
];
|
|
169
|
+
|
|
170
|
+
const updateProfile = () => {
|
|
171
|
+
if (valid.value) {
|
|
172
|
+
console.log("Update profile", image);
|
|
173
|
+
userStore.$patch({
|
|
174
|
+
firstName,
|
|
175
|
+
lastName,
|
|
176
|
+
email,
|
|
177
|
+
password,
|
|
178
|
+
image,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const togglePasswordVisibility = () => {
|
|
184
|
+
showPassword.value = !showPassword.value;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
function onFileChange(e) {
|
|
188
|
+
const file = e.target.files[0];
|
|
189
|
+
image.value = URL.createObjectURL(file);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
async function uploadImage() {
|
|
193
|
+
try {
|
|
194
|
+
error.value = null;
|
|
195
|
+
success.value = null;
|
|
196
|
+
const formData = new FormData();
|
|
197
|
+
Array.from(files.value.files).map((file, index) =>
|
|
198
|
+
formData.append(index, file)
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
const { message } = await $fetch("/api/upload", {
|
|
202
|
+
method: "POST",
|
|
203
|
+
body: formData,
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
success.value = message;
|
|
207
|
+
imageUploaded.value = true;
|
|
208
|
+
} catch (e) {
|
|
209
|
+
error.value = e.statusMessage;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<template></template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<template></template>
|