diff --git a/internal/web/config.go b/internal/web/config.go index d24a85e..a539f0f 100644 --- a/internal/web/config.go +++ b/internal/web/config.go @@ -35,10 +35,20 @@ func saveConfigHandler(c *gin.Context) { appConfig.Theme = c.PostForm("theme") appConfig.Color = c.PostForm("color") appConfig.NodePath = c.PostForm("node") + appConfig.ShoutURL = c.PostForm("shout") + + conf.Write(appConfig) + + slog.Info("Writing new config to " + appConfig.ConfPath) + + c.Redirect(http.StatusFound, "/config") +} + +func saveSettingsHandler(c *gin.Context) { + appConfig.LogLevel = c.PostForm("log") appConfig.ArpArgs = c.PostForm("arpargs") appConfig.Ifaces = c.PostForm("ifaces") - appConfig.ShoutURL = c.PostForm("shout") appConfig.UseDB = c.PostForm("usedb") appConfig.PGConnect = c.PostForm("pgconnect") diff --git a/internal/web/routines-upd.go b/internal/web/routines-upd.go index 7a1c7d5..06eaed7 100644 --- a/internal/web/routines-upd.go +++ b/internal/web/routines-upd.go @@ -7,7 +7,7 @@ import ( ) func updateRoutines() { - slog.Debug("Restarting go routines") + slog.Debug("Restarting scan routine") close(quitScan) diff --git a/internal/web/templates/config.html b/internal/web/templates/config.html index 003468d..1355e6f 100644 --- a/internal/web/templates/config.html +++ b/internal/web/templates/config.html @@ -5,7 +5,7 @@