Show app version on the UI

This commit is contained in:
Khanh Ngo 2020-06-01 15:24:11 +07:00
parent 8aa84b2be6
commit 9169e75e88
No known key found for this signature in database
GPG key ID: D5FAA6A16150E49E
3 changed files with 19 additions and 3 deletions

View file

@ -25,6 +25,10 @@ func main() {
fmt.Println("Build Time\t:", buildTime)
fmt.Println("Git Repo\t:", "https://github.com/ngoduykhanh/wireguard-ui")
// set app extra data
extraData := make(map[string]string)
extraData["appVersion"] = appVersion
// initialize DB
err := util.InitDB()
if err != nil {
@ -38,7 +42,7 @@ func main() {
assetHandler := http.FileServer(rice.MustFindBox("assets").HTTPBox())
// register routes
app := router.New(tmplBox)
app := router.New(tmplBox, extraData)
app.GET("/", handler.WireGuardClients())
app.GET("/login", handler.LoginPage())