From 4f6bb0099670ea3affb014bc13c6749ad8b74495 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 19 Oct 2019 07:52:58 +0200 Subject: [PATCH] web: display version string --- httpd/web.go | 4 ++++ sftpgo.iss | 2 +- templates/base.html | 10 ++++++++++ utils/version.go | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/httpd/web.go b/httpd/web.go index a6b0ee9c..de858dda 100644 --- a/httpd/web.go +++ b/httpd/web.go @@ -10,6 +10,7 @@ import ( "github.com/drakkan/sftpgo/dataprovider" "github.com/drakkan/sftpgo/sftpd" + "github.com/drakkan/sftpgo/utils" ) const ( @@ -43,6 +44,7 @@ type basePage struct { ConnectionsURL string UsersTitle string ConnectionsTitle string + Version string } type usersPage struct { @@ -98,6 +100,7 @@ func loadTemplates(templatesPath string) { } func getBasePageData(title, currentURL string) basePage { + version := utils.GetAppVersion() return basePage{ Title: title, CurrentURL: currentURL, @@ -109,6 +112,7 @@ func getBasePageData(title, currentURL string) basePage { ConnectionsURL: webConnectionsPath, UsersTitle: pageUsersTitle, ConnectionsTitle: pageConnectionsTitle, + Version: version.GetVersionAsString(), } } diff --git a/sftpgo.iss b/sftpgo.iss index f9023e69..b2341c26 100644 --- a/sftpgo.iss +++ b/sftpgo.iss @@ -2,7 +2,7 @@ ; You need to change the paths for the source files to match your environment #define MyAppName "SFTPGo" -#define MyAppVersion "0.9.3" +#define MyAppVersion "0.9.3-dev" #define MyAppURL "https://github.com/drakkan/sftpgo" #define MyAppExeName "sftpgo.exe" #define MyAppDir "C:\Users\vbox\Desktop\sftpgo_setup" diff --git a/templates/base.html b/templates/base.html index 79e7b3c7..9227af66 100644 --- a/templates/base.html +++ b/templates/base.html @@ -99,6 +99,16 @@ + + + + diff --git a/utils/version.go b/utils/version.go index 432f7488..56bdc10e 100644 --- a/utils/version.go +++ b/utils/version.go @@ -1,6 +1,6 @@ package utils -const version = "0.9.3" +const version = "0.9.3-dev" var ( commit = ""