Compare commits

...

23 Commits

Author SHA1 Message Date
Maxi Quoß e72dbb7621 fix: invalid cron will crash the homepage, close #975 2025-02-07 01:32:17 +01:00
dependabot[bot] 9107e4f252 npm-dep: bump typescript-eslint from 8.21.0 to 8.22.0 in /frontend
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.21.0 to 8.22.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.22.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-28 09:19:46 +00:00
dependabot[bot] 957ad71108 npm-dep: bump @eslint/js from 9.18.0 to 9.19.0 in /frontend
Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.18.0 to 9.19.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/commits/v9.19.0/packages/js)

---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-27 09:57:49 +00:00
dependabot[bot] f88b7a4bf6 npm-dep: bump eslint from 9.18.0 to 9.19.0 in /frontend
Bumps [eslint](https://github.com/eslint/eslint) from 9.18.0 to 9.19.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.18.0...v9.19.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-27 09:57:30 +00:00
dependabot[bot] d1158df2ed npm-dep: bump prettier-plugin-tailwindcss in /frontend
Bumps [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) from 0.6.10 to 0.6.11.
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/compare/v0.6.10...v0.6.11)

---
updated-dependencies:
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-24 09:37:36 +00:00
Maxi Quoß 65be53bd3c fix: goreleaser deprecation warning 2025-01-23 12:31:47 +01:00
Maxi Quoß c70efd082f pnpm format 2025-01-23 12:31:47 +01:00
dependabot[bot] 0c68342c11 npm-dep: bump vite from 5.4.12 to 5.4.14 in /frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.12 to 5.4.14.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.14/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.14/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-23 11:14:37 +00:00
Maxi Quoß 8906b2b6ce fix: dependabot ignore major releases 2025-01-23 12:13:00 +01:00
Maxi Quoß d36da86fb7 Revert "npm-dep: bump tailwindcss from 3.4.17 to 4.0.0 in /frontend"
This reverts commit 09d856e8eb.
2025-01-23 12:05:37 +01:00
Maxi Quoß c926eb792e pnpm format 2025-01-23 11:40:23 +01:00
dependabot[bot] 09d856e8eb npm-dep: bump tailwindcss from 3.4.17 to 4.0.0 in /frontend
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss) from 3.4.17 to 4.0.0.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/next/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.0.0/packages/tailwindcss)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-23 09:09:24 +00:00
Maxi Quoß 0e42758513 feat: auto open device link after wake 2025-01-22 15:28:32 +01:00
Maxi Quoß 973a1b80d0 feat: add device description field 2025-01-22 13:21:07 +01:00
Maxi Quoß 558e6484d0 format 2025-01-22 12:45:19 +01:00
Maxi Quoß 8cb100552d fix: grammar in shutdown description 2025-01-22 12:44:27 +01:00
dependabot[bot] ef58ce188a npm-dep: bump vite from 5.4.11 to 5.4.12 in /frontend
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 5.4.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 11:20:59 +00:00
dependabot[bot] 5189a2cbf2 npm-dep: bump @sveltejs/kit from 2.16.0 to 2.16.1 in /frontend
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 2.16.0 to 2.16.1.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@2.16.1/packages/kit)

---
updated-dependencies:
- dependency-name: "@sveltejs/kit"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 09:53:25 +00:00
dependabot[bot] 567fa46e77 go-dep: bump github.com/prometheus-community/pro-bing in /backend
Bumps [github.com/prometheus-community/pro-bing](https://github.com/prometheus-community/pro-bing) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/prometheus-community/pro-bing/releases)
- [Changelog](https://github.com/prometheus-community/pro-bing/blob/main/.goreleaser.yaml)
- [Commits](https://github.com/prometheus-community/pro-bing/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus-community/pro-bing
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 09:30:59 +00:00
dependabot[bot] 4f015fbeee npm-dep: bump @sveltejs/kit from 2.15.3 to 2.16.0 in /frontend
Bumps [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) from 2.15.3 to 2.16.0.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/main/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@2.16.0/packages/kit)

---
updated-dependencies:
- dependency-name: "@sveltejs/kit"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-21 09:22:42 +00:00
dependabot[bot] 9cd8cb21c9 npm-dep: bump typescript-eslint from 8.20.0 to 8.21.0 in /frontend
Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.20.0 to 8.21.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.21.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-21 09:21:05 +00:00
dependabot[bot] eea7ff492b go-dep: bump github.com/pocketbase/pocketbase in /backend
Bumps [github.com/pocketbase/pocketbase](https://github.com/pocketbase/pocketbase) from 0.24.3 to 0.24.4.
- [Release notes](https://github.com/pocketbase/pocketbase/releases)
- [Changelog](https://github.com/pocketbase/pocketbase/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/pocketbase/compare/v0.24.3...v0.24.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 10:02:01 +00:00
dependabot[bot] 42d35dfbd6 npm-dep: bump pocketbase from 0.25.0 to 0.25.1 in /frontend
Bumps [pocketbase](https://github.com/pocketbase/js-sdk) from 0.25.0 to 0.25.1.
- [Release notes](https://github.com/pocketbase/js-sdk/releases)
- [Changelog](https://github.com/pocketbase/js-sdk/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pocketbase/js-sdk/commits)

---
updated-dependencies:
- dependency-name: pocketbase
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 09:47:27 +00:00
28 changed files with 1243 additions and 2276 deletions
+6
View File
@@ -8,6 +8,9 @@ updates:
open-pull-requests-limit: 10
commit-message:
prefix: go-dep
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
- package-ecosystem: npm
directory: "/frontend"
schedule:
@@ -15,6 +18,9 @@ updates:
open-pull-requests-limit: 10
commit-message:
prefix: npm-dep
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
- package-ecosystem: github-actions
directory: "/"
schedule:
+1 -1
View File
@@ -29,7 +29,7 @@ builds:
- goos: darwin
goarch: arm
archives:
- format: zip
- formats: [ 'zip' ]
checksum:
name_template: "checksums.txt"
snapshot:
+2 -2
View File
@@ -5,8 +5,8 @@ go 1.23.4
require (
github.com/mdlayher/wol v0.0.0-20220221231636-b763a792253a
github.com/pocketbase/dbx v1.11.0
github.com/pocketbase/pocketbase v0.24.3
github.com/prometheus-community/pro-bing v0.5.0
github.com/pocketbase/pocketbase v0.24.4
github.com/prometheus-community/pro-bing v0.6.0
github.com/robfig/cron/v3 v3.0.1
golang.org/x/sys v0.29.0
)
+4 -4
View File
@@ -185,10 +185,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pocketbase/dbx v1.11.0 h1:LpZezioMfT3K4tLrqA55wWFw1EtH1pM4tzSVa7kgszU=
github.com/pocketbase/dbx v1.11.0/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
github.com/pocketbase/pocketbase v0.24.3 h1:WUrzW11ijCySlDsVRHon3HXdtiratWv+ODK26/k6cI8=
github.com/pocketbase/pocketbase v0.24.3/go.mod h1:EfXV/8RUY76jA6g1RPNHjOuW7wTd2bz0QlvAI/RU8YY=
github.com/prometheus-community/pro-bing v0.5.0 h1:Fq+4BUXKIvsPtXUY8K+04ud9dkAuFozqGmRAyNUpffY=
github.com/prometheus-community/pro-bing v0.5.0/go.mod h1:1joR9oXdMEAcAJJvhs+8vNDvTg5thfAZcRFhcUozG2g=
github.com/pocketbase/pocketbase v0.24.4 h1:kw/c23HccoxMV/19U9QlDcvNJgQ66vlUrxGQDZicWKM=
github.com/pocketbase/pocketbase v0.24.4/go.mod h1:EfXV/8RUY76jA6g1RPNHjOuW7wTd2bz0QlvAI/RU8YY=
github.com/prometheus-community/pro-bing v0.6.0 h1:04SZ/092gONTE1XUFzYFWqgB4mKwcdkqNChLMFedwhg=
github.com/prometheus-community/pro-bing v0.6.0/go.mod h1:jNCOI3D7pmTCeaoF41cNS6uaxeFY/Gmc3ffwbuJVzAQ=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
@@ -0,0 +1,45 @@
package migrations
import (
"github.com/pocketbase/pocketbase/core"
m "github.com/pocketbase/pocketbase/migrations"
)
func init() {
m.Register(func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("z5lghx2r3tm45n1")
if err != nil {
return err
}
// add field
if err := collection.Fields.AddMarshaledJSONAt(5, []byte(`{
"autogeneratePattern": "",
"hidden": false,
"id": "text1843675174",
"max": 0,
"min": 0,
"name": "description",
"pattern": "",
"presentable": false,
"primaryKey": false,
"required": false,
"system": false,
"type": "text"
}`)); err != nil {
return err
}
return app.Save(collection)
}, func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("z5lghx2r3tm45n1")
if err != nil {
return err
}
// remove field
collection.Fields.RemoveById("text1843675174")
return app.Save(collection)
})
}
@@ -0,0 +1,45 @@
package migrations
import (
"github.com/pocketbase/pocketbase/core"
m "github.com/pocketbase/pocketbase/migrations"
)
func init() {
m.Register(func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("z5lghx2r3tm45n1")
if err != nil {
return err
}
// add field
if err := collection.Fields.AddMarshaledJSONAt(8, []byte(`{
"hidden": false,
"id": "select355930381",
"maxSelect": 1,
"name": "link_open",
"presentable": false,
"required": false,
"system": false,
"type": "select",
"values": [
"same_tab",
"new_tab"
]
}`)); err != nil {
return err
}
return app.Save(collection)
}, func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("z5lghx2r3tm45n1")
if err != nil {
return err
}
// remove field
collection.Fields.RemoveById("select355930381")
return app.Save(collection)
})
}
+7 -7
View File
@@ -16,13 +16,13 @@
},
"devDependencies": {
"@eslint/compat": "^1.2.5",
"@eslint/js": "^9.18.0",
"@eslint/js": "^9.19.0",
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.15.3",
"@sveltejs/kit": "^2.16.1",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"autoprefixer": "^10.4.20",
"daisyui": "^4.12.23",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-svelte": "^2.46.1",
"globals": "^15.14.0",
@@ -30,14 +30,14 @@
"postcss": "^8.5.1",
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.10",
"prettier-plugin-tailwindcss": "^0.6.11",
"svelte": "^4.2.19",
"svelte-check": "^4.1.4",
"tailwindcss": "^3.4.17",
"tslib": "^2.8.1",
"typescript": "^5.7.3",
"typescript-eslint": "^8.20.0",
"vite": "^5.4.11"
"typescript-eslint": "^8.22.0",
"vite": "^5.4.14"
},
"type": "module",
"lint-staged": {
@@ -49,7 +49,7 @@
"cron-parser": "^4.9.0",
"date-fns": "^4.1.0",
"npm-run-all": "^4.1.5",
"pocketbase": "^0.25.0",
"pocketbase": "^0.25.1",
"svelte-fa": "^4.0.3",
"svelte-french-toast": "^1.2.0",
"theme-change": "^2.5.0",
+908 -2235
View File
File diff suppressed because it is too large Load Diff
+16 -5
View File
@@ -3,6 +3,7 @@
import LL, { locale } from '$lib/i18n/i18n-svelte';
import { backendUrl, permission, pocketbase } from '$lib/stores/pocketbase';
import type { Device } from '$lib/types/device';
import { cronRegex } from '$lib/types/device';
import {
faBed,
faCircleArrowDown,
@@ -141,10 +142,18 @@
}
function getNextCronRelativeTime(expression: string, now: number) {
const cron = cronParser.parseExpression(expression);
return formatRelative(cron.next().toISOString(), now, {
locale: dateFnsLocale
});
if (!cronRegex.test(expression)) {
return 'Invalid cron';
}
try {
const cron = cronParser.parseExpression(expression);
return formatRelative(cron.next().toISOString(), now, {
locale: dateFnsLocale
});
} catch {
return 'Invalid cron';
}
}
</script>
@@ -157,8 +166,10 @@
{:else}
<h1 class="card-title">{device.name}</h1>
{/if}
{#if device.description}
<p>{device.description}</p>
{/if}
<ul class="menu rounded-box bg-base-200">
<!-- TODO: change to nic array once backend supports it -->
<DeviceCardNic {device} />
</ul>
{#if device.wake_cron_enabled || device.shutdown_cron_enabled || device.password}
@@ -44,7 +44,6 @@
}
}
// TODO: change wake and shutdown to nic based routes, not device based
function wake() {
fetch(`${backendUrl}api/upsnap/wake/${device.id}`, {
headers: {
@@ -52,9 +51,17 @@
}
})
.then((resp) => resp.json())
.then((data) => {
.then(async (data) => {
device = data as Device;
countdown(Date.parse(device.updated));
await countdown(Date.parse(device.updated));
if (device.status === 'online' && device.link && device.link_open !== '') {
console.log('here');
if (device.link_open === 'new_tab') {
window.open(device.link, '_blank');
} else {
window.open(device.link, '_self');
}
}
})
.catch((err) => {
toast.error(err.message);
@@ -78,15 +85,29 @@
}
function countdown(updated: number) {
timeout = 120;
const end = updated + 2 * 60 * 1000;
interval = setInterval(() => {
timeout = Math.round((end - Date.now()) / 1000);
if (timeout <= 0 || device.status !== 'pending') {
clearInterval(interval);
interval = 0;
return new Promise((resolve, reject) => {
try {
timeout = 120;
const end = updated + 2 * 60 * 1000;
if (interval) {
clearInterval(interval);
interval = 0;
}
interval = setInterval(() => {
timeout = Math.round((end - Date.now()) / 1000);
if (timeout <= 0 || device.status !== 'pending') {
clearInterval(interval);
interval = 0;
resolve(interval);
}
}, 1000);
} catch (error) {
reject(error);
}
}, 1000);
});
}
function handleClick() {
+45 -7
View File
@@ -4,6 +4,7 @@
import LL from '$lib/i18n/i18n-svelte';
import { permission, pocketbase } from '$lib/stores/pocketbase';
import type { Device, Group, Port } from '$lib/types/device';
import { cronRegex } from '$lib/types/device';
import { faSave, faTrash, faX } from '@fortawesome/free-solid-svg-icons';
import { onMount } from 'svelte';
import Fa from 'svelte-fa';
@@ -246,6 +247,21 @@
required
/>
</div>
<div class="form-control w-full max-w-xs">
<label class="label" for="device-description">
<div class="label-text">
<span>{$LL.device.general_description()}</span>
</div>
</label>
<input
id="device-description"
type="text"
placeholder={$LL.device.general_description_placeholder()}
class="input w-full max-w-xs"
bind:value={device.description}
/>
</div>
<span class="badge self-center text-error">* {$LL.device.general_required_field()}</span>
</div>
</div>
@@ -275,13 +291,33 @@
<p class="my-2">
{$LL.device.link_desc()}
</p>
<div class="form-control w-full">
<input
type="url"
placeholder="https:// ..."
class="input w-full max-w-xs"
bind:value={device.link}
/>
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
<div class="form-control w-full">
<label class="label" for="device-link">
<div class="label-text">{$LL.device.link()}</div>
</label>
<input
id="device-link"
type="url"
placeholder="https:// ..."
class="input w-full max-w-xs"
bind:value={device.link}
/>
</div>
<label class="form-control w-full max-w-xs">
<label class="label" for="device-link-open">
<div class="label-text">{$LL.device.link_open()}</div>
</label>
<select
id="device-link-open"
class="select select-bordered"
bind:value={device.link_open}
>
<option value="">{$LL.device.link_open_no()}</option>
<option value="same_tab">{$LL.device.link_open_same_tab()}</option>
<option value="new_tab">{$LL.device.link_open_new_tab()}</option>
</select>
</label>
</div>
</div>
</div>
@@ -357,6 +393,7 @@
bind:value={device.wake_cron}
disabled={!device.wake_cron_enabled}
required={device.wake_cron_enabled}
pattern={cronRegex.source}
/>
</div>
<div class="flex flex-col">
@@ -549,6 +586,7 @@
bind:value={device.shutdown_cron}
disabled={!device.shutdown_cron_enabled}
required={device.shutdown_cron_enabled}
pattern={cronRegex.source}
/>
</div>
<div class="flex flex-col">
+6
View File
@@ -55,6 +55,8 @@ const de = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Netmask',
general_description: 'Beschreibung',
general_description_placeholder: 'Eine Beschreibung des Geräts',
general_required_field: 'Pflichtfeld',
ports: 'Ports',
ports_desc: 'UpSnap kann auch prüfen, ob bestimmte Ports offen sind.',
@@ -64,6 +66,10 @@ const de = {
link: 'Link',
link_desc:
'Macht Ihren Gerätenamen zu einem anklickbaren Link, ideal zum Beispiel für die Verknüpfung eines Dashboards.',
link_open: 'Automatisch Link öffnen',
link_open_no: 'Nein',
link_open_same_tab: 'Selber Tab',
link_open_new_tab: 'Neuer Tab',
ping: 'Ping',
ping_desc:
'Du kannst einen benutzerdefinierten Shell-Befehl verwenden, um festzustellen, ob das Gerät eingeschaltet ist. Der Befehl sollte einen Exit-Code von <span class="badge">0</span> zurückgeben, um anzuzeigen, dass das Gerät eingeschaltet ist. Jeder andere Exit-Code setzt den Status auf offline.',
+7 -1
View File
@@ -53,6 +53,8 @@ const en = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Netmask',
general_description: 'Description',
general_description_placeholder: 'Some description of the device',
general_required_field: 'required field',
ports: 'Ports',
ports_desc: 'UpSnap can also check if given ports are open.',
@@ -62,6 +64,10 @@ const en = {
link: 'Link',
link_desc:
'Makes your device name a clickable link, perfect for linking a dashboard for example.',
link_open: 'Automatically open link',
link_open_no: 'No',
link_open_same_tab: 'Same tab',
link_open_new_tab: 'New tab',
ping: 'Ping',
ping_desc:
'You can use a custom shell command to see if the device is powered on. The command should return an exit code of <span class="badge">0</span> to indicate that the device is powered on, any other exit code will mark the device as powered off.',
@@ -85,7 +91,7 @@ const en = {
sol_password: 'SOL Password',
shutdown: 'Shutdown',
shutdown_desc:
'This <strong>shell command</strong> will run inside your container (if you use docker) or on your host (if you use the binary). To verify that works you can run the command inside the container or on your host shell first. Common commands are <span class="badge">net rpc</span> for windows, <span class="badge">sshpass</span> for linux or <span class="badge">curl</span> in general to make web requests.',
'This <strong>shell command</strong> will run inside your container (if you use docker) or on your host (if you use the binary). To verify that it works, you can run the command inside the container or on your host shell first. Common commands are <span class="badge">net rpc</span> for windows, <span class="badge">sshpass</span> for linux or <span class="badge">curl</span> in general to make web requests.',
shutdown_examples: 'Examples:',
shutdown_examples_windows: 'Shutdown remote windows machine:',
shutdown_examples_linux: 'Shutdown remote linux machine:',
+6
View File
@@ -55,6 +55,8 @@ const es = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Máscara de red',
general_description: 'Descripción',
general_description_placeholder: 'Descripción del dispositivo',
general_required_field: 'Campo obligatorio',
ports: 'Puertos',
ports_desc: 'UpSnap puede comprobar si ciertos puertos están abiertos.',
@@ -64,6 +66,10 @@ const es = {
link: 'Link',
link_desc:
'Permite que el nombre de su dispositivo sea un enlace. Perfecto para dashboard, por ejemplo.',
link_open: 'Abrir enlace automáticamente',
link_open_no: 'No',
link_open_same_tab: 'Misma pestaña',
link_open_new_tab: 'Nueva pestaña',
ping: 'Ping',
ping_desc:
'Puede utilizar un comando de shell personalizado para ver si el dispositivo está conectado. El comando debe devolver un código de salida de <span class="badge">0</span> para indicar que el dispositivo está encendido; cualquier otro código de salida marcará el dispositivo como apagado.',
+6
View File
@@ -56,6 +56,8 @@ const fr = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Masque réseau',
general_description: 'Description',
general_description_placeholder: "Description de l'appareil",
general_required_field: 'champ requis',
ports: 'Ports',
ports_desc: 'UpSnap peut aussi vérifier si certains ports sont ouverts.',
@@ -65,6 +67,10 @@ const fr = {
link: 'Lien',
link_desc:
'Rend le nom de votre appareil cliquable, parfait pour y lier un tableau de bord par exemple.',
link_open: 'Ouvrir automatiquement un lien',
link_open_no: 'No',
link_open_same_tab: 'Même onglet',
link_open_new_tab: 'Nouvel onglet',
ping: 'Ping',
ping_desc:
"Vous pouvez utiliser une commande shell personnalisée pour vérifier si l'appareil est sous tension. La commande doit renvoyer un code de sortie de <span class='badge'>0</span> pour indiquer que l'appareil est sous tension, tout autre code de sortie indiquera que l'appareil est hors tension.",
+51 -2
View File
@@ -21,6 +21,7 @@ export type Locales =
| 'it'
| 'it-IT'
| 'ja'
| 'ja-JP'
| 'nl'
| 'nl-NL'
| 'pt'
@@ -233,6 +234,14 @@ type RootTranslation = {
* N​e​t​m​a​s​k
*/
general_netmask: string;
/**
* D​e​s​c​r​i​p​t​i​o​n
*/
general_description: string;
/**
* S​o​m​e​ ​d​e​s​c​r​i​p​t​i​o​n​ ​o​f​ ​t​h​e​ ​d​e​v​i​c​e
*/
general_description_placeholder: string;
/**
* r​e​q​u​i​r​e​d​ ​f​i​e​l​d
*/
@@ -265,6 +274,22 @@ type RootTranslation = {
* M​a​k​e​s​ ​y​o​u​r​ ​d​e​v​i​c​e​ ​n​a​m​e​ ​a​ ​c​l​i​c​k​a​b​l​e​ ​l​i​n​k​,​ ​p​e​r​f​e​c​t​ ​f​o​r​ ​l​i​n​k​i​n​g​ ​a​ ​d​a​s​h​b​o​a​r​d​ ​f​o​r​ ​e​x​a​m​p​l​e​.
*/
link_desc: string;
/**
* A​u​t​o​m​a​t​i​c​a​l​l​y​ ​o​p​e​n​ ​l​i​n​k
*/
link_open: string;
/**
* N​o
*/
link_open_no: string;
/**
* S​a​m​e​ ​t​a​b
*/
link_open_same_tab: string;
/**
* N​e​w​ ​t​a​b
*/
link_open_new_tab: string;
/**
* P​i​n​g
*/
@@ -338,7 +363,7 @@ type RootTranslation = {
*/
shutdown: string;
/**
* T​h​i​s​ ​<​s​t​r​o​n​g​>​s​h​e​l​l​ ​c​o​m​m​a​n​d​<​/​s​t​r​o​n​g​>​ ​w​i​l​l​ ​r​u​n​ ​i​n​s​i​d​e​ ​y​o​u​r​ ​c​o​n​t​a​i​n​e​r​ ​(​i​f​ ​y​o​u​ ​u​s​e​ ​d​o​c​k​e​r​)​ ​o​r​ ​o​n​ ​y​o​u​r​ ​h​o​s​t​ ​(​i​f​ ​y​o​u​ ​u​s​e​ ​t​h​e​ ​b​i​n​a​r​y​)​.​ ​T​o​ ​v​e​r​i​f​y​ ​t​h​a​t​ ​w​o​r​k​s​ ​y​o​u​ ​c​a​n​ ​r​u​n​ ​t​h​e​ ​c​o​m​m​a​n​d​ ​i​n​s​i​d​e​ ​t​h​e​ ​c​o​n​t​a​i​n​e​r​ ​o​r​ ​o​n​ ​y​o​u​r​ ​h​o​s​t​ ​s​h​e​l​l​ ​f​i​r​s​t​.​ ​C​o​m​m​o​n​ ​c​o​m​m​a​n​d​s​ ​a​r​e​ ​<​s​p​a​n​ ​c​l​a​s​s​=​"​b​a​d​g​e​"​>​n​e​t​ ​r​p​c​<​/​s​p​a​n​>​ ​f​o​r​ ​w​i​n​d​o​w​s​,​ ​<​s​p​a​n​ ​c​l​a​s​s​=​"​b​a​d​g​e​"​>​s​s​h​p​a​s​s​<​/​s​p​a​n​>​ ​f​o​r​ ​l​i​n​u​x​ ​o​r​ ​<​s​p​a​n​ ​c​l​a​s​s​=​"​b​a​d​g​e​"​>​c​u​r​l​<​/​s​p​a​n​>​ ​i​n​ ​g​e​n​e​r​a​l​ ​t​o​ ​m​a​k​e​ ​w​e​b​ ​r​e​q​u​e​s​t​s​.
* T​h​i​s​ ​<​s​t​r​o​n​g​>​s​h​e​l​l​ ​c​o​m​m​a​n​d​<​/​s​t​r​o​n​g​>​ ​w​i​l​l​ ​r​u​n​ ​i​n​s​i​d​e​ ​y​o​u​r​ ​c​o​n​t​a​i​n​e​r​ ​(​i​f​ ​y​o​u​ ​u​s​e​ ​d​o​c​k​e​r​)​ ​o​r​ ​o​n​ ​y​o​u​r​ ​h​o​s​t​ ​(​i​f​ ​y​o​u​ ​u​s​e​ ​t​h​e​ ​b​i​n​a​r​y​)​.​ ​T​o​ ​v​e​r​i​f​y​ ​t​h​a​t​ ​i​t​ ​w​o​r​k​s​,​ ​y​o​u​ ​c​a​n​ ​r​u​n​ ​t​h​e​ ​c​o​m​m​a​n​d​ ​i​n​s​i​d​e​ ​t​h​e​ ​c​o​n​t​a​i​n​e​r​ ​o​r​ ​o​n​ ​y​o​u​r​ ​h​o​s​t​ ​s​h​e​l​l​ ​f​i​r​s​t​.​ ​C​o​m​m​o​n​ ​c​o​m​m​a​n​d​s​ ​a​r​e​ ​<​s​p​a​n​ ​c​l​a​s​s​=​"​b​a​d​g​e​"​>​n​e​t​ ​r​p​c​<​/​s​p​a​n​>​ ​f​o​r​ ​w​i​n​d​o​w​s​,​ ​<​s​p​a​n​ ​c​l​a​s​s​=​"​b​a​d​g​e​"​>​s​s​h​p​a​s​s​<​/​s​p​a​n​>​ ​f​o​r​ ​l​i​n​u​x​ ​o​r​ ​<​s​p​a​n​ ​c​l​a​s​s​=​"​b​a​d​g​e​"​>​c​u​r​l​<​/​s​p​a​n​>​ ​i​n​ ​g​e​n​e​r​a​l​ ​t​o​ ​m​a​k​e​ ​w​e​b​ ​r​e​q​u​e​s​t​s​.
*/
shutdown_desc: string;
/**
@@ -1004,6 +1029,14 @@ export type TranslationFunctions = {
* Netmask
*/
general_netmask: () => LocalizedString;
/**
* Description
*/
general_description: () => LocalizedString;
/**
* Some description of the device
*/
general_description_placeholder: () => LocalizedString;
/**
* required field
*/
@@ -1036,6 +1069,22 @@ export type TranslationFunctions = {
* Makes your device name a clickable link, perfect for linking a dashboard for example.
*/
link_desc: () => LocalizedString;
/**
* Automatically open link
*/
link_open: () => LocalizedString;
/**
* No
*/
link_open_no: () => LocalizedString;
/**
* Same tab
*/
link_open_same_tab: () => LocalizedString;
/**
* New tab
*/
link_open_new_tab: () => LocalizedString;
/**
* Ping
*/
@@ -1109,7 +1158,7 @@ export type TranslationFunctions = {
*/
shutdown: () => LocalizedString;
/**
* This <strong>shell command</strong> will run inside your container (if you use docker) or on your host (if you use the binary). To verify that works you can run the command inside the container or on your host shell first. Common commands are <span class="badge">net rpc</span> for windows, <span class="badge">sshpass</span> for linux or <span class="badge">curl</span> in general to make web requests.
* This <strong>shell command</strong> will run inside your container (if you use docker) or on your host (if you use the binary). To verify that it works, you can run the command inside the container or on your host shell first. Common commands are <span class="badge">net rpc</span> for windows, <span class="badge">sshpass</span> for linux or <span class="badge">curl</span> in general to make web requests.
*/
shutdown_desc: () => LocalizedString;
/**
+1
View File
@@ -16,6 +16,7 @@ const localeTranslationLoaders = {
it: () => import('./it'),
'it-IT': () => import('./it-IT'),
ja: () => import('./ja'),
'ja-JP': () => import('./ja-JP'),
nl: () => import('./nl'),
'nl-NL': () => import('./nl-NL'),
pt: () => import('./pt'),
+2
View File
@@ -15,6 +15,7 @@ import fr_FR from './fr-FR';
import it from './it';
import it_IT from './it-IT';
import ja from './ja';
import ja_JP from './ja-JP';
import nl from './nl';
import nl_NL from './nl-NL';
import pt from './pt';
@@ -35,6 +36,7 @@ const localeTranslations = {
it,
'it-IT': it_IT,
ja,
'ja-JP': ja_JP,
nl,
'nl-NL': nl_NL,
pt,
+1
View File
@@ -25,6 +25,7 @@ export const locales: Locales[] = [
'it',
'it-IT',
'ja',
'ja-JP',
'nl',
'nl-NL',
'pt',
+6
View File
@@ -55,6 +55,8 @@ const it = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Maschera di rete',
general_description: 'Descrizione',
general_description_placeholder: 'Descrizione del dispositivo',
general_required_field: 'Campo obbligatorio',
ports: 'Porte',
ports_desc: "UpSnap puo' anche controllare che le porte siano aperte.",
@@ -64,6 +66,10 @@ const it = {
link: 'Collegamento',
link_desc:
'Rende il nome del tuo dispositivo un collegamento, perfetto per collegare ad esempio un sito.',
link_open: 'Aprire automaticamente il link',
link_open_no: 'No',
link_open_same_tab: 'Stessa scheda',
link_open_new_tab: 'Nuova scheda',
ping: 'Ping',
ping_desc:
'Puoi usare un comando personalizzato per controllare che il dispositivo sia acceso. Il comando deve ritornare un codice uguale a <span class="badge">0</span> per confermare che il dispositivo sia acceso, mentre qualunque altro codice indica che il dispositivo e\' spento.',
+8
View File
@@ -0,0 +1,8 @@
import type { Translation } from '../i18n-types';
import ja from '../ja';
const ja_JP = {
...(ja as unknown as Translation)
} satisfies Translation;
export default ja_JP;
+6
View File
@@ -53,6 +53,8 @@ const ja = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'ネットマスク',
general_description: '説明',
general_description_placeholder: '装置の説明',
general_required_field: '必須項目',
ports: 'ポート',
ports_desc: 'UpSnap は指定されたポートが開いているか確認することもできます。',
@@ -62,6 +64,10 @@ const ja = {
link: 'リンク',
link_desc:
'デバイス名をクリック可能なリンクにします。たとえばダッシュボードへのリンクに最適です。',
link_open: '自動的にリンクを開く',
link_open_no: 'いいえ',
link_open_same_tab: '同じタブ',
link_open_new_tab: '新しいタブ',
ping: 'Ping',
ping_desc:
'デバイスがオンになっているか確認するためにカスタムシェルコマンドを使用できます。このコマンドは、デバイスがオンであることを示すには終了コード <span class="badge">0</span> を返す必要があります。その他の終了コードはオフとして扱われます。',
+6
View File
@@ -55,6 +55,8 @@ const nl = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Subnetmask',
general_description: 'Beschrijving',
general_description_placeholder: 'Enige beschrijving van het apparaat',
general_required_field: 'vereist veld',
ports: 'Poorten',
ports_desc: 'UpSnap kan ook controleren of gegeven poorten open zijn.',
@@ -64,6 +66,10 @@ const nl = {
link: 'Link',
link_desc:
'Maakt de apparaatsnaam een klikbare link, ideaal om bijvoorbeeld een dashboard te linken.',
link_open: 'Link automatisch openen',
link_open_no: 'Nee',
link_open_same_tab: 'Zelfde tab',
link_open_new_tab: 'Nieuw tabblad',
ping: 'Ping',
ping_desc:
'Je kunt een aangepaste shell-opdracht gebruiken om te zien of het apparaat aan staat. De opdracht moet een exitcode van <span class="badge">0</span> retourneren om aan te geven dat het apparaat aan is, elke andere exitcode markeert het apparaat als uitgeschakeld.',
+6
View File
@@ -55,6 +55,8 @@ const pt = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: 'Máscara de rede',
general_description: 'Descrição',
general_description_placeholder: 'Alguma descrição do dispositivo',
general_required_field: 'campo obrigatório',
ports: 'Portos',
ports_desc: 'UpSnap pode verificar se certos portos estão abertos.',
@@ -64,6 +66,10 @@ const pt = {
link: 'Link',
link_desc:
'Permite que o nome do seu dispositivo seja um link. Perfeito para dashboard, por exemplo.',
link_open: 'Abrir automaticamente a ligação',
link_open_no: 'Não',
link_open_same_tab: 'O mesmo separador',
link_open_new_tab: 'Novo separador',
ping: 'Ping',
ping_desc:
'Pode utilizar um comando shell personalizado para ver se o dispositivo está ligado. O comando deve devolver um código de saída de <span class="badge">0</span> para indicar que o dispositivo está ligado, qualquer outro código de saída marcará o dispositivo como desligado.',
+7 -1
View File
@@ -1,5 +1,5 @@
import zh from '../zh';
import type { Translation } from '../i18n-types';
import zh from '../zh';
const zh_TW = {
...(zh as unknown as Translation),
@@ -54,6 +54,8 @@ const zh_TW = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: '子網域遮罩',
general_description: '描述',
general_description_placeholder: '關於這个裝置的描述',
general_required_field: '必填',
ports: '埠',
ports_desc: 'UpSnap 可以檢查指定的埠是否開啟',
@@ -62,6 +64,10 @@ const zh_TW = {
ports_number: '通訊埠編號',
link: '連結',
link_desc: '讓您的裝置名稱成為可點擊的連結,非常適合用來連結儀表板等。',
link_open: '自動開啟連結',
link_open_no: '毋',
link_open_same_tab: '同一個標籤',
link_open_new_tab: '新標籤',
ping: 'Ping',
ping_desc:
'你可以使用自定義的指令來檢查裝置是否開機。該指令應返回退出碼 <span class="badge">0</span> 以表示裝置已開機,任何其他退出碼將標記裝置為關機。',
+6
View File
@@ -52,6 +52,8 @@ const zh = {
general_ip: 'IP',
general_mac: 'Mac',
general_netmask: '子网掩码',
general_description: '说明',
general_description_placeholder: '设备的一些说明',
general_required_field: '必填字段',
ports: '端口',
ports_desc: 'UpSnap 可以检查设备端口是否正常.',
@@ -60,6 +62,10 @@ const zh = {
ports_number: '端口号',
link: '链接',
link_desc: '为您的设备名设置一个可点击的链接.',
link_open: '自动打开链接',
link_open_no: '没有',
link_open_same_tab: '同一标签',
link_open_new_tab: '新标签',
ping: 'Ping',
ping_desc:
'您可以使用自定义 shell 命令来查看设备是否已接通电源。该命令应返回 <span class="badge">0</span> 的退出代码,表示设备电源已打开,任何其他退出代码都将标记设备电源已关闭。',
+6
View File
@@ -5,9 +5,11 @@ export type Device = RecordModel & {
ip: string;
mac: string;
netmask: string;
description: string;
status: 'pending' | 'online' | 'offline' | '';
ports: string[];
link: URL;
link_open: '' | 'same_tab' | 'new_tab';
ping_cmd: string;
wake_cron: string;
wake_cron_enabled: boolean;
@@ -40,3 +42,7 @@ export type Port = RecordModel & {
export type Group = RecordModel & {
name: string;
};
export const cronRegex = new RegExp(
/(@(annually|yearly|monthly|weekly|daily|hourly))|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})/
);
+1
View File
@@ -24,6 +24,7 @@
it: '🇮🇹',
'it-IT': '🇮🇹',
ja: '🇯🇵',
'ja-JP': '🇯🇵',
nl: '🇳🇱',
'nl-NL': '🇳🇱',
pt: '🇵🇹',