mirror of
https://github.com/Luzifer/ots.git
synced 2025-04-19 06:55:51 -04:00
Expose maximum expiry to frontend
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
62ca7b3900
commit
ddd43503dd
@ -48,6 +48,7 @@
|
||||
document.addEventListener('DOMContentLoaded', () => window.refreshTheme())
|
||||
|
||||
// Template variable from Golang process
|
||||
const maxSecretExpire = {{ .MaxSecretExpiry }}
|
||||
const version = "{{ .Version }}"
|
||||
window.OTSCustomize = JSON.parse('{{ .Customize.ToJSON }}')
|
||||
</script>
|
||||
|
2
main.go
2
main.go
@ -182,10 +182,12 @@ func handleIndex(w http.ResponseWriter, r *http.Request) {
|
||||
if err := indexTpl.Execute(w, struct {
|
||||
Customize customize
|
||||
InlineContentNonce string
|
||||
MaxSecretExpiry int64
|
||||
Version string
|
||||
}{
|
||||
Customize: cust,
|
||||
InlineContentNonce: inlineContentNonceStr,
|
||||
MaxSecretExpiry: cfg.SecretExpiry,
|
||||
Version: version,
|
||||
}); err != nil {
|
||||
http.Error(w, errors.Wrap(err, "executing template").Error(), http.StatusInternalServerError)
|
||||
|
Loading…
x
Reference in New Issue
Block a user