diff --git a/.gitignore b/.gitignore index ce33fd59..821a6718 100644 --- a/.gitignore +++ b/.gitignore @@ -199,3 +199,4 @@ frontend/vite.config.ts.timestamp-* backend/pb_data backend/pb_public/* +!backend/pb_public/.gitkeep diff --git a/README.md b/README.md index 8f2fbce6..6c2a0349 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Open up [http://localhost:5173/](http://localhost:5173/) - [x] ~~add rest of settings page~~ - [x] ~~form for adding new devices~~ - - [ ] add per device settings + - [x] ~~add per device settings~~ - [x] ~~theme toggle button~~ - [x] ~~add device ports to cards~~ diff --git a/backend/cronjobs/cronjobs.go b/backend/cronjobs/cronjobs.go index 2502b650..9234e1a5 100644 --- a/backend/cronjobs/cronjobs.go +++ b/backend/cronjobs/cronjobs.go @@ -20,6 +20,11 @@ func RunCron(app *pocketbase.PocketBase) { // init cronjob Jobs = cron.New() Jobs.AddFunc(settingsRecords[0].GetString("interval"), func() { + // skip cron if no realtime clients connected + realtimeClients := len(app.SubscriptionsBroker().Clients()) + if realtimeClients == 0 { + return + } // expand ports field expandFetchFunc := func(c *models.Collection, ids []string) ([]*models.Record, error) { return app.Dao().FindRecordsByIds(c.Id, ids, nil) diff --git a/backend/pb_public/.gitkeep b/backend/pb_public/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/backend/upsnap b/backend/upsnap new file mode 100755 index 00000000..1f3e9d84 Binary files /dev/null and b/backend/upsnap differ diff --git a/frontend/src/app.html b/frontend/src/app.html index f4a15b7a..a3dcb59b 100644 --- a/frontend/src/app.html +++ b/frontend/src/app.html @@ -4,6 +4,7 @@ +
(1) Same cron syntax as for ping interval.
+(2) Shell command to be executed. e.g.:
++ (3) Some network cards have the option to set a password for magic packets, also called + "SecureON". Password can only be 0, 4 or 6 characters in length. +
+