diff --git a/Makefile b/Makefile index 1c9efd1..6237689 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ DNAME=watchyourlan IFACE=enp4s0 DBPATH=/data/hosts.db SHOUTRRR_URL=gotify://192.168.2.1:8083/AwQqpAae.rrl5Ob/?title=Unknown host detected&DisableTLS=yes -THEME=darkly mod: rm go.mod || true && \ @@ -16,7 +15,7 @@ run: cd cmd/WatchYourLAN/ && \ sudo \ env IFACE=$(IFACE) DBPATH=$(DBPATH) THEME=$(THEME) \ - go run . + go run . #-n http://192.168.2.3:8850 fmt: go fmt ./... diff --git a/cmd/WatchYourLAN/main.go b/cmd/WatchYourLAN/main.go index a07fa87..fd023e7 100644 --- a/cmd/WatchYourLAN/main.go +++ b/cmd/WatchYourLAN/main.go @@ -8,15 +8,14 @@ import ( ) const configPath = "/data/config" - -const bootPath = "" +const nodePath = "" func main() { confPtr := flag.String("c", configPath, "Path to config file") - bootPtr := flag.String("b", bootPath, "Path to local Bootswatch") + nodePtr := flag.String("n", nodePath, "Path to node modules") flag.Parse() check.Path(*confPtr) - web.Gui(*confPtr, *bootPtr) // Start web GUI + web.Gui(*confPtr, *nodePtr) // Start web GUI } diff --git a/internal/models/models.go b/internal/models/models.go index 1a2c485..b603365 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -24,7 +24,7 @@ type Conf struct { Color string IgnoreIP string LogLevel string - BootPath string + NodePath string Icon string } diff --git a/internal/web/config.go b/internal/web/config.go index 9138d76..829ba38 100644 --- a/internal/web/config.go +++ b/internal/web/config.go @@ -1,13 +1,10 @@ package web import ( - "io" "log" "net/http" "strconv" - "github.com/tidwall/gjson" - "github.com/aceberg/WatchYourLAN/internal/check" "github.com/aceberg/WatchYourLAN/internal/conf" "github.com/aceberg/WatchYourLAN/internal/db" @@ -27,19 +24,6 @@ func configHandler(w http.ResponseWriter, r *http.Request) { version := string(file) guiData.Version = version[8:] - url := "https://api.github.com/repos/aceberg/WatchYourLAN/releases/latest" - req, err := http.Get(url) - check.IfError(err) - - defer req.Body.Close() - - body, err := io.ReadAll(req.Body) - check.IfError(err) - - bodyStr := string(body) - release := gjson.Get(bodyStr, "tag_name") - guiData.Release = release.String() - guiData.Themes = []string{"cerulean", "cosmo", "cyborg", "darkly", "flatly", "journal", "litera", "lumen", "lux", "materia", "minty", "morph", "pulse", "quartz", "sandstone", "simplex", "sketchy", "slate", "solar", "spacelab", "superhero", "united", "vapor", "yeti", "zephyr"} execTemplate(w, "config", guiData) diff --git a/internal/web/templates/config.html b/internal/web/templates/config.html index ed52492..07c4f75 100644 --- a/internal/web/templates/config.html +++ b/internal/web/templates/config.html @@ -79,10 +79,7 @@
-

Current version: {{ .Version }};   Latest version: {{ .Release }}

- {{ if ne .Version .Release }} -

Update available!

- {{ end }} +

Current version: {{ .Version }}