Show if a new version is available in the web interface

This commit is contained in:
2022-04-03 20:33:20 +09:30
parent 896946c751
commit fbd267e687
6 changed files with 101 additions and 61 deletions

View File

@@ -74,12 +74,16 @@ func (ws *WebService) getStatic(w http.ResponseWriter, r *http.Request) {
}
var b struct {
Body string
Path string
Version string
Body string
Path string
Version string
NewVersionAvailable bool
NewVersionInfo version.GithubRelease
}
b.Path = path
b.Version = version.CurrentVersion
b.NewVersionAvailable = version.UpdateAvailable()
b.NewVersionInfo = version.LatestVersionInfo
err = t.ExecuteTemplate(w, "layout", b)
if err != nil {