Version on config page

This commit is contained in:
aceberg 2023-01-06 22:07:27 +07:00
parent 60ebd860b2
commit 17f7f1fb04
6 changed files with 13 additions and 10 deletions

View file

@ -1 +1 @@
internal/web/templates/footer.html
internal/web/templates/version

View file

@ -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
}

View file

@ -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)

View file

@ -57,6 +57,7 @@
</table>
</div>
<div class="col">
<p>{{ .Version }}</p>
<div class="alert alert-info" role="alert">
<h4 class="alert-heading">Warning!</h4>
<p>After changing <b>Host</b> or <b>Port</b> you need to restart the app</p>

View file

@ -1,9 +1,4 @@
{{ define "footer"}}
<div class="fixed-bottom">
<h6 style="font-size: 10px;">
VERSION=0.9.1
</h6>
</div>
</body>
</html>
{{ end }}

View file

@ -0,0 +1 @@
VERSION=0.9.1