Compare commits

...

6 Commits

Author SHA1 Message Date
seriousm4x 109f374269 feat: network scan: replace netmask for all devices #169 2023-08-18 14:19:08 +02:00
seriousm4x a2d09762b3 fix: let svelte know the type of PUBLIC_VERSION 2023-08-18 13:53:18 +02:00
seriousm4x f83babb494 include .env 2023-08-18 13:51:31 +02:00
Maxi Quoß 36878ee42b fix: account dropdown items could overflow 2023-08-18 11:01:44 +02:00
dependabot[bot] c6e8eee77d go-dep: bump github.com/pocketbase/dbx from 1.10.0 to 1.10.1 in /backend
Bumps [github.com/pocketbase/dbx](https://github.com/pocketbase/dbx) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/pocketbase/dbx/releases)
- [Commits](https://github.com/pocketbase/dbx/compare/v1.10.0...v1.10.1)

---
updated-dependencies:
- dependency-name: github.com/pocketbase/dbx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-17 09:48:33 +00:00
dependabot[bot] e098b0ba5d npm-dep: bump postcss from 8.4.27 to 8.4.28 in /frontend
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.27 to 8.4.28.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.27...8.4.28)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-16 17:06:08 +00:00
10 changed files with 104 additions and 65 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ web_modules/
.yarn-integrity
# dotenv environment variable files
.env
#.env
.env.development.local
.env.test.local
.env.production.local
+1 -1
View File
@@ -5,7 +5,7 @@ go 1.19
require (
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61
github.com/mdlayher/wol v0.0.0-20220221231636-b763a792253a
github.com/pocketbase/dbx v1.10.0
github.com/pocketbase/dbx v1.10.1
github.com/pocketbase/pocketbase v0.17.5
github.com/prometheus-community/pro-bing v0.3.0
github.com/robfig/cron/v3 v3.0.1
+2 -2
View File
@@ -171,8 +171,8 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyex
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pocketbase/dbx v1.10.0 h1:58VIT7r6T+BnVbYVosvGBsPjQEic3/VFRYGT823vWSQ=
github.com/pocketbase/dbx v1.10.0/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
github.com/pocketbase/dbx v1.10.1 h1:cw+vsyfCJD8YObOVeqb93YErnlxwYMkNZ4rwN0G0AaA=
github.com/pocketbase/dbx v1.10.1/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
github.com/pocketbase/pocketbase v0.17.5 h1:3KwMrlSMt1rcwZK2Z1/wFa5p/rkDHpcyeCRvUDXMb+Y=
github.com/pocketbase/pocketbase v0.17.5/go.mod h1:IqsgywiDX5ewaUdeG+0NNckBLWp5mFhJSca1PH9zSp4=
github.com/prometheus-community/pro-bing v0.3.0 h1:SFT6gHqXwbItEDJhTkzPWVqU6CLEtqEfNAPp47RUON4=
+1
View File
@@ -0,0 +1 @@
PUBLIC_VERSION=""
-1
View File
@@ -3,7 +3,6 @@ node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
+1 -1
View File
@@ -23,7 +23,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-svelte": "^2.32.4",
"husky": "^8.0.3",
"postcss": "^8.4.27",
"postcss": "^8.4.28",
"prettier": "^3.0.2",
"prettier-plugin-svelte": "^3.0.3",
"svelte": "^4.2.0",
+39 -39
View File
@@ -39,7 +39,7 @@ devDependencies:
version: 6.4.0(eslint@8.47.0)(typescript@5.1.6)
autoprefixer:
specifier: ^10.4.15
version: 10.4.15(postcss@8.4.27)
version: 10.4.15(postcss@8.4.28)
daisyui:
specifier: ^3.5.1
version: 3.5.1
@@ -56,8 +56,8 @@ devDependencies:
specifier: ^8.0.3
version: 8.0.3
postcss:
specifier: ^8.4.27
version: 8.4.27
specifier: ^8.4.28
version: 8.4.28
prettier:
specifier: ^3.0.2
version: 3.0.2
@@ -69,7 +69,7 @@ devDependencies:
version: 4.2.0
svelte-check:
specifier: ^3.5.0
version: 3.5.0(postcss@8.4.27)(svelte@4.2.0)
version: 3.5.0(postcss@8.4.28)(svelte@4.2.0)
tailwindcss:
specifier: ^3.3.3
version: 3.3.3
@@ -928,7 +928,7 @@ packages:
engines: { node: '>=8' }
dev: true
/autoprefixer@10.4.15(postcss@8.4.27):
/autoprefixer@10.4.15(postcss@8.4.28):
resolution:
{
integrity: sha512-KCuPB8ZCIqFdA4HwKXsvz7j6gvSDNhDP7WnUjBleRkKjPdvCmHFuQ77ocavI8FT6NdvlBnE2UFr2H4Mycn8Vew==
@@ -943,7 +943,7 @@ packages:
fraction.js: 4.2.0
normalize-range: 0.1.2
picocolors: 1.0.0
postcss: 8.4.27
postcss: 8.4.28
postcss-value-parser: 4.2.0
dev: true
@@ -1182,8 +1182,8 @@ packages:
dependencies:
colord: 2.9.3
css-selector-tokenizer: 0.8.0
postcss: 8.4.27
postcss-js: 4.0.1(postcss@8.4.27)
postcss: 8.4.28
postcss-js: 4.0.1(postcss@8.4.28)
tailwindcss: 3.3.3
transitivePeerDependencies:
- ts-node
@@ -1379,9 +1379,9 @@ packages:
eslint: 8.47.0
esutils: 2.0.3
known-css-properties: 0.28.0
postcss: 8.4.27
postcss-load-config: 3.1.4(postcss@8.4.27)
postcss-safe-parser: 6.0.0(postcss@8.4.27)
postcss: 8.4.28
postcss-load-config: 3.1.4(postcss@8.4.28)
postcss-safe-parser: 6.0.0(postcss@8.4.28)
postcss-selector-parser: 6.0.13
semver: 7.5.4
svelte: 4.2.0
@@ -2303,7 +2303,7 @@ packages:
}
dev: false
/postcss-import@15.1.0(postcss@8.4.27):
/postcss-import@15.1.0(postcss@8.4.28):
resolution:
{
integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==
@@ -2312,13 +2312,13 @@ packages:
peerDependencies:
postcss: ^8.0.0
dependencies:
postcss: 8.4.27
postcss: 8.4.28
postcss-value-parser: 4.2.0
read-cache: 1.0.0
resolve: 1.22.4
dev: true
/postcss-js@4.0.1(postcss@8.4.27):
/postcss-js@4.0.1(postcss@8.4.28):
resolution:
{
integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==
@@ -2328,10 +2328,10 @@ packages:
postcss: ^8.4.21
dependencies:
camelcase-css: 2.0.1
postcss: 8.4.27
postcss: 8.4.28
dev: true
/postcss-load-config@3.1.4(postcss@8.4.27):
/postcss-load-config@3.1.4(postcss@8.4.28):
resolution:
{
integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==
@@ -2347,11 +2347,11 @@ packages:
optional: true
dependencies:
lilconfig: 2.1.0
postcss: 8.4.27
postcss: 8.4.28
yaml: 1.10.2
dev: true
/postcss-load-config@4.0.1(postcss@8.4.27):
/postcss-load-config@4.0.1(postcss@8.4.28):
resolution:
{
integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==
@@ -2367,11 +2367,11 @@ packages:
optional: true
dependencies:
lilconfig: 2.1.0
postcss: 8.4.27
postcss: 8.4.28
yaml: 2.3.1
dev: true
/postcss-nested@6.0.1(postcss@8.4.27):
/postcss-nested@6.0.1(postcss@8.4.28):
resolution:
{
integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==
@@ -2380,11 +2380,11 @@ packages:
peerDependencies:
postcss: ^8.2.14
dependencies:
postcss: 8.4.27
postcss: 8.4.28
postcss-selector-parser: 6.0.13
dev: true
/postcss-safe-parser@6.0.0(postcss@8.4.27):
/postcss-safe-parser@6.0.0(postcss@8.4.28):
resolution:
{
integrity: sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==
@@ -2393,10 +2393,10 @@ packages:
peerDependencies:
postcss: ^8.3.3
dependencies:
postcss: 8.4.27
postcss: 8.4.28
dev: true
/postcss-scss@4.0.6(postcss@8.4.27):
/postcss-scss@4.0.6(postcss@8.4.28):
resolution:
{
integrity: sha512-rLDPhJY4z/i4nVFZ27j9GqLxj1pwxE80eAzUNRMXtcpipFYIeowerzBgG3yJhMtObGEXidtIgbUpQ3eLDsf5OQ==
@@ -2405,7 +2405,7 @@ packages:
peerDependencies:
postcss: ^8.4.19
dependencies:
postcss: 8.4.27
postcss: 8.4.28
dev: true
/postcss-selector-parser@6.0.13:
@@ -2426,10 +2426,10 @@ packages:
}
dev: true
/postcss@8.4.27:
/postcss@8.4.28:
resolution:
{
integrity: sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==
integrity: sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==
}
engines: { node: ^10 || ^12 || >=14 }
dependencies:
@@ -2746,7 +2746,7 @@ packages:
engines: { node: '>= 0.4' }
dev: true
/svelte-check@3.5.0(postcss@8.4.27)(svelte@4.2.0):
/svelte-check@3.5.0(postcss@8.4.28)(svelte@4.2.0):
resolution:
{
integrity: sha512-KHujbn4k17xKYLmtCwv0sKKM7uiHTYcQvXnvrCcNU6a7hcszh99zFTIoiu/Sp/ewAw5aJmillJ1Cs8gKLmcX4A==
@@ -2762,7 +2762,7 @@ packages:
picocolors: 1.0.0
sade: 1.8.1
svelte: 4.2.0
svelte-preprocess: 5.0.4(postcss@8.4.27)(svelte@4.2.0)(typescript@5.1.6)
svelte-preprocess: 5.0.4(postcss@8.4.28)(svelte@4.2.0)(typescript@5.1.6)
typescript: 5.1.6
transitivePeerDependencies:
- '@babel/core'
@@ -2791,8 +2791,8 @@ packages:
eslint-scope: 7.2.2
eslint-visitor-keys: 3.4.3
espree: 9.6.1
postcss: 8.4.27
postcss-scss: 4.0.6(postcss@8.4.27)
postcss: 8.4.28
postcss-scss: 4.0.6(postcss@8.4.28)
svelte: 4.2.0
dev: true
@@ -2827,7 +2827,7 @@ packages:
svelte: 4.2.0
dev: true
/svelte-preprocess@5.0.4(postcss@8.4.27)(svelte@4.2.0)(typescript@5.1.6):
/svelte-preprocess@5.0.4(postcss@8.4.28)(svelte@4.2.0)(typescript@5.1.6):
resolution:
{
integrity: sha512-ABia2QegosxOGsVlsSBJvoWeXy1wUKSfF7SWJdTjLAbx/Y3SrVevvvbFNQqrSJw89+lNSsM58SipmZJ5SRi5iw==
@@ -2871,7 +2871,7 @@ packages:
'@types/pug': 2.0.6
detect-indent: 6.1.0
magic-string: 0.27.0
postcss: 8.4.27
postcss: 8.4.28
sorcery: 0.11.0
strip-indent: 3.0.0
svelte: 4.2.0
@@ -2932,11 +2932,11 @@ packages:
normalize-path: 3.0.0
object-hash: 3.0.0
picocolors: 1.0.0
postcss: 8.4.27
postcss-import: 15.1.0(postcss@8.4.27)
postcss-js: 4.0.1(postcss@8.4.27)
postcss-load-config: 4.0.1(postcss@8.4.27)
postcss-nested: 6.0.1(postcss@8.4.27)
postcss: 8.4.28
postcss-import: 15.1.0(postcss@8.4.28)
postcss-js: 4.0.1(postcss@8.4.28)
postcss-load-config: 4.0.1(postcss@8.4.28)
postcss-nested: 6.0.1(postcss@8.4.28)
postcss-selector-parser: 6.0.13
resolve: 1.22.4
sucrase: 3.34.0
@@ -3120,7 +3120,7 @@ packages:
optional: true
dependencies:
esbuild: 0.18.20
postcss: 8.4.27
postcss: 8.4.28
rollup: 3.28.0
optionalDependencies:
fsevents: 2.3.2
+1 -1
View File
@@ -213,7 +213,7 @@
</label>
<ul
tabindex="-1"
class="menu dropdown-content mt-3 z-[1] p-2 shadow bg-base-300 rounded-box w-40"
class="menu dropdown-content mt-3 z-[1] p-2 shadow bg-base-300 rounded-box"
>
<li class="menu-title">
{$isAdmin ? $pocketbase.authStore.model.email : $pocketbase.authStore.model.username}
+56 -17
View File
@@ -18,6 +18,8 @@
devices: []
};
let addAllCheckbox = true;
let replaceNetmaskCheckbox = false;
let replaceNetmask = '';
onMount(() => {
if (!$settingsPriv) {
@@ -75,7 +77,11 @@
}
async function createDevice(device: ScannedDevice): Promise<Device> {
device.netmask = scanResponse.netmask;
if (replaceNetmaskCheckbox) {
device.netmask = replaceNetmask;
} else {
device.netmask = scanResponse.netmask;
}
return $pocketbase.collection('devices').create(device);
}
@@ -195,12 +201,55 @@
</div>
</div>
{/each}
<div class="form-control max-w-fit flex flex-row flex-wrap gap-4 mt-4 ms-auto">
<h2 class="card-title mt-4">Add all devices</h2>
<div class="form-control max-w-fit">
<label class="label cursor-pointer">
<input type="checkbox" class="checkbox" bind:checked={addAllCheckbox} />
<span class="label-text ms-2">Include devices where name is "Unknown"</span>
<input type="checkbox" class="checkbox" bind:checked={replaceNetmaskCheckbox} />
<span class="label-text ms-2">Replace netmask for all devices?</span>
</label>
{#if addAllCheckbox}
</div>
{#if replaceNetmaskCheckbox}
<div class="form-control max-w-fit">
<label class="label cursor-pointer" for="replaceNetmaskInput">
<span class="label-text ms-2">New netmask</span>
</label>
<input
id="replaceNetmaskInput"
class="input input-bordered"
type="text"
placeholder="255.255.0.0"
bind:value={replaceNetmask}
/>
</div>
{/if}
{#if scanResponse.devices.find((dev) => dev.name === 'Unknown')}
<div class="form-control max-w-fit">
<label class="label cursor-pointer">
<input type="checkbox" class="checkbox" bind:checked={addAllCheckbox} />
<span class="label-text ms-2">Include devices where name is "Unknown"</span>
</label>
{#if addAllCheckbox}
<button
class="btn btn-success"
on:click={() => addAll()}
disabled={scanResponse.devices.length === 0}
>
<Fa icon={faPlus} /> Add all ({scanResponse.devices.length})
</button>
{:else}
<button
class="btn btn-success"
on:click={() => addAll()}
disabled={scanResponse.devices.filter((dev) => dev.name !== 'Unknown').length === 0}
>
<Fa icon={faPlus} /> Add all ({scanResponse.devices.filter(
(dev) => dev.name !== 'Unknown'
).length})
</button>
{/if}
</div>
{:else}
<div class="form-control max-w-fit">
<button
class="btn btn-success"
on:click={() => addAll()}
@@ -208,18 +257,8 @@
>
<Fa icon={faPlus} /> Add all ({scanResponse.devices.length})
</button>
{:else}
<button
class="btn btn-success"
on:click={() => addAll()}
disabled={scanResponse.devices.filter((dev) => dev.name !== 'Unknown').length === 0}
>
<Fa icon={faPlus} /> Add all ({scanResponse.devices.filter(
(dev) => dev.name !== 'Unknown'
).length})
</button>
{/if}
</div>
</div>
{/if}
{/if}
</div>
</div>
+2 -2
View File
@@ -185,12 +185,12 @@
</div>
</form>
<div class="container mx-auto text-center mt-6">
{#if PUBLIC_VERSION === undefined}
{#if PUBLIC_VERSION === ''}
UpSnap version: (untracked)
{:else}
UpSnap version: <a
href="https://github.com/seriousm4x/UpSnap/releases/tag/{PUBLIC_VERSION}"
class="text-reset">{PUBLIC_VERSION}</a
class="link">{PUBLIC_VERSION}</a
>
{/if}
</div>