cr fixes and dynamic upload size in UI

This commit is contained in:
Andrea Spacca
2021-07-23 11:20:49 +02:00
parent 88003018e6
commit 3ea4ffd0e3
4 changed files with 38 additions and 4 deletions

View File

@@ -238,6 +238,11 @@ func (s *Server) viewHandler(w http.ResponseWriter, r *http.Request) {
hostname := getURL(r, s.proxyPort).Host
webAddress := resolveWebAddress(r, s.proxyPath, s.proxyPort)
maxUploadSize := ""
if s.maxUploadSize > 0 {
maxUploadSize = formatSize(s.maxUploadSize)
}
purgeTime := ""
if s.purgeDays > 0 {
purgeTime = s.purgeDays.String()
@@ -248,8 +253,9 @@ func (s *Server) viewHandler(w http.ResponseWriter, r *http.Request) {
WebAddress string
GAKey string
UserVoiceKey string
PurgeTime string
SampleToken string
PurgeTime string
MaxUploadSize string
SampleToken string
SampleToken2 string
}{
hostname,
@@ -257,6 +263,7 @@ func (s *Server) viewHandler(w http.ResponseWriter, r *http.Request) {
s.gaKey,
s.userVoiceKey,
purgeTime,
maxUploadSize,
Token(s.randomTokenLength),
Token(s.randomTokenLength),
}