Show version on frontend (#346)

This commit is contained in:
Dmytro Bondar 2025-01-21 12:27:25 +01:00 committed by GitHub
parent c2658534b0
commit 2cea2e477a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,6 +10,7 @@ import (
"net/url" "net/url"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/h44z/wg-portal/internal"
"github.com/h44z/wg-portal/internal/app" "github.com/h44z/wg-portal/internal/app"
"github.com/h44z/wg-portal/internal/app/api/v0/model" "github.com/h44z/wg-portal/internal/app/api/v0/model"
) )
@ -70,7 +71,7 @@ func (e configEndpoint) handleConfigJsGet() gin.HandlerFunc {
buf := &bytes.Buffer{} buf := &bytes.Buffer{}
err := e.tpl.ExecuteTemplate(buf, "frontend_config.js.gotpl", gin.H{ err := e.tpl.ExecuteTemplate(buf, "frontend_config.js.gotpl", gin.H{
"BackendUrl": backendUrl, "BackendUrl": backendUrl,
"Version": "unknown", "Version": internal.Version,
"SiteTitle": e.app.Config.Web.SiteTitle, "SiteTitle": e.app.Config.Web.SiteTitle,
"SiteCompanyName": e.app.Config.Web.SiteCompanyName, "SiteCompanyName": e.app.Config.Web.SiteCompanyName,
}) })