mirror of
https://github.com/vbatts/imgsrv.git
synced 2024-12-28 00:26:31 +00:00
adding app version, and putting it in the footer
This commit is contained in:
parent
e7ec9528d0
commit
6a40f02d9e
2 changed files with 17 additions and 5 deletions
10
layouts.go
10
layouts.go
|
@ -1,9 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
//"html/template"
|
||||
"text/template"
|
||||
"fmt"
|
||||
"io"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
var emptyInterface interface{}
|
||||
|
@ -144,7 +144,7 @@ func UrliePage(w io.Writer) (err error) {
|
|||
if (err != nil) {
|
||||
return err
|
||||
}
|
||||
err = tailTemplate.Execute(w, map[string]string{"footer" : ""})
|
||||
err = tailTemplate.Execute(w, map[string]string{"footer" : fmt.Sprintf("Version: %s", VERSION)})
|
||||
if (err != nil) {
|
||||
return err
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ func UploadPage(w io.Writer) (err error) {
|
|||
if (err != nil) {
|
||||
return err
|
||||
}
|
||||
err = tailTemplate.Execute(w, map[string]string{"footer" : ""})
|
||||
err = tailTemplate.Execute(w, map[string]string{"footer" : fmt.Sprintf("Version: %s", VERSION)})
|
||||
if (err != nil) {
|
||||
return err
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ func ListFilesPage(w io.Writer, files []File) (err error) {
|
|||
if (err != nil) {
|
||||
return err
|
||||
}
|
||||
err = tailTemplate.Execute(w, map[string]string{"footer" : ""})
|
||||
err = tailTemplate.Execute(w, map[string]string{"footer" : fmt.Sprintf("Version: %s", VERSION)})
|
||||
if (err != nil) {
|
||||
return err
|
||||
}
|
||||
|
|
12
version.go
Normal file
12
version.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
MAJOR int = 1
|
||||
MINOR int = 0
|
||||
TINY int = 0
|
||||
VERSION string = fmt.Sprintf("%d.%d.%d", MAJOR, MINOR, TINY)
|
||||
)
|
Loading…
Reference in a new issue