Compare commits
10 Commits
63d76accff
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d0cfefaa3d | |||
| 9a0b73d27c | |||
| b5ace9871d | |||
| 981566c3ba | |||
| 3aa6590c9a | |||
| ca2bd2f50a | |||
| fb01fe583e | |||
| 4925e6b739 | |||
| 0d4c71926d | |||
| e994430d28 |
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM node:23-slim AS base
|
||||
LABEL Author="eisterman"
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
FROM base AS prod-deps
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||
|
||||
FROM base AS build
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||
RUN pnpm run build
|
||||
|
||||
FROM base
|
||||
COPY --from=prod-deps /app/node_modules /app/node_modules
|
||||
COPY --from=build /app/build /app/build
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["node", "build"]
|
||||
42
README.md
42
README.md
@@ -1,38 +1,8 @@
|
||||
# sv
|
||||
# Svelte-Kit RE Charge.re
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
||||
### Missing in TODO:
|
||||
|
||||
## Creating a project
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
|
||||
```bash
|
||||
# create a new project in the current directory
|
||||
npx sv create
|
||||
|
||||
# create a new project in my-app
|
||||
npx sv create my-app
|
||||
```
|
||||
|
||||
## Developing
|
||||
|
||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
|
||||
# or start the server and open the app in a new browser tab
|
||||
npm run dev -- --open
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To create a production version of your app:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
||||
- [ ] Localizzazione
|
||||
- [ ] Opzione per selezione lingue
|
||||
- [ ] Aggiornamento paraglide
|
||||
- [ ] Pagina di "attesa 30 secondi avvio carica"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"@iconify/svelte": "^4.2.0",
|
||||
"@melt-ui/pp": "^0.3.2",
|
||||
"@melt-ui/svelte": "^0.86.5",
|
||||
"@sveltejs/adapter-auto": "^4.0.0",
|
||||
"@sveltejs/adapter-node": "^5.2.12",
|
||||
"@sveltejs/enhanced-img": "^0.4.4",
|
||||
"@sveltejs/kit": "^2.16.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
|
||||
139
pnpm-lock.yaml
generated
139
pnpm-lock.yaml
generated
@@ -36,9 +36,9 @@ importers:
|
||||
'@melt-ui/svelte':
|
||||
specifier: ^0.86.5
|
||||
version: 0.86.5(svelte@5.25.3)
|
||||
'@sveltejs/adapter-auto':
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))
|
||||
'@sveltejs/adapter-node':
|
||||
specifier: ^5.2.12
|
||||
version: 5.2.12(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))
|
||||
'@sveltejs/enhanced-img':
|
||||
specifier: ^0.4.4
|
||||
version: 0.4.4(rollup@4.37.0)(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
@@ -528,6 +528,33 @@ packages:
|
||||
resolution: {integrity: sha512-ct43jurbe7lsUX5eIrj4ijO3j/6zIPp7CDnFWXDs7UPAbw1Pu1iH3oAmFdP4jcskKJBURH5M9oTtyeiUXyHX8Q==}
|
||||
engines: {node: '>=18.16.0'}
|
||||
|
||||
'@rollup/plugin-commonjs@28.0.3':
|
||||
resolution: {integrity: sha512-pyltgilam1QPdn+Zd9gaCfOLcnjMEJ9gV+bTw6/r73INdvzf1ah9zLIJBm+kW7R6IUFIQ1YO+VqZtYxZNWFPEQ==}
|
||||
engines: {node: '>=16.0.0 || 14 >= 14.17'}
|
||||
peerDependencies:
|
||||
rollup: ^2.68.0||^3.0.0||^4.0.0
|
||||
peerDependenciesMeta:
|
||||
rollup:
|
||||
optional: true
|
||||
|
||||
'@rollup/plugin-json@6.1.0':
|
||||
resolution: {integrity: sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
peerDependencies:
|
||||
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
|
||||
peerDependenciesMeta:
|
||||
rollup:
|
||||
optional: true
|
||||
|
||||
'@rollup/plugin-node-resolve@16.0.1':
|
||||
resolution: {integrity: sha512-tk5YCxJWIG81umIvNkSod2qK5KyQW19qcBF/B78n1bjtOON6gzKoVeSzAE8yHCZEDmqkHKkxplExA8KzdJLJpA==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
peerDependencies:
|
||||
rollup: ^2.78.0||^3.0.0||^4.0.0
|
||||
peerDependenciesMeta:
|
||||
rollup:
|
||||
optional: true
|
||||
|
||||
'@rollup/pluginutils@5.1.4':
|
||||
resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
@@ -664,10 +691,10 @@ packages:
|
||||
peerDependencies:
|
||||
acorn: ^8.9.0
|
||||
|
||||
'@sveltejs/adapter-auto@4.0.0':
|
||||
resolution: {integrity: sha512-kmuYSQdD2AwThymQF0haQhM8rE5rhutQXG4LNbnbShwhMO4qQGnKaaTy+88DuNSuoQDi58+thpq8XpHc1+oEKQ==}
|
||||
'@sveltejs/adapter-node@5.2.12':
|
||||
resolution: {integrity: sha512-0bp4Yb3jKIEcZWVcJC/L1xXp9zzJS4hDwfb4VITAkfT4OVdkspSHsx7YhqJDbb2hgLl6R9Vs7VQR+fqIVOxPUQ==}
|
||||
peerDependencies:
|
||||
'@sveltejs/kit': ^2.0.0
|
||||
'@sveltejs/kit': ^2.4.0
|
||||
|
||||
'@sveltejs/enhanced-img@0.4.4':
|
||||
resolution: {integrity: sha512-BlBTGfbLUgHa+zSVrsGLOd+noCKWfipoOjoxE26bAAX97v7zh5eiCAp1KEdpkluL05Tl3+nR14gQdPsATyZqoA==}
|
||||
@@ -798,6 +825,9 @@ packages:
|
||||
'@types/leaflet@1.9.17':
|
||||
resolution: {integrity: sha512-IJ4K6t7I3Fh5qXbQ1uwL3CFVbCi6haW9+53oLWgdKlLP7EaS21byWFJxxqOx9y8I0AP0actXSJLVMbyvxhkUTA==}
|
||||
|
||||
'@types/resolve@1.20.2':
|
||||
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
|
||||
|
||||
'@types/validator@13.12.2':
|
||||
resolution: {integrity: sha512-6SlHBzUW8Jhf3liqrGGXyTJSIFe4nqlJ5A5KaMZ2l/vbM3Wh3KSybots/wfWVzNLK4D1NZluDlSQIbIEPx6oyA==}
|
||||
|
||||
@@ -967,6 +997,9 @@ packages:
|
||||
resolution: {integrity: sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==}
|
||||
engines: {node: '>= 6'}
|
||||
|
||||
commondir@1.0.1:
|
||||
resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==}
|
||||
|
||||
concat-map@0.0.1:
|
||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||
|
||||
@@ -1193,6 +1226,9 @@ packages:
|
||||
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
|
||||
os: [darwin]
|
||||
|
||||
function-bind@1.1.2:
|
||||
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
|
||||
|
||||
glob-parent@5.1.2:
|
||||
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
|
||||
engines: {node: '>= 6'}
|
||||
@@ -1223,6 +1259,10 @@ packages:
|
||||
resolution: {integrity: sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
hasown@2.0.2:
|
||||
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
human-id@4.1.1:
|
||||
resolution: {integrity: sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==}
|
||||
hasBin: true
|
||||
@@ -1252,6 +1292,10 @@ packages:
|
||||
is-arrayish@0.3.2:
|
||||
resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==}
|
||||
|
||||
is-core-module@2.16.1:
|
||||
resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
is-extglob@2.1.1:
|
||||
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -1260,10 +1304,16 @@ packages:
|
||||
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
is-module@1.0.0:
|
||||
resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==}
|
||||
|
||||
is-number@7.0.0:
|
||||
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
|
||||
engines: {node: '>=0.12.0'}
|
||||
|
||||
is-reference@1.2.1:
|
||||
resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==}
|
||||
|
||||
is-reference@3.0.3:
|
||||
resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==}
|
||||
|
||||
@@ -1477,6 +1527,9 @@ packages:
|
||||
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
path-parse@1.0.7:
|
||||
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
|
||||
|
||||
picocolors@1.1.1:
|
||||
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
|
||||
|
||||
@@ -1552,6 +1605,11 @@ packages:
|
||||
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
resolve@1.22.10:
|
||||
resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==}
|
||||
engines: {node: '>= 0.4'}
|
||||
hasBin: true
|
||||
|
||||
reusify@1.1.0:
|
||||
resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==}
|
||||
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
|
||||
@@ -1626,6 +1684,10 @@ packages:
|
||||
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
supports-preserve-symlinks-flag@1.0.0:
|
||||
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
svelte-check@4.1.5:
|
||||
resolution: {integrity: sha512-Gb0T2IqBNe1tLB9EB1Qh+LOe+JB8wt2/rNBDGvkxQVvk8vNeAoG+vZgFB/3P5+zC7RWlyBlzm9dVjZFph/maIg==}
|
||||
engines: {node: '>= 18.0.0'}
|
||||
@@ -2212,6 +2274,34 @@ snapshots:
|
||||
'@poppinss/macroable@1.0.4':
|
||||
optional: true
|
||||
|
||||
'@rollup/plugin-commonjs@28.0.3(rollup@4.37.0)':
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.1.4(rollup@4.37.0)
|
||||
commondir: 1.0.1
|
||||
estree-walker: 2.0.2
|
||||
fdir: 6.4.3(picomatch@4.0.2)
|
||||
is-reference: 1.2.1
|
||||
magic-string: 0.30.17
|
||||
picomatch: 4.0.2
|
||||
optionalDependencies:
|
||||
rollup: 4.37.0
|
||||
|
||||
'@rollup/plugin-json@6.1.0(rollup@4.37.0)':
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.1.4(rollup@4.37.0)
|
||||
optionalDependencies:
|
||||
rollup: 4.37.0
|
||||
|
||||
'@rollup/plugin-node-resolve@16.0.1(rollup@4.37.0)':
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.1.4(rollup@4.37.0)
|
||||
'@types/resolve': 1.20.2
|
||||
deepmerge: 4.3.1
|
||||
is-module: 1.0.0
|
||||
resolve: 1.22.10
|
||||
optionalDependencies:
|
||||
rollup: 4.37.0
|
||||
|
||||
'@rollup/pluginutils@5.1.4(rollup@4.37.0)':
|
||||
dependencies:
|
||||
'@types/estree': 1.0.7
|
||||
@@ -2305,10 +2395,13 @@ snapshots:
|
||||
dependencies:
|
||||
acorn: 8.14.1
|
||||
|
||||
'@sveltejs/adapter-auto@4.0.0(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))':
|
||||
'@sveltejs/adapter-node@5.2.12(@sveltejs/kit@2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))':
|
||||
dependencies:
|
||||
'@rollup/plugin-commonjs': 28.0.3(rollup@4.37.0)
|
||||
'@rollup/plugin-json': 6.1.0(rollup@4.37.0)
|
||||
'@rollup/plugin-node-resolve': 16.0.1(rollup@4.37.0)
|
||||
'@sveltejs/kit': 2.20.2(@sveltejs/vite-plugin-svelte@5.0.3(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2)))(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2))
|
||||
import-meta-resolve: 4.1.0
|
||||
rollup: 4.37.0
|
||||
|
||||
'@sveltejs/enhanced-img@0.4.4(rollup@4.37.0)(svelte@5.25.3)(vite@6.2.3(jiti@2.4.2)(lightningcss@1.29.2))':
|
||||
dependencies:
|
||||
@@ -2440,6 +2533,8 @@ snapshots:
|
||||
dependencies:
|
||||
'@types/geojson': 7946.0.16
|
||||
|
||||
'@types/resolve@1.20.2': {}
|
||||
|
||||
'@types/validator@13.12.2':
|
||||
optional: true
|
||||
|
||||
@@ -2646,6 +2741,8 @@ snapshots:
|
||||
has-own-prop: 2.0.0
|
||||
repeat-string: 1.6.1
|
||||
|
||||
commondir@1.0.1: {}
|
||||
|
||||
concat-map@0.0.1: {}
|
||||
|
||||
consola@3.4.0: {}
|
||||
@@ -2900,6 +2997,8 @@ snapshots:
|
||||
fsevents@2.3.3:
|
||||
optional: true
|
||||
|
||||
function-bind@1.1.2: {}
|
||||
|
||||
glob-parent@5.1.2:
|
||||
dependencies:
|
||||
is-glob: 4.0.3
|
||||
@@ -2920,6 +3019,10 @@ snapshots:
|
||||
|
||||
has-own-prop@2.0.0: {}
|
||||
|
||||
hasown@2.0.2:
|
||||
dependencies:
|
||||
function-bind: 1.1.2
|
||||
|
||||
human-id@4.1.1: {}
|
||||
|
||||
ignore@5.3.2: {}
|
||||
@@ -2939,14 +3042,24 @@ snapshots:
|
||||
|
||||
is-arrayish@0.3.2: {}
|
||||
|
||||
is-core-module@2.16.1:
|
||||
dependencies:
|
||||
hasown: 2.0.2
|
||||
|
||||
is-extglob@2.1.1: {}
|
||||
|
||||
is-glob@4.0.3:
|
||||
dependencies:
|
||||
is-extglob: 2.1.1
|
||||
|
||||
is-module@1.0.0: {}
|
||||
|
||||
is-number@7.0.0: {}
|
||||
|
||||
is-reference@1.2.1:
|
||||
dependencies:
|
||||
'@types/estree': 1.0.7
|
||||
|
||||
is-reference@3.0.3:
|
||||
dependencies:
|
||||
'@types/estree': 1.0.7
|
||||
@@ -3120,6 +3233,8 @@ snapshots:
|
||||
|
||||
path-key@3.1.1: {}
|
||||
|
||||
path-parse@1.0.7: {}
|
||||
|
||||
picocolors@1.1.1: {}
|
||||
|
||||
picomatch@2.3.1: {}
|
||||
@@ -3173,6 +3288,12 @@ snapshots:
|
||||
|
||||
resolve-from@4.0.0: {}
|
||||
|
||||
resolve@1.22.10:
|
||||
dependencies:
|
||||
is-core-module: 2.16.1
|
||||
path-parse: 1.0.7
|
||||
supports-preserve-symlinks-flag: 1.0.0
|
||||
|
||||
reusify@1.1.0: {}
|
||||
|
||||
rollup@4.37.0:
|
||||
@@ -3284,6 +3405,8 @@ snapshots:
|
||||
dependencies:
|
||||
has-flag: 4.0.0
|
||||
|
||||
supports-preserve-symlinks-flag@1.0.0: {}
|
||||
|
||||
svelte-check@4.1.5(picomatch@4.0.2)(svelte@5.25.3)(typescript@5.8.2):
|
||||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.25
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
</script>
|
||||
|
||||
{#if show}
|
||||
<div class="fixed inset-0 h-screen w-screen z-20 pointer-events-auto flex flex-col justify-end items-center">
|
||||
<button type="button" class="bg-base-100/50 w-full grow z-20"
|
||||
<div class="visible fixed inset-0 h-screen w-screen z-20 pointer-events-auto flex flex-col justify-end items-center">
|
||||
<button type="button" class="bg-base-100/50 absolute inset-0 h-full w-full"
|
||||
transition:fade={{duration:200}}
|
||||
onclick={closeOverlay}
|
||||
aria-label="Close Overlay"
|
||||
|
||||
60
src/lib/ToastSystem/Toast.svelte
Normal file
60
src/lib/ToastSystem/Toast.svelte
Normal file
@@ -0,0 +1,60 @@
|
||||
<script lang="ts">
|
||||
import {
|
||||
melt,
|
||||
type Toast,
|
||||
type ToastsElements,
|
||||
} from '@melt-ui/svelte';
|
||||
import type { ToastData } from "$lib/ToastSystem/types";
|
||||
import { onMount } from "svelte";
|
||||
|
||||
interface Props {
|
||||
elements: ToastsElements,
|
||||
toast: Toast<ToastData>,
|
||||
}
|
||||
|
||||
const { elements, toast }: Props = $props();
|
||||
const { content, title, description, close } = $derived(elements);
|
||||
const { data, id, getPercentage } = $derived(toast);
|
||||
|
||||
const alertClass = $derived.by(() => {
|
||||
switch (data.type) {
|
||||
case "success":
|
||||
return 'alert-success';
|
||||
case "warning":
|
||||
return 'alert-warning';
|
||||
case "error":
|
||||
return 'alert-error';
|
||||
case "info":
|
||||
return 'alert-info';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
});
|
||||
|
||||
let percentage = $state(0);
|
||||
|
||||
onMount(() => {
|
||||
let frame: number;
|
||||
const updatePercentage = () => {
|
||||
percentage = getPercentage();
|
||||
frame = requestAnimationFrame(updatePercentage);
|
||||
};
|
||||
frame = requestAnimationFrame(updatePercentage);
|
||||
return () => cancelAnimationFrame(frame);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div use:melt={$content(id)} class="relative w-[70%] visible">
|
||||
<div class="absolute w-full flex flex-col px-2">
|
||||
<progress class="progress h-1 w-full" value={percentage} max="100"></progress>
|
||||
</div>
|
||||
<div class={["alert", alertClass]}>
|
||||
<button use:melt={$close(id)} aria-label="close notification" class="absolute right-2 top-0">x</button>
|
||||
<h3 use:melt={$title(id)} class="font-bold">
|
||||
{data.title}
|
||||
</h3>
|
||||
<div use:melt={$description(id)}>
|
||||
{data.description}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
23
src/lib/ToastSystem/Toaster.svelte
Normal file
23
src/lib/ToastSystem/Toaster.svelte
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang="ts" module>
|
||||
import { createToaster } from '@melt-ui/svelte';
|
||||
import type { ToastData } from "$lib/ToastSystem/types";
|
||||
|
||||
const {
|
||||
elements,
|
||||
helpers,
|
||||
states: { toasts },
|
||||
actions: { portal }
|
||||
} = createToaster<ToastData>();
|
||||
|
||||
export const addToast = helpers.addToast;
|
||||
</script>
|
||||
<script>
|
||||
import Toast from "$lib/ToastSystem/Toast.svelte";
|
||||
</script>
|
||||
|
||||
<div use:portal
|
||||
class="fixed w-screen h-screen top-0 z-50 pb-4 flex flex-col-reverse justify-start items-center gap-2 invisible">
|
||||
{#each $toasts as toast (toast.id)}
|
||||
<Toast {elements} {toast}/>
|
||||
{/each}
|
||||
</div>
|
||||
5
src/lib/ToastSystem/types.ts
Normal file
5
src/lib/ToastSystem/types.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export type ToastData = {
|
||||
title: string
|
||||
description: string
|
||||
type: 'info' | 'success' | 'warning' | 'error',
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<script lang="ts" module>
|
||||
import { createToaster, melt } from '@melt-ui/svelte';
|
||||
|
||||
export type ToastData = {
|
||||
title: string
|
||||
description: string
|
||||
color: string
|
||||
}
|
||||
// TODO: Change color with type e setta classe
|
||||
|
||||
// TODO: Usa getPercentage per mostrare la loading bar sugli alert!
|
||||
|
||||
const {
|
||||
elements: { content, title, description, close },
|
||||
helpers,
|
||||
states: { toasts },
|
||||
actions: { portal }
|
||||
} = createToaster<ToastData>();
|
||||
|
||||
export const addToast = helpers.addToast;
|
||||
</script>
|
||||
|
||||
<div use:portal class="fixed w-screen top-0 z-50 m-4 flex flex-col items-center gap-2 pointer-events-none">
|
||||
{#each $toasts as { id, data } (id)}
|
||||
<div use:melt={$content(id)} class="pointer-events-auto alert alert-info relative w-[70%]">
|
||||
<div>
|
||||
<h3 use:melt={$title(id)} class="font-bold">
|
||||
{data.title}
|
||||
<!-- <span style:color={data.color}></span>-->
|
||||
</h3>
|
||||
<div use:melt={$description(id)}>
|
||||
{data.description}
|
||||
</div>
|
||||
</div>
|
||||
<button use:melt={$close(id)} aria-label="close notification" class="absolute right-2 top-0">x</button>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import '../app.css';
|
||||
import Toaster from "$lib/Toaster.svelte";
|
||||
import Toaster from "$lib/ToastSystem/Toaster.svelte";
|
||||
|
||||
let { children } = $props();
|
||||
</script>
|
||||
|
||||
@@ -85,8 +85,8 @@
|
||||
</Map>
|
||||
{/await}
|
||||
</div>
|
||||
<div class="z-20 mt-16 grow pointer-events-none">
|
||||
<div class="flex justify-center items-center h-full pointer-events-none">
|
||||
<div class="z-20 mt-16 grow invisible">
|
||||
<div class="flex justify-center items-center h-full">
|
||||
{@render children()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { scale } from 'svelte/transition';
|
||||
import { goto } from "$app/navigation";
|
||||
import { goto, invalidate } from "$app/navigation";
|
||||
import BSlideOverlay from "$lib/BSlideOverlay.svelte";
|
||||
import { addToast } from '$lib/Toaster.svelte';
|
||||
import { addToast } from '$lib/ToastSystem/Toaster.svelte';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
@@ -13,37 +13,43 @@
|
||||
if (startingCharge) return;
|
||||
startingCharge = true;
|
||||
try {
|
||||
// TODO: StartCharge fetch request
|
||||
// const response = await fetch(`/api/public/1/chargecontroller/${data.qrcode}/start_charge/`, {
|
||||
// method: 'POST',
|
||||
// headers: {
|
||||
// 'Accept': 'application/json',
|
||||
// }
|
||||
// });
|
||||
console.log("nop");
|
||||
await goto(`/${data.qrcode}/status`);
|
||||
const response = await fetch(`/api/public/1/chargecontroller/${data.qrcode}/start_charge/`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
}
|
||||
});
|
||||
if (response.ok) {
|
||||
addToast({
|
||||
closeDelay: 5000,
|
||||
data: {
|
||||
title: 'Charge Started',
|
||||
description: '',
|
||||
type: 'success',
|
||||
}
|
||||
});
|
||||
await invalidate('app:chargecontroller');
|
||||
await goto(`/${data.qrcode}/status`);
|
||||
} else {
|
||||
addToast({
|
||||
closeDelay: 5000,
|
||||
data: {
|
||||
title: 'Error',
|
||||
description: response.statusText ?? 'unknown',
|
||||
type: 'error',
|
||||
}
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
startingCharge = false;
|
||||
}
|
||||
}
|
||||
|
||||
function test() {
|
||||
addToast({
|
||||
closeDelay: 50000,
|
||||
data: {
|
||||
title: 'Success',
|
||||
description: 'The resource was created!',
|
||||
color: 'green'
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="grid grid-rows-6 h-full w-full">
|
||||
<div class="row-start-5 col-start-1 flex flex-col justify-center items-center">
|
||||
<div class="pointer-events-auto">
|
||||
<div class="visible">
|
||||
<button class="btn btn-primary btn-lg uppercase" onclick={() => showOverlay = true}>Attivare la Ricarica</button>
|
||||
<button class="btn btn-secondary" onclick={test}>Test</button>
|
||||
</div>
|
||||
</div>
|
||||
<BSlideOverlay bind:show={showOverlay} closable={!startingCharge}>
|
||||
|
||||
@@ -3,11 +3,12 @@ import { redirect } from "@sveltejs/kit";
|
||||
|
||||
export const load: PageLoad = async ({ parent }) => {
|
||||
const parentData = await parent();
|
||||
if (parentData.user === null) return redirect(303, `${parentData.qrcode}/login`);
|
||||
if (parentData.user === null) return redirect(303, `/${parentData.qrcode}/login`);
|
||||
else {
|
||||
if (!parentData.chargePermission.includes(parentData.qrcode)) {
|
||||
return redirect(303, `${parentData.qrcode}/forbidden`);
|
||||
return redirect(303, `/${parentData.qrcode}/forbidden`);
|
||||
}
|
||||
}
|
||||
if (parentData.chargecontroller.active_charge !== null) return redirect(303, `/${parentData.qrcode}/status`);
|
||||
return parentData;
|
||||
};
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
<script lang="ts">
|
||||
import * as L from 'leaflet';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
import lmiUrl from 'leaflet/dist/images/marker-icon.png';
|
||||
import lmi2Url from 'leaflet/dist/images/marker-icon-2x.png';
|
||||
import lmsUrl from 'leaflet/dist/images/marker-shadow.png';
|
||||
import { onMount, type Snippet } from "svelte";
|
||||
import type { SvelteHTMLElements } from "svelte/elements";
|
||||
|
||||
if (import.meta.env.MODE === 'production') {
|
||||
// Fix bundling bug for leaflet default marker icon on production
|
||||
L.Icon.Default.prototype.options.iconUrl = lmiUrl;
|
||||
L.Icon.Default.prototype.options.iconRetinaUrl = lmi2Url;
|
||||
L.Icon.Default.prototype.options.shadowUrl = lmsUrl;
|
||||
}
|
||||
|
||||
type Props = {
|
||||
x: number,
|
||||
y: number,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="pointer-events-auto bg-red-500/50 h-full w-full flex justify-center items-center">
|
||||
<div class="visible bg-red-500/50 h-full w-full flex justify-center items-center">
|
||||
<div class="card card-border bg-base-100">
|
||||
<div class="card-body items-center">
|
||||
<h2 class="card-title">Forbidden</h2>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
const { message, enhance, submitting } = form;
|
||||
</script>
|
||||
|
||||
<div class="pointer-events-auto bg-gray-300/50 h-full w-full flex justify-center items-center">
|
||||
<div class="visible bg-gray-300/50 h-full w-full flex justify-center items-center">
|
||||
<div class="card bg-base-100 w-fit shadow-md">
|
||||
<form class="card-body" method="POST" use:enhance>
|
||||
<h2 class="card-title">Accesso Utente</h2>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { onMount } from "svelte";
|
||||
import { goto, invalidate } from "$app/navigation";
|
||||
import { scale } from 'svelte/transition';
|
||||
import { addToast } from '$lib/ToastSystem/Toaster.svelte';
|
||||
import BatteryIcon from "$lib/icons/BatteryIcon.svelte";
|
||||
import BSlideOverlay from "$lib/BSlideOverlay.svelte";
|
||||
|
||||
@@ -32,16 +33,40 @@
|
||||
if (stoppingCharge) return;
|
||||
stoppingCharge = true;
|
||||
try {
|
||||
// TODO: StopCharge fetch request
|
||||
console.log("nop");
|
||||
await goto(`/${data.qrcode}`);
|
||||
const response = await fetch(`/api/public/1/chargecontroller/${data.qrcode}/stop_charge/`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
}
|
||||
});
|
||||
if (response.ok) {
|
||||
addToast({
|
||||
closeDelay: 5000,
|
||||
data: {
|
||||
title: 'Charge Stopped',
|
||||
description: '',
|
||||
type: 'success',
|
||||
}
|
||||
});
|
||||
await invalidate('app:chargecontroller');
|
||||
await goto(`/${data.qrcode}`);
|
||||
} else {
|
||||
addToast({
|
||||
closeDelay: 5000,
|
||||
data: {
|
||||
title: 'Error',
|
||||
description: response.statusText ?? 'unknown',
|
||||
type: 'error',
|
||||
}
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
stoppingCharge = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="pointer-events-auto bg-green-700/80 h-full w-full flex flex-col justify-center items-center gap-12">
|
||||
<div class="visible bg-green-700/80 h-full w-full flex flex-col justify-center items-center gap-12">
|
||||
<div>
|
||||
<BatteryIcon/>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { redirect } from "@sveltejs/kit";
|
||||
|
||||
export const load: PageLoad = async ({ parent }) => {
|
||||
const parentData = await parent();
|
||||
if (parentData.user === null) return redirect(303, `${parentData.qrcode}/login`);
|
||||
if (parentData.user === null) return redirect(303, `/${parentData.qrcode}/login`);
|
||||
if (parentData.chargecontroller.active_charge === null) return redirect(303, `/${parentData.qrcode}`);
|
||||
return parentData;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {preprocessMeltUI, sequence} from "@melt-ui/pp";
|
||||
import adapter from '@sveltejs/adapter-auto';
|
||||
import adapter from '@sveltejs/adapter-node';
|
||||
import {vitePreprocess} from '@sveltejs/vite-plugin-svelte';
|
||||
/** @type {import('@sveltejs/kit').Config}*/
|
||||
const config = {
|
||||
@@ -7,9 +7,6 @@ const config = {
|
||||
// for more information about preprocessors
|
||||
preprocess: sequence([vitePreprocess(), preprocessMeltUI()]),
|
||||
kit: {
|
||||
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
||||
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
||||
adapter: adapter()
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user