Compare commits
342 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| 96376f39a1 | |||
| 0844236807 | |||
| fd96b979b7 | |||
| 5eace664fc | |||
| 8e0b1bf873 | |||
| aa63089b0d | |||
| c57688d72f | |||
| 13201a2709 | |||
| 95c4f5a017 | |||
| 894c8d5722 | |||
| 6ce42ab681 | |||
| f3bdd0e25a | |||
| dff6a4546f | |||
| c7f2c439c2 | |||
| f2fafd9909 | |||
| 255b4a6514 | |||
| 9c20d77a64 | |||
| be88b6f55c | |||
| e160b28985 | |||
| 93f97c73c4 | |||
| 2e494d7350 | |||
| a2b43f6dec | |||
| fb5ef85a74 | |||
| 1672ad73fa | |||
| 4488275a6d | |||
| 6405fc2669 | |||
| 243265f70f | |||
| 0e2e03a0d3 | |||
| 2fa00c8784 | |||
| 16379da2b5 | |||
| 5dcb7b10a3 | |||
| 2d44d96af8 | |||
| 0bd16b855d | |||
| e3259b1574 | |||
| 8555e089f1 | |||
| 82a88f9c68 | |||
| 4a9d1c02b6 | |||
| b80696d278 | |||
| f3a6f47335 | |||
| bfe6fc2d66 | |||
| 89ebd968a6 | |||
| e5a0e37ae3 | |||
| 606c880cdb | |||
| f0aea1b2bc | |||
| a790fbd042 | |||
| 038009c685 | |||
| 68ff1a227e | |||
| b367584fe5 | |||
| 36f6a1dc33 | |||
| 32587f2221 | |||
| 0e3b62c10f | |||
| c95102fd2a | |||
| b51f4a8b28 | |||
| 21692a5362 | |||
| 83aac0c2b8 | |||
| 0590c2e9eb | |||
| 4b1bb39f47 | |||
| 66913d32f4 | |||
| c1ce569b5b | |||
| 44c2c5a495 | |||
| 1f9a97eb01 | |||
| 5c7c0d5f5b | |||
| e5d1dc18a1 | |||
| 71bb9fbdb1 | |||
| c7f7835dc5 | |||
| 5e454a73bc | |||
| c619e9c0fb | |||
| a0c48a25cd | |||
| a2fad2585f | |||
| 5c88336a7a | |||
| c2ec943915 | |||
| 6d0173de24 | |||
| 53962db94e | |||
| 0fff37c4d3 | |||
| e961e957c7 | |||
| a13fd5371d | |||
| 1e10f6ac83 | |||
| d41d256c77 | |||
| 3fb1654556 | |||
| 91ad8ee3f4 | |||
| 60ccc79a13 | |||
| 82480f3a83 | |||
| 6cfbe749e9 | |||
| c925fa8ca0 | |||
| 68c786daaf | |||
| 394f3b2bdd | |||
| 9f5c4f1c3d | |||
| 6606bfe738 | |||
| 9a4530dd5c | |||
| fd8b6316b6 | |||
| dd328ec4ca | |||
| 8f2c270fda | |||
| 2688466c18 | |||
| 2da80204ab | |||
| 0d2a840cff | |||
| 860ce18190 | |||
| 4e68bbe615 | |||
| d79b28dee4 | |||
| cf3c42293b | |||
| 9e0efc97b2 | |||
| 3763975a3b | |||
| a6b0127341 | |||
| 4dc7308d84 | |||
| 9ef4a87197 | |||
| 87f1c8ace0 | |||
| 2cd9e08a57 | |||
| f5fb15ab3c | |||
| d4c454dcee | |||
| 6dee1d86fd | |||
| 2654e327fb | |||
| 1416de0035 | |||
| f795939913 | |||
| 2738d1f5e3 | |||
| c5f8ec0229 | |||
| 85538067dc | |||
| 4a32cb3eb8 | |||
| a5eafffda2 | |||
| 679e6ce14f | |||
| 02e60ff95c | |||
| f3ba5a1d07 | |||
| 339e482ca0 | |||
| e6c61ca442 | |||
| 304f96a5d7 | |||
| 3aac7e4784 | |||
| 745ca763d9 | |||
| 579e374e2f | |||
| 21f9f54115 | |||
| 15fcda8a5a | |||
| 17997d7a56 | |||
| aa2dbf8e2f | |||
| 8c1a27b68b | |||
| e063c575ab | |||
| db07069f9a | |||
| 6c8a145f0a | |||
| 8959a34eb9 | |||
| 3d5563c019 | |||
| a1e7b82993 | |||
| 8759231b9c | |||
| e6b8176fff | |||
| 77c23a4813 | |||
| 24cac05ef8 | |||
| 359a504806 | |||
| 90fb0d0ef7 | |||
| 91fe02839c | |||
| 3121f27d25 | |||
| 92c83e5163 | |||
| 1c0ec91fa8 | |||
| ac4bc761a3 | |||
| 0eb443ff6b | |||
| 0697cfec62 | |||
| c4f2e86a05 | |||
| b884223e5e | |||
| 1ea6efbcef | |||
| a8b976536d | |||
| b7251a3313 | |||
| 9268c9ee68 | |||
| c522fc9d7f | |||
| 6a76a38a59 | |||
| 949e391549 | |||
| 864935b3b3 | |||
| 31231bac1f | |||
| 37842110d1 | |||
| 5c8e1e0833 | |||
| b332d95a0a | |||
| 041a5b4d65 | |||
| 5e8aeb88a8 | |||
| 7488677b61 | |||
| b8642ee6c3 | |||
| 0af2aff5cd | |||
| c61830eb5c | |||
| 12d673c6ac | |||
| 81610f30ac | |||
| 2087e31a92 | |||
| 0a02e70219 | |||
| 22d803fc16 | |||
| 6d8eb54a93 | |||
| 5eda2c524a | |||
| 281adcb3f6 | |||
| 158c4e006e | |||
| 1e72e209e0 | |||
| e15d565a82 | |||
| dc6ca9c1dd | |||
| f2b69fbddb | |||
| b5769508e4 | |||
| bd82e3fe99 | |||
| 7878c64bc7 | |||
| cd2f9fa35d | |||
| 14910b7e84 | |||
| c9a7a09c28 | |||
| 5d3b36ff64 | |||
| bc778779cb | |||
| 3615cdba98 | |||
| c64ad4e5b2 | |||
| 28198a59c0 | |||
| ec387445b9 | |||
| 18551863db | |||
| fceb9cb661 | |||
| 4568521287 | |||
| c0ae608eb5 |
@@ -46,6 +46,7 @@ jobs:
|
||||
pnpm --prefix=./frontend i
|
||||
PUBLIC_VERSION=${GITHUB_REF##*/} pnpm --prefix=./frontend run build
|
||||
cp -r ./frontend/build/* ./backend/pb_public/
|
||||
git reset --hard
|
||||
|
||||
# setup go
|
||||
- name: Set up Go
|
||||
@@ -56,10 +57,10 @@ jobs:
|
||||
|
||||
# build
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v5
|
||||
uses: goreleaser/goreleaser-action@v6
|
||||
with:
|
||||
distribution: goreleaser
|
||||
version: latest
|
||||
version: "~> v2"
|
||||
args: release --clean
|
||||
workdir: backend
|
||||
env:
|
||||
@@ -83,6 +84,7 @@ jobs:
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/seriousm4x/UpSnap
|
||||
seriousm4x/UpSnap
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=semver,pattern={{version}}
|
||||
@@ -106,10 +108,17 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# ducker hub login
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
# build and push
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
FROM alpine:3 as downloader
|
||||
FROM alpine:3 AS downloader
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG TARGETVARIANT
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,25 +5,31 @@
|
||||
<div align="center" width="100%">
|
||||
<h2>UpSnap</h2>
|
||||
<p>A simple wake on lan web app written with SvelteKit, Go and PocketBase.</p>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/upsnap"><img src="https://img.shields.io/github/stars/seriousm4x/upsnap" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/releases"><img src="https://img.shields.io/github/downloads/seriousm4x/upsnap/total" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/releases"><img src="https://img.shields.io/github/go-mod/go-version/seriousm4x/UpSnap?filename=backend/go.mod" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/releases"><img src="https://img.shields.io/github/v/release/seriousm4x/upsnap?display_name=tag" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/actions"><img src="https://github.com/seriousm4x/upsnap/actions/workflows/release.yml/badge.svg?event=push" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/commits/master"><img src="https://img.shields.io/github/last-commit/seriousm4x/upsnap" /></a>
|
||||
<div>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/upsnap"><img src="https://img.shields.io/github/stars/seriousm4x/UpSnap?style=flat&label=Stars" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/pkgs/container/upsnap"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fipitio%2Fbackage%2Findex%2Fseriousm4x%2FUpSnap%2Fupsnap.json&query=downloads&label=ghcr.io%20pulls" /></a>
|
||||
<a target="_blank" href="https://hub.docker.com/r/seriousm4x/upsnap"><img src="https://img.shields.io/docker/pulls/seriousm4x/upsnap?label=docker%20hub%20pulls" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/releases"><img src="https://img.shields.io/github/downloads/seriousm4x/upsnap/total?label=binary%20downloads" /></a>
|
||||
</div>
|
||||
<div>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/releases"><img src="https://img.shields.io/github/go-mod/go-version/seriousm4x/UpSnap?filename=backend/go.mod" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/releases"><img src="https://img.shields.io/github/v/release/seriousm4x/upsnap?display_name=tag&label=Latest%20release" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/actions"><img src="https://github.com/seriousm4x/upsnap/actions/workflows/release.yml/badge.svg?event=push" /></a>
|
||||
<a target="_blank" href="https://github.com/seriousm4x/UpSnap/commits/master"><img src="https://img.shields.io/github/last-commit/seriousm4x/upsnap" /></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- 🚀 One-Click Device Wake-Up Dashboard
|
||||
- ⏰ Timed Events via Cron for Automation
|
||||
- 🔌 Ping Any Port You Choose
|
||||
- 🔍 Discover Devices with Network Scanning (nmap required)
|
||||
- 👤 Secured User Management
|
||||
- 🌐 i18n support for [these](https://github.com/seriousm4x/UpSnap/tree/master/frontend/src/lib/i18n) languages
|
||||
- 🎨 29 Themes
|
||||
- 🐳 [Docker images](https://github.com/seriousm4x/UpSnap/pkgs/container/upsnap) for amd64, arm64, arm/v7, arm/v6
|
||||
- 🏠 Self-Hostable, No Cloud Bullshit!
|
||||
- 🚀 One-Click Device Wake-Up Dashboard
|
||||
- ⏰ Timed Events via Cron for Automation
|
||||
- 🔌 Ping Any Port You Choose
|
||||
- 🔍 Discover Devices with Network Scanning (nmap required)
|
||||
- 👤 Secured User Management
|
||||
- 🌐 i18n support for [these](https://github.com/seriousm4x/UpSnap/tree/master/frontend/src/lib/i18n) languages
|
||||
- 🎨 29 Themes
|
||||
- 🐳 [Docker images](https://github.com/seriousm4x/UpSnap/pkgs/container/upsnap) for amd64, arm64, arm/v7, arm/v6
|
||||
- 🏠 Self-Hostable
|
||||
|
||||
## 📸 Screenshots
|
||||
|
||||
@@ -84,7 +90,7 @@ If you want to change the port from 8090 to something else, change the following
|
||||
```yml
|
||||
entrypoint: /bin/sh -c "./upsnap serve --http 0.0.0.0:5000"
|
||||
healthcheck:
|
||||
test: curl -fs "http://localhost:5000/api/health" || exit 1
|
||||
test: curl -fs "http://localhost:5000/api/health" || exit 1
|
||||
```
|
||||
|
||||
### Install additional packages for shutdown cmd
|
||||
@@ -121,12 +127,15 @@ Although UpSnap has user authorisation, it is **not recommended to expose it to
|
||||
|
||||
UpSnap is available in the following languages so far:
|
||||
|
||||
- 🇺🇸 **English** (en-US)
|
||||
- 🇩🇪 **German** (de-DE)
|
||||
- 🇪🇸 **Spanish** (es-ES)
|
||||
- 🇫🇷 **French** (fr-FR)
|
||||
- 🇵🇹 **Portuguese** (pt-PT)
|
||||
- 🇨🇳 **Chinese** (zh-CN)
|
||||
- 🇺🇸 **English** (en-US)
|
||||
- 🇩🇪 **German** (de-DE)
|
||||
- 🇪🇸 **Spanish** (es-ES)
|
||||
- 🇫🇷 **French** (fr-FR)
|
||||
- 🇮🇹 **Italian** (it-IT)
|
||||
- 🇳🇱 **Dutch** (nl-NL)
|
||||
- 🇵🇹 **Portuguese** (pt-PT)
|
||||
- 🇨🇳 **Chinese** (zh-CN)
|
||||
- 🇹🇼 **Chinese (Taiwan)** (zh-TW)
|
||||
|
||||
**If you want to contribute and help translating, check the wiki: [How to add languages](https://github.com/seriousm4x/UpSnap/wiki/How-to-add-languages)**
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
version: 2
|
||||
release:
|
||||
draft: true
|
||||
draft: false
|
||||
prerelease: auto
|
||||
before:
|
||||
hooks:
|
||||
@@ -31,7 +32,7 @@ archives:
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
snapshot:
|
||||
name_template: "{{ .Version }}"
|
||||
version_template: "{{ .Version }}"
|
||||
changelog:
|
||||
use: github
|
||||
sort: asc
|
||||
|
||||
@@ -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
|
||||
@@ -113,28 +113,27 @@ func SetWakeShutdownJobs(app *pocketbase.PocketBase) {
|
||||
|
||||
if wake_cron_enabled && wake_cron != "" {
|
||||
_, err := CronWakeShutdown.AddFunc(wake_cron, func() {
|
||||
dev, err = app.Dao().FindRecordById("devices", dev.Id)
|
||||
isOnline := networking.PingDevice(dev)
|
||||
if isOnline {
|
||||
return
|
||||
}
|
||||
d, err := app.FindRecordById("devices", dev.Id)
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
status := dev.GetString("status")
|
||||
if status == "pending" || status == "online" {
|
||||
return
|
||||
}
|
||||
dev.Set("status", "pending")
|
||||
if err := app.Dao().SaveRecord(dev); err != nil {
|
||||
d.Set("status", "pending")
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
return
|
||||
}
|
||||
if err := networking.WakeDevice(dev); err != nil {
|
||||
if err := networking.WakeDevice(d); err != nil {
|
||||
logger.Error.Println(err)
|
||||
dev.Set("status", "offline")
|
||||
d.Set("status", "offline")
|
||||
} else {
|
||||
dev.Set("status", "online")
|
||||
d.Set("status", "online")
|
||||
}
|
||||
if err := app.Dao().SaveRecord(dev); err != nil {
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
})
|
||||
@@ -145,27 +144,30 @@ func SetWakeShutdownJobs(app *pocketbase.PocketBase) {
|
||||
|
||||
if shutdown_cron_enabled && shutdown_cron != "" {
|
||||
_, err := CronWakeShutdown.AddFunc(shutdown_cron, func() {
|
||||
dev, err = app.Dao().FindRecordById("devices", dev.Id)
|
||||
isOnline := networking.PingDevice(dev)
|
||||
if !isOnline {
|
||||
return
|
||||
}
|
||||
d, err := app.FindRecordById("devices", dev.Id)
|
||||
if err != nil {
|
||||
logger.Error.Println(err)
|
||||
return
|
||||
}
|
||||
|
||||
status := dev.GetString("status")
|
||||
if status == "pending" || status == "offline" {
|
||||
status := d.GetString("status")
|
||||
if status != "online" {
|
||||
return
|
||||
}
|
||||
dev.Set("status", "pending")
|
||||
if err := app.Dao().SaveRecord(dev); err != nil {
|
||||
d.Set("status", "pending")
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
if err := networking.ShutdownDevice(dev); err != nil {
|
||||
if err := networking.ShutdownDevice(d); err != nil {
|
||||
logger.Error.Println(err)
|
||||
dev.Set("status", "online")
|
||||
d.Set("status", "online")
|
||||
} else {
|
||||
dev.Set("status", "offline")
|
||||
d.Set("status", "offline")
|
||||
}
|
||||
if err := app.Dao().SaveRecord(dev); err != nil {
|
||||
if err := app.Save(d); err != nil {
|
||||
logger.Error.Println("Failed to save record:", err)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,90 +1,83 @@
|
||||
module github.com/seriousm4x/upsnap
|
||||
|
||||
go 1.22.2
|
||||
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.12
|
||||
github.com/prometheus-community/pro-bing v0.4.0
|
||||
github.com/pocketbase/pocketbase v0.23.12
|
||||
github.com/prometheus-community/pro-bing v0.5.0
|
||||
github.com/robfig/cron/v3 v3.0.1
|
||||
golang.org/x/sys v0.20.0
|
||||
golang.org/x/sys v0.28.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.27.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.16 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.16 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.21 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.54.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.28.10 // indirect
|
||||
github.com/aws/smithy-go v1.20.2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2 v1.32.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/config v1.28.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.48 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 // 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.26 // 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.4.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 // 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.4 // indirect
|
||||
github.com/ganigeorgiev/fexpr v0.4.0 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.7 // 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.12.4 // 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/jmespath/go-jmespath v0.4.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-isatty v0.0.20 // indirect
|
||||
github.com/mattn/go-sqlite3 v1.14.22 // 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/pocketbase/dbx v1.11.0 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/spf13/cast v1.6.0 // indirect
|
||||
github.com/spf13/cobra v1.8.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.37.0 // indirect
|
||||
golang.org/x/crypto v0.23.0 // indirect
|
||||
golang.org/x/image v0.16.0 // indirect
|
||||
golang.org/x/net v0.25.0 // indirect
|
||||
golang.org/x/oauth2 v0.20.0 // indirect
|
||||
golang.org/x/sync v0.7.0 // indirect
|
||||
golang.org/x/term v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
||||
google.golang.org/api v0.182.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
|
||||
google.golang.org/grpc v1.64.0 // indirect
|
||||
google.golang.org/protobuf v1.34.1 // indirect
|
||||
modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b // indirect
|
||||
modernc.org/libc v1.50.9 // indirect
|
||||
modernc.org/mathutil v1.6.0 // indirect
|
||||
gocloud.dev v0.40.0 // indirect
|
||||
golang.org/x/crypto v0.31.0 // indirect
|
||||
golang.org/x/image v0.23.0 // indirect
|
||||
golang.org/x/net v0.33.0 // indirect
|
||||
golang.org/x/oauth2 v0.24.0 // indirect
|
||||
golang.org/x/sync v0.10.0 // indirect
|
||||
golang.org/x/term v0.27.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.214.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8 // indirect
|
||||
google.golang.org/grpc v1.69.2 // indirect
|
||||
google.golang.org/protobuf v1.36.1 // indirect
|
||||
modernc.org/gc/v3 v3.0.0-20241223112719-96e2e1e4408d // indirect
|
||||
modernc.org/libc v1.55.3 // indirect
|
||||
modernc.org/mathutil v1.7.1 // indirect
|
||||
modernc.org/memory v1.8.0 // indirect
|
||||
modernc.org/sqlite v1.29.10 // indirect
|
||||
modernc.org/sqlite v1.34.4 // indirect
|
||||
modernc.org/strutil v1.2.0 // indirect
|
||||
modernc.org/token v1.1.0 // indirect
|
||||
)
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.112.2 h1:ZaGT6LiG7dBzi6zNOvVZwacaXlmf3lRqnC4DQzqyRQw=
|
||||
cloud.google.com/go v0.112.2/go.mod h1:iEqjp//KquGIJV/m+Pk3xecgKNhV+ry+vVTsy4TbDms=
|
||||
cloud.google.com/go v0.114.0 h1:OIPFAdfrFDFO2ve2U7r/H5SwSbBzEdrBdE7xkgwc+kY=
|
||||
cloud.google.com/go/auth v0.4.1 h1:Z7YNIhlWRtrnKlZke7z3GMqzvuYzdc2z98F9D1NV5Hg=
|
||||
cloud.google.com/go/auth v0.4.1/go.mod h1:QVBuVEKpCn4Zp58hzRGvL0tjRGU0YqdRTdCHM1IHnro=
|
||||
cloud.google.com/go/auth v0.4.2 h1:sb0eyLkhRtpq5jA+a8KWw0W70YcdVca7KJ8TM0AFYDg=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q=
|
||||
cloud.google.com/go/compute v1.25.0 h1:H1/4SqSUhjPFE7L5ddzHOfY2bCAvjwNRZPNl6Ni5oYU=
|
||||
cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU=
|
||||
cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
|
||||
cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
|
||||
cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc=
|
||||
cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI=
|
||||
cloud.google.com/go/storage v1.39.1 h1:MvraqHKhogCOTXTlct/9C3K3+Uy2jBmFYb3/Sp6dVtY=
|
||||
cloud.google.com/go/storage v1.39.1/go.mod h1:xK6xZmxZmo+fyP7+DEF6FhNc24/JAe95OLyOHCXFH1o=
|
||||
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.13.0 h1:8Fu8TZy167JkW8Tj3q7dIkr2v4cndv41ouecJx0PAHs=
|
||||
cloud.google.com/go/auth v0.13.0/go.mod h1:COOjD9gwfKNKz+IIduatIhYJQIc0mG3H102r/EMxX6Q=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU=
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8=
|
||||
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=
|
||||
cloud.google.com/go/storage v1.43.0/go.mod h1:ajvxEa7WmZS1PxvKRq4bq0tFT3vMd502JwstCcYv0Q0=
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
|
||||
@@ -25,80 +21,50 @@ github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDe
|
||||
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/aws/aws-sdk-go v1.51.11 h1:El5VypsMIz7sFwAAj/j06JX9UGs4KAbAIEaZ57bNY4s=
|
||||
github.com/aws/aws-sdk-go v1.51.11/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
|
||||
github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA=
|
||||
github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
|
||||
github.com/aws/aws-sdk-go-v2 v1.27.0 h1:7bZWKoXhzI+mMR/HjdMx8ZCC5+6fY0lS5tr0bbgiLlo=
|
||||
github.com/aws/aws-sdk-go-v2 v1.27.0/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.13 h1:WbKW8hOzrWoOA/+35S5okqO/2Ap8hkkFUzoW8Hzq24A=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.13/go.mod h1:XLiyiTMnguytjRER7u5RIkhIqS8Nyz41SwAWb4xEjxs=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.16 h1:knpCuH7laFVGYTNd99Ns5t+8PuRjDn4HnnZK48csipM=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.16/go.mod h1:vutqgRhDUktwSge3hrC3nkuirzkJ4E/mLj5GvI0BQas=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.13 h1:XDCJDzk/u5cN7Aple7D/MiAhx1Rjo/0nueJ0La8mRuE=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.13/go.mod h1:FMNcjQrmuBYvOTZDtOLCIu0esmxjF7RuA/89iSXWzQI=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.16 h1:7d2QxY83uYl0l58ceyiSpxg9bSbStqBC6BeEeHEchwo=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.16/go.mod h1:Ae6li/6Yc6eMzysRL2BXlPYvnrLLBg3D11/AmOjw50k=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 h1:FVJ0r5XTHSmIHJV6KuDmdYhEpvlHpiSd38RQWhut5J4=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1/go.mod h1:zusuAeqezXzAB24LGuzuekqMAEgWkVYukBec3kr3jUg=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 h1:dQLK4TjtnlRGb0czOht2CevZ5l6RSyRWAnKeGd7VAFE=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3/go.mod h1:TL79f2P6+8Q7dTsILpiVST+AL9lkF6PPGI167Ny0Cjw=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.17 h1:9b1Os1s11mF5qTIKLgSsyPG810di2+ySSLIIt9bwe9I=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.17/go.mod h1:9Wp7tDOMhv0+sb/FTRAkbHNQ7abYDnoJRzm5AAtCnTc=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.21 h1:1v8Ii0MRVGYB/sdhkbxrtolCA7Tp+lGh+5OJTs5vmZ8=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.16.21/go.mod h1:cxdd1rc8yxCjKz28hi30XN1jDXr2DxZvD44vLxTz/bg=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 h1:lf/8VTF2cM+N4SLzaYJERKEWAXq8MOMpZfU6wEPWsPk=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7/go.mod h1:4SjkU7QiqK2M9oozyMzfZ/23LmUY+h3oFqhdeP5OMiI=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 h1:4OYVp0705xu8yjdyoWix0r9wPIRXnIzzOoUpQVHIJ/g=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7/go.mod h1:vd7ESTEvI76T2Na050gODNmNU7+OyKrIKroYTu4ABiI=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 h1:81KE7vaZzrl7yHBYHVEzYB8sypz11NMOZ40YlWvPxsU=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5/go.mod h1:LIt2rg7Mcgn09Ygbdh/RdIm0rQ+3BNkbP1gyVMFtRK0=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7 h1:/FUtT3xsoHO3cfh+I/kCbcMCN98QZRsiFet/V8QkWSs=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.7/go.mod h1:MaCAgWpGooQoCWZnMur97rGn5dp350w2+CeiV5406wE=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 h1:ZMeFZ5yk+Ek+jNr1+uwCd2tG89t6oTS5yVWpa6yy2es=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7/go.mod h1:mxV05U+4JiHqIpGqqYXOHLPKUC6bDXC44bsUhNjOEwY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9 h1:UXqEWQI0n+q0QixzU0yUUQBZXRd5037qdInTIHFTl98=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.9/go.mod h1:xP6Gq6fzGZT8w/ZN+XvGMZ2RU1LeEs7b2yUP5DN8NY4=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 h1:Wx0rlZoEJR7JwlSZcHnEa7CNjrSIyVxMFWGAaXy4fJY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9/go.mod h1:aVMHdE0aHO3v+f/iw01fmXV/5DbfQ3Bi9nN7nd9bE9Y=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 h1:f9RyWNtS8oH7cZlbn+/JNPpjUk5+5fLd5lM9M0i49Ys=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5/go.mod h1:h5CoMZV2VF297/VLhRhO1WF+XYWOzXo+4HsObA4HjBQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7 h1:uO5XR6QGBcmPyo2gxofYJLFkcVQ4izOoGDNenlZhTEk=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.7/go.mod h1:feeeAYfAcwTReM6vbwjEyDmiGho+YgBhaFULuXDW8kc=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.53.2 h1:rq2hglTQM3yHZvOPVMtNvLS5x6hijx7JvRDgKiTNDGQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.53.2/go.mod h1:qmdkIIAC+GCLASF7R2whgNrJADz0QZPX+Seiw/i4S3o=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.54.3 h1:57NtjG+WLims0TxIQbjTqebZUKDM03DfM11ANAekW0s=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.54.3/go.mod h1:739CllldowZiPPsDFcJHNF4FXrVxaSGVnZ9Ez9Iz9hc=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.20.6 h1:o5cTaeunSpfXiLTIBx5xo2enQmiChtu1IBbzXnfU9Hs=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.20.6/go.mod h1:qGzynb/msuZIE8I75DVRCUXw3o3ZyBmUvMwQ2t/BrGM=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.20.9 h1:aD7AGQhvPuAxlSUfo0CWU7s6FpkbyykMhGYMvlqTjVs=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.20.9/go.mod h1:c1qtZUWtygI6ZdvKppzCSXsDOq5I4luJPZ0Ud3juFCA=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.0 h1:Qe0r0lVURDDeBQJ4yP+BOrJkvkiCo/3FH/t+wY11dmw=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.0/go.mod h1:mUYPBhaF2lGiukDEjJX2BLRRKTmoUSitGDUgM4tRxak=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3 h1:Pav5q3cA260Zqez42T9UhIlsd9QeypszRPwC9LdSSsQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.3/go.mod h1:9lmoVDVLz/yUZwLaQ676TK02fhCu4+PgRSmMaKR1ozk=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.28.7 h1:et3Ta53gotFR4ERLXXHIHl/Uuk1qYpP5uU7cvNql8ns=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.28.7/go.mod h1:FZf1/nKNEkHdGGJP/cI2MoIMquumuRK6ol3QQJNDxmw=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.28.10 h1:69tpbPED7jKPyzMcrwSvhWcJ9bPnZsZs18NT40JwM0g=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.28.10/go.mod h1:0Aqn1MnEuitqfsCNyKsdKLhDUOr4txD/g19EfiUqgws=
|
||||
github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q=
|
||||
github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=
|
||||
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.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw=
|
||||
github.com/aws/aws-sdk-go-v2 v1.32.7/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.28.7 h1:GduUnoTXlhkgnxTD93g1nv4tVPILbdNQOzav+Wpg7AE=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.28.7/go.mod h1:vZGX6GVkIE8uECSUHB6MWAUsd4ZcG2Yq/dMa4refR3M=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.48 h1:IYdLD1qTJ0zanRavulofmqut4afs45mOWEI+MzZtTfQ=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.48/go.mod h1:tOscxHN3CGmuX9idQ3+qbkzrjVIx32lqDSU1/0d/qXs=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44 h1:2zxMLXLedpB4K1ilbJFxtMKsVKaexOqDttOhc0QGm3Q=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.44/go.mod h1:VuLHdqwjSvgftNC7yqPWyGVhEwPmJpeRi07gOgOfHF8=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 h1:I/5wmGMffY4happ8NOCuIUEWGUvvFp5NSeQcXl9RHcI=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26/go.mod h1:FR8f4turZtNy6baO0KJ5FJUmXH/cSkI9fOngs0yl6mA=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 h1:zXFLuEuMMUOvEARXFUVJdfqZ4bvvSgdGRq/ATcrQxzM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26/go.mod h1:3o2Wpy0bogG1kyOPrgkXA8pgIfEEv0+m19O9D5+W8y8=
|
||||
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.26 h1:GeNJsIFHB+WW5ap2Tec4K6dzcVTsRbsT1Lra46Hv9ME=
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26/go.mod h1:zfgMpwHDXX2WGoG84xG2H+ZlPTkJUU4YUvx2svLQYWo=
|
||||
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.4.7 h1:tB4tNw83KcajNAzaIMhkhVI2Nt8fAZd5A5ro113FEMY=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7/go.mod h1:lvpyBGkZ3tZ9iSsUIcC2EWp+0ywa7aK3BLT+FwZi+mQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQzZHqe/3FE+cqwfH+0p5Jo8PFM/QYQSmeZ+M=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 h1:CvuUmnXI7ebaUAhbJcDy9YQx8wHR69eZ9I7q5hszt/g=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.24.8/go.mod h1:XDeGv1opzwm8ubxddF0cgqkZWsyOtw4lr6dxwmb6YQg=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 h1:F2rBfNAL5UyswqoeWv9zs74N/NanhK16ydHW1pahX6E=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7/go.mod h1:JfyQ0g2JG8+Krq0EuZNnRwX0mU0HrwY/tG6JNfcqh4k=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 h1:Xgv/hyNgvLda/M9l9qxXc4UFSgppnRczLxlMs5Ae/QY=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.33.3/go.mod h1:5Gn+d+VaaRgsjewpMvGazt0WfcFO+Md4wLOuBfGR9Bc=
|
||||
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=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
|
||||
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -114,39 +80,31 @@ 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.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
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.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
|
||||
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
|
||||
github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I=
|
||||
github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s=
|
||||
github.com/ganigeorgiev/fexpr v0.4.0 h1:ojitI+VMNZX/odeNL1x3RzTTE8qAIVvnSSYPNAnQFDI=
|
||||
github.com/ganigeorgiev/fexpr v0.4.0/go.mod h1:RyGiGqmeXhEQ6+mlGdnUleLHgtzzu/VGO2WtJkF5drE=
|
||||
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
||||
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA=
|
||||
github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU=
|
||||
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=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es=
|
||||
github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew=
|
||||
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-sql-driver/mysql v1.8.0 h1:UtktXaU2Nb64z/pLiGIxY4431SJ4/dR5cjMmlVHgnT4=
|
||||
github.com/go-sql-driver/mysql v1.8.0/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
|
||||
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||
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/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/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=
|
||||
@@ -170,19 +128,19 @@ 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-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo=
|
||||
github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw=
|
||||
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
|
||||
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
|
||||
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.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=
|
||||
github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=
|
||||
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=
|
||||
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.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
|
||||
github.com/googleapis/gax-go/v2 v2.12.4 h1:9gWcmF85Wvq4ryPFvGFaOgPIs1AQX0d0bcbGw4Z96qg=
|
||||
github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI=
|
||||
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.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=
|
||||
@@ -191,8 +149,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/josharian/native v1.0.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
|
||||
github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA=
|
||||
github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w=
|
||||
@@ -202,8 +158,6 @@ 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=
|
||||
@@ -211,8 +165,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
|
||||
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.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/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=
|
||||
@@ -232,12 +184,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.12 h1:2wWcs2yoyA3OkbW9cxFShemzchOh3eHFr1e8QvLy5is=
|
||||
github.com/pocketbase/pocketbase v0.22.12/go.mod h1:yY/3IGi1tUbcI6yGVFspAyKi/IDHCntdYk4IAP32UF0=
|
||||
github.com/prometheus-community/pro-bing v0.4.0 h1:YMbv+i08gQz97OZZBwLyvmmQEEzyfyrrjEaAchdy3R4=
|
||||
github.com/prometheus-community/pro-bing v0.4.0/go.mod h1:b7wRYZtCcPmt4Sz319BykUU241rWLe1VFXyiyWK/dH4=
|
||||
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.23.12 h1:HB4THFbzaliF0C3wvpx+kNOZxIwCEMDqN3/17gn5N7E=
|
||||
github.com/pocketbase/pocketbase v0.23.12/go.mod h1:OcFJNMO0Vzt3f9+lweMbup6iL7V13ckxu1pdEY6FeM0=
|
||||
github.com/prometheus-community/pro-bing v0.5.0 h1:Fq+4BUXKIvsPtXUY8K+04ud9dkAuFozqGmRAyNUpffY=
|
||||
github.com/prometheus-community/pro-bing v0.5.0/go.mod h1:1joR9oXdMEAcAJJvhs+8vNDvTg5thfAZcRFhcUozG2g=
|
||||
github.com/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=
|
||||
@@ -246,10 +198,10 @@ 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.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
|
||||
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
|
||||
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=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
@@ -262,40 +214,40 @@ 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=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
|
||||
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
|
||||
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
|
||||
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
|
||||
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
|
||||
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
|
||||
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
|
||||
gocloud.dev v0.37.0 h1:XF1rN6R0qZI/9DYjN16Uy0durAmSlf58DHOcb28GPro=
|
||||
gocloud.dev v0.37.0/go.mod h1:7/O4kqdInCNsc6LqgmuFnS0GRew4XNNYWpA44yQnwco=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc=
|
||||
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.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.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
|
||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
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.16.0 h1:9kloLAKhUufZhA12l5fwnx2NZW39/we1UhBesW433jw=
|
||||
golang.org/x/image v0.16.0/go.mod h1:ugSZItdV4nOxyqp56HmXwH0Ry0nBCpjnZdpDaIHdoPs=
|
||||
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.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
|
||||
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
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=
|
||||
@@ -308,18 +260,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.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
|
||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
|
||||
golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
|
||||
golang.org/x/oauth2 v0.24.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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||
golang.org/x/sync v0.7.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=
|
||||
@@ -334,21 +286,21 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
|
||||
golang.org/x/sys v0.28.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.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
|
||||
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
|
||||
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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||
golang.org/x/time v0.5.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.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
|
||||
golang.org/x/time v0.8.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=
|
||||
@@ -356,39 +308,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.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw=
|
||||
golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc=
|
||||
golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
|
||||
golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
|
||||
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-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
|
||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
|
||||
google.golang.org/api v0.180.0 h1:M2D87Yo0rGBPWpo1orwfCLehUUL6E7/TYe5gvMQWDh4=
|
||||
google.golang.org/api v0.180.0/go.mod h1:51AiyoEg1MJPSZ9zvklA8VnRILPXxn1iVen9v25XHAE=
|
||||
google.golang.org/api v0.182.0 h1:if5fPvudRQ78GeRx3RayIoiuV7modtErPIZC/T2bIvE=
|
||||
google.golang.org/api v0.182.0/go.mod h1:cGhjy4caqA5yXRzEhkHI8Y9mfyC2VLTlER2l08xaqtM=
|
||||
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.214.0 h1:h2Gkq07OYi6kusGOaT/9rnNljuXmqPnaig7WGPmKbwA=
|
||||
google.golang.org/api v0.214.0/go.mod h1:bYPpLG8AyeMWwDU6NXoB00xC0DFkikVvd5MfwoxjLqE=
|
||||
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-20240311173647-c811ad7063a7 h1:ImUcDPHjTrAqNhlOkSocDLfG9rrNHH7w7uoKWPaWZ8s=
|
||||
google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7/go.mod h1:/3XmxOjePkvmKrHuBy4zNFw7IzxJXtAgdpXi8Ll990U=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240415180920-8c6c420018be h1:Zz7rLWqp0ApfsR/l7+zSHhY3PMiH2xqgxlfYfAfNpoU=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240415180920-8c6c420018be/go.mod h1:dvdCTIoAGbkWbcIKBniID56/7XHTt6WfxXNMxuziJ+w=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240509183442-62759503f434 h1:umK/Ey0QEzurTNlsV3R+MfxHAb78HCEX/IkuR+zH4WQ=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240509183442-62759503f434/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
|
||||
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-20241223144023-3abc09e42ca8 h1:TqExAhdPaB60Ux47Cn0oLV07rGnxZzIsaRhQaqS666A=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241223144023-3abc09e42ca8/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA=
|
||||
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.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
|
||||
google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
|
||||
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
|
||||
google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
|
||||
google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU=
|
||||
google.golang.org/grpc v1.69.2/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=
|
||||
@@ -398,45 +344,37 @@ 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.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
||||
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
|
||||
google.golang.org/protobuf v1.36.1/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.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
modernc.org/cc/v4 v4.21.0 h1:D/gLKtcztomvWbsbvBKo3leKQv+86f+DdqEZBBXhnag=
|
||||
modernc.org/cc/v4 v4.21.0/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ=
|
||||
modernc.org/cc/v4 v4.21.2 h1:dycHFB/jDc3IyacKipCNSDrjIC0Lm1hyoWOZTRR20Lk=
|
||||
modernc.org/ccgo/v4 v4.17.3 h1:t2CQci84jnxKw3GGnHvjGKjiNZeZqyQx/023spkk4hU=
|
||||
modernc.org/ccgo/v4 v4.17.3/go.mod h1:1FCbAtWYJoKuc+AviS+dH+vGNtYmFJqBeRWjmnDWsIg=
|
||||
modernc.org/ccgo/v4 v4.17.8 h1:yyWBf2ipA0Y9GGz/MmCmi3EFpKgeS7ICrAFes+suEbs=
|
||||
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.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.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw=
|
||||
modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU=
|
||||
modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b h1:BnN1t+pb1cy61zbvSUV7SeI0PwosMhlAEi/vBY4qxp8=
|
||||
modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4=
|
||||
modernc.org/libc v1.50.5 h1:ZzeUd0dIc/sUtoPTCYIrgypkuzoGzNu6kbEWj2VuEmk=
|
||||
modernc.org/libc v1.50.5/go.mod h1:rhzrUx5oePTSTIzBgM0mTftwWHK8tiT9aNFUt1mldl0=
|
||||
modernc.org/libc v1.50.9 h1:hIWf1uz55lorXQhfoEoezdUHjxzuO6ceshET/yWjSjk=
|
||||
modernc.org/libc v1.50.9/go.mod h1:15P6ublJ9FJR8YQCGy8DeQ2Uwur7iW9Hserr/T3OFZE=
|
||||
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
|
||||
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
|
||||
modernc.org/gc/v3 v3.0.0-20241223112719-96e2e1e4408d h1:d0JExN5U5FjUVHCP6L9DIlLJBZveR6KUM4AvfDUL3+k=
|
||||
modernc.org/gc/v3 v3.0.0-20241223112719-96e2e1e4408d/go.mod h1:qBSLm/exCqouT2hrfyTKikWKG9IPq8EoX5fS00l3jqk=
|
||||
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.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E=
|
||||
modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU=
|
||||
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.29.9 h1:9RhNMklxJs+1596GNuAX+O/6040bvOwacTxuFcRuQow=
|
||||
modernc.org/sqlite v1.29.9/go.mod h1:ItX2a1OVGgNsFh6Dv60JQvGfJfTPHPVpV6DF59akYOA=
|
||||
modernc.org/sqlite v1.29.10 h1:3u93dz83myFnMilBGCOLbr+HjklS6+5rJLx4q86RDAg=
|
||||
modernc.org/sqlite v1.29.10/go.mod h1:ItX2a1OVGgNsFh6Dv60JQvGfJfTPHPVpV6DF59akYOA=
|
||||
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.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
|
||||
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
|
||||
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
type Device struct {
|
||||
@@ -17,7 +17,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 +49,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 +60,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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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 := 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 := 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 := 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 := 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 := 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 := 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 := 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 := 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 := 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 := 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 := 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 := 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 := 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 := App.FindAllRecords("settings_private")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -215,5 +214,5 @@ func HandlerScan(c echo.Context) error {
|
||||
res.Devices = append(res.Devices, dev)
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, res)
|
||||
return e.JSON(http.StatusOK, res)
|
||||
}
|
||||
|
||||
@@ -3,34 +3,34 @@ package pb
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
"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",
|
||||
res, err := App.FindFirstRecordByFilter("permissions",
|
||||
fmt.Sprintf("user.id = '%s' && power.id ?= '%s'", user.Id, deviceId))
|
||||
if res == nil || err != nil {
|
||||
return apis.NewForbiddenError("You are not allowed to perform this request.", nil)
|
||||
}
|
||||
|
||||
return next(c)
|
||||
}
|
||||
return e.Next()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,15 +3,12 @@ package pb
|
||||
import (
|
||||
"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"
|
||||
@@ -61,58 +58,14 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
})
|
||||
|
||||
// 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(),
|
||||
},
|
||||
})
|
||||
|
||||
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(),
|
||||
},
|
||||
})
|
||||
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())
|
||||
|
||||
if err := importSettings(); err != nil {
|
||||
return err
|
||||
@@ -130,14 +83,14 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
// 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)
|
||||
} 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")
|
||||
@@ -164,10 +117,10 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return nil
|
||||
return se.Next()
|
||||
})
|
||||
|
||||
App.OnModelAfterCreate().Add(func(e *core.ModelEvent) error {
|
||||
App.OnModelAfterCreateSuccess().BindFunc(func(e *core.ModelEvent) error {
|
||||
if e.Model.TableName() == "_admins" {
|
||||
if err := setSetupCompleted(); err != nil {
|
||||
logger.Error.Println(err)
|
||||
@@ -176,11 +129,11 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
return nil
|
||||
} 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,7 +143,7 @@ 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
|
||||
}
|
||||
@@ -198,7 +151,7 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
App.OnModelAfterDelete().Add(func(e *core.ModelEvent) error {
|
||||
App.OnModelAfterDeleteSuccess().BindFunc(func(e *core.ModelEvent) error {
|
||||
if e.Model.TableName() == "_admins" {
|
||||
if err := setSetupCompleted(); err != nil {
|
||||
logger.Error.Println(err)
|
||||
@@ -208,7 +161,7 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
return nil
|
||||
})
|
||||
|
||||
App.OnTerminate().Add(func(e *core.TerminateEvent) error {
|
||||
App.OnTerminate().BindFunc(func(e *core.TerminateEvent) error {
|
||||
cronjobs.StopAll()
|
||||
return nil
|
||||
})
|
||||
@@ -219,28 +172,28 @@ func StartPocketBase(distDirFS fs.FS) {
|
||||
}
|
||||
|
||||
func importSettings() error {
|
||||
settingsPrivateRecords, err := App.Dao().FindRecordsByExpr("settings_private")
|
||||
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,10 +219,10 @@ 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 {
|
||||
@@ -282,13 +235,13 @@ func importSettings() error {
|
||||
}
|
||||
|
||||
func resetDeviceStates() error {
|
||||
devices, err := App.Dao().FindRecordsByExpr("devices")
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -296,11 +249,11 @@ func resetDeviceStates() error {
|
||||
}
|
||||
|
||||
func setSetupCompleted() error {
|
||||
totalAdmins, err := App.Dao().TotalAdmins()
|
||||
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 +262,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,4 +1,3 @@
|
||||
version: "3"
|
||||
services:
|
||||
upsnap:
|
||||
container_name: upsnap
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
version: "3"
|
||||
services:
|
||||
upsnap:
|
||||
container_name: upsnap
|
||||
image: ghcr.io/seriousm4x/upsnap:4
|
||||
image: ghcr.io/seriousm4x/upsnap:4 # images are also available on docker hub: seriousm4x/upsnap:4
|
||||
network_mode: host
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1,4 +1 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
cd frontend && npx lint-staged
|
||||
|
||||
@@ -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/']
|
||||
}
|
||||
];
|
||||
@@ -9,47 +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.3.0",
|
||||
"@sveltejs/adapter-static": "^3.0.1",
|
||||
"@sveltejs/kit": "^2.5.10",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.1.1",
|
||||
"@typescript-eslint/eslint-plugin": "^7.11.0",
|
||||
"@typescript-eslint/parser": "^7.11.0",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"daisyui": "^4.11.1",
|
||||
"eslint": "^8.57.0",
|
||||
"@eslint/compat": "^1.2.4",
|
||||
"@eslint/js": "^9.17.0",
|
||||
"@sveltejs/adapter-static": "^3.0.8",
|
||||
"@sveltejs/kit": "^2.15.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"daisyui": "^4.12.23",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-svelte": "^2.39.0",
|
||||
"husky": "^9.0.11",
|
||||
"postcss": "^8.4.38",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-plugin-svelte": "^3.2.3",
|
||||
"prettier-plugin-tailwindcss": "^0.5.14",
|
||||
"svelte": "^4.2.17",
|
||||
"svelte-check": "^3.8.0",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.4.5",
|
||||
"typescript-eslint": "^7.11.0",
|
||||
"vite": "^5.2.12"
|
||||
"eslint-plugin-svelte": "^2.46.1",
|
||||
"globals": "^15.14.0",
|
||||
"husky": "^9.1.7",
|
||||
"postcss": "^8.4.49",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-svelte": "^3.3.2",
|
||||
"prettier-plugin-tailwindcss": "^0.6.9",
|
||||
"svelte": "^4.2.19",
|
||||
"svelte-check": "^4.1.1",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"tslib": "^2.8.1",
|
||||
"typescript": "^5.7.2",
|
||||
"typescript-eslint": "^8.18.2",
|
||||
"vite": "^5.4.11"
|
||||
},
|
||||
"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.5.2",
|
||||
"date-fns": "^3.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.2",
|
||||
"svelte-fa": "^4.0.2",
|
||||
"pocketbase": "^0.24.0",
|
||||
"svelte-fa": "^4.0.3",
|
||||
"svelte-french-toast": "^1.2.0",
|
||||
"theme-change": "^2.5.0",
|
||||
"typesafe-i18n": "^5.26.2"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="manifest" href="/manifest.webmanifest" />
|
||||
%sveltekit.head%
|
||||
<script>
|
||||
const darkTheme = 'dark';
|
||||
|
||||
@@ -11,14 +11,18 @@
|
||||
faPen,
|
||||
faRotateLeft
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import cronParser from 'cron-parser';
|
||||
import type { Locale } from 'date-fns';
|
||||
import { formatDistance, parseISO } from 'date-fns';
|
||||
import { formatDistance, formatRelative, parseISO } from 'date-fns';
|
||||
import { de } from 'date-fns/locale/de';
|
||||
import { enUS } from 'date-fns/locale/en-US';
|
||||
import { es } from 'date-fns/locale/es';
|
||||
import { fr } from 'date-fns/locale/fr';
|
||||
import { it } from 'date-fns/locale/it';
|
||||
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';
|
||||
import Fa from 'svelte-fa';
|
||||
import toast from 'svelte-french-toast';
|
||||
import { scale } from 'svelte/transition';
|
||||
@@ -26,19 +30,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
|
||||
},
|
||||
@@ -47,7 +51,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 !== ''
|
||||
}
|
||||
@@ -81,10 +85,18 @@
|
||||
case 'fr-FR':
|
||||
dateFnsLocale = fr;
|
||||
break;
|
||||
case 'it':
|
||||
case 'it-IT':
|
||||
dateFnsLocale = it;
|
||||
break;
|
||||
case 'es':
|
||||
case 'es-ES':
|
||||
dateFnsLocale = es;
|
||||
break;
|
||||
case 'nl':
|
||||
case 'nl-NL':
|
||||
dateFnsLocale = nl;
|
||||
break;
|
||||
case 'pt':
|
||||
case 'pt-PT':
|
||||
dateFnsLocale = pt;
|
||||
@@ -93,6 +105,9 @@
|
||||
case 'zh-CN':
|
||||
dateFnsLocale = zhCN;
|
||||
break;
|
||||
case 'zh-TW':
|
||||
dateFnsLocale = zhTW;
|
||||
break;
|
||||
default:
|
||||
dateFnsLocale = enUS;
|
||||
break;
|
||||
@@ -119,6 +134,13 @@
|
||||
toast.error(err.message);
|
||||
});
|
||||
}
|
||||
|
||||
function getNextCronRelativeTime(expression: string, now: number) {
|
||||
const cron = cronParser.parseExpression(expression);
|
||||
return formatRelative(cron.next().toISOString(), now, {
|
||||
locale: dateFnsLocale
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="card rounded-3xl bg-base-300 shadow-md" transition:scale={{ delay: 0, duration: 200 }}>
|
||||
@@ -135,18 +157,21 @@
|
||||
<DeviceCardNic {device} />
|
||||
</ul>
|
||||
{#if device.wake_cron_enabled || device.shutdown_cron_enabled || device.password}
|
||||
<div class="flex flex-row flex-wrap gap-2">
|
||||
<div class="mt-1 flex flex-row flex-wrap gap-2">
|
||||
{#if device.wake_cron_enabled}
|
||||
<div class="tooltip" data-tip={$LL.device.card_tooltip_wake_cron()}>
|
||||
<span class="badge badge-success gap-1 p-3"
|
||||
><Fa icon={faCircleArrowUp} />{device.wake_cron}</span
|
||||
><Fa icon={faCircleArrowUp} />{getNextCronRelativeTime(device.wake_cron, now)}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
{#if device.shutdown_cron_enabled}
|
||||
<div class="tooltip" data-tip={$LL.device.card_tooltip_shutdown_cron()}>
|
||||
<span class="badge badge-error gap-1 p-3"
|
||||
><Fa icon={faCircleArrowDown} />{device.shutdown_cron}</span
|
||||
><Fa icon={faCircleArrowDown} />{getNextCronRelativeTime(
|
||||
device.shutdown_cron,
|
||||
now
|
||||
)}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -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 {
|
||||
@@ -51,9 +51,10 @@
|
||||
Authorization: $pocketbase.authStore.token
|
||||
}
|
||||
})
|
||||
.then(async (data) => {
|
||||
const dev = (await data.json()) as Device;
|
||||
countdown(Date.parse(dev.updated));
|
||||
.then((resp) => resp.json())
|
||||
.then((data) => {
|
||||
device = data as Device;
|
||||
countdown(Date.parse(device.updated));
|
||||
})
|
||||
.catch((err) => {
|
||||
toast.error(err.message);
|
||||
@@ -66,9 +67,10 @@
|
||||
Authorization: $pocketbase.authStore.token
|
||||
}
|
||||
})
|
||||
.then(async (data) => {
|
||||
const dev = (await data.json()) as Device;
|
||||
countdown(Date.parse(dev.updated));
|
||||
.then((resp) => resp.json())
|
||||
.then((data) => {
|
||||
device = data as Device;
|
||||
countdown(Date.parse(device.updated));
|
||||
})
|
||||
.catch((err) => {
|
||||
toast.error(err.message);
|
||||
@@ -89,9 +91,17 @@
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,15 @@
|
||||
}
|
||||
})
|
||||
);
|
||||
device.ip = device.ip.replaceAll(' ', '');
|
||||
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) {
|
||||
@@ -53,7 +60,9 @@
|
||||
}
|
||||
|
||||
async function createDevice(device: Device) {
|
||||
device.created_by = $pocketbase.authStore.isAdmin ? '' : $pocketbase.authStore.model?.id ?? '';
|
||||
device.created_by = $pocketbase.authStore.isSuperuser
|
||||
? ''
|
||||
: ($pocketbase.authStore.record?.id ?? '');
|
||||
$pocketbase
|
||||
.collection('devices')
|
||||
.create(device)
|
||||
@@ -231,7 +240,7 @@
|
||||
<input
|
||||
id="device-netmask"
|
||||
type="text"
|
||||
placeholder="255.255.255.255"
|
||||
placeholder="255.255.255.0"
|
||||
class="input w-full max-w-xs"
|
||||
bind:value={device.netmask}
|
||||
required
|
||||
@@ -619,7 +628,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>
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -18,10 +18,15 @@ export type Locales =
|
||||
| 'es-ES'
|
||||
| 'fr'
|
||||
| 'fr-FR'
|
||||
| 'it'
|
||||
| 'it-IT'
|
||||
| 'nl'
|
||||
| 'nl-NL'
|
||||
| 'pt'
|
||||
| 'pt-PT'
|
||||
| 'zh'
|
||||
| 'zh-CN';
|
||||
| 'zh-CN'
|
||||
| 'zh-TW';
|
||||
|
||||
export type Translation = RootTranslation;
|
||||
|
||||
|
||||
@@ -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';
|
||||
@@ -14,10 +13,15 @@ const localeTranslationLoaders = {
|
||||
'es-ES': () => import('./es-ES'),
|
||||
fr: () => import('./fr'),
|
||||
'fr-FR': () => import('./fr-FR'),
|
||||
it: () => import('./it'),
|
||||
'it-IT': () => import('./it-IT'),
|
||||
nl: () => import('./nl'),
|
||||
'nl-NL': () => import('./nl-NL'),
|
||||
pt: () => import('./pt'),
|
||||
'pt-PT': () => import('./pt-PT'),
|
||||
zh: () => import('./zh'),
|
||||
'zh-CN': () => import('./zh-CN')
|
||||
'zh-CN': () => import('./zh-CN'),
|
||||
'zh-TW': () => import('./zh-TW')
|
||||
};
|
||||
|
||||
const updateDictionary = (locale: Locales, dictionary: Partial<Translations>): Translations =>
|
||||
|
||||
@@ -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';
|
||||
@@ -13,10 +12,15 @@ import es from './es';
|
||||
import es_ES from './es-ES';
|
||||
import fr from './fr';
|
||||
import fr_FR from './fr-FR';
|
||||
import it from './it';
|
||||
import it_IT from './it-IT';
|
||||
import nl from './nl';
|
||||
import nl_NL from './nl-NL';
|
||||
import pt from './pt';
|
||||
import pt_PT from './pt-PT';
|
||||
import zh from './zh';
|
||||
import zh_CN from './zh-CN';
|
||||
import zh_TW from './zh-TW';
|
||||
|
||||
const localeTranslations = {
|
||||
de,
|
||||
@@ -27,10 +31,15 @@ const localeTranslations = {
|
||||
'es-ES': es_ES,
|
||||
fr,
|
||||
'fr-FR': fr_FR,
|
||||
it,
|
||||
'it-IT': it_IT,
|
||||
nl,
|
||||
'nl-NL': nl_NL,
|
||||
pt,
|
||||
'pt-PT': pt_PT,
|
||||
zh,
|
||||
'zh-CN': zh_CN
|
||||
'zh-CN': zh_CN,
|
||||
'zh-TW': zh_TW
|
||||
};
|
||||
|
||||
export const loadLocale = (locale: Locales): void => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten.
|
||||
/* eslint-disable */
|
||||
|
||||
import {
|
||||
i18n as initI18n,
|
||||
@@ -23,10 +22,15 @@ export const locales: Locales[] = [
|
||||
'es-ES',
|
||||
'fr',
|
||||
'fr-FR',
|
||||
'it',
|
||||
'it-IT',
|
||||
'nl',
|
||||
'nl-NL',
|
||||
'pt',
|
||||
'pt-PT',
|
||||
'zh',
|
||||
'zh-CN'
|
||||
'zh-CN',
|
||||
'zh-TW'
|
||||
];
|
||||
|
||||
export const isLocale = (locale: string): locale is Locales => locales.includes(locale as Locales);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import it from '../it';
|
||||
import type { Translation } from '../i18n-types';
|
||||
|
||||
const it_IT = {
|
||||
...(it as unknown as Translation)
|
||||
} satisfies Translation;
|
||||
|
||||
export default it_IT;
|
||||
@@ -0,0 +1,226 @@
|
||||
import type { BaseTranslation } from '../i18n-types';
|
||||
|
||||
const it = {
|
||||
home: {
|
||||
page_title: 'Home',
|
||||
order_groups: 'Gruppi',
|
||||
order_name: 'Nome',
|
||||
order_ip: 'IP',
|
||||
order_tooltip: 'Ordine',
|
||||
no_devices: 'Nessun dispositivo qui.',
|
||||
add_first_device: 'Aggiungi il tuo primo dispositivo',
|
||||
grant_permissions:
|
||||
"Per favore chiedi all' amministratore di darti i permessi necessari per aggiungere un nuovo dispositivo."
|
||||
},
|
||||
account: {
|
||||
page_title: 'Account',
|
||||
account_type_admin: 'Amministratore',
|
||||
account_type_user: 'Utente',
|
||||
avatar_title: 'Avatar',
|
||||
language_title: 'Lingua',
|
||||
language_option_auto: 'Automatico',
|
||||
change_password_title: 'Cambia password',
|
||||
change_password_body: 'Dopo aver cambiato la password, dovrai effettuare di nuovo il login.',
|
||||
change_password_label: 'Vecchia password',
|
||||
change_password_new: 'Nuova password',
|
||||
change_password_confirm: 'Conferma la password'
|
||||
},
|
||||
device: {
|
||||
page_title: 'Nuovo dispositivo',
|
||||
tabs: ['Manuale', 'Scansiona la rete'],
|
||||
card_btn_more: '...',
|
||||
card_btn_more_edit: 'Modifica',
|
||||
card_btn_more_sleep: 'Dormi',
|
||||
card_btn_more_reboot: 'Riavvia',
|
||||
card_tooltip_wake_cron: 'Sveglia programmata',
|
||||
card_tooltip_shutdown_cron: 'Spegnimento programmato',
|
||||
card_tooltip_wake_password: 'Password sveglia',
|
||||
card_tooltip_last_status_change: 'Ultimo cambiamento di stato',
|
||||
card_password: 'Password',
|
||||
card_nic_tooltip_pending: 'In attesa',
|
||||
card_nic_tooltip_shutdown: 'Spegni',
|
||||
card_nic_tooltip_shutdown_no_cmd: 'Nessun comando di spegnimento impostato',
|
||||
card_nic_tooltip_shutdown_no_permission:
|
||||
'Non hai i permessi necessari per spegnere questo dispositivo',
|
||||
card_nic_tooltip_power: 'Accendi',
|
||||
card_nic_tooltip_power_no_permission:
|
||||
'Non hai i permessi necessari per accendere questo dispositivo',
|
||||
modal_confirm_wake_title: 'Accendere {device}?',
|
||||
modal_confirm_wake_desc: 'Sicuro di voler accendere {device}.',
|
||||
modal_confirm_shutdown_title: 'Spegnere {device}?',
|
||||
modal_confirm_shutdown_desc: 'Sicuro di voler spegnere {device}.',
|
||||
general: 'Generale',
|
||||
general_name: 'Nome',
|
||||
general_name_placeholder: 'Nome dispositivo',
|
||||
general_ip: 'IP',
|
||||
general_mac: 'Mac',
|
||||
general_netmask: 'Maschera di rete',
|
||||
general_required_field: 'Campo obbligatorio',
|
||||
ports: 'Porte',
|
||||
ports_desc: "UpSnap puo' anche controllare che le porte siano aperte.",
|
||||
ports_add_new: 'Aggiungi nuova porta',
|
||||
ports_name: 'Nome',
|
||||
ports_number: 'Numero',
|
||||
link: 'Collegamento',
|
||||
link_desc:
|
||||
'Rende il nome del tuo dispositivo un collegamento, perfetto per collegare ad esempio un sito.',
|
||||
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.',
|
||||
ping_cmd: 'Comando ping personalizzato',
|
||||
wake: 'Accendi',
|
||||
wake_desc: 'Puoi accendere questo dispositivo con una sveglia programmata.',
|
||||
wake_cmd: 'Comando di accensione personalizzato',
|
||||
wake_cron: 'Sveglia programmata',
|
||||
wake_cron_enable: 'Abilita sveglia programmata',
|
||||
sol: 'Sleep-On-LAN',
|
||||
sol_desc1:
|
||||
'Puoi spegnere il tuo dispositivo usando lo strumento <a class="link" href="https://github.com/SR-G/sleep-on-lan" target="_blank">Sleep-On-LAN</a>. Sleep-On-LAN (SOL) e\' uno strumento esterno che opera sul dispositivo che vuoi spegnere, il quale rende disponibile un endpoint REST. Puoi riferirti al link <a href="https://github.com/SR-G/sleep-on-lan#usage" class="link" target="_blank">Uso</a> (in inglese) per le istruzioni.',
|
||||
sol_desc2:
|
||||
"Lo strumento SOL e' configurato per mandare richieste con il protocollo HTTP invece che UDP per abilitare l' autorizzazione e rendere le richieste piu' affidabili",
|
||||
sol_desc3:
|
||||
'Pertanto, assicuratevi di includere <span class="badge">HTTP:<LA-TUA-PORTA></span> nella sezione <span class="badge">Listeners</span> della <a href="https://github.com/SR-G/sleep-on-lan#configuration" class="link" target="_blank">configurazione di SOL</a>.',
|
||||
sol_enable: 'Abilita Sleep-On-LAN',
|
||||
sol_port: 'Porta SOL',
|
||||
sol_authorization: 'Autorizzazione',
|
||||
sol_user: 'Utente SOL',
|
||||
sol_password: 'Password SOL',
|
||||
shutdown: 'Spegni',
|
||||
shutdown_desc:
|
||||
'Questo <strong>prompt dei comandi</strong> girera\' nel tuo container (se usi docker) o direttamente sul tuo host (se usi i file di installazione). Per verificare che funzioni correttamente, puoi eseguire i comandi direttamente nel container o nel tuo sistema host. Alcuni comandi comuni sono <span class="badge">net rpc</span> per windows, <span class="badge">sshpass</span> per linux oppure <span class="badge">curl</span> in generale per fare richieste con HTTP.',
|
||||
shutdown_examples: 'Esempi:',
|
||||
shutdown_examples_windows: 'Spegni macchina windows remota:',
|
||||
shutdown_examples_linux: 'Spegni macchina linux remota:',
|
||||
shutdown_cmd: 'Comando di spegnimento',
|
||||
shutdown_cron_desc:
|
||||
'Settando i parametri esattamente come fareste con cron su linux, potrete cosi anche impostare un azione di spegnimento su questo dispositivo.',
|
||||
shutdown_cron: 'Parametri di spegnimento per cron',
|
||||
shutdown_cron_enable: 'Abilita lo spegnimento tramite cron',
|
||||
password: 'Password',
|
||||
password_desc:
|
||||
'Alcune schede di rete hanno una opzione per settare una password per i magic packets, chiamata anche <span class="badge">SecureON</span>. La lunghezza della password puo\' essere solo di 0, 4 o 6 caratteri.',
|
||||
groups: 'Gruppi',
|
||||
groups_desc:
|
||||
'Puoi aggiungere un dispositivo ad un gruppo per averli raggruppati nel schermata principale.',
|
||||
groups_placeholder: "per esempio 'Cantina' o 'Ufficio'",
|
||||
network_scan_range_saved: 'Intervallo di scansione salvato',
|
||||
network_scan_desc:
|
||||
"Scansiona automaticamente la tua rete per i dispositivi disponibili. Affinche' funzioni, devi eseguire UpSnap come root/admin ed avere nmap installato e disponibile nella variabile d'ambiente $PATH (per gli utenti docker, questo e' gia' il caso e non devi cambiare niente). La scansione puo' richiedere alcuni secondi.",
|
||||
network_scan_ip_range: 'Intervallo IP',
|
||||
network_scan_no_range: 'Nessuno intervallo di scansione',
|
||||
network_scan_unsaved_changes: 'Modifiche non salvate',
|
||||
network_scan_running: 'Scansione in corso',
|
||||
network_scan: 'Scansiona',
|
||||
network_scan_ip: 'IP:',
|
||||
network_scan_mac: 'Mac:',
|
||||
network_scan_mac_vendor: 'Fornitore Mac:',
|
||||
network_scan_netmask: 'Maschera di rete:',
|
||||
network_scan_add_all: 'Aggiungi tutti i dispositivi',
|
||||
network_scan_replace_netmask: 'Modificare la maschera di rete per tutti i dispositivi?',
|
||||
network_scan_new_netmask: 'Nuova mascheda di rete',
|
||||
network_scan_include_unknown: 'Includi i dispositivi il cui nome e\' "Unknown" o "Sconosciuto"',
|
||||
require_confirmation: 'Chiedi conferma'
|
||||
},
|
||||
login: {
|
||||
welcome: 'Benvenuti',
|
||||
email_label: 'Email o nome utente:',
|
||||
password_label: 'Password:',
|
||||
btn_more: 'Di piu...',
|
||||
menu_title_auth_providers: 'Altri gestori di autenticazione',
|
||||
btn_login: 'Login'
|
||||
},
|
||||
settings: {
|
||||
page_title: 'Opzioni',
|
||||
ping_interval_title: 'Intervallo di ping',
|
||||
ping_interval_desc1:
|
||||
'Imposta l\'intervallo nel quale i dispositivi vengono testati con ping. Lasciare in bianco per lasciare il valore predefinito <span class="badge">@every 3s</span>.',
|
||||
ping_interval_desc2:
|
||||
'Per ulteriori dettagli circa la sintassi corretta di cron, fare riferimento a <a class="link" href="https://it.wikipedia.org/wiki/Cron" target="_blank">Wikipedia</a> oppure a <a class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3" target="_blank">questa documentazione</a> (in inglese).',
|
||||
lazy_ping_title: 'Ping pigro',
|
||||
lazy_ping_desc:
|
||||
"Quando il ping pigro e' abilitato, UpSnap effettuera' i ping verso di dispositivi solamente quando un utente effettivamente visita il sito. Se e' spento, allora UpSnap continuera' con il ping sempre.",
|
||||
lazy_ping_enable: 'Abilita',
|
||||
website_title_title: 'Nome del sito',
|
||||
website_title_desc: 'Imposta il nome del sito.',
|
||||
icon_title: 'Icona',
|
||||
icon_desc: 'Imposta una icona personalizzata. I tipi di file supportati sono:',
|
||||
upsnap_version: 'Versione UpSnap'
|
||||
},
|
||||
users: {
|
||||
page_title: 'Utenti',
|
||||
allow_create_devices:
|
||||
'Permetti a {username} di creare nuovo dispositivi e gestire i gruppi di dispositivi.',
|
||||
device_permissions: 'Permessi dispositivo',
|
||||
create_new_device: 'Crea un nuovo dispositivo',
|
||||
read: 'Leggi',
|
||||
update: 'Modifica',
|
||||
delete: 'Cancella',
|
||||
power: 'Accendi',
|
||||
toggle: 'Inverti',
|
||||
confirm_delete_title: 'Conferma rimozione',
|
||||
confirm_delete_desc: 'Sei sicuro di voler rimuovere {username}?',
|
||||
create_new_user: 'Crea nuovo utente',
|
||||
username: 'Nome utente',
|
||||
password: 'Password',
|
||||
password_confirm: 'Conferma la password',
|
||||
required_field: 'Campo obbligatorio'
|
||||
},
|
||||
buttons: {
|
||||
save: 'Salva',
|
||||
delete: 'Cancella',
|
||||
change: 'Cambia',
|
||||
reset: 'Resetta',
|
||||
cancel: 'Annulla',
|
||||
add: 'Aggiungi',
|
||||
confirm: 'Conferma'
|
||||
},
|
||||
welcome: {
|
||||
step1_page_title: 'Benvenuti ad UpSnap 🥳',
|
||||
step1_setup_desc: "Per favore, completate i seguenti passi per terminare l'installazione.",
|
||||
step1_setup_btn_next: 'Avanti',
|
||||
step2_page_title: 'Creare un account amministratore',
|
||||
step2_label_email: 'Email:',
|
||||
step2_label_password: 'Password:',
|
||||
step2_label_min_chars: 'Min. 10 caratteri',
|
||||
step2_label_password_confirm: 'Conferma la password:',
|
||||
step2_btn_create: 'Crea',
|
||||
step3_page_title: 'Abbiamo finito! 🎉',
|
||||
step3_page_desc: 'Prosegui adesso per aggiungere dispositivi alla tua lista.',
|
||||
step3_btn_done: 'Andiamo!',
|
||||
not_expected_title: 'Non mi aspettavo di vederti qui! 🧐',
|
||||
not_expected_desc:
|
||||
"L' installazione e' gia' terminata! Non ci sono operazioni da svolgere qui.",
|
||||
not_expected_back: 'Indietro',
|
||||
progress_step1: 'Benvenuti',
|
||||
progress_step2: 'Creare un account',
|
||||
progress_step3: 'Fatto'
|
||||
},
|
||||
toasts: {
|
||||
admin_saved: 'Account amministratore salvato',
|
||||
user_saved: 'Account utente salvato',
|
||||
user_created: 'Utente {username} creato',
|
||||
user_deleted: 'Utente {username} cancellato',
|
||||
settings_saved: 'Impostazioni salvate',
|
||||
password_changed: 'Password cambiata. Per favore, effettuate di nuovo il login.',
|
||||
passwords_missmatch: 'Le password non corrispondono',
|
||||
permissions_created: 'I permessi per {username} sono stati creati',
|
||||
permissions_deleted: 'I permessi per {username} sono stati cancellati',
|
||||
permissions_updated: 'I permessi per {username} sono stati aggiornati',
|
||||
permissions_updated_personal: 'I tuoi permessi sono stati aggiornati',
|
||||
no_permission: 'Non hai i permessi necessari per visitare {url}',
|
||||
device_created: 'Creato dispositivo {device}',
|
||||
devices_created_multiple: 'Creato/i {count|int} dispositivi',
|
||||
device_updated: '{device} aggiornato',
|
||||
device_deleted: '{device} cancellato',
|
||||
group_created: 'Gruppo {group} creato',
|
||||
group_deleted: 'Gruppo {group} cancellato'
|
||||
},
|
||||
navbar: {
|
||||
theme: 'Tema',
|
||||
new: 'Nuovo',
|
||||
edit_account: 'Modifica accont',
|
||||
logout: 'Esci'
|
||||
}
|
||||
} satisfies BaseTranslation;
|
||||
|
||||
export default it;
|
||||
@@ -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,225 @@
|
||||
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_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.',
|
||||
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;
|
||||
@@ -0,0 +1,217 @@
|
||||
import zh from '../zh';
|
||||
import type { Translation } from '../i18n-types';
|
||||
|
||||
const zh_TW = {
|
||||
...(zh as unknown as Translation),
|
||||
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_required_field: '必填',
|
||||
ports: '埠',
|
||||
ports_desc: 'UpSnap 可以檢查指定的埠是否開啟',
|
||||
ports_add_new: '新增埠',
|
||||
ports_name: '名稱',
|
||||
ports_number: '通訊埠編號',
|
||||
link: '連結',
|
||||
link_desc: '讓您的裝置名稱成為可點擊的連結,非常適合用來連結儀表板等。',
|
||||
ping: 'Ping',
|
||||
ping_desc:
|
||||
'你可以使用自定義的指令來檢查裝置是否開機。該指令應返回退出碼 <span class="badge">0</span> 以表示裝置已開機,任何其他退出碼將標記裝置為關機。',
|
||||
ping_cmd: '自定義 ping 指令',
|
||||
wake: '喚醒',
|
||||
wake_desc: '你可以透過排程来唤醒裝置。',
|
||||
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上執行並有RestAPI端口. 有關 Sleep-On-LAN 設定的說明, 請見文檔 <a href="https://github.com/SR-G/sleep-on-lan#usage" class="link" target="_blank">Usage</a>',
|
||||
sol_desc2: 'SOL 已配置為使用 HTTP 發送請求,而不是 UDP以啟用授權並提高請求的可靠性。',
|
||||
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>shell指令</strong>將在您的容器內運行(如果您使用docker),或者在您的主機上運行(如果您使用二進制)。為了驗證其正常工作,您可以先在容器內或主機的shell中運行這個指令。常見的指令有<span class="badge">net rpc</span>用於Windows,<span class="badge">sshpass</span>用於Linux,或者一般用於進行網絡請求的<span class="badge">curl</span>。',
|
||||
shutdown_examples: '範例:',
|
||||
shutdown_examples_windows: '關閉遠端 Windows 主機:',
|
||||
shutdown_examples_linux: '關閉遠端 Linux 主機:',
|
||||
shutdown_cmd: '關機指令',
|
||||
shutdown_cron_desc: '就像設定排程來喚醒裝置一樣,您也可以設定一個排程來關閉這個裝置。',
|
||||
shutdown_cron: '關機排程',
|
||||
shutdown_cron_enable: '啟用關機排程',
|
||||
password: '密碼',
|
||||
password_desc:
|
||||
'一些網路介面卡能給 magic packets 設密碼, 也可稱作 <span class="badge">SecureON</span>. 密碼長度只能為0、4或6個字。',
|
||||
groups: '群組',
|
||||
groups_desc: '你可以將裝置加到群組, 以便在控制面板上依群組排序。',
|
||||
groups_placeholder: "例如: 'Basement' 或 'Office'",
|
||||
network_scan_range_saved: '掃瞄範圍已儲存',
|
||||
network_scan_desc:
|
||||
'自動掃描網路上的設備,要使用這個功能,你需要以root/系統管理員權限執行 UpSnap, 並在你的 $PATH 中安裝nmap(使用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://zh.wikipedia.org/wiki/Cron" target="_blank">Wikipedia</a> 或參閱 <a class="link" href="https://pkg.go.dev/github.com/robfig/cron/v3" target="_blank">cron 文檔</a>.',
|
||||
lazy_ping_title: 'Lazy ping',
|
||||
lazy_ping_desc: '當開關打開時, 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 Translation;
|
||||
|
||||
export default zh_TW;
|
||||
@@ -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,7 +64,7 @@
|
||||
}
|
||||
|
||||
// refresh auth token
|
||||
if ($pocketbase.authStore.isAdmin) {
|
||||
if ($pocketbase.authStore.isSuperuser) {
|
||||
await $pocketbase.admins.authRefresh().catch(() => {
|
||||
$pocketbase.authStore.clear();
|
||||
goto('/login');
|
||||
|
||||
@@ -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()}
|
||||
|
||||
@@ -15,18 +15,23 @@
|
||||
|
||||
// locales
|
||||
const languageEmojis = {
|
||||
de: '🇩🇪',
|
||||
'de-DE': '🇩🇪',
|
||||
en: '🇺🇸',
|
||||
'en-US': '🇺🇸',
|
||||
fr: '🇫🇷',
|
||||
'fr-FR': '🇫🇷',
|
||||
de: '🇩🇪',
|
||||
'de-DE': '🇩🇪',
|
||||
it: '🇮🇹',
|
||||
'it-IT': '🇮🇹',
|
||||
nl: '🇳🇱',
|
||||
'nl-NL': '🇳🇱',
|
||||
pt: '🇵🇹',
|
||||
'pt-PT': '🇵🇹',
|
||||
es: '🇪🇸',
|
||||
'es-ES': '🇪🇸',
|
||||
zh: '🇨🇳',
|
||||
'zh-CN': '🇨🇳'
|
||||
'zh-CN': '🇨🇳',
|
||||
'zh-TW': '🇹🇼'
|
||||
};
|
||||
let localStorageLang: Locales | 'auto' = 'auto';
|
||||
let selectedLanguage: Locales | 'auto' = localStorageLang;
|
||||
@@ -63,10 +68,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());
|
||||
})
|
||||
@@ -74,10 +80,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());
|
||||
})
|
||||
@@ -89,8 +95,8 @@
|
||||
|
||||
function changePassword() {
|
||||
fetch(
|
||||
`${backendUrl}api/${$pocketbase.authStore.isAdmin ? 'admins' : `collections/users/records`}/${
|
||||
$pocketbase.authStore.model?.id
|
||||
`${backendUrl}api/${$pocketbase.authStore.isSuperuser ? 'admins' : `collections/users/records`}/${
|
||||
$pocketbase.authStore.record?.id
|
||||
}`,
|
||||
{
|
||||
method: 'PATCH',
|
||||
@@ -98,7 +104,7 @@
|
||||
Authorization: $pocketbase.authStore.token,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: $pocketbase.authStore.isAdmin ? adminBody : userBody
|
||||
body: $pocketbase.authStore.isSuperuser ? adminBody : userBody
|
||||
}
|
||||
)
|
||||
.then(async (data) => {
|
||||
@@ -136,25 +142,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>
|
||||
@@ -169,26 +172,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>
|
||||
@@ -220,7 +218,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>
|
||||
@@ -243,7 +241,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
|
||||
@@ -258,7 +256,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 } 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';
|
||||
@@ -62,7 +62,14 @@
|
||||
<h1 class="text-center text-xl font-bold">{$settingsPub?.website_title}</h1>
|
||||
{/if}
|
||||
<div class="flex flex-row gap-4">
|
||||
<figure class="w-16"><img src="/gopher.svg" alt="Gopher" /></figure>
|
||||
<figure class="w-16">
|
||||
<img
|
||||
src={$settingsPub?.id && $settingsPub?.favicon
|
||||
? `${backendUrl}api/files/settings_public/${$settingsPub?.id}/${$settingsPub?.favicon}`
|
||||
: '/gopher.svg'}
|
||||
alt={$settingsPub?.website_title ? $settingsPub?.website_title : 'Gopher'}
|
||||
/>
|
||||
</figure>
|
||||
<h2 class="card-title">{$LL.login.welcome()}</h2>
|
||||
</div>
|
||||
<form class="form-control w-full" on:submit|preventDefault={tryAdminThenUser}>
|
||||
@@ -115,8 +122,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}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import LL from '$lib/i18n/i18n-svelte';
|
||||
import { pocketbase } from '$lib/stores/pocketbase';
|
||||
import { settingsPub } from '$lib/stores/settings';
|
||||
import type { SettingsPublic } from '$lib/types/settings';
|
||||
import { faArrowRight, faEye } from '@fortawesome/free-solid-svg-icons';
|
||||
import { onMount } from 'svelte';
|
||||
import Fa from 'svelte-fa';
|
||||
@@ -32,6 +33,12 @@
|
||||
passwordConfirm: form.confirm
|
||||
})
|
||||
.then(() => {
|
||||
$pocketbase
|
||||
.collection('settings_public')
|
||||
.getFirstListItem('')
|
||||
.then((data) => {
|
||||
settingsPub.set(data as SettingsPublic);
|
||||
});
|
||||
$pocketbase.admins
|
||||
.authWithPassword(form.email, form.password)
|
||||
.then(() => {
|
||||
|
||||
@@ -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 |
@@ -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>Chien-Shiung</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="#ce3762"></rect><rect x="0" y="0" width="36" height="36" transform="translate(4 4) rotate(310 18 18) scale(1.1)" fill="#2f1335" rx="6"></rect><g transform="translate(6 -5) rotate(0 18 18)"><path d="M15 20c2 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: 803 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>Hetty Green</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="#f9ce07"></rect><rect x="0" y="0" width="36" height="36" transform="translate(-1 5) rotate(25 18 18) scale(1.1)" fill="#1f0441" rx="36"></rect><g transform="translate(-1 5) rotate(5 18 18)"><path d="M13,20 a1,0.75 0 0,0 10,0" fill="#FFFFFF"></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: 773 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="#004853"></rect><rect x="0" y="0" width="36" height="36" transform="translate(9 -5) rotate(219 18 18) scale(1)" fill="#00b9bd" 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>Jane Johnston</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="#b50d57"></rect><rect x="0" y="0" width="36" height="36" transform="translate(-5 9) rotate(349 18 18) scale(1.1)" fill="#dec790" rx="36"></rect><g transform="translate(-5 4.5) rotate(9 18 18)"><path d="M13,20 a1,0.75 0 0,0 10,0" fill="#000000"></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: 778 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>Virginia Apgar</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="#3b2d38"></rect><rect x="0" y="0" width="36" height="36" transform="translate(-2 6) rotate(306 18 18) scale(1)" fill="#cfbe27" rx="36"></rect><g transform="translate(-2 6) rotate(6 18 18)"><path d="M13,19 a1,0.75 0 0,0 10,0" fill="#000000"></path><rect x="13" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#000000"></rect><rect x="21" y="14" width="1.5" height="2" rx="1" stroke="none" fill="#000000"></rect></g></g></svg>
|
||||
|
After Width: | Height: | Size: 775 B |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 65 KiB |
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "UpSnap",
|
||||
"short_name": "UpSnap",
|
||||
"description": "A simple wake on lan web app written with SvelteKit, Go and PocketBase.",
|
||||
"theme_color": "#55BCD9",
|
||||
"background_color": "#55BCD9",
|
||||
"display": "standalone",
|
||||
"orientation": "any",
|
||||
"scope": "/",
|
||||
"start_url": "/",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icon_192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icon_512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/maskable_192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "/maskable_512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "/gopher.svg",
|
||||
"type": "image/svg+xml",
|
||||
"sizes": "any"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
After Width: | Height: | Size: 20 KiB |