From 2b5c1bbf1162e12fb5064a700f4b26524b9e89db Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Mon, 12 May 2025 20:59:48 +0000 Subject: [PATCH] various code cleanup, add required tag to select template --- app/app.go | 7 +- app/common/types.go | 5 +- app/routes/account.go | 142 +++++++++++++++++------------------ app/routes/config.go | 130 ++++++++++++++------------------ app/routes/index.go | 70 ++++++++--------- app/routes/login.go | 27 +++---- web/scripts/index.js | 29 ++----- web/templates/select.go.tmpl | 2 +- 8 files changed, 189 insertions(+), 223 deletions(-) diff --git a/app/app.go b/app/app.go index 9d3e1fb..6968f19 100644 --- a/app/app.go +++ b/app/app.go @@ -29,15 +29,14 @@ func Run() { router.GET("/account", routes.HandleGETAccount) router.GET("/", routes.HandleGETIndex) router.GET("/index", routes.HandleGETIndex) - router.GET("/config", routes.HandleGETConfig) - router.GET("/login", routes.HandleGETLogin) - router.GET("/settings", routes.HandleGETSettings) - router.GET("/index/instances", routes.HandleGETInstancesFragment) + router.GET("/config", routes.HandleGETConfig) router.GET("/config/volumes", routes.HandleGETConfigVolumesFragment) router.GET("/config/nets", routes.HandleGETConfigNetsFragment) router.GET("/config/devices", routes.HandleGETConfigDevicesFragment) router.GET("/config/boot", routes.HandleGETConfigBootFragment) + router.GET("/login", routes.HandleGETLogin) + router.GET("/settings", routes.HandleGETSettings) log.Fatal(router.Run(fmt.Sprintf("0.0.0.0:%d", common.Global.Port))) } diff --git a/app/common/types.go b/app/common/types.go index 96b37fb..2acde1e 100644 --- a/app/common/types.go +++ b/app/common/types.go @@ -15,8 +15,9 @@ type StaticFile struct { // type used for templated +