This commit is contained in:
seriousm4x
2023-07-25 10:10:36 +02:00
parent ef69268736
commit de2d86f752
11 changed files with 277 additions and 192 deletions

View File

@@ -14,7 +14,7 @@ require (
require (
github.com/AlecAivazis/survey/v2 v2.3.7 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go v1.44.303 // indirect
github.com/aws/aws-sdk-go v1.44.307 // indirect
github.com/aws/aws-sdk-go-v2 v1.19.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.28 // indirect
@@ -78,9 +78,9 @@ require (
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.11.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.132.0 // indirect
google.golang.org/api v0.133.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230724170836-66ad5b6ff146 // indirect
google.golang.org/grpc v1.56.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
lukechampine.com/uint128 v1.3.0 // indirect

View File

@@ -781,6 +781,8 @@ github.com/aws/aws-sdk-go v1.44.298 h1:5qTxdubgV7PptZJmp/2qDwD2JL187ePL7VOxsSh1i
github.com/aws/aws-sdk-go v1.44.298/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.303 h1:GybJmj22u3KVMghsqYZoicS3NpiWiNaPE1+5bhvkxIs=
github.com/aws/aws-sdk-go v1.44.303/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.307 h1:2R0/EPgpZcFSUwZhYImq/srjaOrOfLv5MNRzrFyAM38=
github.com/aws/aws-sdk-go v1.44.307/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
github.com/aws/aws-sdk-go-v2 v1.18.1 h1:+tefE750oAb7ZQGzla6bLkOwfcQCEtC5y2RqoqCeqKo=
github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=
@@ -2975,6 +2977,8 @@ google.golang.org/api v0.130.0 h1:A50ujooa1h9iizvfzA4rrJr2B7uRmWexwbekQ2+5FPQ=
google.golang.org/api v0.130.0/go.mod h1:J/LCJMYSDFvAVREGCbrESb53n4++NMBDetSHGL5I5RY=
google.golang.org/api v0.132.0 h1:8t2/+qZ26kAOGSmOiHwVycqVaDg7q3JDILrNi/Z6rvc=
google.golang.org/api v0.132.0/go.mod h1:AeTBC6GpJnJSRJjktDcPX0QwtS8pGYZOV6MSuSCusw0=
google.golang.org/api v0.133.0 h1:N7Ym5Hl0Dpn0I0o7R1z4UpVA1GCDyS8vbPu1/ObV73A=
google.golang.org/api v0.133.0/go.mod h1:sjRL3UnjTx5UqNQS9EWr9N8p7xbHpy1k0XGRLCf3Spk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -3152,6 +3156,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 h1:
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753 h1:XUODHrpzJEUeWmVo/jfNTLj0YyVveOo28oE6vkFbkO4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230717213848-3f92550aa753/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230724170836-66ad5b6ff146 h1:0PjALPu/U/4OVXKQM2P8b8NJGd4V+xbZSP+uuBJpGm0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230724170836-66ad5b6ff146/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=
google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=

View File

@@ -57,25 +57,25 @@
"prepare": "cd .. && husky install frontend/.husky"
},
"devDependencies": {
"@sveltejs/adapter-static": "^2.0.0",
"@sveltejs/kit": "^1.20.4",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"@sveltejs/adapter-static": "^2.0.2",
"@sveltejs/kit": "^1.22.3",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"autoprefixer": "^10.4.14",
"daisyui": "^3.3.1",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte": "^2.30.0",
"husky": "^8.0.0",
"daisyui": "^3.4.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-svelte": "^2.32.4",
"husky": "^8.0.3",
"postcss": "^8.4.27",
"prettier": "^2.8.0",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.1",
"svelte": "^4.0.5",
"svelte-check": "^3.4.3",
"svelte": "^4.1.1",
"svelte-check": "^3.4.6",
"tailwindcss": "^3.3.3",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.4.2"
"tslib": "^2.6.1",
"typescript": "^5.1.6",
"vite": "^4.4.7"
},
"type": "module",
"lint-staged": {

272
frontend/pnpm-lock.yaml generated
View File

@@ -40,6 +40,7 @@ dependencies:
devDependencies:
'@sveltejs/adapter-static':
<<<<<<< HEAD
<<<<<<< HEAD
specifier: ^2.0.3
version: 2.0.3(@sveltejs/kit@1.22.5)
@@ -53,45 +54,57 @@ devDependencies:
specifier: ^1.20.4
version: 1.22.3(svelte@4.1.1)(vite@4.4.6)
>>>>>>> 5340d83 (first commit for tailwind rewrite)
=======
specifier: ^2.0.2
version: 2.0.2(@sveltejs/kit@1.22.3)
'@sveltejs/kit':
specifier: ^1.22.3
version: 1.22.3(svelte@4.1.1)(vite@4.4.7)
>>>>>>> fae38a0 (cleanup)
'@typescript-eslint/eslint-plugin':
specifier: ^5.45.0
specifier: ^5.62.0
version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.45.0)(typescript@5.1.6)
'@typescript-eslint/parser':
specifier: ^5.45.0
specifier: ^5.62.0
version: 5.62.0(eslint@8.45.0)(typescript@5.1.6)
autoprefixer:
specifier: ^10.4.14
version: 10.4.14(postcss@8.4.27)
daisyui:
specifier: ^3.3.1
version: 3.3.1
specifier: ^3.4.0
version: 3.4.0
eslint:
specifier: ^8.28.0
specifier: ^8.45.0
version: 8.45.0
eslint-config-prettier:
specifier: ^8.5.0
specifier: ^8.8.0
version: 8.8.0(eslint@8.45.0)
eslint-plugin-svelte:
<<<<<<< HEAD
<<<<<<< HEAD
specifier: ^2.32.4
version: 2.32.4(eslint@8.45.0)(svelte@4.1.2)
=======
specifier: ^2.30.0
=======
specifier: ^2.32.4
>>>>>>> fae38a0 (cleanup)
version: 2.32.4(eslint@8.45.0)(svelte@4.1.1)
>>>>>>> 5340d83 (first commit for tailwind rewrite)
husky:
specifier: ^8.0.0
specifier: ^8.0.3
version: 8.0.3
postcss:
specifier: ^8.4.27
version: 8.4.27
prettier:
specifier: ^2.8.0
specifier: ^2.8.8
version: 2.8.8
prettier-plugin-svelte:
specifier: ^2.10.1
version: 2.10.1(prettier@2.8.8)(svelte@4.1.2)
svelte:
<<<<<<< HEAD
<<<<<<< HEAD
specifier: ^4.1.2
version: 4.1.2
@@ -100,21 +113,30 @@ devDependencies:
version: 5.0.4(postcss@8.4.27)(sass@1.64.2)(svelte@4.1.2)(typescript@5.1.6)
=======
specifier: ^4.0.5
=======
specifier: ^4.1.1
>>>>>>> fae38a0 (cleanup)
version: 4.1.1
svelte-check:
specifier: ^3.4.3
specifier: ^3.4.6
version: 3.4.6(postcss@8.4.27)(svelte@4.1.1)
tailwindcss:
specifier: ^3.3.3
version: 3.3.3
tslib:
<<<<<<< HEAD
specifier: ^2.4.1
version: 2.6.0
>>>>>>> 5340d83 (first commit for tailwind rewrite)
=======
specifier: ^2.6.1
version: 2.6.1
>>>>>>> fae38a0 (cleanup)
typescript:
specifier: ^5.0.0
specifier: ^5.1.6
version: 5.1.6
vite:
<<<<<<< HEAD
<<<<<<< HEAD
specifier: ^4.4.9
version: 4.4.9(sass@1.64.2)
@@ -122,6 +144,10 @@ devDependencies:
specifier: ^4.4.2
version: 4.4.6
>>>>>>> 5340d83 (first commit for tailwind rewrite)
=======
specifier: ^4.4.7
version: 4.4.7
>>>>>>> fae38a0 (cleanup)
packages:
/@aashutoshrathi/word-wrap@1.2.6:
@@ -161,10 +187,10 @@ packages:
regenerator-runtime: 0.13.11
dev: false
/@esbuild/android-arm64@0.18.15:
/@esbuild/android-arm64@0.18.16:
resolution:
{
integrity: sha512-NI/gnWcMl2kXt1HJKOn2H69SYn4YNheKo6NZt1hyfKWdMbaGadxjZIkcj4Gjk/WPxnbFXs9/3HjGHaknCqjrww==
integrity: sha512-wsCqSPqLz+6Ov+OM4EthU43DyYVVyfn15S4j1bJzylDpc1r1jZFFfJQNfDuT8SlgwuqpmpJXK4uPlHGw6ve7eA==
}
engines: { node: '>=12' }
cpu: [arm64]
@@ -173,10 +199,10 @@ packages:
dev: true
optional: true
/@esbuild/android-arm@0.18.15:
/@esbuild/android-arm@0.18.16:
resolution:
{
integrity: sha512-wlkQBWb79/jeEEoRmrxt/yhn5T1lU236OCNpnfRzaCJHZ/5gf82uYx1qmADTBWE0AR/v7FiozE1auk2riyQd3w==
integrity: sha512-gCHjjQmA8L0soklKbLKA6pgsLk1byULuHe94lkZDzcO3/Ta+bbeewJioEn1Fr7kgy9NWNFy/C+MrBwC6I/WCug==
}
engines: { node: '>=12' }
cpu: [arm]
@@ -185,10 +211,10 @@ packages:
dev: true
optional: true
/@esbuild/android-x64@0.18.15:
/@esbuild/android-x64@0.18.16:
resolution:
{
integrity: sha512-FM9NQamSaEm/IZIhegF76aiLnng1kEsZl2eve/emxDeReVfRuRNmvT28l6hoFD9TsCxpK+i4v8LPpEj74T7yjA==
integrity: sha512-ldsTXolyA3eTQ1//4DS+E15xl0H/3DTRJaRL0/0PgkqDsI0fV/FlOtD+h0u/AUJr+eOTlZv4aC9gvfppo3C4sw==
}
engines: { node: '>=12' }
cpu: [x64]
@@ -197,10 +223,10 @@ packages:
dev: true
optional: true
/@esbuild/darwin-arm64@0.18.15:
/@esbuild/darwin-arm64@0.18.16:
resolution:
{
integrity: sha512-XmrFwEOYauKte9QjS6hz60FpOCnw4zaPAb7XV7O4lx1r39XjJhTN7ZpXqJh4sN6q60zbP6QwAVVA8N/wUyBH/w==
integrity: sha512-aBxruWCII+OtluORR/KvisEw0ALuw/qDQWvkoosA+c/ngC/Kwk0lLaZ+B++LLS481/VdydB2u6tYpWxUfnLAIw==
}
engines: { node: '>=12' }
cpu: [arm64]
@@ -209,10 +235,10 @@ packages:
dev: true
optional: true
/@esbuild/darwin-x64@0.18.15:
/@esbuild/darwin-x64@0.18.16:
resolution:
{
integrity: sha512-bMqBmpw1e//7Fh5GLetSZaeo9zSC4/CMtrVFdj+bqKPGJuKyfNJ5Nf2m3LknKZTS+Q4oyPiON+v3eaJ59sLB5A==
integrity: sha512-6w4Dbue280+rp3LnkgmriS1icOUZDyPuZo/9VsuMUTns7SYEiOaJ7Ca1cbhu9KVObAWfmdjUl4gwy9TIgiO5eA==
}
engines: { node: '>=12' }
cpu: [x64]
@@ -221,10 +247,10 @@ packages:
dev: true
optional: true
/@esbuild/freebsd-arm64@0.18.15:
/@esbuild/freebsd-arm64@0.18.16:
resolution:
{
integrity: sha512-LoTK5N3bOmNI9zVLCeTgnk5Rk0WdUTrr9dyDAQGVMrNTh9EAPuNwSTCgaKOKiDpverOa0htPcO9NwslSE5xuLA==
integrity: sha512-x35fCebhe9s979DGKbVAwXUOcTmCIE32AIqB9CB1GralMIvxdnMLAw5CnID17ipEw9/3MvDsusj/cspYt2ZLNQ==
}
engines: { node: '>=12' }
cpu: [arm64]
@@ -233,10 +259,10 @@ packages:
dev: true
optional: true
/@esbuild/freebsd-x64@0.18.15:
/@esbuild/freebsd-x64@0.18.16:
resolution:
{
integrity: sha512-62jX5n30VzgrjAjOk5orYeHFq6sqjvsIj1QesXvn5OZtdt5Gdj0vUNJy9NIpjfdNdqr76jjtzBJKf+h2uzYuTQ==
integrity: sha512-YM98f+PeNXF3GbxIJlUsj+McUWG1irguBHkszCIwfr3BXtXZsXo0vqybjUDFfu9a8Wr7uUD/YSmHib+EeGAFlg==
}
engines: { node: '>=12' }
cpu: [x64]
@@ -245,10 +271,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-arm64@0.18.15:
/@esbuild/linux-arm64@0.18.16:
resolution:
{
integrity: sha512-BWncQeuWDgYv0jTNzJjaNgleduV4tMbQjmk/zpPh/lUdMcNEAxy+jvneDJ6RJkrqloG7tB9S9rCrtfk/kuplsQ==
integrity: sha512-XIqhNUxJiuy+zsR77+H5Z2f7s4YRlriSJKtvx99nJuG5ATuJPjmZ9n0ANgnGlPCpXGSReFpgcJ7O3SMtzIFeiQ==
}
engines: { node: '>=12' }
cpu: [arm64]
@@ -257,10 +283,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-arm@0.18.15:
/@esbuild/linux-arm@0.18.16:
resolution:
{
integrity: sha512-dT4URUv6ir45ZkBqhwZwyFV6cH61k8MttIwhThp2BGiVtagYvCToF+Bggyx2VI57RG4Fbt21f9TmXaYx0DeUJg==
integrity: sha512-b5ABb+5Ha2C9JkeZXV+b+OruR1tJ33ePmv9ZwMeETSEKlmu/WJ45XTTG+l6a2KDsQtJJ66qo/hbSGBtk0XVLHw==
}
engines: { node: '>=12' }
cpu: [arm]
@@ -269,10 +295,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-ia32@0.18.15:
/@esbuild/linux-ia32@0.18.16:
resolution:
{
integrity: sha512-JPXORvgHRHITqfms1dWT/GbEY89u848dC08o0yK3fNskhp0t2TuNUnsrrSgOdH28ceb1hJuwyr8R/1RnyPwocw==
integrity: sha512-no+pfEpwnRvIyH+txbBAWtjxPU9grslmTBfsmDndj7bnBmr55rOo/PfQmRfz7Qg9isswt1FP5hBbWb23fRWnow==
}
engines: { node: '>=12' }
cpu: [ia32]
@@ -281,10 +307,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-loong64@0.18.15:
/@esbuild/linux-loong64@0.18.16:
resolution:
{
integrity: sha512-kArPI0DopjJCEplsVj/H+2Qgzz7vdFSacHNsgoAKpPS6W/Ndh8Oe24HRDQ5QCu4jHgN6XOtfFfLpRx3TXv/mEg==
integrity: sha512-Zbnczs9ZXjmo0oZSS0zbNlJbcwKXa/fcNhYQjahDs4Xg18UumpXG/lwM2lcSvHS3mTrRyCYZvJbmzYc4laRI1g==
}
engines: { node: '>=12' }
cpu: [loong64]
@@ -293,10 +319,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-mips64el@0.18.15:
/@esbuild/linux-mips64el@0.18.16:
resolution:
{
integrity: sha512-b/tmngUfO02E00c1XnNTw/0DmloKjb6XQeqxaYuzGwHe0fHVgx5/D6CWi+XH1DvkszjBUkK9BX7n1ARTOst59w==
integrity: sha512-YMF7hih1HVR/hQVa/ot4UVffc5ZlrzEb3k2ip0nZr1w6fnYypll9td2qcoMLvd3o8j3y6EbJM3MyIcXIVzXvQQ==
}
engines: { node: '>=12' }
cpu: [mips64el]
@@ -305,10 +331,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-ppc64@0.18.15:
/@esbuild/linux-ppc64@0.18.16:
resolution:
{
integrity: sha512-KXPY69MWw79QJkyvUYb2ex/OgnN/8N/Aw5UDPlgoRtoEfcBqfeLodPr42UojV3NdkoO4u10NXQdamWm1YEzSKw==
integrity: sha512-Wkz++LZ29lDwUyTSEnzDaaP5OveOgTU69q9IyIw9WqLRxM4BjTBjz9un4G6TOvehWpf/J3gYVFN96TjGHrbcNQ==
}
engines: { node: '>=12' }
cpu: [ppc64]
@@ -317,10 +343,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-riscv64@0.18.15:
/@esbuild/linux-riscv64@0.18.16:
resolution:
{
integrity: sha512-komK3NEAeeGRnvFEjX1SfVg6EmkfIi5aKzevdvJqMydYr9N+pRQK0PGJXk+bhoPZwOUgLO4l99FZmLGk/L1jWg==
integrity: sha512-LFMKZ30tk78/mUv1ygvIP+568bwf4oN6reG/uczXnz6SvFn4e2QUFpUpZY9iSJT6Qpgstrhef/nMykIXZtZWGQ==
}
engines: { node: '>=12' }
cpu: [riscv64]
@@ -329,10 +355,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-s390x@0.18.15:
/@esbuild/linux-s390x@0.18.16:
resolution:
{
integrity: sha512-632T5Ts6gQ2WiMLWRRyeflPAm44u2E/s/TJvn+BP6M5mnHSk93cieaypj3VSMYO2ePTCRqAFXtuYi1yv8uZJNA==
integrity: sha512-3ZC0BgyYHYKfZo3AV2/66TD/I9tlSBaW7eWTEIkrQQKfJIifKMMttXl9FrAg+UT0SGYsCRLI35Gwdmm96vlOjg==
}
engines: { node: '>=12' }
cpu: [s390x]
@@ -341,10 +367,10 @@ packages:
dev: true
optional: true
/@esbuild/linux-x64@0.18.15:
/@esbuild/linux-x64@0.18.16:
resolution:
{
integrity: sha512-MsHtX0NgvRHsoOtYkuxyk4Vkmvk3PLRWfA4okK7c+6dT0Fu4SUqXAr9y4Q3d8vUf1VWWb6YutpL4XNe400iQ1g==
integrity: sha512-xu86B3647DihHJHv/wx3NCz2Dg1gjQ8bbf9cVYZzWKY+gsvxYmn/lnVlqDRazObc3UMwoHpUhNYaZset4X8IPA==
}
engines: { node: '>=12' }
cpu: [x64]
@@ -353,10 +379,10 @@ packages:
dev: true
optional: true
/@esbuild/netbsd-x64@0.18.15:
/@esbuild/netbsd-x64@0.18.16:
resolution:
{
integrity: sha512-djST6s+jQiwxMIVQ5rlt24JFIAr4uwUnzceuFL7BQT4CbrRtqBPueS4GjXSiIpmwVri1Icj/9pFRJ7/aScvT+A==
integrity: sha512-uVAgpimx9Ffw3xowtg/7qQPwHFx94yCje+DoBx+LNm2ePDpQXHrzE+Sb0Si2VBObYz+LcRps15cq+95YM7gkUw==
}
engines: { node: '>=12' }
cpu: [x64]
@@ -365,10 +391,10 @@ packages:
dev: true
optional: true
/@esbuild/openbsd-x64@0.18.15:
/@esbuild/openbsd-x64@0.18.16:
resolution:
{
integrity: sha512-naeRhUIvhsgeounjkF5mvrNAVMGAm6EJWiabskeE5yOeBbLp7T89tAEw0j5Jm/CZAwyLe3c67zyCWH6fsBLCpw==
integrity: sha512-6OjCQM9wf7z8/MBi6BOWaTL2AS/SZudsZtBziXMtNI8r/U41AxS9x7jn0ATOwVy08OotwkPqGRMkpPR2wcTJXA==
}
engines: { node: '>=12' }
cpu: [x64]
@@ -377,10 +403,10 @@ packages:
dev: true
optional: true
/@esbuild/sunos-x64@0.18.15:
/@esbuild/sunos-x64@0.18.16:
resolution:
{
integrity: sha512-qkT2+WxyKbNIKV1AEhI8QiSIgTHMcRctzSaa/I3kVgMS5dl3fOeoqkb7pW76KwxHoriImhx7Mg3TwN/auMDsyQ==
integrity: sha512-ZoNkruFYJp9d1LbUYCh8awgQDvB9uOMZqlQ+gGEZR7v6C+N6u7vPr86c+Chih8niBR81Q/bHOSKGBK3brJyvkQ==
}
engines: { node: '>=12' }
cpu: [x64]
@@ -389,10 +415,10 @@ packages:
dev: true
optional: true
/@esbuild/win32-arm64@0.18.15:
/@esbuild/win32-arm64@0.18.16:
resolution:
{
integrity: sha512-HC4/feP+pB2Vb+cMPUjAnFyERs+HJN7E6KaeBlFdBv799MhD+aPJlfi/yk36SED58J9TPwI8MAcVpJgej4ud0A==
integrity: sha512-+j4anzQ9hrs+iqO+/wa8UE6TVkKua1pXUb0XWFOx0FiAj6R9INJ+WE//1/Xo6FG1vB5EpH3ko+XcgwiDXTxcdw==
}
engines: { node: '>=12' }
cpu: [arm64]
@@ -401,10 +427,10 @@ packages:
dev: true
optional: true
/@esbuild/win32-ia32@0.18.15:
/@esbuild/win32-ia32@0.18.16:
resolution:
{
integrity: sha512-ovjwoRXI+gf52EVF60u9sSDj7myPixPxqzD5CmkEUmvs+W9Xd0iqISVBQn8xcx4ciIaIVlWCuTbYDOXOnOL44Q==
integrity: sha512-5PFPmq3sSKTp9cT9dzvI67WNfRZGvEVctcZa1KGjDDu4n3H8k59Inbk0du1fz0KrAbKKNpJbdFXQMDUz7BG4rQ==
}
engines: { node: '>=12' }
cpu: [ia32]
@@ -413,10 +439,10 @@ packages:
dev: true
optional: true
/@esbuild/win32-x64@0.18.15:
/@esbuild/win32-x64@0.18.16:
resolution:
{
integrity: sha512-imUxH9a3WJARyAvrG7srLyiK73XdX83NXQkjKvQ+7vPh3ZxoLrzvPkQKKw2DwZ+RV2ZB6vBfNHP8XScAmQC3aA==
integrity: sha512-sCIVrrtcWN5Ua7jYXNG1xD199IalrbfV2+0k/2Zf2OyV2FtnQnMgdzgpRAbi4AWlKJj1jkX+M+fEGPQj6BQB4w==
}
engines: { node: '>=12' }
cpu: [x64]
@@ -438,10 +464,10 @@ packages:
eslint-visitor-keys: 3.4.1
dev: true
/@eslint-community/regexpp@4.5.1:
/@eslint-community/regexpp@4.6.1:
resolution:
{
integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==
integrity: sha512-O7x6dMstWLn2ktjcoiNLDkAGG2EjveHL+Vvc+n0fXumkJYAcSqcVYKtwDU+hDZ0uDUsnUagSYaZrOLAYE8un1A==
}
engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 }
dev: true
@@ -645,6 +671,7 @@ packages:
peerDependencies:
'@sveltejs/kit': ^1.5.0
dependencies:
<<<<<<< HEAD
'@sveltejs/kit': 1.22.5(svelte@4.1.2)(vite@4.4.9)
dev: true
@@ -654,6 +681,12 @@ packages:
engines: {node: ^16.14 || >=18}
=======
/@sveltejs/kit@1.22.3(svelte@4.1.1)(vite@4.4.6):
=======
'@sveltejs/kit': 1.22.3(svelte@4.1.1)(vite@4.4.7)
dev: true
/@sveltejs/kit@1.22.3(svelte@4.1.1)(vite@4.4.7):
>>>>>>> fae38a0 (cleanup)
resolution:
{
integrity: sha512-IpHD5wvuoOIHYaHQUBJ1zERD2Iz+fB/rBXhXjl8InKw6X4VKE9BSus+ttHhE7Ke+Ie9ecfilzX8BnWE3FeQyng==
@@ -666,7 +699,11 @@ packages:
svelte: ^3.54.0 || ^4.0.0-next.0
vite: ^4.0.0
dependencies:
<<<<<<< HEAD
'@sveltejs/vite-plugin-svelte': 2.4.2(svelte@4.1.2)(vite@4.4.9)
=======
'@sveltejs/vite-plugin-svelte': 2.4.3(svelte@4.1.1)(vite@4.4.7)
>>>>>>> fae38a0 (cleanup)
'@types/cookie': 0.5.1
cookie: 0.5.0
devalue: 4.3.2
@@ -684,18 +721,26 @@ packages:
=======
svelte: 4.1.1
undici: 5.22.1
<<<<<<< HEAD
vite: 4.4.6
>>>>>>> 5340d83 (first commit for tailwind rewrite)
=======
vite: 4.4.7
>>>>>>> fae38a0 (cleanup)
transitivePeerDependencies:
- supports-color
dev: true
<<<<<<< HEAD
<<<<<<< HEAD
/@sveltejs/vite-plugin-svelte-inspector@1.0.3(@sveltejs/vite-plugin-svelte@2.4.2)(svelte@4.1.2)(vite@4.4.9):
resolution: {integrity: sha512-Khdl5jmmPN6SUsVuqSXatKpQTMIifoQPDanaxC84m9JxIibWvSABJyHpyys0Z+1yYrxY5TTEQm+6elh0XCMaOA==}
engines: {node: ^14.18.0 || >= 16}
=======
/@sveltejs/vite-plugin-svelte-inspector@1.0.3(@sveltejs/vite-plugin-svelte@2.4.2)(svelte@4.1.1)(vite@4.4.6):
=======
/@sveltejs/vite-plugin-svelte-inspector@1.0.3(@sveltejs/vite-plugin-svelte@2.4.3)(svelte@4.1.1)(vite@4.4.7):
>>>>>>> fae38a0 (cleanup)
resolution:
{
integrity: sha512-Khdl5jmmPN6SUsVuqSXatKpQTMIifoQPDanaxC84m9JxIibWvSABJyHpyys0Z+1yYrxY5TTEQm+6elh0XCMaOA==
@@ -707,28 +752,40 @@ packages:
svelte: ^3.54.0 || ^4.0.0
vite: ^4.0.0
dependencies:
<<<<<<< HEAD
'@sveltejs/vite-plugin-svelte': 2.4.2(svelte@4.1.2)(vite@4.4.9)
=======
'@sveltejs/vite-plugin-svelte': 2.4.3(svelte@4.1.1)(vite@4.4.7)
>>>>>>> fae38a0 (cleanup)
debug: 4.3.4
<<<<<<< HEAD
svelte: 4.1.2
vite: 4.4.9(sass@1.64.2)
=======
svelte: 4.1.1
<<<<<<< HEAD
vite: 4.4.6
>>>>>>> 5340d83 (first commit for tailwind rewrite)
=======
vite: 4.4.7
>>>>>>> fae38a0 (cleanup)
transitivePeerDependencies:
- supports-color
dev: true
<<<<<<< HEAD
<<<<<<< HEAD
/@sveltejs/vite-plugin-svelte@2.4.2(svelte@4.1.2)(vite@4.4.9):
resolution: {integrity: sha512-ePfcC48ftMKhkT0OFGdOyycYKnnkT6i/buzey+vHRTR/JpQvuPzzhf1PtKqCDQfJRgoPSN2vscXs6gLigx/zGw==}
engines: {node: ^14.18.0 || >= 16}
=======
/@sveltejs/vite-plugin-svelte@2.4.2(svelte@4.1.1)(vite@4.4.6):
=======
/@sveltejs/vite-plugin-svelte@2.4.3(svelte@4.1.1)(vite@4.4.7):
>>>>>>> fae38a0 (cleanup)
resolution:
{
integrity: sha512-ePfcC48ftMKhkT0OFGdOyycYKnnkT6i/buzey+vHRTR/JpQvuPzzhf1PtKqCDQfJRgoPSN2vscXs6gLigx/zGw==
integrity: sha512-NY2h+B54KHZO3kDURTdARqthn6D4YSIebtfW75NvZ/fwyk4G+AJw3V/i0OBjyN4406Ht9yZcnNWMuRUFnDNNiA==
}
engines: { node: ^14.18.0 || >= 16 }
>>>>>>> ea070a3 (more changes to device settings)
@@ -736,7 +793,11 @@ packages:
svelte: ^3.54.0 || ^4.0.0
vite: ^4.0.0
dependencies:
<<<<<<< HEAD
'@sveltejs/vite-plugin-svelte-inspector': 1.0.3(@sveltejs/vite-plugin-svelte@2.4.2)(svelte@4.1.2)(vite@4.4.9)
=======
'@sveltejs/vite-plugin-svelte-inspector': 1.0.3(@sveltejs/vite-plugin-svelte@2.4.3)(svelte@4.1.1)(vite@4.4.7)
>>>>>>> fae38a0 (cleanup)
debug: 4.3.4
deepmerge: 4.3.1
kleur: 4.1.5
@@ -749,9 +810,14 @@ packages:
=======
svelte: 4.1.1
svelte-hmr: 0.15.2(svelte@4.1.1)
<<<<<<< HEAD
vite: 4.4.6
vitefu: 0.2.4(vite@4.4.6)
>>>>>>> 5340d83 (first commit for tailwind rewrite)
=======
vite: 4.4.7
vitefu: 0.2.4(vite@4.4.7)
>>>>>>> fae38a0 (cleanup)
transitivePeerDependencies:
- supports-color
dev: true
@@ -805,7 +871,7 @@ packages:
typescript:
optional: true
dependencies:
'@eslint-community/regexpp': 4.5.1
'@eslint-community/regexpp': 4.6.1
'@typescript-eslint/parser': 5.62.0(eslint@8.45.0)(typescript@5.1.6)
'@typescript-eslint/scope-manager': 5.62.0
'@typescript-eslint/type-utils': 5.62.0(eslint@8.45.0)(typescript@5.1.6)
@@ -1132,7 +1198,7 @@ packages:
hasBin: true
dependencies:
caniuse-lite: 1.0.30001517
electron-to-chromium: 1.4.468
electron-to-chromium: 1.4.470
node-releases: 2.0.13
update-browserslist-db: 1.0.11(browserslist@4.21.9)
dev: true
@@ -1308,10 +1374,10 @@ packages:
hasBin: true
dev: true
/daisyui@3.3.1:
/daisyui@3.4.0:
resolution:
{
integrity: sha512-0PVNl+0r2Ie+FRkDNQABYcv8qLc0bt0lhUfSf8PxGocqpDsCB6cNQ5k8jOlnZIjUhc1EXMIDPU9r0pVrfRGftw==
integrity: sha512-s9EvNxnw/ubCIopKul+3ddASzZG+jMOmZgLJ0BFOVnxFQy6HJ5+EbMx5yY7Ef0cA6qjeUMl88SwhE94WLSLtHQ==
}
engines: { node: '>=16.9.0' }
dependencies:
@@ -1421,10 +1487,10 @@ packages:
esutils: 2.0.3
dev: true
/electron-to-chromium@1.4.468:
/electron-to-chromium@1.4.470:
resolution:
{
integrity: sha512-6M1qyhaJOt7rQtNti1lBA0GwclPH+oKCmsra/hkcWs5INLxfXXD/dtdnaKUYQu/pjOBP/8Osoe4mAcNvvzoFag==
integrity: sha512-zZM48Lmy2FKWgqyvsX9XK+J6FfP7aCDUFLmgooLJzA7v1agCs/sxSoBpTIwDLhmbhpx9yJIxj2INig/ncjJRqg==
}
dev: true
@@ -1435,37 +1501,37 @@ packages:
}
dev: true
/esbuild@0.18.15:
/esbuild@0.18.16:
resolution:
{
integrity: sha512-3WOOLhrvuTGPRzQPU6waSDWrDTnQriia72McWcn6UCi43GhCHrXH4S59hKMeez+IITmdUuUyvbU9JIp+t3xlPQ==
integrity: sha512-1xLsOXrDqwdHxyXb/x/SOyg59jpf/SH7YMvU5RNSU7z3TInaASNJWNFJ6iRvLvLETZMasF3d1DdZLg7sgRimRQ==
}
engines: { node: '>=12' }
hasBin: true
requiresBuild: true
optionalDependencies:
'@esbuild/android-arm': 0.18.15
'@esbuild/android-arm64': 0.18.15
'@esbuild/android-x64': 0.18.15
'@esbuild/darwin-arm64': 0.18.15
'@esbuild/darwin-x64': 0.18.15
'@esbuild/freebsd-arm64': 0.18.15
'@esbuild/freebsd-x64': 0.18.15
'@esbuild/linux-arm': 0.18.15
'@esbuild/linux-arm64': 0.18.15
'@esbuild/linux-ia32': 0.18.15
'@esbuild/linux-loong64': 0.18.15
'@esbuild/linux-mips64el': 0.18.15
'@esbuild/linux-ppc64': 0.18.15
'@esbuild/linux-riscv64': 0.18.15
'@esbuild/linux-s390x': 0.18.15
'@esbuild/linux-x64': 0.18.15
'@esbuild/netbsd-x64': 0.18.15
'@esbuild/openbsd-x64': 0.18.15
'@esbuild/sunos-x64': 0.18.15
'@esbuild/win32-arm64': 0.18.15
'@esbuild/win32-ia32': 0.18.15
'@esbuild/win32-x64': 0.18.15
'@esbuild/android-arm': 0.18.16
'@esbuild/android-arm64': 0.18.16
'@esbuild/android-x64': 0.18.16
'@esbuild/darwin-arm64': 0.18.16
'@esbuild/darwin-x64': 0.18.16
'@esbuild/freebsd-arm64': 0.18.16
'@esbuild/freebsd-x64': 0.18.16
'@esbuild/linux-arm': 0.18.16
'@esbuild/linux-arm64': 0.18.16
'@esbuild/linux-ia32': 0.18.16
'@esbuild/linux-loong64': 0.18.16
'@esbuild/linux-mips64el': 0.18.16
'@esbuild/linux-ppc64': 0.18.16
'@esbuild/linux-riscv64': 0.18.16
'@esbuild/linux-s390x': 0.18.16
'@esbuild/linux-x64': 0.18.16
'@esbuild/netbsd-x64': 0.18.16
'@esbuild/openbsd-x64': 0.18.16
'@esbuild/sunos-x64': 0.18.16
'@esbuild/win32-arm64': 0.18.16
'@esbuild/win32-ia32': 0.18.16
'@esbuild/win32-x64': 0.18.16
dev: true
/escalade@3.1.1:
@@ -1572,7 +1638,7 @@ packages:
hasBin: true
dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@8.45.0)
'@eslint-community/regexpp': 4.5.1
'@eslint-community/regexpp': 4.6.1
'@eslint/eslintrc': 2.1.0
'@eslint/js': 8.44.0
'@humanwhocodes/config-array': 0.11.10
@@ -1691,10 +1757,10 @@ packages:
}
dev: true
/fast-glob@3.3.0:
/fast-glob@3.3.1:
resolution:
{
integrity: sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==
integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==
}
engines: { node: '>=8.6.0' }
dependencies:
@@ -1883,7 +1949,7 @@ packages:
dependencies:
array-union: 2.1.0
dir-glob: 3.0.1
fast-glob: 3.3.0
fast-glob: 3.3.1
ignore: 5.2.4
merge2: 1.4.1
slash: 3.0.0
@@ -2958,7 +3024,7 @@ packages:
dependencies:
'@jridgewell/trace-mapping': 0.3.18
chokidar: 3.5.3
fast-glob: 3.3.0
fast-glob: 3.3.1
import-fresh: 3.3.0
picocolors: 1.0.0
sade: 1.8.1
@@ -3133,7 +3199,7 @@ packages:
chokidar: 3.5.3
didyoumean: 1.2.2
dlv: 1.1.3
fast-glob: 3.3.0
fast-glob: 3.3.1
glob-parent: 6.0.2
is-glob: 4.0.3
jiti: 1.19.1
@@ -3212,10 +3278,10 @@ packages:
}
dev: true
/tslib@2.6.0:
/tslib@2.6.1:
resolution:
{
integrity: sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==
integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==
}
dev: true
@@ -3305,6 +3371,7 @@ packages:
}
dev: true
<<<<<<< HEAD
<<<<<<< HEAD
/vite@4.4.9(sass@1.64.2):
resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==}
@@ -3315,9 +3382,12 @@ packages:
>>>>>>> 5340d83 (first commit for tailwind rewrite)
engines: {node: ^14.18.0 || >=16.0.0}
=======
=======
/vite@4.4.7:
>>>>>>> fae38a0 (cleanup)
resolution:
{
integrity: sha512-EY6Mm8vJ++S3D4tNAckaZfw3JwG3wa794Vt70M6cNJ6NxT87yhq7EC8Rcap3ahyHdo8AhCmV9PTk+vG1HiYn1A==
integrity: sha512-6pYf9QJ1mHylfVh39HpuSfMPojPSKVxZvnclX1K1FyZ1PXDOcLBibdq5t1qxJSnL63ca8Wf4zts6mD8u8oc9Fw==
}
engines: { node: ^14.18.0 || >=16.0.0 }
>>>>>>> ea070a3 (more changes to device settings)
@@ -3346,7 +3416,7 @@ packages:
terser:
optional: true
dependencies:
esbuild: 0.18.15
esbuild: 0.18.16
postcss: 8.4.27
<<<<<<< HEAD
rollup: 3.27.2
@@ -3358,11 +3428,15 @@ packages:
fsevents: 2.3.2
dev: true
<<<<<<< HEAD
<<<<<<< HEAD
/vitefu@0.2.4(vite@4.4.9):
resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==}
=======
/vitefu@0.2.4(vite@4.4.6):
=======
/vitefu@0.2.4(vite@4.4.7):
>>>>>>> fae38a0 (cleanup)
resolution:
{
integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==
@@ -3374,11 +3448,15 @@ packages:
vite:
optional: true
dependencies:
<<<<<<< HEAD
<<<<<<< HEAD
vite: 4.4.9(sass@1.64.2)
=======
vite: 4.4.6
>>>>>>> 5340d83 (first commit for tailwind rewrite)
=======
vite: 4.4.7
>>>>>>> fae38a0 (cleanup)
dev: true
/which@2.0.2:

View File

@@ -1,6 +1,5 @@
<script lang="ts">
import { scale } from 'svelte/transition';
import { tweened } from 'svelte/motion';
import Fa from 'svelte-fa';
import type { IconDefinition } from '@fortawesome/free-solid-svg-icons';
@@ -9,22 +8,11 @@
export let message: string;
export let icon: IconDefinition;
export let customClasses = '';
export let duration = 0;
const value = tweened(0, {
duration: duration
});
value.set(duration);
</script>
<div class="alert alert-{color} {customClasses}" transition:scale={{ delay: 0, duration: 200 }}>
<div class="flex flex-col text-left">
{#if icon}
<Fa {icon} />
{/if}
<span>{message}</span>
{#if duration !== 0}
<progress class="progress" value={duration - $value} max={duration} />
{/if}
</div>
{#if icon}
<Fa {icon} />
{/if}
<span>{message}</span>
</div>

View File

@@ -8,7 +8,13 @@
<div class="card bg-base-300 shadow-md rounded-3xl">
<div class="card-body p-6">
<h1 class="card-title">{device.name}</h1>
{#if device.link !== ''}
<a href={device.link} target="_blank">
<h1 class="card-title link">{device.name}</h1>
</a>
{:else}
<h1 class="card-title">{device.name}</h1>
{/if}
<ul class="menu bg-base-200 rounded-box">
<!-- TODO: change to nic array once backend supports it -->
<DeviceCardNic {device} />

View File

@@ -8,7 +8,7 @@
// TODO: change wake and shutdown to nic based routes, not device based
function wake() {
fetch(`${backendUrl}/api/upsnap/wake/${device.id}`, {
fetch(`${backendUrl}api/upsnap/wake/${device.id}`, {
headers: {
Authorization: $pocketbase.authStore.token
}
@@ -16,27 +16,34 @@
}
function shutdown() {
fetch(`${backendUrl}/api/upsnap/shutdown/${device.id}`, {
fetch(`${backendUrl}api/upsnap/shutdown/${device.id}`, {
headers: {
Authorization: $pocketbase.authStore.token
}
});
}
function handleClick() {
if (device.status === 'offline') {
wake();
} else if (device.statis === 'online') {
shutdown();
}
}
</script>
<li>
<div class="flex items-start p-2 gap-4">
<div
class="flex items-start p-2 gap-4"
on:click={handleClick}
on:keydown={handleClick}
role="none"
>
<div>
{#if device.status === 'offline'}
<button class="btn btn-error flex-shrink" on:click={() => wake()} on:keydown={() => wake()}
><Fa icon={faPowerOff} /></button
>
<button class="btn btn-error flex-shrink"><Fa icon={faPowerOff} /></button>
{:else if device.status === 'online'}
<button
class="btn btn-success flex-shrink"
on:click={() => shutdown()}
on:keydown={() => shutdown()}><Fa icon={faPowerOff} /></button
>
<button class="btn btn-success flex-shrink"><Fa icon={faPowerOff} /></button>
{:else}
<button class="btn btn-warning flex-shrink"
><span class="loading loading-ring loading-md" /></button

View File

@@ -6,7 +6,7 @@
import type { Device, Port } from '$lib/types/device';
import type { Record } from 'pocketbase';
export let changes: Device;
export let deviceClone: Device;
export let index: number;
export let portErrMsg: string;
export let portErrTimeout: number;
@@ -17,7 +17,9 @@
.collection('ports')
.delete(port.id)
.then(() => {
changes.ports = changes.ports.filter((id: number) => id !== changes.ports[index]);
deviceClone.ports = deviceClone.ports.filter(
(id: number) => id !== deviceClone.ports[index]
);
})
.catch((err) => {
clearTimeout(portErrTimeout);
@@ -27,13 +29,13 @@
portErrMsg = err;
});
}
changes.expand.ports = changes.expand.ports.filter(
(p) => p.id !== changes.expand.ports[index].id
deviceClone.expand.ports = deviceClone.expand.ports.filter(
(p) => p !== deviceClone.expand.ports[index]
);
}
</script>
{#if changes.expand.ports[index]}
{#if deviceClone.expand.ports[index]}
<div class="card bg-base-100 shadow-xl" transition:scale={{ delay: 0, duration: 200 }}>
<div class="card-body p-3">
<div class="flex flex-row gap-2">
@@ -46,7 +48,7 @@
type="text"
placeholder="ssh"
class="input input-sm input-bordered w-full max-w-xs"
bind:value={changes.expand.ports[index].name}
bind:value={deviceClone.expand.ports[index].name}
/>
</div>
<div>
@@ -60,14 +62,14 @@
min="1"
max="65535"
class="input input-sm input-bordered w-24"
bind:value={changes.expand.ports[index].number}
bind:value={deviceClone.expand.ports[index].number}
/>
</div>
</div>
<div class="card-actions justify-end">
<button
class="btn btn-xs btn-error"
on:click={() => deletePort(changes.expand.ports[index])}
on:click={() => deletePort(deviceClone.expand.ports[index])}
type="button"><Fa icon={faTrash} />Delete</button
>
</div>

View File

@@ -23,6 +23,7 @@
// redirect to welcome page if setup is not completed
if (!$settingsPub?.setup_completed && $page.url.pathname !== '/welcome') {
goto('/welcome');
return;
}
// load auth from localstorage
@@ -35,6 +36,7 @@
$pocketbase.authStore.loadFromCookie('pb_auth=' + pbCookie);
if (!$pocketbase.authStore.isValid) {
goto('/login');
return;
}
if ($pocketbase.authStore.model?.collectionName === 'users') {

View File

@@ -20,7 +20,7 @@
$devices[index] = data as Device;
});
} else if (e.action === 'delete') {
delete $devices[index];
$devices = $devices.filter((d) => d !== $devices[index]);
}
});
@@ -43,12 +43,14 @@
});
</script>
{#each $devices as device}
{#if $devices.length > 0}
<div
class="grid grid-flow-row-dense grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4"
>
<DeviceCard {device} />
{#each $devices as device}
<DeviceCard {device} />
{/each}
</div>
{:else}
<div class="container mx-auto text-center">No devices</div>
{/each}
{/if}

View File

@@ -9,7 +9,7 @@
let waitingForDevices = true;
let device: Device | undefined;
let changes: Device | undefined;
let deviceClone: Device | undefined;
let portErrMsg = '';
let portErrTimeout: number;
@@ -23,21 +23,21 @@
device = data.find((dev) => dev.id === $page.params.id);
if (device !== undefined) {
changes = device;
if (changes.expand.ports === undefined) {
changes.expand.ports = [];
deviceClone = device;
if (deviceClone.expand.ports === undefined) {
deviceClone.expand.ports = [];
}
}
waitingForDevices = false;
});
async function saveDevice() {
if (device === undefined || changes === undefined) return;
if (deviceClone === undefined) return;
// create/update all ports
let portIds: string[] = [];
await Promise.all(
changes.expand.ports.map(async (port) => {
deviceClone.expand.ports.map(async (port) => {
if (port.id === undefined) {
const data = await createPort(port as Port);
if (data === undefined) return;
@@ -50,10 +50,10 @@
})
);
changes.ports = portIds;
deviceClone.ports = portIds;
$pocketbase
.collection('devices')
.update(device.id, changes)
.update(deviceClone.id, deviceClone)
.then(() => {
goto('/');
})
@@ -105,8 +105,8 @@
}
function createEmptyPort() {
if (changes === undefined) return;
changes.expand.ports = [...changes.expand.ports, { name: '', number: 1 } as Port];
if (deviceClone === undefined) return;
deviceClone.expand.ports = [...deviceClone.expand.ports, { name: '', number: 1 } as Port];
}
</script>
@@ -114,26 +114,13 @@
<div class="container max-w-lg mx-auto text-center">
<span class="loading loading-dots loading-lg" />
</div>
{:else if device === undefined || changes === undefined}
{:else if device === undefined || deviceClone === undefined}
<div class="container max-w-lg mx-auto">
<div class="alert alert-error">
<svg
xmlns="http://www.w3.org/2000/svg"
class="stroke-current shrink-0 h-6 w-6"
fill="none"
viewBox="0 0 24 24"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
/></svg
>
<span><strong>No device with id:</strong> {$page.params.id}</span>
<div>
<a class="btn btn-sm" href="/">Ok</a>
</div>
</div>
<Alert
color="error"
message="No device with id: {$page.params.id}"
icon={faTriangleExclamation}
/>
</div>
{:else}
<h1 class="text-3xl font-bold mb-8">{device.name}</h1>
@@ -154,7 +141,7 @@
type="text"
placeholder="Device name"
class="input w-full max-w-xs"
bind:value={changes.name}
bind:value={deviceClone.name}
required
/>
</div>
@@ -170,7 +157,7 @@
type="text"
placeholder="192.168.0.5"
class="input w-full max-w-xs"
bind:value={changes.ip}
bind:value={deviceClone.ip}
required
/>
</div>
@@ -186,7 +173,7 @@
type="text"
placeholder="aa:bb:cc:dd:ee:ff"
class="input w-full max-w-xs"
bind:value={changes.mac}
bind:value={deviceClone.mac}
required
/>
</div>
@@ -202,7 +189,7 @@
type="text"
placeholder="255.255.255.0"
class="input w-full max-w-xs"
bind:value={changes.netmask}
bind:value={deviceClone.netmask}
required
/>
</div>
@@ -213,8 +200,8 @@
UpSnap can also check if given ports are open. You can define them below.
</p>
<div class="flex flex-wrap gap-4">
{#each changes.expand.ports as _, index}
<DeviceFormPort bind:changes {index} bind:portErrMsg bind:portErrTimeout />
{#each deviceClone.expand.ports as _, index}
<DeviceFormPort bind:deviceClone {index} bind:portErrMsg bind:portErrTimeout />
{/each}
</div>
{#if portErrMsg !== ''}
@@ -223,7 +210,6 @@
icon={faTriangleExclamation}
message={portErrMsg}
customClasses="mt-4 max-w-fit"
duration={10000}
/>
{/if}
<button
@@ -241,9 +227,17 @@
type="url"
placeholder="https:// ..."
class="input w-full max-w-xs"
bind:value={changes.link}
bind:value={deviceClone.link}
/>
</div>
{#if saveErrMsg !== ''}
<Alert
color="error"
message={saveErrMsg}
icon={faTriangleExclamation}
customClasses="mt-4 max-w-fit"
/>
{/if}
<div class="card-actions justify-end mt-4">
<span class="text-error me-4 self-center">* required field</span>
<button class="btn btn-primary" type="submit">Save</button>