mirror of
https://github.com/seriousm4x/UpSnap.git
synced 2026-11-27 20:32:04 +00:00
Compare commits
206 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e72dbb7621 | |||
| 9107e4f252 | |||
| 957ad71108 | |||
| f88b7a4bf6 | |||
| d1158df2ed | |||
| 65be53bd3c | |||
| c70efd082f | |||
| 0c68342c11 | |||
| 8906b2b6ce | |||
| d36da86fb7 | |||
| c926eb792e | |||
| 09d856e8eb | |||
| 0e42758513 | |||
| 973a1b80d0 | |||
| 558e6484d0 | |||
| 8cb100552d | |||
| ef58ce188a | |||
| 5189a2cbf2 | |||
| 567fa46e77 | |||
| 4f015fbeee | |||
| 9cd8cb21c9 | |||
| eea7ff492b | |||
| 42d35dfbd6 | |||
| 22c16cc455 | |||
| 7764ccc65f | |||
| 62cb0e8f73 | |||
| 2d8fce32d3 | |||
| 3746d71c2d | |||
| 34a0ae5c65 | |||
| 3e7eb6cbf9 | |||
| 9da93677bf | |||
| 71319f0497 | |||
| 74326f3436 | |||
| db8eaab3db | |||
| 8da9b15b5e | |||
| 641095b1bd | |||
| 14a9841218 | |||
| 1f0818b5ed | |||
| 84f7a792cf | |||
| c9bb412729 | |||
| 1216702203 | |||
| 7e30943015 | |||
| 7c91f02606 | |||
| 743da5c4f3 | |||
| d1a0457702 | |||
| 48ad232b50 | |||
| e0431509e2 | |||
| 8372d52212 | |||
| 1c07638b9f | |||
| 19acedeea0 | |||
| e98b9ba75d | |||
| 46016ff5fa | |||
| bc3cd9b77f | |||
| 0d6d94b455 | |||
| e124f5b86e | |||
| 322c1ccc50 | |||
| 4540d8b851 | |||
| c6a9af4086 | |||
| 61980c62d7 | |||
| abe7b446be | |||
| 47b81553be | |||
| 9ebe092b9d | |||
| 6d06e5ae9b | |||
| 69bb334b20 | |||
| 885b69ff03 | |||
| 27e6bf01d3 | |||
| ecce74795d | |||
| 44a2a91e9d | |||
| 2f1acee092 | |||
| 2c92334884 | |||
| 652924e8cd | |||
| bd24ddde74 | |||
| b56c69108b | |||
| 6b9a942b14 | |||
| af84e91bfa | |||
| ac0f9096da | |||
| 71b49adf44 | |||
| e523400551 | |||
| 7e07210ad3 | |||
| 9485351e63 | |||
| bc379d3888 | |||
| 7a4a0d5049 | |||
| d09d1620f3 | |||
| ff46a9ac80 | |||
| 7110be01c6 | |||
| a08a39cbdd | |||
| fba43d919a | |||
| f36e03ef32 | |||
| d3e88bc2dd | |||
| d03f1b220b | |||
| a1ee1e5d27 | |||
| f86a24606f | |||
| 79317fec30 | |||
| fd7ab53b75 | |||
| b0988fc20e | |||
| e3f14e90f7 | |||
| a41495ccb7 | |||
| 1d5cea4620 | |||
| bcd34bdf38 | |||
| 6f512fbc1b | |||
| 78f0375566 | |||
| 6f9039474d | |||
| bf69134e7c | |||
| aef9db57ae | |||
| 6b50d6a0f7 | |||
| 888ddb1c56 | |||
| c4e02fab7a | |||
| 5ffec52b89 | |||
| 20d98f6628 | |||
| f0d7715aca | |||
| f4a1990462 | |||
| 6cbaedebc9 | |||
| 70709024ae | |||
| b870627f86 | |||
| 9b19a114df | |||
| eb9bb9d92f | |||
| 60142488a6 | |||
| 0d15ade648 | |||
| 5b48d924ae | |||
| 96158ce2d8 | |||
| 6707a5bd95 | |||
| 688d05eda9 | |||
| 7ae27a94b0 | |||
| 62c3de819a | |||
| a8f997d0f6 | |||
| dabc97fd49 | |||
| 3e54cdd8f8 | |||
| 6532eb48f8 | |||
| 72d36e297a | |||
| 25373a6605 | |||
| 1cdd2863a1 | |||
| a2f8597cca | |||
| 081cb022ee | |||
| f4116fbd9c | |||
| 85f18c6470 | |||
| 08f5a3deb7 | |||
| 74f30b78eb | |||
| d8616f1e2d | |||
| 59c2316c3d | |||
| a05a615aa8 | |||
| b8246e60c3 | |||
| 9bee856944 | |||
| 1b486e5128 | |||
| 8fc1c251f2 | |||
| 5e86cb2937 | |||
| e6e2993f9d | |||
| 0f96bdff3e | |||
| a4739af0e3 | |||
| d8bbcbb1aa | |||
| 1d71d9c659 | |||
| 7c0bd93b08 | |||
| d018334384 | |||
| c45622f404 | |||
| 44c7431aad | |||
| 0ea70284f7 | |||
| b3b711d3c8 | |||
| af55e7e68f | |||
| d621d942e4 | |||
| baa8b3a0fe | |||
| ba9ffa1146 | |||
| db1e09cb2d | |||
| 019292d22c | |||
| 82663125e9 | |||
| 505b9a5e07 | |||
| 9e5fda3d27 | |||
| de511638c0 | |||
| 8f569c6d3b | |||
| 076f1f9fc9 | |||
| 7176184073 | |||
| b707e2b793 | |||
| b3386a98ae | |||
| 7a3435f1d4 | |||
| 8f1f2de3a6 | |||
| 1684208e82 | |||
| fe55367854 | |||
| f024b6dc47 | |||
| 96140f39cc | |||
| 8c3bebd33e | |||
| f0065952bc | |||
| 47a5ea794e | |||
| f7e986a924 | |||
| 3f9930b36a | |||
| 942f2478c9 | |||
| 142ac89964 | |||
| 93fe3be0a6 | |||
| 0a2d770a11 | |||
| 67ec72cbaa | |||
| df1d33b723 | |||
| f53889d074 | |||
| e89e50d06c | |||
| e5fa6f82f5 | |||
| 1c765c0385 | |||
| ea49757016 | |||
| 3ac2fc6461 | |||
| b91cdac789 | |||
| 9623192869 | |||
| 688e32b41d | |||
| c15e6b6274 | |||
| c77bf9e118 | |||
| 4476089a79 | |||
| 7123048261 | |||
| 993ae9fd45 | |||
| 96aa800f80 | |||
| c72e6c844e | |||
| 9efca82559 | |||
| eea0cc3e7e |
@@ -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:
|
||||
|
||||
+37
-4
@@ -1,5 +1,5 @@
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/go,visualstudiocode,svelte,node
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=go,visualstudiocode,svelte,node
|
||||
# Created by https://www.toptal.com/developers/gitignore/api/go,node,svelte,visualstudiocode,macos
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=go,node,svelte,visualstudiocode,macos
|
||||
|
||||
### Go ###
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
@@ -24,6 +24,39 @@
|
||||
# Go workspace file
|
||||
go.work
|
||||
|
||||
### macOS ###
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
### macOS Patch ###
|
||||
# iCloud generated files
|
||||
*.icloud
|
||||
|
||||
### Node ###
|
||||
# Logs
|
||||
logs
|
||||
@@ -100,7 +133,7 @@ web_modules/
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variable files
|
||||
#.env
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
@@ -190,7 +223,7 @@ package
|
||||
.history
|
||||
.ionide
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/go,visualstudiocode,svelte,node
|
||||
# End of https://www.toptal.com/developers/gitignore/api/go,node,svelte,visualstudiocode,macos
|
||||
|
||||
build
|
||||
data
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM alpine:3 as downloader
|
||||
FROM alpine:3 AS downloader
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
FROM node:alpine as node
|
||||
FROM node:alpine AS node
|
||||
WORKDIR /app
|
||||
COPY frontend/ .
|
||||
RUN npm i -g pnpm &&\
|
||||
pnpm i &&\
|
||||
pnpm run build
|
||||
|
||||
FROM golang:alpine as go
|
||||
FROM golang:alpine AS go
|
||||
WORKDIR /app
|
||||
COPY backend/ .
|
||||
COPY --from=node /app/build ./pb_public
|
||||
|
||||
@@ -129,9 +129,11 @@ UpSnap is available in the following languages so far:
|
||||
|
||||
- 🇺🇸 **English** (en-US)
|
||||
- 🇩🇪 **German** (de-DE)
|
||||
- 🇮🇹 **Italian** (it-IT)
|
||||
- 🇪🇸 **Spanish** (es-ES)
|
||||
- 🇫🇷 **French** (fr-FR)
|
||||
- 🇮🇹 **Italian** (it-IT)
|
||||
- 🇯🇵 **Japanese** (ja-JP)
|
||||
- 🇳🇱 **Dutch** (nl-NL)
|
||||
- 🇵🇹 **Portuguese** (pt-PT)
|
||||
- 🇨🇳 **Chinese** (zh-CN)
|
||||
- 🇹🇼 **Chinese (Taiwan)** (zh-TW)
|
||||
|
||||
@@ -15,20 +15,21 @@ builds:
|
||||
- linux
|
||||
- windows
|
||||
- darwin
|
||||
- freebsd
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
- arm
|
||||
goarm:
|
||||
- 6
|
||||
- 7
|
||||
- "6"
|
||||
- "7"
|
||||
ignore:
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
archives:
|
||||
- format: zip
|
||||
- formats: [ 'zip' ]
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
snapshot:
|
||||
@@ -56,7 +57,7 @@ changelog:
|
||||
order: 2
|
||||
git:
|
||||
ignore_tags:
|
||||
- "{{ if not .Prerelease}}beta{{ end }}"
|
||||
- "{{ if not .Prerelease}}*beta*{{ end }}"
|
||||
aurs:
|
||||
- name: upsnap-bin
|
||||
homepage: https://github.com/seriousm4x/UpSnap
|
||||
|
||||
@@ -2,7 +2,7 @@ package cronjobs
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/robfig/cron/v3"
|
||||
"github.com/seriousm4x/upsnap/logger"
|
||||
"github.com/seriousm4x/upsnap/networking"
|
||||
@@ -21,7 +21,7 @@ func SetPingJobs(app *pocketbase.PocketBase) {
|
||||
CronPing.Remove(job.ID)
|
||||
}
|
||||
|
||||
settingsPrivateRecords, err := app.Dao().FindRecordsByExpr("settings_private")
|
||||
settingsPrivateRecords, err := app.FindAllRecords("settings_private")
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
}
|
||||
@@ -33,24 +33,24 @@ func SetPingJobs(app *pocketbase.PocketBase) {
|
||||
return
|
||||
}
|
||||
|
||||
devices, err := app.Dao().FindRecordsByExpr("devices")
|
||||
devices, err := app.FindAllRecords("devices")
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
// expand ports field
|
||||
expandFetchFunc := func(c *models.Collection, ids []string) ([]*models.Record, error) {
|
||||
return app.Dao().FindRecordsByIds(c.Id, ids, nil)
|
||||
expandFetchFunc := func(c *core.Collection, ids []string) ([]*core.Record, error) {
|
||||
return app.FindRecordsByIds(c.Id, ids, nil)
|
||||
}
|
||||
merr := app.Dao().ExpandRecords(devices, []string{"ports"}, expandFetchFunc)
|
||||
merr := app.ExpandRecords(devices, []string{"ports"}, expandFetchFunc)
|
||||
if len(merr) > 0 {
|
||||
return
|
||||
}
|
||||
|
||||
for _, device := range devices {
|
||||
// ping device
|
||||
go func(d *models.Record) {
|
||||
go func(d *core.Record) {
|
||||
status := d.GetString("status")
|
||||
if status == "pending" {
|
||||
return
|
||||
@@ -60,7 +60,7 @@ func SetPingJobs(app *pocketbase.PocketBase) {
|
||||
return
|
||||
}
|
||||
d.Set("status", "online")
|
||||
if err := app.Dao().SaveRecord(d); err != nil {
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
} else {
|
||||
@@ -68,15 +68,15 @@ func SetPingJobs(app *pocketbase.PocketBase) {
|
||||
return
|
||||
}
|
||||
d.Set("status", "offline")
|
||||
if err := app.Dao().SaveRecord(d); err != nil {
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
}
|
||||
}(device)
|
||||
|
||||
// ping ports
|
||||
go func(d *models.Record) {
|
||||
ports, err := app.Dao().FindRecordsByIds("ports", d.GetStringSlice("ports"))
|
||||
go func(d *core.Record) {
|
||||
ports, err := app.FindRecordsByIds("ports", d.GetStringSlice("ports"))
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func SetPingJobs(app *pocketbase.PocketBase) {
|
||||
isUp := networking.CheckPort(d.GetString("ip"), port.GetString("number"))
|
||||
if isUp != port.GetBool("status") {
|
||||
port.Set("status", isUp)
|
||||
if err := app.Dao().SaveRecord(port); err != nil {
|
||||
if err := app.Save(port); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func SetWakeShutdownJobs(app *pocketbase.PocketBase) {
|
||||
CronWakeShutdown.Remove(job.ID)
|
||||
}
|
||||
|
||||
devices, err := app.Dao().FindRecordsByExpr("devices")
|
||||
devices, err := app.FindAllRecords("devices")
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
return
|
||||
@@ -117,13 +117,13 @@ func SetWakeShutdownJobs(app *pocketbase.PocketBase) {
|
||||
if isOnline {
|
||||
return
|
||||
}
|
||||
d, err := app.Dao().FindRecordById("devices", dev.Id)
|
||||
d, err := app.FindRecordById("devices", dev.Id)
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
return
|
||||
}
|
||||
d.Set("status", "pending")
|
||||
if err := app.Dao().SaveRecord(d); err != nil {
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
return
|
||||
}
|
||||
@@ -133,7 +133,7 @@ func SetWakeShutdownJobs(app *pocketbase.PocketBase) {
|
||||
} else {
|
||||
d.Set("status", "online")
|
||||
}
|
||||
if err := app.Dao().SaveRecord(d); err != nil {
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
})
|
||||
@@ -148,7 +148,7 @@ func SetWakeShutdownJobs(app *pocketbase.PocketBase) {
|
||||
if !isOnline {
|
||||
return
|
||||
}
|
||||
d, err := app.Dao().FindRecordById("devices", dev.Id)
|
||||
d, err := app.FindRecordById("devices", dev.Id)
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
return
|
||||
@@ -158,7 +158,7 @@ func SetWakeShutdownJobs(app *pocketbase.PocketBase) {
|
||||
return
|
||||
}
|
||||
d.Set("status", "pending")
|
||||
if err := app.Dao().SaveRecord(d); err != nil {
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
if err := networking.ShutdownDevice(d); err != nil {
|
||||
@@ -167,7 +167,7 @@ func SetWakeShutdownJobs(app *pocketbase.PocketBase) {
|
||||
} else {
|
||||
d.Set("status", "offline")
|
||||
}
|
||||
if err := app.Dao().SaveRecord(d); err != nil {
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
})
|
||||
|
||||
+48
-55
@@ -1,90 +1,83 @@
|
||||
module github.com/seriousm4x/upsnap
|
||||
|
||||
go 1.23.0
|
||||
go 1.23.4
|
||||
|
||||
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.1
|
||||
github.com/pocketbase/pocketbase v0.22.20
|
||||
github.com/prometheus-community/pro-bing v0.4.1
|
||||
github.com/pocketbase/dbx v1.11.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.25.0
|
||||
golang.org/x/sys v0.29.0
|
||||
)
|
||||
|
||||
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-v2 v1.30.5 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.35 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.33 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.20 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.33.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.29.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.53 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.24 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.51 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.28 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.28 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.19 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.17 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.61.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 // indirect
|
||||
github.com/aws/smithy-go v1.20.4 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.28 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.5.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.73.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.24.10 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.8 // indirect
|
||||
github.com/aws/smithy-go v1.22.1 // indirect
|
||||
github.com/disintegration/imaging v1.6.2 // indirect
|
||||
github.com/domodwyer/mailyak/v3 v3.6.2 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/fatih/color v1.17.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
|
||||
github.com/ganigeorgiev/fexpr v0.4.1 // indirect
|
||||
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
|
||||
github.com/goccy/go-json v0.10.3 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/josharian/native v1.1.0 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.23 // indirect
|
||||
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 // indirect
|
||||
github.com/mdlayher/packet v1.1.2 // indirect
|
||||
github.com/mdlayher/socket v0.5.1 // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/spf13/cast v1.7.0 // indirect
|
||||
github.com/spf13/cast v1.7.1 // indirect
|
||||
github.com/spf13/cobra v1.8.1 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.2 // indirect
|
||||
go.opencensus.io v0.24.0 // indirect
|
||||
gocloud.dev v0.39.0 // indirect
|
||||
golang.org/x/crypto v0.27.0 // indirect
|
||||
golang.org/x/image v0.20.0 // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
golang.org/x/oauth2 v0.23.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/term v0.24.0 // indirect
|
||||
golang.org/x/text v0.18.0 // indirect
|
||||
golang.org/x/time v0.6.0 // indirect
|
||||
golang.org/x/tools v0.25.0 // indirect
|
||||
gocloud.dev v0.40.0 // indirect
|
||||
golang.org/x/crypto v0.32.0 // indirect
|
||||
golang.org/x/image v0.23.0 // indirect
|
||||
golang.org/x/net v0.34.0 // indirect
|
||||
golang.org/x/oauth2 v0.25.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/term v0.28.0 // indirect
|
||||
golang.org/x/text v0.21.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
|
||||
google.golang.org/api v0.197.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
|
||||
google.golang.org/grpc v1.66.2 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a // indirect
|
||||
modernc.org/libc v1.58.0 // indirect
|
||||
modernc.org/mathutil v1.6.0 // indirect
|
||||
modernc.org/memory v1.8.0 // indirect
|
||||
modernc.org/sqlite v1.33.1 // indirect
|
||||
modernc.org/strutil v1.2.0 // indirect
|
||||
google.golang.org/api v0.217.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
|
||||
google.golang.org/grpc v1.69.4 // indirect
|
||||
google.golang.org/protobuf v1.36.3 // indirect
|
||||
modernc.org/gc/v3 v3.0.0-20250105121824-520be1a3aee6 // indirect
|
||||
modernc.org/libc v1.55.3 // indirect
|
||||
modernc.org/mathutil v1.7.1 // indirect
|
||||
modernc.org/memory v1.8.2 // indirect
|
||||
modernc.org/sqlite v1.34.4 // indirect
|
||||
modernc.org/strutil v1.2.1 // indirect
|
||||
modernc.org/token v1.1.0 // indirect
|
||||
)
|
||||
|
||||
+130
-138
@@ -1,12 +1,12 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ=
|
||||
cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc=
|
||||
cloud.google.com/go/auth v0.9.3 h1:VOEUIAADkkLtyfr3BLa3R8Ed/j6w1jTBmARx+wb5w5U=
|
||||
cloud.google.com/go/auth v0.9.3/go.mod h1:7z6VY+7h3KUdRov5F1i8NDP5ZzWKYmEPO842BgCsmTk=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc=
|
||||
cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
|
||||
cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
|
||||
cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14=
|
||||
cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU=
|
||||
cloud.google.com/go/auth v0.14.0 h1:A5C4dKV/Spdvxcl0ggWwWEzzP7AZMJSEIgrkngwhGYM=
|
||||
cloud.google.com/go/auth v0.14.0/go.mod h1:CYsoRL1PdiDuqeQpZE0bP2pnPrGqFcOkI0nldEQis+A=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.7 h1:/Lc7xODdqcEw8IrZ9SvwnlLX6j9FHQM74z6cBk9Rw6M=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.7/go.mod h1:NTbTTzfvPl1Y3V1nPpOgl2w6d/FjO7NNUQaWSox6ZMc=
|
||||
cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I=
|
||||
cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg=
|
||||
cloud.google.com/go/iam v1.1.13 h1:7zWBXG9ERbMLrzQBRhFliAV+kjcRToDTgQT3CTwYyv4=
|
||||
cloud.google.com/go/iam v1.1.13/go.mod h1:K8mY0uSXwEXS30KrnVb+j54LB/ntfZu1dr+4zFMNbus=
|
||||
cloud.google.com/go/storage v1.43.0 h1:CcxnSohZwizt4LCzQHWvBf1/kvtHUn7gk9QERXPyXFs=
|
||||
@@ -23,44 +23,44 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
|
||||
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
|
||||
github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g=
|
||||
github.com/aws/aws-sdk-go-v2 v1.30.5/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 h1:70PVAiL15/aBMh5LThwgXdSQorVr91L127ttckI9QQU=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4/go.mod h1:/MQxMqci8tlqDH+pjmoLu1i0tbWCUP1hhyMRuFxpQCw=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.35 h1:jeFgiWYNV0vrgdZqB4kZBjYNdy0IKkwrAjr2fwpHIig=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.35/go.mod h1:qnpEvTq8ZfjrCqmJGRfWZuF+lGZ/vG8LK2K0L/TY1gQ=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.33 h1:lBHAQQznENv0gLHAZ73ONiTSkCtr8q3pSqWrpbBBZz0=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.33/go.mod h1:MBuqCUOT3ChfLuxNDGyra67eskx7ge9e3YKYBce7wpI=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 h1:pfQ2sqNpMVK6xz2RbqLEL0GH87JOwSxPV2rzm8Zsb74=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13/go.mod h1:NG7RXPUlqfsCLLFfi0+IpKN4sCB9D9fw/qTaSB+xRoU=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.20 h1:I41tSUE9zJlf98j1VnSN0ATyj8WnsAXexlJyUvJF0Ak=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.20/go.mod h1:44AcWwA15PG6ACWgOt6G9eXO4t/HdURFzXQ0FSGh45Y=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 h1:pI7Bzt0BJtYA0N/JEC6B8fJ4RBrEMi1LBrkMdFYNSnQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17/go.mod h1:Dh5zzJYMtxfIjYW+/evjQ8uj2OyR/ve2KROHGHlSFqE=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 h1:Mqr/V5gvrhA2gvgnF42Zh5iMiQNcOYthFYwCyrnuWlc=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17/go.mod h1:aLJpZlCmjE+V+KtN1q1uyZkfnUWpQGpbsn89XPKyzfU=
|
||||
github.com/aws/aws-sdk-go-v2 v1.33.0 h1:Evgm4DI9imD81V0WwD+TN4DCwjUMdc94TrduMLbgZJs=
|
||||
github.com/aws/aws-sdk-go-v2 v1.33.0/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.29.0 h1:Vk/u4jof33or1qAQLdofpjKV7mQQT7DcUpnYx8kdmxY=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.29.0/go.mod h1:iXAZK3Gxvpq3tA+B9WaDYpZis7M8KFgdrDPMmHrgbJM=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.53 h1:lwrVhiEDW5yXsuVKlFVUnR2R50zt2DklhOyeLETqDuE=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.53/go.mod h1:CkqM1bIw/xjEpBMhBnvqUXYZbpCFuj6dnCAyDk2AtAY=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.24 h1:5grmdTdMsovn9kPZPI23Hhvp0ZyNm5cRO+IZFIYiAfw=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.24/go.mod h1:zqi7TVKTswH3Ozq28PkmBmgzG1tona7mo9G2IJg4Cis=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.51 h1:Q0FNHs6JTGuoBWNQycD5LRSf+/WVHWEl+FwJ0tEDZUE=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.51/go.mod h1:B9sW5/AD5bStKdTyUdz1xWRKOwnyUwJ4eJ4olQBtZo0=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.28 h1:igORFSiH3bfq4lxKFkTSYDhJEUCYo6C8VKiWJjYwQuQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.28/go.mod h1:3So8EA/aAYm36L7XIvCVwLa0s5N0P7o2b1oqnx/2R4g=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.28 h1:1mOW9zAUMhTSrMDssEHS/ajx8JcAj/IcftzcmNlmVLI=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.28/go.mod h1:kGlXVIWDfvt2Ox5zEaNglmq0hXPHgQFNMix33Tw22jA=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.17 h1:Roo69qTpfu8OlJ2Tb7pAYVuF0CpuUMB0IYWwYP/4DZM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.17/go.mod h1:NcWPxQzGM1USQggaTVwz6VpqMZPX1CvDJLDh6jnOCa4=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.19 h1:FLMkfEiRjhgeDTCjjLoc3URo/TBkgeQbocA78lfkzSI=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.19/go.mod h1:Vx+GucNSsdhaxs3aZIKfSUjKVGsxN25nX2SRcdhuw08=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 h1:rfprUlsdzgl7ZL2KlXiUAoJnI/VxfHCvDFr2QDFj6u4=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19/go.mod h1:SCWkEdRq8/7EK60NcvvQ6NXKuTcchAD4ROAsC37VEZE=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.17 h1:u+EfGmksnJc/x5tq3A+OD7LrMbSSR/5TrKLvkdy/fhY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.17/go.mod h1:VaMx6302JHax2vHJWgRo+5n9zvbacs3bLU/23DNQrTY=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.61.3 h1:O/rjUvLED2dWzrSY6wv3njBjJlH4LT2xYRnUm402ovI=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.61.3/go.mod h1:5FmD/Dqq57gP+XwaUnd5WFPipAuzrf0HmupX27Gvjvc=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.22.8 h1:JRwuL+S1Qe1owZQoxblV7ORgRf2o0SrtzDVIbaVCdQ0=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.22.8/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8 h1:+HpGETD9463PFSj7lX5+eq7aLDs85QUIA+NBkeAsscA=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.8/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.30.8 h1:bAi+4p5EKnni+jrfcAhb7iHFQ24bthOAV9t0taf3DCE=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.30.8/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o=
|
||||
github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4=
|
||||
github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.28 h1:7kpeALOUeThs2kEjlAxlADAVfxKmkYAedlpZ3kdoSJ4=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.28/go.mod h1:pyaOYEdp1MJWgtXLy6q80r3DhsVdOIOZNB9hdTcJIvI=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.5.1 h1:mJ9FRktB8v1Ihpqwfk0AWvYEd0FgQtLsshc2Qb2TVc8=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.5.1/go.mod h1:dIW8puxSbYLSPv/ju0d9A3CpwXdtqvJtYKDMVmPLOWE=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.9 h1:TQmKDyETFGiXVhZfQ/I0cCFziqqX58pi4tKJGYGFSz0=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.9/go.mod h1:HVLPK2iHQBUx7HfZeOQSEu3v2ubZaAY2YPbAm5/WUyY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.9 h1:2aInXbh02XsbO0KobPGMNXyv2QP73VDKsWPNJARj/+4=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.9/go.mod h1:dgXS1i+HgWnYkPXqNoPIPKeUsUUYHaUbThC90aDnNiE=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.73.1 h1:OzmyfYGiMCOIAq5pa0KWcaZoA9F8FqajOJevh+hhFdY=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.73.1/go.mod h1:K+0a0kWDHAUXBH8GvYGS3cQRwIuRjO9bMWUz6vpNCaU=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.24.10 h1:DyZUj3xSw3FR3TXSwDhPhuZkkT14QHBiacdbUVcD0Dg=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.24.10/go.mod h1:Ro744S4fKiCCuZECXgOi760TiYylUM8ZBf6OGiZzJtY=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.9 h1:I1TsPEs34vbpOnR81GIcAq4/3Ud+jRHVGwx6qLQUHLs=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.9/go.mod h1:Fzsj6lZEb8AkTE5S68OhcbBqeWPsR8RnGuKPr8Todl8=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.8 h1:pqEJQtlKWvnv3B6VRt60ZmsHy3SotlEBvfUBPB1KVcM=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.8/go.mod h1:f6vjfZER1M17Fokn0IzssOTMT2N8ZSq+7jnNF0tArvw=
|
||||
github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro=
|
||||
github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
@@ -80,14 +80,14 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
|
||||
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
|
||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/gabriel-vasile/mimetype v1.4.5 h1:J7wGKdGu33ocBOhGy0z653k/lFKLFDPJMG8Gql0kxn4=
|
||||
github.com/gabriel-vasile/mimetype v1.4.5/go.mod h1:ibHel+/kbxn9x2407k1izTA1S81ku1z/DlgOW2QE0M4=
|
||||
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
|
||||
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
|
||||
github.com/ganigeorgiev/fexpr v0.4.1 h1:hpUgbUEEWIZhSDBtf4M9aUNfQQ0BZkGRaMePy7Gcx5k=
|
||||
github.com/ganigeorgiev/fexpr v0.4.1/go.mod h1:RyGiGqmeXhEQ6+mlGdnUleLHgtzzu/VGO2WtJkF5drE=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
@@ -99,14 +99,12 @@ github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRi
|
||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
|
||||
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ=
|
||||
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
@@ -130,10 +128,10 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
|
||||
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
|
||||
github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=
|
||||
github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=
|
||||
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k=
|
||||
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
|
||||
github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0=
|
||||
github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
@@ -141,8 +139,8 @@ github.com/google/wire v0.6.0 h1:HBkoIh4BdSxoyo9PveV8giw7ZsaBOvzWKfcg/6MrVwI=
|
||||
github.com/google/wire v0.6.0/go.mod h1:F4QhpQ9EDIdJ1Mbop/NZBRB+5yrR6qg3BnctaoUk6NA=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA=
|
||||
github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s=
|
||||
github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A=
|
||||
github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q=
|
||||
github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
|
||||
@@ -160,17 +158,12 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61 h1:FwuzbVh87iLiUQj1+uQUsuw9x5t9m5n5g7rG7o4svW4=
|
||||
github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61/go.mod h1:paQfF1YtHe+GrGg5fOgjsjoCX/UKDr9bc1DoWpZfns8=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.23 h1:gbShiuAP1W5j9UOksQ06aiiqPMxYecovVGwmTxWtuw0=
|
||||
github.com/mattn/go-sqlite3 v1.14.23/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/mdlayher/ethernet v0.0.0-20190313224307-5b5fc417d966/go.mod h1:5s5p/sMJ6sNsFl6uCh85lkFGV8kLuIYJCRJLavVJwvg=
|
||||
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 h1:2oDp6OOhLxQ9JBoUuysVz9UZ9uI6oLUbvAZu0x8o+vE=
|
||||
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118/go.mod h1:ZFUnHIVchZ9lJoWoEGUg8Q3M4U8aNNWA3CVSUTkW4og=
|
||||
@@ -190,12 +183,12 @@ github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdh
|
||||
github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||
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.1 h1:cw+vsyfCJD8YObOVeqb93YErnlxwYMkNZ4rwN0G0AaA=
|
||||
github.com/pocketbase/dbx v1.10.1/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs=
|
||||
github.com/pocketbase/pocketbase v0.22.20 h1:yUkhO5bTPWlzD4ZK6EQlS4R3AcHKDlBD+DxxU2BR83I=
|
||||
github.com/pocketbase/pocketbase v0.22.20/go.mod h1:Cw5E4uoGhKItBIE2lJL3NfmiUr9Syk2xaNJ2G7Dssow=
|
||||
github.com/prometheus-community/pro-bing v0.4.1 h1:aMaJwyifHZO0y+h8+icUz0xbToHbia0wdmzdVZ+Kl3w=
|
||||
github.com/prometheus-community/pro-bing v0.4.1/go.mod h1:aLsw+zqCaDoa2RLVVSX3+UiCkBBXTMtZC3c7EkfWnAE=
|
||||
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.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=
|
||||
@@ -204,8 +197,8 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w=
|
||||
github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
|
||||
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
|
||||
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
@@ -220,10 +213,6 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
|
||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
||||
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||
@@ -231,29 +220,33 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8=
|
||||
go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw=
|
||||
go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8=
|
||||
go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc=
|
||||
go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8=
|
||||
go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4=
|
||||
go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ=
|
||||
gocloud.dev v0.39.0 h1:EYABYGhAalPUaMrbSKOr5lejxoxvXj99nE8XFtsDgds=
|
||||
gocloud.dev v0.39.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ=
|
||||
go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY=
|
||||
go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE=
|
||||
go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE=
|
||||
go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY=
|
||||
go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk=
|
||||
go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8=
|
||||
go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys=
|
||||
go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A=
|
||||
gocloud.dev v0.40.0 h1:f8LgP+4WDqOG/RXoUcyLpeIAGOcAbZrZbDQCUee10ng=
|
||||
gocloud.dev v0.40.0/go.mod h1:drz+VyYNBvrMTW0KZiBAYEdl8lbNZx+OQ7oQvdrFmSQ=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
|
||||
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.20.0 h1:7cVCUjQwfL18gyBJOmYvptfSHS8Fb3YUDtfLIZ7Nbpw=
|
||||
golang.org/x/image v0.20.0/go.mod h1:0a88To4CYVBAHp5FXJm8o7QbUl37Vd85ply1vyD8auM=
|
||||
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
|
||||
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
|
||||
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
|
||||
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -266,18 +259,18 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
|
||||
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
|
||||
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||
golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70=
|
||||
golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -290,23 +283,22 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
|
||||
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
|
||||
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
|
||||
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
|
||||
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
|
||||
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
|
||||
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
@@ -314,33 +306,33 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE=
|
||||
golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg=
|
||||
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
|
||||
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY=
|
||||
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
|
||||
google.golang.org/api v0.197.0 h1:x6CwqQLsFiA5JKAiGyGBjc2bNtHtLddhJCE2IKuhhcQ=
|
||||
google.golang.org/api v0.197.0/go.mod h1:AuOuo20GoQ331nq7DquGHlU6d+2wN2fZ8O0ta60nRNw=
|
||||
google.golang.org/api v0.217.0 h1:GYrUtD289o4zl1AhiTZL0jvQGa2RDLyC+kX1N/lfGOU=
|
||||
google.golang.org/api v0.217.0/go.mod h1:qMc2E8cBAbQlRypBTBWHklNJlaZZJBwDv81B1Iu8oSI=
|
||||
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.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU=
|
||||
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:hL97c3SYopEHblzpxRL4lSs523++l8DYxGM1FQiYmb4=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240812133136-8ffd90a71988 h1:+/tmTy5zAieooKIXfzDm9KiA3Bv6JBwriRN9LY+yayk=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240812133136-8ffd90a71988/go.mod h1:4+X6GvPs+25wZKbQq9qyAXrwIRExv7w0Ea6MgZLZiDM=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
|
||||
google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988 h1:CT2Thj5AuPV9phrYMtzX11k+XkzMGfRAet42PmoTATM=
|
||||
google.golang.org/genproto v0.0.0-20240812133136-8ffd90a71988/go.mod h1:7uvplUBj4RjHAxIZ//98LzOvrQ04JBkaixRmCMI29hc=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
|
||||
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
|
||||
google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A=
|
||||
google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@@ -350,8 +342,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||
google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU=
|
||||
google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
@@ -361,27 +353,27 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ=
|
||||
modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ=
|
||||
modernc.org/ccgo/v4 v4.20.7 h1:skrinQsjxWfvj6nbC3ztZPJy+NuwmB3hV9zX/pthNYQ=
|
||||
modernc.org/ccgo/v4 v4.20.7/go.mod h1:UOkI3JSG2zT4E2ioHlncSOZsXbuDCZLvPi3uMlZT5GY=
|
||||
modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y=
|
||||
modernc.org/ccgo/v4 v4.19.2/go.mod h1:ysS3mxiMV38XGRTTcgo0DQTeTmAO4oCmJl1nX9VFI3s=
|
||||
modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE=
|
||||
modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ=
|
||||
modernc.org/gc/v2 v2.5.0 h1:bJ9ChznK1L1mUtAQtxi0wi5AtAs5jQuw4PrPHO5pb6M=
|
||||
modernc.org/gc/v2 v2.5.0/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
|
||||
modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a h1:CfbpOLEo2IwNzJdMvE8aiRbPMxoTpgAJeyePh0SmO8M=
|
||||
modernc.org/gc/v3 v3.0.0-20240801135723-a856999a2e4a/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4=
|
||||
modernc.org/libc v1.58.0 h1:TebzsKutZdvJposq9SA1atw3yBfrB+u03A8rpN0I+Qc=
|
||||
modernc.org/libc v1.58.0/go.mod h1:EY/egGEU7Ju66eU6SBqCNYaFUDuc4npICkMWnU5EE3A=
|
||||
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
|
||||
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
|
||||
modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E=
|
||||
modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU=
|
||||
modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
|
||||
modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
|
||||
modernc.org/gc/v3 v3.0.0-20250105121824-520be1a3aee6 h1:JoKwHjIFumiKrjMbp1cNbC5E9UyCgA/ZcID0xOWQ2N8=
|
||||
modernc.org/gc/v3 v3.0.0-20250105121824-520be1a3aee6/go.mod h1:LG5UO1Ran4OO0JRKz2oNiXhR5nNrgz0PzH7UKhz0aMU=
|
||||
modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U=
|
||||
modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w=
|
||||
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||
modernc.org/memory v1.8.2 h1:cL9L4bcoAObu4NkxOlKWBWtNHIsnnACGF/TbqQ6sbcI=
|
||||
modernc.org/memory v1.8.2/go.mod h1:ZbjSvMO5NQ1A2i3bWeDiVMxIorXwdClKE/0SZ+BMotU=
|
||||
modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
|
||||
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
|
||||
modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
|
||||
modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss=
|
||||
modernc.org/sqlite v1.33.1 h1:trb6Z3YYoeM9eDL1O8do81kP+0ejv+YzgyFo+Gwy0nM=
|
||||
modernc.org/sqlite v1.33.1/go.mod h1:pXV2xHxhzXZsgT/RtTFAPY6JJDEvOTcTdwADQCCWD4k=
|
||||
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
|
||||
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
|
||||
modernc.org/sqlite v1.34.4 h1:sjdARozcL5KJBvYQvLlZEmctRgW9xqIZc2ncN7PU0P8=
|
||||
modernc.org/sqlite v1.34.4/go.mod h1:3QQFCG2SEMtc2nv+Wq4cQCH7Hjcg+p/RMlS1XK+zwbk=
|
||||
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
|
||||
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
|
||||
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||
|
||||
+2
-2
@@ -3,13 +3,13 @@ package main
|
||||
import (
|
||||
"embed"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/pocketbase/apis"
|
||||
"github.com/seriousm4x/upsnap/pb"
|
||||
)
|
||||
|
||||
//go:embed all:pb_public
|
||||
var distDir embed.FS
|
||||
var distDirFS = echo.MustSubFS(distDir, "pb_public")
|
||||
var distDirFS = apis.MustSubFS(distDir, "pb_public")
|
||||
|
||||
func main() {
|
||||
pb.StartPocketBase(distDirFS)
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
jsonData := `{
|
||||
"id": "z5lghx2r3tm45n1",
|
||||
"created": "2023-01-28 19:10:29.223Z",
|
||||
"updated": "2023-01-28 19:10:29.223Z",
|
||||
"name": "devices",
|
||||
"type": "base",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "tiqcmnjo",
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "1si6ajha",
|
||||
"name": "ip",
|
||||
"type": "text",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "fyqmpon6",
|
||||
"name": "mac",
|
||||
"type": "text",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "s8c5z7n0",
|
||||
"name": "netmask",
|
||||
"type": "text",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "qqvyfrex",
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "ilrwvlev",
|
||||
"name": "ports",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": null,
|
||||
"collectionId": "cti4l8f4mz8df3r",
|
||||
"cascadeDelete": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "gdctb8hj",
|
||||
"name": "link",
|
||||
"type": "url",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"exceptDomains": null,
|
||||
"onlyDomains": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "kzvdbbws",
|
||||
"name": "wake_cron",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "dcd3vuc3",
|
||||
"name": "wake_cron_enabled",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "91bs6clw",
|
||||
"name": "shutdown_cron",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "vnlymcuw",
|
||||
"name": "shutdown_cron_enabled",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "1a7yrwo9",
|
||||
"name": "shutdown_cmd",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "iarksm3l",
|
||||
"name": "password",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"listRule": "",
|
||||
"viewRule": "",
|
||||
"createRule": "",
|
||||
"updateRule": "",
|
||||
"deleteRule": "",
|
||||
"options": {}
|
||||
}`
|
||||
|
||||
collection := &models.Collection{}
|
||||
if err := json.Unmarshal([]byte(jsonData), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return daos.New(db).SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dao.DeleteCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
jsonData := `{
|
||||
"id": "cti4l8f4mz8df3r",
|
||||
"created": "2023-01-28 19:10:29.223Z",
|
||||
"updated": "2023-01-28 19:10:29.223Z",
|
||||
"name": "ports",
|
||||
"type": "base",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "8nwuncgg",
|
||||
"name": "number",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": 65535
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "o0he3pu6",
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "w0bh39gv",
|
||||
"name": "status",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"listRule": "",
|
||||
"viewRule": "",
|
||||
"createRule": "",
|
||||
"updateRule": "",
|
||||
"deleteRule": "",
|
||||
"options": {}
|
||||
}`
|
||||
|
||||
collection := &models.Collection{}
|
||||
if err := json.Unmarshal([]byte(jsonData), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return daos.New(db).SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("cti4l8f4mz8df3r")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dao.DeleteCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
jsonData := `{
|
||||
"id": "nmj3ko20gzkg8n3",
|
||||
"created": "2023-01-28 19:10:29.223Z",
|
||||
"updated": "2023-01-28 19:10:29.223Z",
|
||||
"name": "settings",
|
||||
"type": "base",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "ph88gaa5",
|
||||
"name": "interval",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "agw2fyd1",
|
||||
"name": "scan_range",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "slrjkipw",
|
||||
"name": "website_title",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"listRule": "",
|
||||
"viewRule": "",
|
||||
"createRule": "",
|
||||
"updateRule": "",
|
||||
"deleteRule": "",
|
||||
"options": {}
|
||||
}`
|
||||
|
||||
collection := &models.Collection{}
|
||||
if err := json.Unmarshal([]byte(jsonData), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return daos.New(db).SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("nmj3ko20gzkg8n3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dao.DeleteCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("_pb_users_auth_")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dao.DeleteCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
jsonData := `{
|
||||
"id": "_pb_users_auth_",
|
||||
"created": "2023-01-28 19:10:12.835Z",
|
||||
"updated": "2023-01-28 19:10:12.835Z",
|
||||
"name": "users",
|
||||
"type": "auth",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "users_name",
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "users_avatar",
|
||||
"name": "avatar",
|
||||
"type": "file",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"maxSize": 5242880,
|
||||
"mimeTypes": [
|
||||
"image/jpg",
|
||||
"image/jpeg",
|
||||
"image/png",
|
||||
"image/svg+xml",
|
||||
"image/gif",
|
||||
"image/webp"
|
||||
],
|
||||
"thumbs": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"listRule": "id = @request.auth.id",
|
||||
"viewRule": "id = @request.auth.id",
|
||||
"createRule": "",
|
||||
"updateRule": "id = @request.auth.id",
|
||||
"deleteRule": "id = @request.auth.id",
|
||||
"options": {
|
||||
"allowEmailAuth": true,
|
||||
"allowOAuth2Auth": true,
|
||||
"allowUsernameAuth": true,
|
||||
"exceptEmailDomains": null,
|
||||
"manageRule": null,
|
||||
"minPasswordLength": 8,
|
||||
"onlyEmailDomains": null,
|
||||
"requireEmail": false
|
||||
}
|
||||
}`
|
||||
|
||||
collection := &models.Collection{}
|
||||
if err := json.Unmarshal([]byte(jsonData), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return daos.New(db).SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
jsonData := `{
|
||||
"id": "27do0wbcuyfmbmx",
|
||||
"created": "2023-03-04 20:33:00.558Z",
|
||||
"updated": "2023-03-04 20:33:00.558Z",
|
||||
"name": "users",
|
||||
"type": "auth",
|
||||
"system": false,
|
||||
"schema": [],
|
||||
"listRule": null,
|
||||
"viewRule": null,
|
||||
"createRule": null,
|
||||
"updateRule": null,
|
||||
"deleteRule": null,
|
||||
"options": {
|
||||
"allowEmailAuth": true,
|
||||
"allowOAuth2Auth": false,
|
||||
"allowUsernameAuth": true,
|
||||
"exceptEmailDomains": [],
|
||||
"manageRule": null,
|
||||
"minPasswordLength": 8,
|
||||
"onlyEmailDomains": [],
|
||||
"requireEmail": false
|
||||
}
|
||||
}`
|
||||
|
||||
collection := &models.Collection{}
|
||||
if err := json.Unmarshal([]byte(jsonData), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return daos.New(db).SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dao.DeleteCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = types.Pointer("@request.auth.id != \"\"")
|
||||
|
||||
collection.ViewRule = types.Pointer("@request.auth.id != \"\"")
|
||||
|
||||
collection.CreateRule = nil
|
||||
|
||||
collection.UpdateRule = nil
|
||||
|
||||
collection.DeleteRule = nil
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = nil
|
||||
|
||||
collection.ViewRule = nil
|
||||
|
||||
collection.CreateRule = types.Pointer("")
|
||||
|
||||
collection.UpdateRule = types.Pointer("")
|
||||
|
||||
collection.DeleteRule = types.Pointer("")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("cti4l8f4mz8df3r")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = types.Pointer("@request.auth.id != \"\"")
|
||||
|
||||
collection.ViewRule = types.Pointer("@request.auth.id != \"\"")
|
||||
|
||||
collection.CreateRule = nil
|
||||
|
||||
collection.UpdateRule = nil
|
||||
|
||||
collection.DeleteRule = nil
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("cti4l8f4mz8df3r")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = nil
|
||||
|
||||
collection.ViewRule = nil
|
||||
|
||||
collection.CreateRule = types.Pointer("")
|
||||
|
||||
collection.UpdateRule = types.Pointer("")
|
||||
|
||||
collection.DeleteRule = types.Pointer("")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("nmj3ko20gzkg8n3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = types.Pointer("@request.auth.id != \"\"")
|
||||
|
||||
collection.ViewRule = types.Pointer("@request.auth.id != \"\"")
|
||||
|
||||
collection.CreateRule = nil
|
||||
|
||||
collection.UpdateRule = nil
|
||||
|
||||
collection.DeleteRule = nil
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("nmj3ko20gzkg8n3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = nil
|
||||
|
||||
collection.ViewRule = nil
|
||||
|
||||
collection.CreateRule = types.Pointer("")
|
||||
|
||||
collection.UpdateRule = types.Pointer("")
|
||||
|
||||
collection.DeleteRule = types.Pointer("")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
jsonData := `{
|
||||
"id": "t1rajoyzl6691g3",
|
||||
"created": "2023-03-09 22:17:29.463Z",
|
||||
"updated": "2023-03-09 22:17:29.463Z",
|
||||
"name": "settings_public",
|
||||
"type": "base",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "s1grje98",
|
||||
"name": "website_title",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "tlzz87pj",
|
||||
"name": "favicon",
|
||||
"type": "file",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"maxSize": 5242880,
|
||||
"mimeTypes": [
|
||||
"image/x-icon",
|
||||
"image/png",
|
||||
"image/svg+xml",
|
||||
"image/gif",
|
||||
"image/jpeg"
|
||||
],
|
||||
"thumbs": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"listRule": "",
|
||||
"viewRule": "",
|
||||
"createRule": null,
|
||||
"updateRule": null,
|
||||
"deleteRule": null,
|
||||
"options": {}
|
||||
}`
|
||||
|
||||
collection := &models.Collection{}
|
||||
if err := json.Unmarshal([]byte(jsonData), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return daos.New(db).SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("t1rajoyzl6691g3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dao.DeleteCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("nmj3ko20gzkg8n3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.Name = "settings_private"
|
||||
|
||||
collection.ListRule = nil
|
||||
|
||||
collection.ViewRule = nil
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("slrjkipw")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("nmj3ko20gzkg8n3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.Name = "settings"
|
||||
|
||||
collection.ListRule = types.Pointer("@request.auth.id != \"\"")
|
||||
|
||||
collection.ViewRule = types.Pointer("@request.auth.id != \"\"")
|
||||
|
||||
// add
|
||||
del_website_title := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "slrjkipw",
|
||||
"name": "website_title",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}`), del_website_title)
|
||||
collection.Schema.AddField(del_website_title)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("t1rajoyzl6691g3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add
|
||||
new_setup_completed := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "vrxqcsnv",
|
||||
"name": "setup_completed",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}`), new_setup_completed)
|
||||
collection.Schema.AddField(new_setup_completed)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("t1rajoyzl6691g3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("vrxqcsnv")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
jsonData := `{
|
||||
"id": "djqp3uxrac2ores",
|
||||
"created": "2023-06-29 10:39:59.291Z",
|
||||
"updated": "2023-06-29 10:39:59.291Z",
|
||||
"name": "groups",
|
||||
"type": "base",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "b3oaemnp",
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"indexes": [],
|
||||
"listRule": "@request.auth.id != \"\"",
|
||||
"viewRule": "@request.auth.id != \"\"",
|
||||
"createRule": null,
|
||||
"updateRule": null,
|
||||
"deleteRule": null,
|
||||
"options": {}
|
||||
}`
|
||||
|
||||
collection := &models.Collection{}
|
||||
if err := json.Unmarshal([]byte(jsonData), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return daos.New(db).SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("djqp3uxrac2ores")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dao.DeleteCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add
|
||||
new_groups := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "rk2vrn57",
|
||||
"name": "groups",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "djqp3uxrac2ores",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": null,
|
||||
"displayFields": []
|
||||
}
|
||||
}`), new_groups)
|
||||
collection.Schema.AddField(new_groups)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("rk2vrn57")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
options := map[string]any{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"allowEmailAuth": true,
|
||||
"allowOAuth2Auth": true,
|
||||
"allowUsernameAuth": true,
|
||||
"exceptEmailDomains": [],
|
||||
"manageRule": null,
|
||||
"minPasswordLength": 8,
|
||||
"onlyEmailDomains": [],
|
||||
"requireEmail": false
|
||||
}`), &options)
|
||||
collection.SetOptions(options)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
options := map[string]any{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"allowEmailAuth": true,
|
||||
"allowOAuth2Auth": false,
|
||||
"allowUsernameAuth": true,
|
||||
"exceptEmailDomains": [],
|
||||
"manageRule": null,
|
||||
"minPasswordLength": 8,
|
||||
"onlyEmailDomains": [],
|
||||
"requireEmail": false
|
||||
}`), &options)
|
||||
collection.SetOptions(options)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.CreateRule = types.Pointer("@request.data.password:isset = false")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.CreateRule = nil
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
options := map[string]any{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"allowEmailAuth": true,
|
||||
"allowOAuth2Auth": true,
|
||||
"allowUsernameAuth": true,
|
||||
"exceptEmailDomains": [],
|
||||
"manageRule": null,
|
||||
"minPasswordLength": 5,
|
||||
"onlyEmailDomains": [],
|
||||
"requireEmail": false
|
||||
}`), &options)
|
||||
collection.SetOptions(options)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
options := map[string]any{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"allowEmailAuth": true,
|
||||
"allowOAuth2Auth": true,
|
||||
"allowUsernameAuth": true,
|
||||
"exceptEmailDomains": [],
|
||||
"manageRule": null,
|
||||
"minPasswordLength": 8,
|
||||
"onlyEmailDomains": [],
|
||||
"requireEmail": false
|
||||
}`), &options)
|
||||
collection.SetOptions(options)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("djqp3uxrac2ores")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.Name = "device_groups"
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("djqp3uxrac2ores")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.Name = "groups"
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
jsonData := `{
|
||||
"id": "7emu7fnnwuim2ua",
|
||||
"created": "2023-08-10 21:19:39.520Z",
|
||||
"updated": "2023-08-10 21:19:39.520Z",
|
||||
"name": "permissions",
|
||||
"type": "base",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "tzxtuykz",
|
||||
"name": "user",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "27do0wbcuyfmbmx",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": 1,
|
||||
"displayFields": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "nd1ekexz",
|
||||
"name": "create",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "z79gcpy3",
|
||||
"name": "read",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "z5lghx2r3tm45n1",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": null,
|
||||
"displayFields": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "t7wwbk2c",
|
||||
"name": "update",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "z5lghx2r3tm45n1",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": null,
|
||||
"displayFields": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "b4u0gqa7",
|
||||
"name": "delete",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "z5lghx2r3tm45n1",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": null,
|
||||
"displayFields": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "nyeqt3fn",
|
||||
"name": "power",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "z5lghx2r3tm45n1",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": null,
|
||||
"displayFields": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
"CREATE UNIQUE INDEX ` + "`" + `idx_2GIk1Fo` + "`" + ` ON ` + "`" + `permissions` + "`" + ` (` + "`" + `user` + "`" + `)"
|
||||
],
|
||||
"listRule": "@request.auth.id = user.id",
|
||||
"viewRule": "@request.auth.id = user.id",
|
||||
"createRule": null,
|
||||
"updateRule": null,
|
||||
"deleteRule": "@request.auth.id = user.id",
|
||||
"options": {}
|
||||
}`
|
||||
|
||||
collection := &models.Collection{}
|
||||
if err := json.Unmarshal([]byte(jsonData), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return daos.New(db).SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("7emu7fnnwuim2ua")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return dao.DeleteCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = types.Pointer("@request.auth.id = @collection.permissions.user.id && id ?= @collection.permissions.read.id")
|
||||
|
||||
collection.ViewRule = types.Pointer("@request.auth.id = @collection.permissions.user.id && id ?= @collection.permissions.read.id")
|
||||
|
||||
collection.CreateRule = types.Pointer("@request.auth.id = @collection.permissions.user.id && @collection.permissions.create = true")
|
||||
|
||||
collection.UpdateRule = types.Pointer("@request.auth.id = @collection.permissions.user.id && id ?= @collection.permissions.update.id")
|
||||
|
||||
collection.DeleteRule = types.Pointer("@request.auth.id = @collection.permissions.user.id && id ?= @collection.permissions.delete.id")
|
||||
|
||||
// add
|
||||
new_created_by := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "naciykac",
|
||||
"name": "created_by",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "27do0wbcuyfmbmx",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": 1,
|
||||
"displayFields": [
|
||||
"username"
|
||||
]
|
||||
}
|
||||
}`), new_created_by)
|
||||
collection.Schema.AddField(new_created_by)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = nil
|
||||
|
||||
collection.ViewRule = nil
|
||||
|
||||
collection.CreateRule = nil
|
||||
|
||||
collection.UpdateRule = nil
|
||||
|
||||
collection.DeleteRule = nil
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("naciykac")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("djqp3uxrac2ores")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.CreateRule = types.Pointer("@request.auth.id = @collection.permissions.user.id && @collection.permissions.create = true")
|
||||
|
||||
collection.UpdateRule = types.Pointer("@request.auth.id = @collection.permissions.user.id && @collection.permissions.create = true")
|
||||
|
||||
collection.DeleteRule = types.Pointer("@request.auth.id = @collection.permissions.user.id && @collection.permissions.create = true")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("djqp3uxrac2ores")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.CreateRule = nil
|
||||
|
||||
collection.UpdateRule = nil
|
||||
|
||||
collection.DeleteRule = nil
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("qqvyfrex")
|
||||
|
||||
// add
|
||||
new_status := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "qmiatdwa",
|
||||
"name": "status",
|
||||
"type": "select",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSelect": 1,
|
||||
"values": [
|
||||
"pending",
|
||||
"online",
|
||||
"offline"
|
||||
]
|
||||
}
|
||||
}`), new_status)
|
||||
collection.Schema.AddField(new_status)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add
|
||||
del_status := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "qqvyfrex",
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}`), del_status)
|
||||
collection.Schema.AddField(del_status)
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("qmiatdwa")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = types.Pointer("@request.auth.id = id")
|
||||
|
||||
collection.ViewRule = types.Pointer("@request.auth.id = id")
|
||||
|
||||
collection.UpdateRule = types.Pointer("@request.auth.id = id")
|
||||
|
||||
collection.DeleteRule = types.Pointer("@request.auth.id = id")
|
||||
|
||||
// add
|
||||
new_avatar := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "i1qnezoa",
|
||||
"name": "avatar",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": 0,
|
||||
"max": 9
|
||||
}
|
||||
}`), new_avatar)
|
||||
collection.Schema.AddField(new_avatar)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = nil
|
||||
|
||||
collection.ViewRule = nil
|
||||
|
||||
collection.UpdateRule = nil
|
||||
|
||||
collection.DeleteRule = nil
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("i1qnezoa")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("nmj3ko20gzkg8n3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add
|
||||
new_lazy_ping := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "yjyq5pvg",
|
||||
"name": "lazy_ping",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}`), new_lazy_ping)
|
||||
collection.Schema.AddField(new_lazy_ping)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("nmj3ko20gzkg8n3")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("yjyq5pvg")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("djqp3uxrac2ores")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.CreateRule = types.Pointer("@request.auth.id ?= @collection.permissions.user.id && @collection.permissions.create = true")
|
||||
|
||||
collection.UpdateRule = types.Pointer("@request.auth.id ?= @collection.permissions.user.id && @collection.permissions.create = true")
|
||||
|
||||
collection.DeleteRule = types.Pointer("@request.auth.id ?= @collection.permissions.user.id && @collection.permissions.create = true")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("djqp3uxrac2ores")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.CreateRule = nil
|
||||
|
||||
collection.UpdateRule = nil
|
||||
|
||||
collection.DeleteRule = nil
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/tools/types"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = types.Pointer("@request.auth.id ?= @collection.permissions.user.id && id ?= @collection.permissions.read.id")
|
||||
|
||||
collection.ViewRule = types.Pointer("@request.auth.id ?= @collection.permissions.user.id && id ?= @collection.permissions.read.id")
|
||||
|
||||
collection.CreateRule = types.Pointer("@request.auth.id ?= @collection.permissions.user.id && @collection.permissions.create = true")
|
||||
|
||||
collection.UpdateRule = types.Pointer("@request.auth.id ?= @collection.permissions.user.id && id ?= @collection.permissions.update.id")
|
||||
|
||||
collection.DeleteRule = types.Pointer("@request.auth.id ?= @collection.permissions.user.id && id ?= @collection.permissions.delete.id")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.ListRule = nil
|
||||
|
||||
collection.ViewRule = nil
|
||||
|
||||
collection.CreateRule = nil
|
||||
|
||||
collection.UpdateRule = nil
|
||||
|
||||
collection.DeleteRule = nil
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add
|
||||
new_sol_enabled := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "ueieydw5",
|
||||
"name": "sol_enabled",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}`), new_sol_enabled)
|
||||
collection.Schema.AddField(new_sol_enabled)
|
||||
|
||||
// add
|
||||
new_sol_auth := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "yfszwhpw",
|
||||
"name": "sol_auth",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}`), new_sol_auth)
|
||||
collection.Schema.AddField(new_sol_auth)
|
||||
|
||||
// add
|
||||
new_sol_user := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "dbcmnrmp",
|
||||
"name": "sol_user",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}`), new_sol_user)
|
||||
collection.Schema.AddField(new_sol_user)
|
||||
|
||||
// add
|
||||
new_sol_password := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "hvz8stfy",
|
||||
"name": "sol_password",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}`), new_sol_password)
|
||||
collection.Schema.AddField(new_sol_password)
|
||||
|
||||
// add
|
||||
new_sol_port := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "6kfqheid",
|
||||
"name": "sol_port",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
}
|
||||
}`), new_sol_port)
|
||||
collection.Schema.AddField(new_sol_port)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("ueieydw5")
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("yfszwhpw")
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("dbcmnrmp")
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("hvz8stfy")
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("6kfqheid")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("cti4l8f4mz8df3r")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_number := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "8nwuncgg",
|
||||
"name": "number",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
}
|
||||
}`), edit_number)
|
||||
collection.Schema.AddField(edit_number)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("cti4l8f4mz8df3r")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_number := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "8nwuncgg",
|
||||
"name": "number",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": 65535
|
||||
}
|
||||
}`), edit_number)
|
||||
collection.Schema.AddField(edit_number)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_sol_port := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "6kfqheid",
|
||||
"name": "sol_port",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
}
|
||||
}`), edit_sol_port)
|
||||
collection.Schema.AddField(edit_sol_port)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update
|
||||
edit_sol_port := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "6kfqheid",
|
||||
"name": "sol_port",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
}
|
||||
}`), edit_sol_port)
|
||||
collection.Schema.AddField(edit_sol_port)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add
|
||||
new_wake_confirm := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "chtoblvl",
|
||||
"name": "wake_confirm",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}`), new_wake_confirm)
|
||||
collection.Schema.AddField(new_wake_confirm)
|
||||
|
||||
// add
|
||||
new_shutdown_confirm := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "muqy3axq",
|
||||
"name": "shutdown_confirm",
|
||||
"type": "bool",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {}
|
||||
}`), new_shutdown_confirm)
|
||||
collection.Schema.AddField(new_shutdown_confirm)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("chtoblvl")
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("muqy3axq")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add
|
||||
new_wake_cmd := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "murx1eum",
|
||||
"name": "wake_cmd",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}`), new_wake_cmd)
|
||||
collection.Schema.AddField(new_wake_cmd)
|
||||
|
||||
// add
|
||||
new_ping_cmd := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "kefxqjbj",
|
||||
"name": "ping_cmd",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}`), new_ping_cmd)
|
||||
collection.Schema.AddField(new_ping_cmd)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("z5lghx2r3tm45n1")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("murx1eum")
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("kefxqjbj")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/daos"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
"github.com/pocketbase/pocketbase/models/schema"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("cti4l8f4mz8df3r")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add
|
||||
new_link := &schema.SchemaField{}
|
||||
json.Unmarshal([]byte(`{
|
||||
"system": false,
|
||||
"id": "i3uvw7ij",
|
||||
"name": "link",
|
||||
"type": "url",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"exceptDomains": null,
|
||||
"onlyDomains": null
|
||||
}
|
||||
}`), new_link)
|
||||
collection.Schema.AddField(new_link)
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
}, func(db dbx.Builder) error {
|
||||
dao := daos.New(db);
|
||||
|
||||
collection, err := dao.FindCollectionByNameOrId("cti4l8f4mz8df3r")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove
|
||||
collection.Schema.RemoveField("i3uvw7ij")
|
||||
|
||||
return dao.SaveCollection(collection)
|
||||
})
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,43 @@
|
||||
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("pbc_3142635823")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// add field
|
||||
if err := collection.Fields.AddMarshaledJSONAt(6, []byte(`{
|
||||
"hidden": false,
|
||||
"id": "number376926767",
|
||||
"max": 9,
|
||||
"min": 0,
|
||||
"name": "avatar",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
}`)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
}, func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("pbc_3142635823")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove field
|
||||
collection.Fields.RemoveById("number376926767")
|
||||
|
||||
return app.Save(collection)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
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("pbc_3142635823")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update field
|
||||
if err := collection.Fields.AddMarshaledJSONAt(6, []byte(`{
|
||||
"hidden": false,
|
||||
"id": "number376926767",
|
||||
"max": 9,
|
||||
"min": 0,
|
||||
"name": "avatar",
|
||||
"onlyInt": true,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
}`)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
}, func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("pbc_3142635823")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update field
|
||||
if err := collection.Fields.AddMarshaledJSONAt(6, []byte(`{
|
||||
"hidden": false,
|
||||
"id": "number376926767",
|
||||
"max": 9,
|
||||
"min": 0,
|
||||
"name": "avatar",
|
||||
"onlyInt": false,
|
||||
"presentable": false,
|
||||
"required": false,
|
||||
"system": false,
|
||||
"type": "number"
|
||||
}`)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"createRule": ""
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
}, func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("27do0wbcuyfmbmx")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// update collection data
|
||||
if err := json.Unmarshal([]byte(`{
|
||||
"createRule": "@request.body.password:isset = false"
|
||||
}`), &collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return app.Save(collection)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
// Up migration: Change `url` field type from URL to string
|
||||
collectionName := "devices"
|
||||
|
||||
return app.RunInTransaction(func(txApp core.App) error {
|
||||
// Step 1: Fetch the collection
|
||||
collection, err := txApp.FindCollectionByNameOrId(collectionName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 2: Add a new text field
|
||||
newField := &core.TextField{
|
||||
Name: "new_field",
|
||||
Required: false,
|
||||
}
|
||||
collection.Fields.AddAt(6, newField)
|
||||
|
||||
if err := txApp.Save(collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 3: Migrate data from `url` to `new_field`
|
||||
records, err := txApp.FindAllRecords(collectionName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, record := range records {
|
||||
url := record.GetString("link")
|
||||
record.Set("new_field", url)
|
||||
if err := txApp.Save(record); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Step 4: Remove the old `url` field
|
||||
collection.Fields.RemoveByName("link")
|
||||
if err := txApp.Save(collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 5: Rename `new_field` to `url`
|
||||
renamedField := collection.Fields.GetByName("new_field")
|
||||
renamedField.SetName("link")
|
||||
|
||||
return txApp.Save(collection)
|
||||
})
|
||||
}, func(app core.App) error {
|
||||
// Down migration: Restore the `url` field
|
||||
collectionName := "devices"
|
||||
|
||||
return app.RunInTransaction(func(txApp core.App) error {
|
||||
// Step 1: Fetch the collection
|
||||
collection, err := txApp.FindCollectionByNameOrId(collectionName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 2: Add a new `url` field
|
||||
newField := &core.URLField{
|
||||
Name: "new_field",
|
||||
Required: false,
|
||||
}
|
||||
collection.Fields.AddAt(6, newField)
|
||||
|
||||
if err := txApp.Save(collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 3: Migrate data from `url` to `new_field`
|
||||
records, err := txApp.FindAllRecords(collectionName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, record := range records {
|
||||
text := record.GetString("link")
|
||||
record.Set("new_field", text)
|
||||
if err := txApp.Save(record); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Step 4: Remove the old `url` field
|
||||
collection.Fields.RemoveByName("link")
|
||||
if err := txApp.Save(collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 5: Rename `new_field` to `url`
|
||||
renamedField := collection.Fields.GetByName("new_field")
|
||||
renamedField.SetName("link")
|
||||
|
||||
return txApp.Save(collection)
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
// Up migration: Change `url` field type from URL to string
|
||||
collectionName := "ports"
|
||||
|
||||
return app.RunInTransaction(func(txApp core.App) error {
|
||||
// Step 1: Fetch the collection
|
||||
collection, err := txApp.FindCollectionByNameOrId(collectionName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 2: Add a new text field
|
||||
newField := &core.TextField{
|
||||
Name: "new_field",
|
||||
Required: false,
|
||||
}
|
||||
collection.Fields.AddAt(5, newField)
|
||||
|
||||
if err := txApp.Save(collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 3: Migrate data from `url` to `new_field`
|
||||
records, err := txApp.FindAllRecords(collectionName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, record := range records {
|
||||
url := record.GetString("link")
|
||||
record.Set("new_field", url)
|
||||
if err := txApp.Save(record); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Step 4: Remove the old `url` field
|
||||
collection.Fields.RemoveByName("link")
|
||||
if err := txApp.Save(collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 5: Rename `new_field` to `url`
|
||||
renamedField := collection.Fields.GetByName("new_field")
|
||||
renamedField.SetName("link")
|
||||
|
||||
return txApp.Save(collection)
|
||||
})
|
||||
}, func(app core.App) error {
|
||||
// Down migration: Restore the `url` field
|
||||
collectionName := "ports"
|
||||
|
||||
return app.RunInTransaction(func(txApp core.App) error {
|
||||
// Step 1: Fetch the collection
|
||||
collection, err := txApp.FindCollectionByNameOrId(collectionName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 2: Add a new `url` field
|
||||
newField := &core.URLField{
|
||||
Name: "new_field",
|
||||
Required: false,
|
||||
}
|
||||
collection.Fields.AddAt(5, newField)
|
||||
|
||||
if err := txApp.Save(collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 3: Migrate data from `url` to `new_field`
|
||||
records, err := txApp.FindAllRecords(collectionName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, record := range records {
|
||||
text := record.GetString("link")
|
||||
record.Set("new_field", text)
|
||||
if err := txApp.Save(record); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Step 4: Remove the old `url` field
|
||||
collection.Fields.RemoveByName("link")
|
||||
if err := txApp.Save(collection); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Step 5: Rename `new_field` to `url`
|
||||
renamedField := collection.Fields.GetByName("new_field")
|
||||
renamedField.SetName("link")
|
||||
|
||||
return txApp.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(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)
|
||||
})
|
||||
}
|
||||
@@ -6,10 +6,10 @@ import (
|
||||
"net"
|
||||
|
||||
"github.com/mdlayher/wol"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
func SendMagicPacket(device *models.Record) error {
|
||||
func SendMagicPacket(device *core.Record) error {
|
||||
ip := device.GetString("ip")
|
||||
mac := device.GetString("mac")
|
||||
netmask := device.GetString("netmask")
|
||||
@@ -32,23 +32,41 @@ func SendMagicPacket(device *models.Record) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
targetAddr := fmt.Sprintf("%s:%d", broadcastIp, 9)
|
||||
|
||||
// send wake via udp port 9
|
||||
if err := wakeUDP(targetAddr, parsedMac, bytePassword); err != nil {
|
||||
if err := wakeUDP(broadcastIp, parsedMac, bytePassword); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func wakeUDP(addr string, target net.HardwareAddr, password []byte) error {
|
||||
func wakeUDP(broadcastIp string, target net.HardwareAddr, password []byte) error {
|
||||
c, err := wol.NewClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer c.Close()
|
||||
return c.WakePassword(addr, target, password)
|
||||
|
||||
// send 4 magic packets to different addresses to enhance change of waking up
|
||||
destinations := []string{
|
||||
// default user-calculated broadcast to port 9
|
||||
fmt.Sprintf("%s:9", broadcastIp),
|
||||
// user-calculated broadcast to port alternative port 7
|
||||
fmt.Sprintf("%s:7", broadcastIp),
|
||||
// broadcast to port 9
|
||||
"255.255.255.255:9",
|
||||
// broadcast to alternative port 7
|
||||
"255.255.255.255:7",
|
||||
}
|
||||
|
||||
for _, dest := range destinations {
|
||||
if err := c.WakePassword(dest, target, password); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func getBroadcastIp(ipStr, maskStr string) (string, error) {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package networking
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
type Device struct {
|
||||
@@ -17,7 +16,7 @@ type Device struct {
|
||||
}
|
||||
|
||||
func TestSendMagicPacket(t *testing.T) {
|
||||
collection := &models.Collection{}
|
||||
collection := &core.Collection{}
|
||||
devices_success := []Device{
|
||||
{
|
||||
IP: "8.8.8.8",
|
||||
@@ -49,7 +48,7 @@ func TestSendMagicPacket(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, v := range devices_success {
|
||||
device := models.NewRecord(collection)
|
||||
device := core.NewRecord(collection)
|
||||
device.Set("ip", v.IP)
|
||||
device.Set("mac", v.MAC)
|
||||
device.Set("netmask", v.Netmask)
|
||||
@@ -60,7 +59,7 @@ func TestSendMagicPacket(t *testing.T) {
|
||||
}
|
||||
}
|
||||
for _, v := range devices_fail {
|
||||
device := models.NewRecord(collection)
|
||||
device := core.NewRecord(collection)
|
||||
device.Set("ip", v.IP)
|
||||
device.Set("mac", v.MAC)
|
||||
device.Set("netmask", v.Netmask)
|
||||
@@ -121,10 +120,9 @@ func TestWakeUDP(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
targetAddr := fmt.Sprintf("%s:%d", broadcastIp, 9)
|
||||
|
||||
if err := wakeUDP(targetAddr, parsedMac, bytePassword); err != nil {
|
||||
t.Fatalf(`%v (targetAddr "%v", parsedMac "%v", bytePassword "%v")`, err, targetAddr, parsedMac, bytePassword)
|
||||
if err := wakeUDP(broadcastIp, parsedMac, bytePassword); err != nil {
|
||||
t.Fatalf(`%v (broadcastIp "%v", parsedMac "%v", bytePassword "%v")`, err, broadcastIp, parsedMac, bytePassword)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
probing "github.com/prometheus-community/pro-bing"
|
||||
"github.com/seriousm4x/upsnap/logger"
|
||||
)
|
||||
|
||||
func PingDevice(device *models.Record) bool {
|
||||
func PingDevice(device *core.Record) bool {
|
||||
ping_cmd := device.GetString("ping_cmd")
|
||||
if ping_cmd == "" {
|
||||
pinger, err := probing.NewPinger(device.GetString("ip"))
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/seriousm4x/upsnap/logger"
|
||||
)
|
||||
|
||||
func ShutdownDevice(device *models.Record) error {
|
||||
func ShutdownDevice(device *core.Record) error {
|
||||
logger.Info.Println("Shutdown triggered for", device.GetString("name"))
|
||||
shutdown_cmd := device.GetString("shutdown_cmd")
|
||||
if shutdown_cmd == "" {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/seriousm4x/upsnap/logger"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ type SolResponse struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
func SleepDevice(device *models.Record) (SolResponse, error) {
|
||||
func SleepDevice(device *core.Record) (SolResponse, error) {
|
||||
logger.Info.Println("Sleep triggered for", device.GetString("name"))
|
||||
|
||||
var solResp SolResponse
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/seriousm4x/upsnap/logger"
|
||||
)
|
||||
|
||||
func WakeDevice(device *models.Record) error {
|
||||
func WakeDevice(device *core.Record) error {
|
||||
logger.Info.Println("Wake triggered for", device.GetString("name"))
|
||||
|
||||
wake_cmd := device.GetString("wake_cmd")
|
||||
|
||||
+68
-29
@@ -10,71 +10,70 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/pocketbase/apis"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/seriousm4x/upsnap/logger"
|
||||
"github.com/seriousm4x/upsnap/networking"
|
||||
)
|
||||
|
||||
func HandlerWake(c echo.Context) error {
|
||||
record, err := App.Dao().FindFirstRecordByData("devices", "id", c.PathParam("id"))
|
||||
func HandlerWake(e *core.RequestEvent) error {
|
||||
record, err := e.App.FindFirstRecordByData("devices", "id", e.Request.PathValue("id"))
|
||||
if err != nil {
|
||||
return apis.NewNotFoundError("The device does not exist.", err)
|
||||
}
|
||||
record.Set("status", "pending")
|
||||
if err := App.Dao().SaveRecord(record); err != nil {
|
||||
if err := e.App.Save(record); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
go func(r *models.Record) {
|
||||
go func(r *core.Record) {
|
||||
if err := networking.WakeDevice(r); err != nil {
|
||||
logger.Error.Println(err)
|
||||
r.Set("status", "offline")
|
||||
} else {
|
||||
r.Set("status", "online")
|
||||
}
|
||||
if err := App.Dao().SaveRecord(r); err != nil {
|
||||
if err := e.App.Save(r); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
}(record)
|
||||
return c.JSON(http.StatusOK, record)
|
||||
return e.JSON(http.StatusOK, record)
|
||||
}
|
||||
|
||||
func HandlerSleep(c echo.Context) error {
|
||||
record, err := App.Dao().FindFirstRecordByData("devices", "id", c.PathParam("id"))
|
||||
func HandlerSleep(e *core.RequestEvent) error {
|
||||
record, err := e.App.FindFirstRecordByData("devices", "id", e.Request.PathValue("id"))
|
||||
if err != nil {
|
||||
return apis.NewNotFoundError("The device does not exist.", err)
|
||||
}
|
||||
record.Set("status", "pending")
|
||||
if err := App.Dao().SaveRecord(record); err != nil {
|
||||
if err := e.App.Save(record); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
resp, err := networking.SleepDevice(record)
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
record.Set("status", "online")
|
||||
if err := App.Dao().SaveRecord(record); err != nil {
|
||||
if err := e.App.Save(record); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
return apis.NewBadRequestError(resp.Message, nil)
|
||||
}
|
||||
record.Set("status", "offline")
|
||||
if err := App.Dao().SaveRecord(record); err != nil {
|
||||
if err := e.App.Save(record); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
return c.JSON(http.StatusOK, nil)
|
||||
return e.JSON(http.StatusOK, nil)
|
||||
}
|
||||
|
||||
func HandlerReboot(c echo.Context) error {
|
||||
record, err := App.Dao().FindFirstRecordByData("devices", "id", c.PathParam("id"))
|
||||
func HandlerReboot(e *core.RequestEvent) error {
|
||||
record, err := e.App.FindFirstRecordByData("devices", "id", e.Request.PathValue("id"))
|
||||
if err != nil {
|
||||
return apis.NewNotFoundError("The device does not exist.", err)
|
||||
}
|
||||
record.Set("status", "pending")
|
||||
if err := App.Dao().SaveRecord(record); err != nil {
|
||||
if err := e.App.Save(record); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
go func(r *models.Record) {
|
||||
go func(r *core.Record) {
|
||||
if err := networking.ShutdownDevice(r); err != nil {
|
||||
logger.Error.Println(err)
|
||||
r.Set("status", "online")
|
||||
@@ -87,34 +86,34 @@ func HandlerReboot(c echo.Context) error {
|
||||
r.Set("status", "online")
|
||||
}
|
||||
}
|
||||
if err := App.Dao().SaveRecord(r); err != nil {
|
||||
if err := e.App.Save(r); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
}(record)
|
||||
return c.JSON(http.StatusOK, record)
|
||||
return e.JSON(http.StatusOK, record)
|
||||
}
|
||||
|
||||
func HandlerShutdown(c echo.Context) error {
|
||||
record, err := App.Dao().FindFirstRecordByData("devices", "id", c.PathParam("id"))
|
||||
func HandlerShutdown(e *core.RequestEvent) error {
|
||||
record, err := e.App.FindFirstRecordByData("devices", "id", e.Request.PathValue("id"))
|
||||
if err != nil {
|
||||
return apis.NewNotFoundError("The device does not exist.", err)
|
||||
}
|
||||
record.Set("status", "pending")
|
||||
if err := App.Dao().SaveRecord(record); err != nil {
|
||||
if err := e.App.Save(record); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
go func(r *models.Record) {
|
||||
go func(r *core.Record) {
|
||||
if err := networking.ShutdownDevice(r); err != nil {
|
||||
logger.Error.Println(err)
|
||||
r.Set("status", "online")
|
||||
} else {
|
||||
r.Set("status", "offline")
|
||||
}
|
||||
if err := App.Dao().SaveRecord(r); err != nil {
|
||||
if err := e.App.Save(r); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
}(record)
|
||||
return c.JSON(http.StatusOK, record)
|
||||
return e.JSON(http.StatusOK, record)
|
||||
}
|
||||
|
||||
type Nmaprun struct {
|
||||
@@ -127,7 +126,7 @@ type Nmaprun struct {
|
||||
} `xml:"host"`
|
||||
}
|
||||
|
||||
func HandlerScan(c echo.Context) error {
|
||||
func HandlerScan(e *core.RequestEvent) error {
|
||||
// check if nmap installed
|
||||
nmap, err := exec.LookPath("nmap")
|
||||
if err != nil {
|
||||
@@ -135,7 +134,7 @@ func HandlerScan(c echo.Context) error {
|
||||
}
|
||||
|
||||
// check if scan range is valid
|
||||
allPrivateSettings, err := App.Dao().FindRecordsByExpr("settings_private")
|
||||
allPrivateSettings, err := e.App.FindAllRecords("settings_private")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -215,5 +214,45 @@ func HandlerScan(c echo.Context) error {
|
||||
res.Devices = append(res.Devices, dev)
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, res)
|
||||
return e.JSON(http.StatusOK, res)
|
||||
}
|
||||
|
||||
func HandlerInitSuperuser(e *core.RequestEvent) error {
|
||||
superusersCollection, err := e.App.FindCollectionByNameOrId(core.CollectionNameSuperusers)
|
||||
if err != nil {
|
||||
return e.NotFoundError("Failed to retrieve superusers collection", err)
|
||||
}
|
||||
|
||||
totalSuperusers, err := e.App.CountRecords(superusersCollection)
|
||||
if err != nil {
|
||||
return e.InternalServerError("Failed to retrieve superusers count", err)
|
||||
}
|
||||
|
||||
if totalSuperusers > 0 {
|
||||
return e.BadRequestError("An initial superuser already exists", nil)
|
||||
}
|
||||
|
||||
data := struct {
|
||||
Email string `json:"email" form:"email"`
|
||||
Password string `json:"password" form:"password"`
|
||||
PasswordConfirm string `json:"password_confirm" form:"password-confirm"`
|
||||
}{}
|
||||
err = e.BindBody(&data)
|
||||
if err != nil {
|
||||
return e.BadRequestError("Failed to read request data", err)
|
||||
}
|
||||
|
||||
if data.Password != data.PasswordConfirm {
|
||||
return e.BadRequestError("Password don't match", err)
|
||||
}
|
||||
|
||||
record := core.NewRecord(superusersCollection)
|
||||
record.SetEmail(data.Email)
|
||||
record.SetPassword(data.Password)
|
||||
err = e.App.Save(record)
|
||||
if err != nil {
|
||||
return e.BadRequestError("Failed to create initial superuser", err)
|
||||
}
|
||||
|
||||
return apis.RecordAuthResponse(e, record, "", nil)
|
||||
}
|
||||
|
||||
+17
-16
@@ -1,36 +1,37 @@
|
||||
package pb
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/apis"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/tools/hook"
|
||||
)
|
||||
|
||||
func RequireUpSnapPermission() echo.MiddlewareFunc {
|
||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
admin, _ := c.Get(apis.ContextAdminKey).(*models.Admin)
|
||||
if admin != nil {
|
||||
return next(c)
|
||||
func RequireUpSnapPermission() *hook.Handler[*core.RequestEvent] {
|
||||
return &hook.Handler[*core.RequestEvent]{
|
||||
Func: func(e *core.RequestEvent) error {
|
||||
admin := e.HasSuperuserAuth()
|
||||
if admin {
|
||||
return e.Next()
|
||||
}
|
||||
|
||||
user, _ := c.Get(apis.ContextAuthRecordKey).(*models.Record)
|
||||
user := e.Auth
|
||||
if user == nil {
|
||||
return apis.NewUnauthorizedError("The request requires admin or record authorization token to be set.", nil)
|
||||
}
|
||||
|
||||
deviceId := c.PathParam("id")
|
||||
deviceId := e.Request.PathValue("id")
|
||||
|
||||
// find record where user has device with power permission
|
||||
res, err := App.Dao().FindFirstRecordByFilter("permissions",
|
||||
fmt.Sprintf("user.id = '%s' && power.id ?= '%s'", user.Id, deviceId))
|
||||
res, err := e.App.FindFirstRecordByFilter("permissions", "user.id = {:userId} && power.id ?= {:deviceId}", dbx.Params{
|
||||
"userId": user.Id,
|
||||
"deviceId": deviceId,
|
||||
})
|
||||
if res == nil || err != nil {
|
||||
return apis.NewForbiddenError("You are not allowed to perform this request.", nil)
|
||||
}
|
||||
|
||||
return next(c)
|
||||
}
|
||||
return e.Next()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
+67
-104
@@ -1,24 +1,21 @@
|
||||
package pb
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/pocketbase/pocketbase"
|
||||
"github.com/pocketbase/pocketbase/apis"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/plugins/migratecmd"
|
||||
"github.com/seriousm4x/upsnap/cronjobs"
|
||||
"github.com/seriousm4x/upsnap/logger"
|
||||
_ "github.com/seriousm4x/upsnap/migrations"
|
||||
)
|
||||
|
||||
var App *pocketbase.PocketBase
|
||||
var Version = "(untracked)"
|
||||
|
||||
func StartPocketBase(distDirFS fs.FS) {
|
||||
@@ -49,95 +46,52 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
}
|
||||
|
||||
// create app
|
||||
App = pocketbase.NewWithConfig(pocketbase.Config{
|
||||
app := pocketbase.NewWithConfig(pocketbase.Config{
|
||||
DefaultDataDir: dataDir,
|
||||
})
|
||||
App.RootCmd.Short = "UpSnap CLI"
|
||||
App.RootCmd.Version = Version
|
||||
app.RootCmd.Short = "UpSnap CLI"
|
||||
app.RootCmd.Version = Version
|
||||
|
||||
// auto migrate db
|
||||
migratecmd.MustRegister(App, App.RootCmd, migratecmd.Config{
|
||||
migratecmd.MustRegister(app, app.RootCmd, migratecmd.Config{
|
||||
Automigrate: true,
|
||||
})
|
||||
|
||||
// event hooks
|
||||
App.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
||||
e.Router.GET("/*", apis.StaticDirectoryHandler(distDirFS, true))
|
||||
app.OnServe().BindFunc(func(se *core.ServeEvent) error {
|
||||
se.Router.GET("/{path...}", apis.Static(distDirFS, true))
|
||||
|
||||
e.Router.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/upsnap/wake/:id",
|
||||
Handler: HandlerWake,
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.ActivityLogger(App),
|
||||
RequireUpSnapPermission(),
|
||||
},
|
||||
})
|
||||
se.Router.GET("/api/upsnap/wake/{id}", HandlerWake).Bind(RequireUpSnapPermission())
|
||||
se.Router.GET("/api/upsnap/sleep/{id}", HandlerSleep).Bind(RequireUpSnapPermission())
|
||||
se.Router.GET("/api/upsnap/reboot/{id}", HandlerReboot).Bind(RequireUpSnapPermission())
|
||||
se.Router.GET("/api/upsnap/shutdown/{id}", HandlerShutdown).Bind(RequireUpSnapPermission())
|
||||
se.Router.GET("/api/upsnap/scan", HandlerScan).Bind(apis.RequireSuperuserAuth())
|
||||
se.Router.POST("/api/upsnap/init-superuser", HandlerInitSuperuser) // https://github.com/pocketbase/pocketbase/discussions/6198
|
||||
|
||||
e.Router.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/upsnap/sleep/:id",
|
||||
Handler: HandlerSleep,
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.ActivityLogger(App),
|
||||
RequireUpSnapPermission(),
|
||||
},
|
||||
})
|
||||
|
||||
e.Router.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/upsnap/reboot/:id",
|
||||
Handler: HandlerReboot,
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.ActivityLogger(App),
|
||||
RequireUpSnapPermission(),
|
||||
},
|
||||
})
|
||||
|
||||
e.Router.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/upsnap/shutdown/:id",
|
||||
Handler: HandlerShutdown,
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.ActivityLogger(App),
|
||||
RequireUpSnapPermission(),
|
||||
},
|
||||
})
|
||||
|
||||
e.Router.AddRoute(echo.Route{
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/upsnap/scan",
|
||||
Handler: HandlerScan,
|
||||
Middlewares: []echo.MiddlewareFunc{
|
||||
apis.ActivityLogger(App),
|
||||
apis.RequireAdminAuth(),
|
||||
},
|
||||
})
|
||||
|
||||
if err := importSettings(); err != nil {
|
||||
if err := importSettings(app); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := resetDeviceStates(); err != nil {
|
||||
if err := resetDeviceStates(app); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cronjobs.SetPingJobs(App)
|
||||
cronjobs.SetPingJobs(app)
|
||||
cronjobs.StartPing()
|
||||
cronjobs.SetWakeShutdownJobs(App)
|
||||
cronjobs.SetWakeShutdownJobs(app)
|
||||
cronjobs.StartWakeShutdown()
|
||||
|
||||
// restart ping cronjobs or wake/shutdown cronjobs on model update
|
||||
// add event hook before starting server.
|
||||
// using this outside App.OnBeforeServe() would not work
|
||||
App.OnModelAfterUpdate("settings_private", "devices").Add(func(e *core.ModelEvent) error {
|
||||
app.OnModelAfterUpdateSuccess("settings_private", "devices").BindFunc(func(e *core.ModelEvent) error {
|
||||
if e.Model.TableName() == "settings_private" {
|
||||
cronjobs.SetPingJobs(App)
|
||||
cronjobs.SetPingJobs(app)
|
||||
} else if e.Model.TableName() == "devices" {
|
||||
// only restart wake/shutdown cronjobs if new model's cron changed
|
||||
record := e.Model.(*models.Record)
|
||||
newRecord := record.CleanCopy()
|
||||
oldRecord := record.OriginalCopy()
|
||||
record := e.Model.(*core.Record)
|
||||
newRecord := record.Fresh()
|
||||
oldRecord := record.Original()
|
||||
|
||||
newWakeCron := newRecord.GetString("wake_cron")
|
||||
newWakeCmd := newRecord.GetString("wake_cmd")
|
||||
@@ -159,28 +113,28 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
newShutdownCron != oldShutdownCron ||
|
||||
newShutdownCronEnabled != oldShutdownCronEnabled ||
|
||||
newShutdownCmd != oldShutdownCmd {
|
||||
cronjobs.SetWakeShutdownJobs(App)
|
||||
cronjobs.SetWakeShutdownJobs(app)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
return e.Next()
|
||||
})
|
||||
return nil
|
||||
return se.Next()
|
||||
})
|
||||
|
||||
App.OnModelAfterCreate().Add(func(e *core.ModelEvent) error {
|
||||
if e.Model.TableName() == "_admins" {
|
||||
if err := setSetupCompleted(); err != nil {
|
||||
app.OnModelAfterCreateSuccess().BindFunc(func(e *core.ModelEvent) error {
|
||||
if e.Model.TableName() == "_superusers" {
|
||||
if err := setSetupCompleted(e.App); err != nil {
|
||||
logger.Error.Println(err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return e.Next()
|
||||
} else if e.Model.TableName() == "devices" {
|
||||
// when a device is created, give the user all rights to the device he just created
|
||||
deviceRec := e.Model.(*models.Record)
|
||||
deviceRec := e.Model.(*core.Record)
|
||||
userId := deviceRec.GetString("created_by")
|
||||
|
||||
var permissionRec *models.Record
|
||||
permissionRec, err := App.Dao().FindFirstRecordByFilter("permissions",
|
||||
var permissionRec *core.Record
|
||||
permissionRec, err := app.FindFirstRecordByFilter("permissions",
|
||||
fmt.Sprintf("user.id = '%s'", userId))
|
||||
if err != nil && err.Error() != "sql: no rows in result set" {
|
||||
logger.Error.Println(err)
|
||||
@@ -190,57 +144,66 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
permissionRec.Set("update", append(permissionRec.GetStringSlice("update"), deviceRec.Id))
|
||||
permissionRec.Set("delete", append(permissionRec.GetStringSlice("delete"), deviceRec.Id))
|
||||
permissionRec.Set("power", append(permissionRec.GetStringSlice("power"), deviceRec.Id))
|
||||
if err := App.Dao().SaveRecord(permissionRec); err != nil {
|
||||
if err := app.Save(permissionRec); err != nil {
|
||||
logger.Error.Println(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
return e.Next()
|
||||
})
|
||||
App.OnModelAfterDelete().Add(func(e *core.ModelEvent) error {
|
||||
if e.Model.TableName() == "_admins" {
|
||||
if err := setSetupCompleted(); err != nil {
|
||||
|
||||
app.OnModelAfterDeleteSuccess().BindFunc(func(e *core.ModelEvent) error {
|
||||
if e.Model.TableName() == "_superusers" {
|
||||
if err := setSetupCompleted(e.App); err != nil {
|
||||
logger.Error.Println(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
return e.Next()
|
||||
})
|
||||
|
||||
App.OnTerminate().Add(func(e *core.TerminateEvent) error {
|
||||
// prevent new superuser bahavior introduced in pocketbase 0.23
|
||||
app.OnRecordCreate(core.CollectionNameSuperusers).BindFunc(func(e *core.RecordEvent) error {
|
||||
if e.Record.Email() == core.DefaultInstallerEmail {
|
||||
return errors.New("skip default PocketBase installer")
|
||||
}
|
||||
return e.Next()
|
||||
})
|
||||
|
||||
app.OnTerminate().BindFunc(func(e *core.TerminateEvent) error {
|
||||
cronjobs.StopAll()
|
||||
return nil
|
||||
return e.Next()
|
||||
})
|
||||
|
||||
if err := App.Start(); err != nil {
|
||||
if err := app.Start(); err != nil {
|
||||
logger.Error.Fatalln(err)
|
||||
}
|
||||
}
|
||||
|
||||
func importSettings() error {
|
||||
settingsPrivateRecords, err := App.Dao().FindRecordsByExpr("settings_private")
|
||||
func importSettings(app *pocketbase.PocketBase) error {
|
||||
settingsPrivateRecords, err := app.FindAllRecords("settings_private")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
settingsPrivateCollection, err := App.Dao().FindCollectionByNameOrId("settings_private")
|
||||
settingsPrivateCollection, err := app.FindCollectionByNameOrId("settings_private")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
settingsPrivate := models.NewRecord(settingsPrivateCollection)
|
||||
settingsPrivate := core.NewRecord(settingsPrivateCollection)
|
||||
if len(settingsPrivateRecords) > 0 {
|
||||
settingsPrivate = settingsPrivateRecords[0]
|
||||
}
|
||||
|
||||
settingsPublicRecords, err := App.Dao().FindRecordsByExpr("settings_public")
|
||||
settingsPublicRecords, err := app.FindAllRecords("settings_public")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
settingsPublicCollection, err := App.Dao().FindCollectionByNameOrId("settings_public")
|
||||
settingsPublicCollection, err := app.FindCollectionByNameOrId("settings_public")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
settingsPublic := models.NewRecord(settingsPublicCollection)
|
||||
settingsPublic := core.NewRecord(settingsPublicCollection)
|
||||
if len(settingsPublicRecords) > 0 {
|
||||
settingsPublic = settingsPublicRecords[0]
|
||||
}
|
||||
@@ -266,13 +229,13 @@ func importSettings() error {
|
||||
settingsPublic.Set("website_title", websiteTitle)
|
||||
}
|
||||
|
||||
if err := App.Dao().SaveRecord(settingsPrivate); err != nil {
|
||||
if err := app.Save(settingsPrivate); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := App.Dao().SaveRecord(settingsPublic); err != nil {
|
||||
if err := app.Save(settingsPublic); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := setSetupCompleted(); err != nil {
|
||||
if err := setSetupCompleted(app); err != nil {
|
||||
logger.Error.Println(err)
|
||||
return err
|
||||
}
|
||||
@@ -281,26 +244,26 @@ func importSettings() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func resetDeviceStates() error {
|
||||
devices, err := App.Dao().FindRecordsByExpr("devices")
|
||||
func resetDeviceStates(app *pocketbase.PocketBase) error {
|
||||
devices, err := app.FindAllRecords("devices")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, device := range devices {
|
||||
device.Set("status", "offline")
|
||||
if err := App.Dao().SaveRecord(device); err != nil {
|
||||
if err := app.Save(device); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func setSetupCompleted() error {
|
||||
totalAdmins, err := App.Dao().TotalAdmins()
|
||||
func setSetupCompleted(app core.App) error {
|
||||
totalAdmins, err := app.CountRecords(core.CollectionNameSuperusers)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
settingsPublicRecords, err := App.Dao().FindRecordsByExpr("settings_public")
|
||||
settingsPublicRecords, err := app.FindAllRecords("settings_public")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -309,7 +272,7 @@ func setSetupCompleted() error {
|
||||
} else {
|
||||
settingsPublicRecords[0].Set("setup_completed", false)
|
||||
}
|
||||
if err := App.Dao().SaveRecord(settingsPublicRecords[0]); err != nil {
|
||||
if err := app.Save(settingsPublicRecords[0]); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Ignore files for PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
@@ -1,30 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:svelte/recommended',
|
||||
'prettier'
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint'],
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 2020,
|
||||
extraFileExtensions: ['.svelte']
|
||||
},
|
||||
env: {
|
||||
browser: true,
|
||||
es2017: true,
|
||||
node: true
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.svelte'],
|
||||
parser: 'svelte-eslint-parser',
|
||||
parserOptions: {
|
||||
parser: '@typescript-eslint/parser'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
import js from '@eslint/js';
|
||||
import ts from 'typescript-eslint';
|
||||
import svelte from 'eslint-plugin-svelte';
|
||||
import prettier from 'eslint-config-prettier';
|
||||
import globals from 'globals';
|
||||
import { includeIgnoreFile } from '@eslint/compat';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const gitignorePath = path.resolve(__dirname, '.gitignore');
|
||||
|
||||
/** @type {import('eslint').Linter.Config[]} */
|
||||
export default [
|
||||
includeIgnoreFile(gitignorePath),
|
||||
js.configs.recommended,
|
||||
...ts.configs.recommended,
|
||||
...svelte.configs['flat/recommended'],
|
||||
prettier,
|
||||
...svelte.configs['flat/prettier'],
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.svelte'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
parser: ts.parser
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
ignores: ['build/', '.svelte-kit/', 'dist/']
|
||||
}
|
||||
];
|
||||
+25
-25
@@ -9,48 +9,48 @@
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||
"lint": "eslint --fix --cache --ignore-path ../.gitignore .",
|
||||
"lint": "eslint --fix --cache .",
|
||||
"format": "prettier --write --cache --cache-strategy content --ignore-path ../.gitignore .",
|
||||
"prepare": "cd .. && husky frontend/.husky",
|
||||
"typesafe-i18n": "typesafe-i18n"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.10.0",
|
||||
"@sveltejs/adapter-static": "^3.0.4",
|
||||
"@sveltejs/kit": "^2.5.27",
|
||||
"@eslint/compat": "^1.2.5",
|
||||
"@eslint/js": "^9.19.0",
|
||||
"@sveltejs/adapter-static": "^3.0.8",
|
||||
"@sveltejs/kit": "^2.16.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"daisyui": "^4.12.10",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-svelte": "^2.44.0",
|
||||
"husky": "^9.1.6",
|
||||
"postcss": "^8.4.47",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier-plugin-svelte": "^3.2.6",
|
||||
"prettier-plugin-tailwindcss": "^0.6.6",
|
||||
"daisyui": "^4.12.23",
|
||||
"eslint": "^9.19.0",
|
||||
"eslint-config-prettier": "^10.0.1",
|
||||
"eslint-plugin-svelte": "^2.46.1",
|
||||
"globals": "^15.14.0",
|
||||
"husky": "^9.1.7",
|
||||
"postcss": "^8.5.1",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-svelte": "^3.3.3",
|
||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
||||
"svelte": "^4.2.19",
|
||||
"svelte-check": "^4.0.2",
|
||||
"tailwindcss": "^3.4.11",
|
||||
"tslib": "^2.7.0",
|
||||
"typescript": "^5.6.2",
|
||||
"typescript-eslint": "^8.6.0",
|
||||
"vite": "^5.4.6"
|
||||
"svelte-check": "^4.1.4",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.7.3",
|
||||
"typescript-eslint": "^8.22.0",
|
||||
"vite": "^5.4.14"
|
||||
},
|
||||
"type": "module",
|
||||
"lint-staged": {
|
||||
"*.{js,svelte}": "eslint --fix --cache --ignore-path ../.gitignore .",
|
||||
"*.{js,svelte}": "eslint --fix --cache .",
|
||||
"*.{js,css,md,svelte,scss}": "prettier --write --cache --cache-strategy content --ignore-path ../.gitignore ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/free-solid-svg-icons": "^6.6.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
||||
"cron-parser": "^4.9.0",
|
||||
"date-fns": "^4.1.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"pocketbase": "^0.21.5",
|
||||
"svelte-fa": "^4.0.2",
|
||||
"pocketbase": "^0.25.1",
|
||||
"svelte-fa": "^4.0.3",
|
||||
"svelte-french-toast": "^1.2.0",
|
||||
"theme-change": "^2.5.0",
|
||||
"typesafe-i18n": "^5.26.2"
|
||||
|
||||
Generated
+1219
-1167
File diff suppressed because it is too large
Load Diff
@@ -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,
|
||||
@@ -19,6 +20,8 @@
|
||||
import { es } from 'date-fns/locale/es';
|
||||
import { fr } from 'date-fns/locale/fr';
|
||||
import { it } from 'date-fns/locale/it';
|
||||
import { ja } from 'date-fns/locale/ja';
|
||||
import { nl } from 'date-fns/locale/nl';
|
||||
import { pt } from 'date-fns/locale/pt';
|
||||
import { zhCN } from 'date-fns/locale/zh-CN';
|
||||
import { zhTW } from 'date-fns/locale/zh-TW';
|
||||
@@ -29,19 +32,19 @@
|
||||
|
||||
export let device: Device;
|
||||
|
||||
let moreButtons = [
|
||||
$: moreButtons = [
|
||||
{
|
||||
text: $LL.device.card_btn_more_edit(),
|
||||
icon: faPen,
|
||||
onClick: () => goto(`/device/${device.id}`),
|
||||
requires: $pocketbase.authStore.isAdmin || $permission.update?.includes(device.id)
|
||||
requires: $pocketbase.authStore.isSuperuser || $permission.update?.includes(device.id)
|
||||
},
|
||||
{
|
||||
text: $LL.device.card_btn_more_sleep(),
|
||||
icon: faBed,
|
||||
onClick: () => sleep(),
|
||||
requires:
|
||||
($pocketbase.authStore.isAdmin || $permission.power?.includes(device.id)) &&
|
||||
($pocketbase.authStore.isSuperuser || $permission.power?.includes(device.id)) &&
|
||||
device.status === 'online' &&
|
||||
device.sol_enabled
|
||||
},
|
||||
@@ -50,7 +53,7 @@
|
||||
icon: faRotateLeft,
|
||||
onClick: () => reboot(),
|
||||
requires:
|
||||
($pocketbase.authStore.isAdmin || $permission.power?.includes(device.id)) &&
|
||||
($pocketbase.authStore.isSuperuser || $permission.power?.includes(device.id)) &&
|
||||
device.status === 'online' &&
|
||||
device.shutdown_cmd !== ''
|
||||
}
|
||||
@@ -88,10 +91,18 @@
|
||||
case 'it-IT':
|
||||
dateFnsLocale = it;
|
||||
break;
|
||||
case 'ja':
|
||||
case 'ja-JP':
|
||||
dateFnsLocale = ja;
|
||||
break;
|
||||
case 'es':
|
||||
case 'es-ES':
|
||||
dateFnsLocale = es;
|
||||
break;
|
||||
case 'nl':
|
||||
case 'nl-NL':
|
||||
dateFnsLocale = nl;
|
||||
break;
|
||||
case 'pt':
|
||||
case 'pt-PT':
|
||||
dateFnsLocale = pt;
|
||||
@@ -131,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>
|
||||
|
||||
@@ -147,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}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
if (device.shutdown_cmd === '') {
|
||||
disabled = true;
|
||||
hoverText = $LL.device.card_nic_tooltip_shutdown_no_cmd();
|
||||
} else if (!$pocketbase.authStore.isAdmin && !$permission.power?.includes(device.id)) {
|
||||
} else if (!$pocketbase.authStore.isSuperuser && !$permission.power?.includes(device.id)) {
|
||||
disabled = true;
|
||||
hoverText = $LL.device.card_nic_tooltip_shutdown_no_permission();
|
||||
} else {
|
||||
@@ -35,7 +35,7 @@
|
||||
hoverText = $LL.device.card_nic_tooltip_shutdown();
|
||||
}
|
||||
} else if (device.status === 'offline') {
|
||||
if (!$pocketbase.authStore.isAdmin && !$permission.power?.includes(device.id)) {
|
||||
if (!$pocketbase.authStore.isSuperuser && !$permission.power?.includes(device.id)) {
|
||||
disabled = true;
|
||||
hoverText = $LL.device.card_nic_tooltip_power_no_permission();
|
||||
} else {
|
||||
@@ -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,22 +85,44 @@
|
||||
}
|
||||
|
||||
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() {
|
||||
if (device.status === 'offline') {
|
||||
device.wake_confirm ? askConfirmation('wake') : wake();
|
||||
if (device.wake_confirm) {
|
||||
askConfirmation('wake');
|
||||
} else {
|
||||
wake();
|
||||
}
|
||||
} else if (device.status === 'online') {
|
||||
device.shutdown_confirm ? askConfirmation('shutdown') : shutdown();
|
||||
if (device.shutdown_confirm) {
|
||||
askConfirmation('shutdown');
|
||||
} else {
|
||||
shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
@@ -39,7 +40,11 @@
|
||||
device.mac = device.mac.replaceAll(' ', '');
|
||||
device.netmask = device.netmask.replaceAll(' ', '');
|
||||
device.ports = portIds;
|
||||
device.id ? updateDevice(device) : createDevice(device);
|
||||
if (device.id) {
|
||||
updateDevice(device);
|
||||
} else {
|
||||
createDevice(device);
|
||||
}
|
||||
}
|
||||
|
||||
async function updateDevice(device: Device) {
|
||||
@@ -56,9 +61,9 @@
|
||||
}
|
||||
|
||||
async function createDevice(device: Device) {
|
||||
device.created_by = $pocketbase.authStore.isAdmin
|
||||
device.created_by = $pocketbase.authStore.isSuperuser
|
||||
? ''
|
||||
: ($pocketbase.authStore.model?.id ?? '');
|
||||
: ($pocketbase.authStore.record?.id ?? '');
|
||||
$pocketbase
|
||||
.collection('devices')
|
||||
.create(device)
|
||||
@@ -242,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>
|
||||
@@ -271,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>
|
||||
@@ -353,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">
|
||||
@@ -545,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">
|
||||
@@ -624,7 +666,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-actions mt-6 justify-end gap-4">
|
||||
{#if $pocketbase.authStore.isAdmin || $permission.delete?.includes(device.id)}
|
||||
{#if $pocketbase.authStore.isSuperuser || $permission.delete?.includes(device.id)}
|
||||
<button class="btn btn-error" type="button" on:click={() => deleteModal.showModal()}
|
||||
><Fa icon={faTrash} />{$LL.buttons.delete()}</button
|
||||
>
|
||||
|
||||
@@ -55,14 +55,14 @@
|
||||
'colorful'
|
||||
];
|
||||
let activeTheme: string | null = '';
|
||||
let avatar = $pocketbase.authStore.model?.avatar;
|
||||
$: avatar = $pocketbase.authStore.record?.avatar;
|
||||
|
||||
onMount(() => {
|
||||
themeChange(false);
|
||||
activeTheme = document.documentElement.getAttribute('data-theme');
|
||||
|
||||
$pocketbase.authStore.onChange(() => {
|
||||
avatar = $pocketbase.authStore.model?.avatar;
|
||||
avatar = $pocketbase.authStore.record?.avatar;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
><Fa icon={faHome} />{$LL.home.page_title()}</a
|
||||
>
|
||||
</li>
|
||||
{#if $pocketbase.authStore.isAdmin}
|
||||
{#if $pocketbase.authStore.isSuperuser}
|
||||
<li>
|
||||
<a
|
||||
href="/users"
|
||||
@@ -198,7 +198,7 @@
|
||||
><Fa icon={faHome} />{$LL.home.page_title()}</a
|
||||
>
|
||||
</li>
|
||||
{#if $pocketbase.authStore.isAdmin}
|
||||
{#if $pocketbase.authStore.isSuperuser}
|
||||
<li>
|
||||
<a href="/users" class="p-2" class:active={$page.url.pathname.startsWith('/users')}
|
||||
><Fa icon={faUsersGear} />{$LL.users.page_title()}</a
|
||||
@@ -252,8 +252,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="ms-auto justify-end">
|
||||
{#if $pocketbase.authStore?.model !== null}
|
||||
{#if $pocketbase.authStore.isAdmin || $permission.create}
|
||||
{#if $pocketbase.authStore?.record !== null}
|
||||
{#if $pocketbase.authStore.isSuperuser || $permission.create}
|
||||
<a class="btn btn-success me-4" href="/device/new">
|
||||
<Fa icon={faPlus} />
|
||||
{$LL.navbar.new()}
|
||||
@@ -262,7 +262,7 @@
|
||||
<div class="dropdown dropdown-end">
|
||||
<label tabindex="-1" class="avatar btn btn-circle btn-ghost" for="avatar">
|
||||
<div class="w-10 rounded-full" id="avatar">
|
||||
<img src="{backendUrl}_/images/avatars/avatar{avatar}.svg" alt="Avatar {avatar}" />
|
||||
<img src="/avatars/avatar{avatar}.svg" alt="Avatar {avatar}" />
|
||||
</div>
|
||||
</label>
|
||||
<ul
|
||||
@@ -270,9 +270,9 @@
|
||||
class="menu dropdown-content z-[1] mt-3 rounded-box bg-base-300 p-2 shadow"
|
||||
>
|
||||
<li class="menu-title">
|
||||
{$pocketbase.authStore.isAdmin
|
||||
? $pocketbase.authStore.model.email
|
||||
: $pocketbase.authStore.model.username}
|
||||
{$pocketbase.authStore.isSuperuser
|
||||
? $pocketbase.authStore.record?.email
|
||||
: $pocketbase.authStore.record?.username}
|
||||
</li>
|
||||
<li>
|
||||
<a href="/account"><Fa icon={faUserGear} />{$LL.navbar.edit_account()}</a>
|
||||
|
||||
@@ -28,8 +28,9 @@
|
||||
.collection('settings_private')
|
||||
.getFirstListItem('')
|
||||
.then((res) => {
|
||||
settingsPriv.set(res as SettingsPrivate);
|
||||
scanRange = $settingsPriv.scan_range;
|
||||
const settings = res as SettingsPrivate;
|
||||
settingsPriv.set(settings);
|
||||
scanRange = settings.scan_range;
|
||||
})
|
||||
.catch((err) => {
|
||||
toast.error(err.message);
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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:',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
|
||||
/* eslint-disable */
|
||||
|
||||
import { initI18nSvelte } from 'typesafe-i18n/svelte';
|
||||
import type { Formatters, Locales, TranslationFunctions, Translations } from './i18n-types';
|
||||
|
||||
@@ -20,6 +20,10 @@ export type Locales =
|
||||
| 'fr-FR'
|
||||
| 'it'
|
||||
| 'it-IT'
|
||||
| 'ja'
|
||||
| 'ja-JP'
|
||||
| 'nl'
|
||||
| 'nl-NL'
|
||||
| 'pt'
|
||||
| 'pt-PT'
|
||||
| 'zh'
|
||||
@@ -230,6 +234,14 @@ type RootTranslation = {
|
||||
* Netmask
|
||||
*/
|
||||
general_netmask: string;
|
||||
/**
|
||||
* Description
|
||||
*/
|
||||
general_description: string;
|
||||
/**
|
||||
* Some description of the device
|
||||
*/
|
||||
general_description_placeholder: string;
|
||||
/**
|
||||
* required field
|
||||
*/
|
||||
@@ -262,6 +274,22 @@ type RootTranslation = {
|
||||
* Makes your device name a clickable link, perfect for linking a dashboard for example.
|
||||
*/
|
||||
link_desc: string;
|
||||
/**
|
||||
* Automatically open link
|
||||
*/
|
||||
link_open: string;
|
||||
/**
|
||||
* No
|
||||
*/
|
||||
link_open_no: string;
|
||||
/**
|
||||
* Same tab
|
||||
*/
|
||||
link_open_same_tab: string;
|
||||
/**
|
||||
* New tab
|
||||
*/
|
||||
link_open_new_tab: string;
|
||||
/**
|
||||
* Ping
|
||||
*/
|
||||
@@ -335,7 +363,7 @@ type RootTranslation = {
|
||||
*/
|
||||
shutdown: string;
|
||||
/**
|
||||
* 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: string;
|
||||
/**
|
||||
@@ -1001,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
|
||||
*/
|
||||
@@ -1033,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
|
||||
*/
|
||||
@@ -1106,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,5 +1,4 @@
|
||||
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
|
||||
/* eslint-disable */
|
||||
|
||||
import { initFormatters } from './formatters';
|
||||
import type { Locales, Translations } from './i18n-types';
|
||||
@@ -16,6 +15,10 @@ const localeTranslationLoaders = {
|
||||
'fr-FR': () => import('./fr-FR'),
|
||||
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'),
|
||||
'pt-PT': () => import('./pt-PT'),
|
||||
zh: () => import('./zh'),
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
|
||||
/* eslint-disable */
|
||||
|
||||
import { initFormatters } from './formatters';
|
||||
import type { Locales, Translations } from './i18n-types';
|
||||
@@ -15,6 +14,10 @@ import fr from './fr';
|
||||
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';
|
||||
import pt_PT from './pt-PT';
|
||||
import zh from './zh';
|
||||
@@ -32,6 +35,10 @@ const localeTranslations = {
|
||||
'fr-FR': fr_FR,
|
||||
it,
|
||||
'it-IT': it_IT,
|
||||
ja,
|
||||
'ja-JP': ja_JP,
|
||||
nl,
|
||||
'nl-NL': nl_NL,
|
||||
pt,
|
||||
'pt-PT': pt_PT,
|
||||
zh,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
|
||||
/* eslint-disable */
|
||||
|
||||
import {
|
||||
i18n as initI18n,
|
||||
@@ -25,6 +24,10 @@ export const locales: Locales[] = [
|
||||
'fr-FR',
|
||||
'it',
|
||||
'it-IT',
|
||||
'ja',
|
||||
'ja-JP',
|
||||
'nl',
|
||||
'nl-NL',
|
||||
'pt',
|
||||
'pt-PT',
|
||||
'zh',
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -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;
|
||||
@@ -0,0 +1,229 @@
|
||||
import type { BaseTranslation } from '../i18n-types';
|
||||
|
||||
const ja = {
|
||||
home: {
|
||||
page_title: 'ホーム',
|
||||
order_groups: 'グループ',
|
||||
order_name: '名前',
|
||||
order_ip: 'IP',
|
||||
order_tooltip: '順序',
|
||||
no_devices: 'デバイスがありません',
|
||||
add_first_device: '最初のデバイスを追加してください',
|
||||
grant_permissions:
|
||||
'既存のデバイスへの権限を付与するか、新しいデバイスを作成するために管理者に依頼してください。'
|
||||
},
|
||||
account: {
|
||||
page_title: 'アカウント',
|
||||
account_type_admin: '管理者',
|
||||
account_type_user: 'ユーザー',
|
||||
avatar_title: 'アバター',
|
||||
language_title: '言語',
|
||||
language_option_auto: '自動',
|
||||
change_password_title: 'パスワード変更',
|
||||
change_password_body: 'パスワードを変更すると、再度ログインする必要があります。',
|
||||
change_password_label: '現在のパスワード',
|
||||
change_password_new: '新しいパスワード',
|
||||
change_password_confirm: 'パスワードの確認'
|
||||
},
|
||||
device: {
|
||||
page_title: '新しいデバイス',
|
||||
tabs: ['手動', 'ネットワークスキャン'],
|
||||
card_btn_more: '詳細',
|
||||
card_btn_more_edit: '編集',
|
||||
card_btn_more_sleep: 'スリープ',
|
||||
card_btn_more_reboot: '再起動',
|
||||
card_tooltip_wake_cron: '起動スケジュール',
|
||||
card_tooltip_shutdown_cron: 'シャットダウンスケジュール',
|
||||
card_tooltip_wake_password: '起動パスワード',
|
||||
card_tooltip_last_status_change: '最終ステータス変更',
|
||||
card_password: 'パスワード',
|
||||
card_nic_tooltip_pending: '保留中',
|
||||
card_nic_tooltip_shutdown: 'シャットダウン済み',
|
||||
card_nic_tooltip_shutdown_no_cmd: 'シャットダウンコマンドが設定されていません',
|
||||
card_nic_tooltip_shutdown_no_permission: 'このデバイスをシャットダウンする権限がありません',
|
||||
card_nic_tooltip_power: '電源オン',
|
||||
card_nic_tooltip_power_no_permission: 'このデバイスの電源をオンにする権限がありません',
|
||||
modal_confirm_wake_title: '{device} を起動しますか?',
|
||||
modal_confirm_wake_desc: '{device} を起動することを確認してください。',
|
||||
modal_confirm_shutdown_title: '{device} をシャットダウンしますか?',
|
||||
modal_confirm_shutdown_desc: '{device} をシャットダウンすることを確認してください。',
|
||||
general: '一般',
|
||||
general_name: '名前',
|
||||
general_name_placeholder: 'デバイス名',
|
||||
general_ip: 'IP',
|
||||
general_mac: 'Mac',
|
||||
general_netmask: 'ネットマスク',
|
||||
general_description: '説明',
|
||||
general_description_placeholder: '装置の説明',
|
||||
general_required_field: '必須項目',
|
||||
ports: 'ポート',
|
||||
ports_desc: 'UpSnap は指定されたポートが開いているか確認することもできます。',
|
||||
ports_add_new: '新しいポートを追加',
|
||||
ports_name: '名前',
|
||||
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> を返す必要があります。その他の終了コードはオフとして扱われます。',
|
||||
ping_cmd: 'カスタム Ping コマンド',
|
||||
wake: '起動',
|
||||
wake_desc: 'スケジュールされた cron ジョブを使用してこのデバイスを起動できます。',
|
||||
wake_cmd: 'カスタム起動コマンド',
|
||||
wake_cron: '起動スケジュール',
|
||||
wake_cron_enable: '起動スケジュールを有効化',
|
||||
sol: 'Sleep-On-LAN',
|
||||
sol_desc1:
|
||||
'<a class="link" href="https://github.com/SR-G/sleep-on-lan" target="_blank">Sleep-On-LAN</a> ツールを使用してコンピュータをスリープ状態にすることができます。Sleep-On-LAN(SOL)は、スリープ状態にしたい PC で動作する外部ツール/デーモンで、REST エンドポイントを提供します。Sleep-On-LAN のセットアップ方法については、<a href="https://github.com/SR-G/sleep-on-lan#usage" class="link" target="_blank">Usage</a> セクションを参照してください。',
|
||||
sol_desc2:
|
||||
'SOL は、認証を有効にし、要求をより信頼性の高いものにするために、UDP の代わりに HTTP を使用してリクエストを送信するように構成されています。',
|
||||
sol_desc3:
|
||||
'したがって、<a href="https://github.com/SR-G/sleep-on-lan#configuration" class="link" target="_blank">SOL 構成</a>の <span class="badge">Listeners</span> セクションに <span class="badge">HTTP:<YOURPORT></span> を含めるようにしてください。',
|
||||
sol_enable: 'Sleep-On-LAN を有効化',
|
||||
sol_port: 'SOL ポート',
|
||||
sol_authorization: '認証',
|
||||
sol_user: 'SOL ユーザー',
|
||||
sol_password: 'SOL パスワード',
|
||||
shutdown: 'シャットダウン',
|
||||
shutdown_desc:
|
||||
'この <strong>シェルコマンド</strong> は、コンテナ内(Docker を使用している場合)またはホスト(バイナリを使用している場合)で実行されます。機能を確認するには、まずコマンドをコンテナ内またはホストのシェルで実行してください。一般的なコマンドには、Windows 用の <span class="badge">net rpc</span>、Linux 用の <span class="badge">sshpass</span>、またはウェブリクエストを行うための <span class="badge">curl</span> などがあります。',
|
||||
shutdown_examples: '例:',
|
||||
shutdown_examples_windows: 'リモート Windows マシンのシャットダウン:',
|
||||
shutdown_examples_linux: 'リモート Linux マシンのシャットダウン:',
|
||||
shutdown_cmd: 'シャットダウンコマンド',
|
||||
shutdown_cron_desc:
|
||||
'デバイスを起動するために cron を設定するのと同様に、このデバイスをシャットダウンするための cron ジョブをスケジュールすることもできます。',
|
||||
shutdown_cron: 'シャットダウンスケジュール',
|
||||
shutdown_cron_enable: 'シャットダウンスケジュールを有効化',
|
||||
password: 'パスワード',
|
||||
password_desc:
|
||||
'一部のネットワークカードには、マジックパケット用のパスワード(<span class="badge">SecureON</span> とも呼ばれる)を設定するオプションがあります。パスワードは 0、4、または 6 文字のみの長さである必要があります。',
|
||||
groups: 'グループ',
|
||||
groups_desc:
|
||||
'デバイスをグループに追加することで、ダッシュボード上でグループごとに並べ替えることができます。',
|
||||
groups_placeholder: "例: '自宅' や 'オフィス' など",
|
||||
network_scan_range_saved: 'スキャン範囲が保存されました',
|
||||
network_scan_desc:
|
||||
'ネットワーク上のデバイスを自動的にスキャンします。この機能を使用するには、UpSnap を root/admin 権限で実行し、nmap が $PATH にインストールされて利用可能である必要があります(Docker ユーザーの場合、すでに設定済みで何もする必要はありません)。スキャンには数秒かかる場合があります。',
|
||||
network_scan_ip_range: 'IP 範囲',
|
||||
network_scan_no_range: 'スキャン範囲なし',
|
||||
network_scan_unsaved_changes: '未保存の変更',
|
||||
network_scan_running: 'スキャン実行中',
|
||||
network_scan: 'スキャン',
|
||||
network_scan_ip: 'IP:',
|
||||
network_scan_mac: 'Mac:',
|
||||
network_scan_mac_vendor: 'Mac ベンダー:',
|
||||
network_scan_netmask: 'ネットマスク:',
|
||||
network_scan_add_all: 'すべてのデバイスを追加',
|
||||
network_scan_replace_netmask: 'すべてのデバイスのネットマスクを置き換えますか?',
|
||||
network_scan_new_netmask: '新しいネットマスク',
|
||||
network_scan_include_unknown: '名前が「Unknown」のデバイスを含める',
|
||||
require_confirmation: '確認を要求'
|
||||
},
|
||||
login: {
|
||||
welcome: 'ようこそ',
|
||||
email_label: 'メールアドレスまたはユーザー名:',
|
||||
password_label: 'パスワード:',
|
||||
btn_more: '詳細',
|
||||
menu_title_auth_providers: '他の認証プロバイダー',
|
||||
btn_login: 'ログイン'
|
||||
},
|
||||
settings: {
|
||||
page_title: '設定',
|
||||
ping_interval_title: 'Ping 間隔',
|
||||
ping_interval_desc1:
|
||||
'デバイスが ping される間隔を設定します。空白の場合、デフォルト値 <span class="badge">@every 3s</span> が使用されます。',
|
||||
ping_interval_desc2:
|
||||
'cron の正しい構文については、<a class="link" href="https://en.wikipedia.org/wiki/Cron" target="_blank">Wikipedia</a> または <a class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3" target="_blank">パッケージドキュメント</a> を参照してください。',
|
||||
lazy_ping_title: 'Lazy ping',
|
||||
lazy_ping_desc:
|
||||
'Lazy ping をオンにすると、UpSnap はアクティブなユーザーがウェブサイトを訪れている場合にのみデバイスを ping します。オフの場合、UpSnap は常にデバイスを ping します。',
|
||||
lazy_ping_enable: '有効化',
|
||||
website_title_title: 'ウェブサイトタイトル',
|
||||
website_title_desc: 'ウェブサイトおよびブラウザタブのタイトルを設定します。',
|
||||
icon_title: 'アイコン',
|
||||
icon_desc: 'カスタムファビコンを設定します。サポートされているファイルタイプ:',
|
||||
upsnap_version: 'UpSnap バージョン'
|
||||
},
|
||||
users: {
|
||||
page_title: 'ユーザー',
|
||||
allow_create_devices:
|
||||
'{username} が新しいデバイスを作成し、デバイスグループを編集できるようにする',
|
||||
device_permissions: 'デバイスの権限',
|
||||
create_new_device: '新しいデバイスを作成',
|
||||
read: '読み取り',
|
||||
update: '更新',
|
||||
delete: '削除',
|
||||
power: '電源',
|
||||
toggle: '切り替え',
|
||||
confirm_delete_title: '削除の確認',
|
||||
confirm_delete_desc: '{username} を削除してもよろしいですか?',
|
||||
create_new_user: '新しいユーザーを作成',
|
||||
username: 'ユーザー名',
|
||||
password: 'パスワード',
|
||||
password_confirm: 'パスワードの確認',
|
||||
required_field: '必須項目'
|
||||
},
|
||||
buttons: {
|
||||
save: '保存',
|
||||
delete: '削除',
|
||||
change: '変更',
|
||||
reset: 'リセット',
|
||||
cancel: 'キャンセル',
|
||||
add: '追加',
|
||||
confirm: '確認'
|
||||
},
|
||||
welcome: {
|
||||
step1_page_title: 'UpSnap へようこそ 🥳',
|
||||
step1_setup_desc: 'セットアップを完了するには、以下の手順を完了してください。',
|
||||
step1_setup_btn_next: '次へ',
|
||||
step2_page_title: '管理者アカウントを作成',
|
||||
step2_label_email: 'メールアドレス:',
|
||||
step2_label_password: 'パスワード:',
|
||||
step2_label_min_chars: '最小 10 文字',
|
||||
step2_label_password_confirm: 'パスワードの確認:',
|
||||
step2_btn_create: '作成',
|
||||
step3_page_title: '準備完了です! 🎉',
|
||||
step3_page_desc: 'ダッシュボードにデバイスを追加してください。',
|
||||
step3_btn_done: '始めましょう!',
|
||||
not_expected_title: 'ここにいるとは思いませんでした! 🧐',
|
||||
not_expected_desc: 'セットアップはすでに完了しています!やるべきことはありません。',
|
||||
not_expected_back: '戻る',
|
||||
progress_step1: 'ようこそ',
|
||||
progress_step2: 'アカウント作成',
|
||||
progress_step3: '完了'
|
||||
},
|
||||
toasts: {
|
||||
admin_saved: '管理者を保存しました',
|
||||
user_saved: 'ユーザーを保存しました',
|
||||
user_created: 'ユーザー {username} を作成しました',
|
||||
user_deleted: 'ユーザー {username} を削除しました',
|
||||
settings_saved: '設定を保存しました',
|
||||
password_changed: 'パスワードが変更されました。再度ログインしてください。',
|
||||
passwords_missmatch: 'パスワードが一致しません',
|
||||
permissions_created: '{username} の権限を作成しました',
|
||||
permissions_deleted: '{username} の権限を削除しました',
|
||||
permissions_updated: '{username} の権限を更新しました',
|
||||
permissions_updated_personal: 'あなたの権限が更新されました',
|
||||
no_permission: '{url} へのアクセス権がありません',
|
||||
device_created: '{device} を作成しました',
|
||||
devices_created_multiple: '{count|int} 台のデバイスを作成しました',
|
||||
device_updated: '{device} を更新しました',
|
||||
device_deleted: '{device} を削除しました',
|
||||
group_created: 'グループ {group} を作成しました',
|
||||
group_deleted: 'グループ {group} を削除しました'
|
||||
},
|
||||
navbar: {
|
||||
theme: 'テーマ',
|
||||
new: '新規',
|
||||
edit_account: 'アカウント編集',
|
||||
logout: 'ログアウト'
|
||||
}
|
||||
} satisfies BaseTranslation;
|
||||
|
||||
export default ja;
|
||||
@@ -0,0 +1,8 @@
|
||||
import nl from '../nl';
|
||||
import type { Translation } from '../i18n-types';
|
||||
|
||||
const nl_NL = {
|
||||
...(nl as unknown as Translation)
|
||||
} satisfies Translation;
|
||||
|
||||
export default nl_NL;
|
||||
@@ -0,0 +1,231 @@
|
||||
import en from '../en';
|
||||
import type { Translation } from '../i18n-types';
|
||||
|
||||
const nl = {
|
||||
...(en as unknown as Translation),
|
||||
home: {
|
||||
page_title: 'Home',
|
||||
order_groups: 'Groepen',
|
||||
order_name: 'Naam',
|
||||
order_ip: 'IP',
|
||||
order_tooltip: 'Sorteren',
|
||||
no_devices: 'Geen apparaten gevonden.',
|
||||
add_first_device: 'Voeg je eerste apparaat toe',
|
||||
grant_permissions:
|
||||
'Vraag de admin om je toestemming te geven voor bestaande apparaten of om nieuwe te creëren.'
|
||||
},
|
||||
account: {
|
||||
page_title: 'Account',
|
||||
account_type_admin: 'Beheerder',
|
||||
account_type_user: 'Gebruiker',
|
||||
avatar_title: 'Avatar',
|
||||
language_title: 'Taal',
|
||||
language_option_auto: 'Automatisch',
|
||||
change_password_title: 'Wachtwoord wijzigen',
|
||||
change_password_body: 'Na het wijzigen van het wachtwoord moet je opnieuw inloggen.',
|
||||
change_password_label: 'Oud wachtwoord',
|
||||
change_password_new: 'Nieuw wachtwoord',
|
||||
change_password_confirm: 'Bevestig wachtwoord'
|
||||
},
|
||||
device: {
|
||||
page_title: 'Nieuw apparaat',
|
||||
tabs: ['Handmatig', 'Netwerkscan'],
|
||||
card_btn_more: 'Meer',
|
||||
card_btn_more_edit: 'Bewerken',
|
||||
card_btn_more_sleep: 'Slaapstand',
|
||||
card_btn_more_reboot: 'Herstarten',
|
||||
card_tooltip_wake_cron: 'Wek cron',
|
||||
card_tooltip_shutdown_cron: 'Afsluiten cron',
|
||||
card_tooltip_wake_password: 'Wek wachtwoord',
|
||||
card_tooltip_last_status_change: 'Laatste statuswijziging',
|
||||
card_password: 'Wachtwoord',
|
||||
card_nic_tooltip_pending: 'In behandeling',
|
||||
card_nic_tooltip_shutdown: 'Afsluiten',
|
||||
card_nic_tooltip_shutdown_no_cmd: 'Geen uitschakel-opdracht ingesteld',
|
||||
card_nic_tooltip_shutdown_no_permission: 'Geen toestemming om dit apparaat uit te schakelen',
|
||||
card_nic_tooltip_power: 'Aanzetten',
|
||||
card_nic_tooltip_power_no_permission: 'Geen toestemming om dit apparaat aan te zetten',
|
||||
modal_confirm_wake_title: 'Wek {device}?',
|
||||
modal_confirm_wake_desc: 'Bevestig om {device} te wekken.',
|
||||
modal_confirm_shutdown_title: 'Afsluiten {device}?',
|
||||
modal_confirm_shutdown_desc: 'Bevestig om {device} af te sluiten.',
|
||||
general: 'Algemeen',
|
||||
general_name: 'Naam',
|
||||
general_name_placeholder: 'Apparaatnaam',
|
||||
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.',
|
||||
ports_add_new: 'Voeg nieuwe poort toe',
|
||||
ports_name: 'Naam',
|
||||
ports_number: 'Nummer',
|
||||
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.',
|
||||
ping_cmd: 'Aangepaste ping-opdracht',
|
||||
wake: 'Wek',
|
||||
wake_desc: 'Je kunt dit apparaat inschakelen met een geplande cron-taak.',
|
||||
wake_cmd: 'Aangepaste wek-opdracht',
|
||||
wake_cron: 'Wek cron',
|
||||
wake_cron_enable: 'Wek cron inschakelen',
|
||||
sol: 'Sleep-On-LAN',
|
||||
sol_desc1:
|
||||
'Je kunt computers in de slaapstand zetten met de <a class="link" href="https://github.com/SR-G/sleep-on-lan" target="_blank">Sleep-On-LAN</a> tool. Sleep-On-LAN (SOL) is een externe tool/daemon die op de PC\'s werkt die je in de slaapstand wilt zetten en biedt een REST-endpoint. Voor instructies over het instellen van Sleep-On-LAN, zie de <a href="https://github.com/SR-G/sleep-on-lan#usage" class="link" target="_blank">Gebruik</a> sectie.',
|
||||
sol_desc2:
|
||||
'SOL is geconfigureerd om verzoeken over HTTP in plaats van UDP te verzenden om autorisatie mogelijk te maken en verzoeken betrouwbaarder te maken.',
|
||||
sol_desc3:
|
||||
'Zorg er daarom voor dat je <span class="badge">HTTP:<JOUWPOORT></span> opneemt in de <span class="badge">Listeners</span> sectie van de <a href="https://github.com/SR-G/sleep-on-lan#configuration" class="link" target="_blank">SOL-configuratie</a>.',
|
||||
sol_enable: 'Sleep-On-LAN inschakelen',
|
||||
sol_port: 'SOL Poort',
|
||||
sol_authorization: 'Autorisatie',
|
||||
sol_user: 'SOL Gebruiker',
|
||||
sol_password: 'SOL Wachtwoord',
|
||||
shutdown: 'Afsluiten',
|
||||
shutdown_desc:
|
||||
'Deze <strong>shell-opdracht</strong> wordt uitgevoerd binnen de container (als je docker gebruikt) of op jouw host (als je de binaire versie gebruikt). Om te verifiëren dat het werkt, kun je de opdracht eerst binnen de container of op jouw host-shell uitvoeren. Veelvoorkomende opdrachten zijn <span class="badge">net rpc</span> voor Windows, <span class="badge">sshpass</span> voor Linux of <span class="badge">curl</span> in het algemeen om webverzoeken te doen.',
|
||||
shutdown_examples: 'Voorbeelden:',
|
||||
shutdown_examples_windows: 'Afsluiten van een externe Windows-machine:',
|
||||
shutdown_examples_linux: 'Afsluiten van een externe Linux-machine:',
|
||||
shutdown_cmd: 'Afsluitopdracht',
|
||||
shutdown_cron_desc:
|
||||
'Net als het instellen van een cron om het apparaat te wekken, kun je ook een cron-taak plannen om dit apparaat af te sluiten.',
|
||||
shutdown_cron: 'Afsluitcron',
|
||||
shutdown_cron_enable: 'Afsluitcron inschakelen',
|
||||
password: 'Wachtwoord',
|
||||
password_desc:
|
||||
'Sommige netwerkkaarten hebben de optie om een wachtwoord voor magic packets in te stellen, ook wel <span class="badge">SecureON</span> genoemd. Het wachtwoord kan alleen 0, 4 of 6 tekens lang zijn.',
|
||||
groups: 'Groepen',
|
||||
groups_desc:
|
||||
'Je kunt apparaten aan een groep toevoegen om ze op het dashboard per groep te sorteren.',
|
||||
groups_placeholder: "bijv. 'Kelder' of 'Kantoor'",
|
||||
network_scan_range_saved: 'Scanbereik opgeslagen',
|
||||
network_scan_desc:
|
||||
'Automatisch jouw netwerk scannen op apparaten. Voor dit te laten werken, moet je UpSnap als root/admin uitvoeren en moet nmap geïnstalleerd en beschikbaar zijn in jouw $PATH (Voor docker-gebruikers is dit al het geval en hoef je niets meer te doen). Scannen kan enkele seconden duren.',
|
||||
network_scan_ip_range: 'IP-bereik',
|
||||
network_scan_no_range: 'Geen scanbereik',
|
||||
network_scan_unsaved_changes: 'Niet-opgeslagen wijzigingen',
|
||||
network_scan_running: 'Scan loopt',
|
||||
network_scan: 'Scannen',
|
||||
network_scan_ip: 'IP:',
|
||||
network_scan_mac: 'Mac:',
|
||||
network_scan_mac_vendor: 'Mac leverancier:',
|
||||
network_scan_netmask: 'Subnetmasker:',
|
||||
network_scan_add_all: 'Alle apparaten toevoegen',
|
||||
network_scan_replace_netmask: 'Subnetmasker voor alle apparaten vervangen?',
|
||||
network_scan_new_netmask: 'Nieuw subnetmasker',
|
||||
network_scan_include_unknown: 'Voeg apparaten toe waarvan de naam "Onbekend" is',
|
||||
require_confirmation: 'Bevestiging vereist'
|
||||
},
|
||||
login: {
|
||||
welcome: 'Welkom',
|
||||
email_label: 'E-mail of gebruikersnaam:',
|
||||
password_label: 'Wachtwoord:',
|
||||
btn_more: 'Meer',
|
||||
menu_title_auth_providers: 'Andere auth-providers',
|
||||
btn_login: 'Inloggen'
|
||||
},
|
||||
settings: {
|
||||
page_title: 'Instellingen',
|
||||
ping_interval_title: 'Ping-interval',
|
||||
ping_interval_desc1:
|
||||
'Stelt de interval in waarin de apparaten worden gepingt. Laat leeg om de standaardwaarde van <span class="badge">@every 3s</span> te gebruiken.',
|
||||
ping_interval_desc2:
|
||||
'Leer meer over de juiste syntax voor cron op <a class="link" href="https://en.wikipedia.org/wiki/Cron" target="_blank">Wikipedia</a> of raadpleeg de <a class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3" target="_blank">pakketdocumentatie</a>.',
|
||||
lazy_ping_title: 'Lazy ping',
|
||||
lazy_ping_desc:
|
||||
'Wanneer lazy ping is ingeschakeld, pingt UpSnap alleen apparaten als er een actieve gebruiker de website bezoekt. Als het is uitgeschakeld, pingt UpSnap altijd apparaten.',
|
||||
lazy_ping_enable: 'Inschakelen',
|
||||
website_title_title: 'Website titel',
|
||||
website_title_desc: 'Stelt de titel van de website en in het browsertabblad in.',
|
||||
icon_title: 'Icoon',
|
||||
icon_desc: 'Stel een aangepast favicon in. Ondersteunde bestandstypen zijn:',
|
||||
upsnap_version: 'UpSnap versie'
|
||||
},
|
||||
users: {
|
||||
page_title: 'Gebruikers',
|
||||
allow_create_devices:
|
||||
'Sta {username} toe om nieuwe apparaten te maken en apparaatgroepen te bewerken',
|
||||
device_permissions: 'Apparaattoestemmingen',
|
||||
create_new_device: 'Nieuw apparaat maken',
|
||||
read: 'Lezen',
|
||||
update: 'Bijwerken',
|
||||
delete: 'Verwijderen',
|
||||
power: 'Aanzetten',
|
||||
toggle: 'Wisselen',
|
||||
confirm_delete_title: 'Bevestig verwijderen',
|
||||
confirm_delete_desc: 'Weet je zeker dat je {username} wilt verwijderen?',
|
||||
create_new_user: 'Nieuwe gebruiker aanmaken',
|
||||
username: 'Gebruikersnaam',
|
||||
password: 'Wachtwoord',
|
||||
password_confirm: 'Bevestig wachtwoord',
|
||||
required_field: 'vereist veld'
|
||||
},
|
||||
buttons: {
|
||||
save: 'Opslaan',
|
||||
delete: 'Verwijderen',
|
||||
change: 'Wijzigen',
|
||||
reset: 'Resetten',
|
||||
cancel: 'Annuleren',
|
||||
add: 'Toevoegen',
|
||||
confirm: 'Bevestigen'
|
||||
},
|
||||
welcome: {
|
||||
step1_page_title: 'Welkom bij UpSnap 🥳',
|
||||
step1_setup_desc: 'Voltooi de volgende stappen om de installatie te voltooien.',
|
||||
step1_setup_btn_next: 'Volgende',
|
||||
step2_page_title: 'Maak een beheerdersaccount aan',
|
||||
step2_label_email: 'E-mail:',
|
||||
step2_label_password: 'Wachtwoord:',
|
||||
step2_label_min_chars: 'min. 10 tekens',
|
||||
step2_label_password_confirm: 'Bevestig wachtwoord:',
|
||||
step2_btn_create: 'Aanmaken',
|
||||
step3_page_title: 'Je bent helemaal klaar! 🎉',
|
||||
step3_page_desc: 'Ga je gang en voeg enkele apparaten toe aan je dashboard.',
|
||||
step3_btn_done: 'Laten we beginnen!',
|
||||
not_expected_title: 'Ik zag je hier niet aankomen! 🧐',
|
||||
not_expected_desc: 'Je bent al klaar met de installatie! Er is niets meer te doen.',
|
||||
not_expected_back: 'Breng me terug',
|
||||
progress_step1: 'Welkom',
|
||||
progress_step2: 'Account aanmaken',
|
||||
progress_step3: 'Klaar'
|
||||
},
|
||||
toasts: {
|
||||
admin_saved: 'Beheerder opgeslagen',
|
||||
user_saved: 'Gebruiker opgeslagen',
|
||||
user_created: 'Gebruiker {username} aangemaakt',
|
||||
user_deleted: 'Gebruiker {username} verwijderd',
|
||||
settings_saved: 'Instellingen opgeslagen',
|
||||
password_changed: 'Wachtwoord gewijzigd. Log alsjeblieft opnieuw in.',
|
||||
passwords_missmatch: 'Wachtwoorden komen niet overeen',
|
||||
permissions_created: 'Rechten voor {username} aangemaakt',
|
||||
permissions_deleted: 'Rechten voor {username} verwijderd',
|
||||
permissions_updated: 'Rechten voor {username} bijgewerkt',
|
||||
permissions_updated_personal: 'Jouw rechten zijn bijgewerkt',
|
||||
no_permission: 'Je hebt geen toestemming om {url} te bezoeken',
|
||||
device_created: 'Aangemaakt {device}',
|
||||
devices_created_multiple: 'Aangemaakt {count|int} apparaten',
|
||||
device_updated: 'Bijgewerkt {device}',
|
||||
device_deleted: 'Verwijderd {device}',
|
||||
group_created: 'Groep {group} aangemaakt',
|
||||
group_deleted: 'Groep {group} verwijderd'
|
||||
},
|
||||
navbar: {
|
||||
theme: 'Thema',
|
||||
new: 'Nieuw',
|
||||
edit_account: 'Account bewerken',
|
||||
logout: 'Uitloggen'
|
||||
}
|
||||
} satisfies Translation;
|
||||
|
||||
export default nl;
|
||||
@@ -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.',
|
||||
|
||||
@@ -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> 以表示裝置已開機,任何其他退出碼將標記裝置為關機。',
|
||||
|
||||
@@ -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> 的退出代码,表示设备电源已打开,任何其他退出代码都将标记设备电源已关闭。',
|
||||
|
||||
@@ -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})/
|
||||
);
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
|
||||
$pocketbase.authStore.onChange(() => {
|
||||
// load user permissions
|
||||
if ($pocketbase.authStore.model?.collectionName === 'users') {
|
||||
if ($pocketbase.authStore.record?.collectionName === 'users') {
|
||||
$pocketbase
|
||||
.collection('permissions')
|
||||
.getFirstListItem(`user.id = '${$pocketbase.authStore.model.id}'`)
|
||||
.getFirstListItem(`user.id = '${$pocketbase.authStore.record.id}'`)
|
||||
.then((data) => {
|
||||
permission.set(data as Permission);
|
||||
})
|
||||
@@ -64,11 +64,14 @@
|
||||
}
|
||||
|
||||
// refresh auth token
|
||||
if ($pocketbase.authStore.isAdmin) {
|
||||
await $pocketbase.admins.authRefresh().catch(() => {
|
||||
$pocketbase.authStore.clear();
|
||||
goto('/login');
|
||||
});
|
||||
if ($pocketbase.authStore.isSuperuser) {
|
||||
await $pocketbase
|
||||
.collection('_superusers')
|
||||
.authRefresh()
|
||||
.catch(() => {
|
||||
$pocketbase.authStore.clear();
|
||||
goto('/login');
|
||||
});
|
||||
} else {
|
||||
await $pocketbase
|
||||
.collection('users')
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
{:else}
|
||||
<div class="container text-center">
|
||||
<p>{$LL.home.no_devices()}</p>
|
||||
{#if $pocketbase.authStore.isAdmin || $permission.create}
|
||||
{#if $pocketbase.authStore.isSuperuser || $permission.create}
|
||||
<p>
|
||||
<a href="/device/new" class="btn btn-ghost"
|
||||
><Fa icon={faPlus} class="ms-2" />{$LL.home.add_first_device()}
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
'fr-FR': '🇫🇷',
|
||||
it: '🇮🇹',
|
||||
'it-IT': '🇮🇹',
|
||||
ja: '🇯🇵',
|
||||
'ja-JP': '🇯🇵',
|
||||
nl: '🇳🇱',
|
||||
'nl-NL': '🇳🇱',
|
||||
pt: '🇵🇹',
|
||||
'pt-PT': '🇵🇹',
|
||||
es: '🇪🇸',
|
||||
@@ -66,10 +70,11 @@
|
||||
await loadLocaleAsync(newLang);
|
||||
setLocale(newLang);
|
||||
|
||||
if ($pocketbase.authStore.isAdmin) {
|
||||
if (!$pocketbase.authStore.model?.id) return;
|
||||
$pocketbase.admins
|
||||
.update($pocketbase.authStore.model.id, { avatar: newAvatar })
|
||||
if ($pocketbase.authStore.isSuperuser) {
|
||||
if (!$pocketbase.authStore.record?.id) return;
|
||||
$pocketbase
|
||||
.collection('_superusers')
|
||||
.update($pocketbase.authStore.record.id, { avatar: newAvatar })
|
||||
.then(() => {
|
||||
toast.success($LL.toasts.admin_saved());
|
||||
})
|
||||
@@ -77,10 +82,10 @@
|
||||
toast.error(err.message);
|
||||
});
|
||||
} else {
|
||||
if (!$pocketbase.authStore.model?.id) return;
|
||||
if (!$pocketbase.authStore.record?.id) return;
|
||||
$pocketbase
|
||||
.collection('users')
|
||||
.update($pocketbase.authStore.model.id, { avatar: newAvatar })
|
||||
.update($pocketbase.authStore.record.id, { avatar: newAvatar })
|
||||
.then(() => {
|
||||
toast.success($LL.toasts.user_saved());
|
||||
})
|
||||
@@ -92,16 +97,16 @@
|
||||
|
||||
function changePassword() {
|
||||
fetch(
|
||||
`${backendUrl}api/${$pocketbase.authStore.isAdmin ? 'admins' : `collections/users/records`}/${
|
||||
$pocketbase.authStore.model?.id
|
||||
}`,
|
||||
`${backendUrl}api/collections/${
|
||||
$pocketbase.authStore.isSuperuser ? '_superusers' : `users`
|
||||
}/records/${$pocketbase.authStore.record?.id}`,
|
||||
{
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
Authorization: $pocketbase.authStore.token,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: $pocketbase.authStore.isAdmin ? adminBody : userBody
|
||||
body: $pocketbase.authStore.isSuperuser ? adminBody : userBody
|
||||
}
|
||||
)
|
||||
.then(async (data) => {
|
||||
@@ -139,25 +144,22 @@
|
||||
<div class="flex flex-row items-center gap-4">
|
||||
<div class="avatar">
|
||||
<div class="w-16 rounded-full">
|
||||
<!-- svelte static build will fail, because the image gets served from pocketbase
|
||||
and is not a local static file -->
|
||||
{#if $pocketbase.authStore.model?.id}
|
||||
{#if $pocketbase.authStore.record?.id}
|
||||
<img
|
||||
src="{backendUrl}_/images/avatars/avatar{newAvatar ??
|
||||
$pocketbase.authStore.model?.avatar}.svg"
|
||||
alt="Avatar {newAvatar ?? $pocketbase.authStore.model?.avatar}"
|
||||
src="/avatars/avatar{newAvatar ?? $pocketbase.authStore.record?.avatar}.svg"
|
||||
alt="Avatar {newAvatar ?? $pocketbase.authStore.record?.avatar}"
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="card-title">
|
||||
{$pocketbase.authStore.isAdmin
|
||||
? $pocketbase.authStore.model?.email
|
||||
: $pocketbase.authStore.model?.username}
|
||||
{$pocketbase.authStore.isSuperuser
|
||||
? $pocketbase.authStore.record?.email
|
||||
: $pocketbase.authStore.record?.username}
|
||||
</h2>
|
||||
<h3>
|
||||
{$pocketbase.authStore.isAdmin
|
||||
{$pocketbase.authStore.isSuperuser
|
||||
? $LL.account.account_type_admin()
|
||||
: $LL.account.account_type_user()}
|
||||
</h3>
|
||||
@@ -172,26 +174,21 @@
|
||||
class="w-11 rounded-full"
|
||||
class:ring={newAvatar !== undefined
|
||||
? i === newAvatar
|
||||
: i === $pocketbase.authStore.model?.avatar}
|
||||
: i === $pocketbase.authStore.record?.avatar}
|
||||
class:ring-primary={newAvatar !== undefined
|
||||
? i === newAvatar
|
||||
: i === $pocketbase.authStore.model?.avatar}
|
||||
: i === $pocketbase.authStore.record?.avatar}
|
||||
class:ring-offset-base-100={newAvatar !== undefined
|
||||
? i === newAvatar
|
||||
: i === $pocketbase.authStore.model?.avatar}
|
||||
: i === $pocketbase.authStore.record?.avatar}
|
||||
class:ring-offset-2={newAvatar !== undefined
|
||||
? i === newAvatar
|
||||
: i === $pocketbase.authStore.model?.avatar}
|
||||
: i === $pocketbase.authStore.record?.avatar}
|
||||
on:click={() => (newAvatar = i)}
|
||||
role="none"
|
||||
>
|
||||
<!-- svelte static build will fail, because the image gets served from pocketbase
|
||||
and is not a local static file -->
|
||||
{#if $pocketbase.authStore.model?.id}
|
||||
<img
|
||||
src="{backendUrl}_/images/avatars/avatar{i}.svg"
|
||||
alt="{$LL.account.avatar_title()} {i}"
|
||||
/>
|
||||
{#if $pocketbase.authStore.record?.id}
|
||||
<img src="/avatars/avatar{i}.svg" alt="{$LL.account.avatar_title()} {i}" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -223,7 +220,7 @@
|
||||
<p>{$LL.account.change_password_body()}</p>
|
||||
<form on:submit|preventDefault={changePassword}>
|
||||
<div class="form-control w-full max-w-xs">
|
||||
{#if !$pocketbase.authStore.isAdmin}
|
||||
{#if !$pocketbase.authStore.isSuperuser}
|
||||
<label class="label" for="password-old">
|
||||
<span class="label-text">{$LL.account.change_password_label()}</span>
|
||||
</label>
|
||||
@@ -246,7 +243,7 @@
|
||||
type="password"
|
||||
placeholder={$LL.account.change_password_new()}
|
||||
class="input input-bordered w-full max-w-xs"
|
||||
minlength={$pocketbase.authStore.isAdmin ? 10 : 5}
|
||||
minlength={$pocketbase.authStore.isSuperuser ? 10 : 5}
|
||||
maxlength="72"
|
||||
bind:value={newPassword.password}
|
||||
required
|
||||
@@ -261,7 +258,7 @@
|
||||
type="password"
|
||||
placeholder={$LL.account.change_password_confirm()}
|
||||
class="input input-bordered w-full max-w-xs"
|
||||
minlength={$pocketbase.authStore.isAdmin ? 10 : 5}
|
||||
minlength={$pocketbase.authStore.isSuperuser ? 10 : 5}
|
||||
maxlength="72"
|
||||
bind:value={newPassword.confirm}
|
||||
required
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import toast from 'svelte-french-toast';
|
||||
|
||||
$: if (Object.hasOwn($permission, 'update')) {
|
||||
if (!$pocketbase.authStore.isAdmin && !$permission.update.includes($page.params.id)) {
|
||||
if (!$pocketbase.authStore.isSuperuser && !$permission.update.includes($page.params.id)) {
|
||||
toast($LL.toasts.no_permission({ url: $page.url.pathname }), {
|
||||
icon: '⛔'
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
} as Device;
|
||||
|
||||
$: if (Object.hasOwn($permission, 'create')) {
|
||||
if (!$pocketbase.authStore.isAdmin && !$permission.create) {
|
||||
if (!$pocketbase.authStore.isSuperuser && !$permission.create) {
|
||||
toast($LL.toasts.no_permission({ url: $page.url.pathname }), {
|
||||
icon: '⛔'
|
||||
});
|
||||
@@ -37,7 +37,7 @@
|
||||
name: 'scan',
|
||||
ll_name: $LL.device.tabs[1](),
|
||||
icon: faBinoculars,
|
||||
show: $pocketbase.authStore.isAdmin
|
||||
show: $pocketbase.authStore.isSuperuser
|
||||
}
|
||||
];
|
||||
let activeTab = 'manual';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { goto } from '$app/navigation';
|
||||
import { toggleVisibility } from '$lib/helpers/forms';
|
||||
import LL from '$lib/i18n/i18n-svelte';
|
||||
import { pocketbase, backendUrl } from '$lib/stores/pocketbase';
|
||||
import { backendUrl, pocketbase } from '$lib/stores/pocketbase';
|
||||
import { settingsPub } from '$lib/stores/settings';
|
||||
import { faEye, faLockOpen, faQuestionCircle } from '@fortawesome/free-solid-svg-icons';
|
||||
import type { AuthProviderInfo } from 'pocketbase';
|
||||
@@ -23,7 +23,8 @@
|
||||
});
|
||||
|
||||
function tryAdminThenUser() {
|
||||
$pocketbase.admins
|
||||
$pocketbase
|
||||
.collection('_superusers')
|
||||
.authWithPassword(form.email, form.password)
|
||||
.then(() => {
|
||||
goto('/');
|
||||
@@ -122,8 +123,8 @@
|
||||
>
|
||||
</li>
|
||||
{#await $pocketbase.collection('users').listAuthMethods() then authMethods}
|
||||
{#if authMethods.authProviders.length > 0}
|
||||
{#each authMethods.authProviders as provider}
|
||||
{#if authMethods.oauth2.enabled && authMethods.oauth2.providers.length > 0}
|
||||
{#each authMethods.oauth2.providers as provider}
|
||||
<li>
|
||||
<button type="button" on:click={() => loginWithProvider(provider)}
|
||||
>{provider.displayName}</button
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
let faviconInputElement: HTMLInputElement;
|
||||
|
||||
onMount(() => {
|
||||
if (!$pocketbase.authStore.isAdmin) {
|
||||
if (!$pocketbase.authStore.isSuperuser) {
|
||||
toast($LL.toasts.no_permission({ url: $page.url.pathname }), {
|
||||
icon: '⛔'
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { page } from '$app/stores';
|
||||
import PageLoading from '$lib/components/PageLoading.svelte';
|
||||
import LL from '$lib/i18n/i18n-svelte';
|
||||
import { backendUrl, pocketbase } from '$lib/stores/pocketbase';
|
||||
import { pocketbase } from '$lib/stores/pocketbase';
|
||||
import type { Device } from '$lib/types/device';
|
||||
import type { Permission } from '$lib/types/permission';
|
||||
import type { User } from '$lib/types/user';
|
||||
@@ -33,7 +33,7 @@
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
if (!$pocketbase.authStore.isAdmin) {
|
||||
if (!$pocketbase.authStore.isSuperuser) {
|
||||
toast($LL.toasts.no_permission({ url: $page.url.pathname }), {
|
||||
icon: '⛔'
|
||||
});
|
||||
@@ -189,10 +189,7 @@
|
||||
<h2 class="card-title">
|
||||
<label tabindex="-1" class="avatar" for="avatar{index}">
|
||||
<div class="w-10 rounded-full" id="avatar{index}">
|
||||
<img
|
||||
src="{backendUrl}_/images/avatars/avatar{user.avatar}.svg"
|
||||
alt="Avatar {user.avatar}"
|
||||
/>
|
||||
<img src="/avatars/avatar{user.avatar}.svg" alt="Avatar {user.avatar}" />
|
||||
</div>
|
||||
</label>
|
||||
{user.username}
|
||||
|
||||
@@ -26,11 +26,14 @@
|
||||
});
|
||||
|
||||
async function register() {
|
||||
$pocketbase.admins
|
||||
.create({
|
||||
email: form.email,
|
||||
password: form.password,
|
||||
passwordConfirm: form.confirm
|
||||
$pocketbase
|
||||
.send('/api/upsnap/init-superuser', {
|
||||
method: 'POST',
|
||||
body: {
|
||||
email: form.email,
|
||||
password: form.password,
|
||||
password_confirm: form.confirm
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
$pocketbase
|
||||
@@ -39,7 +42,8 @@
|
||||
.then((data) => {
|
||||
settingsPub.set(data as SettingsPublic);
|
||||
});
|
||||
$pocketbase.admins
|
||||
$pocketbase
|
||||
.collection('_superusers')
|
||||
.authWithPassword(form.email, form.password)
|
||||
.then(() => {
|
||||
stepsCompleted = 2;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 36 36" fill="none" role="img" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><title>Mary Roebling</title><mask id="mask__beam" maskUnits="userSpaceOnUse" x="0" y="0" width="36" height="36"><rect width="36" height="36" fill="#FFFFFF"></rect></mask><g mask="url(#mask__beam)"><rect width="36" height="36" fill="#f0f0d8"></rect><rect x="0" y="0" width="36" height="36" transform="translate(5 -1) rotate(155 18 18) scale(1.2)" fill="#000000" rx="6"></rect><g transform="translate(3 -4) rotate(-5 18 18)"><path d="M15 21c2 1 4 1 6 0" stroke="#FFFFFF" fill="none" stroke-linecap="round"></path><rect x="14" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#FFFFFF"></rect><rect x="20" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#FFFFFF"></rect></g></g></svg>
|
||||
|
After Width: | Height: | Size: 806 B |
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 36 36" fill="none" role="img" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><title>Nellie Bly</title><mask id="mask__beam" maskUnits="userSpaceOnUse" x="0" y="0" width="36" height="36"><rect width="36" height="36" fill="#FFFFFF"></rect></mask><g mask="url(#mask__beam)"><rect width="36" height="36" fill="#a89f1d"></rect><rect x="0" y="0" width="36" height="36" transform="translate(8 8) rotate(118 18 18) scale(1.1)" fill="#fcaf14" rx="6"></rect><g transform="translate(4 4) rotate(-8 18 18)"><path d="M13,20 a1,0.75 0 0,0 10,0" fill="#000000"></path><rect x="11" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#000000"></rect><rect x="23" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#000000"></rect></g></g></svg>
|
||||
|
After Width: | Height: | Size: 771 B |
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 36 36" fill="none" role="img" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><title>Elizabeth Peratrovich</title><mask id="mask__beam" maskUnits="userSpaceOnUse" x="0" y="0" width="36" height="36"><rect width="36" height="36" fill="#FFFFFF"></rect></mask><g mask="url(#mask__beam)"><rect width="36" height="36" fill="#9d007a"></rect><rect x="0" y="0" width="36" height="36" transform="translate(9 -5) rotate(219 18 18) scale(1)" fill="#ff6e49" rx="6"></rect><g transform="translate(4.5 -4) rotate(9 18 18)"><path d="M15 19c2 1 4 1 6 0" stroke="#000000" fill="none" stroke-linecap="round"></path><rect x="10" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#000000"></rect><rect x="24" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#000000"></rect></g></g></svg>
|
||||
|
After Width: | Height: | Size: 813 B |
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 36 36" fill="none" role="img" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><title>Amelia Boynton</title><mask id="mask__beam" maskUnits="userSpaceOnUse" x="0" y="0" width="36" height="36"><rect width="36" height="36" fill="#FFFFFF"></rect></mask><g mask="url(#mask__beam)"><rect width="36" height="36" fill="#029daf"></rect><rect x="0" y="0" width="36" height="36" transform="translate(6 6) rotate(332 18 18) scale(1.2)" fill="#ffc219" rx="6"></rect><g transform="translate(4 3) rotate(-2 18 18)"><path d="M13,21 a1,0.75 0 0,0 10,0" fill="#000000"></path><rect x="12" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#000000"></rect><rect x="22" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#000000"></rect></g></g></svg>
|
||||
|
After Width: | Height: | Size: 775 B |
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 36 36" fill="none" role="img" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><title>Victoria Woodhull</title><mask id="mask__beam" maskUnits="userSpaceOnUse" x="0" y="0" width="36" height="36"><rect width="36" height="36" fill="#FFFFFF"></rect></mask><g mask="url(#mask__beam)"><rect width="36" height="36" fill="#00988d"></rect><rect x="0" y="0" width="36" height="36" transform="translate(-5 9) rotate(189 18 18) scale(1)" fill="#013750" rx="36"></rect><g transform="translate(-5 4.5) rotate(9 18 18)"><path d="M13,19 a1,0.75 0 0,0 10,0" fill="#FFFFFF"></path><rect x="10" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#FFFFFF"></rect><rect x="24" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#FFFFFF"></rect></g></g></svg>
|
||||
|
After Width: | Height: | Size: 780 B |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user