diff --git a/.version b/.version index 48eaba0..bb7777a 120000 --- a/.version +++ b/.version @@ -1 +1 @@ -internal/web/templates/footer.html \ No newline at end of file +internal/web/templates/version \ No newline at end of file diff --git a/internal/models/models.go b/internal/models/models.go index 64f6e19..88048b5 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -26,8 +26,9 @@ type Conf struct { // GuiData - all data sent to html page type GuiData struct { - Config Conf - Hosts []Host - Icon string - Themes []string + Config Conf + Hosts []Host + Icon string + Themes []string + Version string } diff --git a/internal/web/config.go b/internal/web/config.go index 9eb487b..489a118 100644 --- a/internal/web/config.go +++ b/internal/web/config.go @@ -18,6 +18,11 @@ func configHandler(w http.ResponseWriter, r *http.Request) { guiData.Config = AppConfig guiData.Icon = Icon + file, err := TemplHTML.ReadFile(TemplPath + "version") + check.IfError(err) + + guiData.Version = string(file) + 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 e032c01..8da14e4 100644 --- a/internal/web/templates/config.html +++ b/internal/web/templates/config.html @@ -57,6 +57,7 @@
{{ .Version }}
After changing Host or Port you need to restart the app
diff --git a/internal/web/templates/footer.html b/internal/web/templates/footer.html index 7345777..5dd8ca7 100644 --- a/internal/web/templates/footer.html +++ b/internal/web/templates/footer.html @@ -1,9 +1,4 @@ {{ define "footer"}} -