From 476ca67cd4abbb94acb995adb525cc5d596d9ab4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 7 May 2019 00:18:17 +0800 Subject: [PATCH] fix config ui error about cache ttl (#6861) (#6865) --- options/locale/locale_en-US.ini | 1 + routers/admin/admin.go | 1 + templates/admin/config.tmpl | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 703942af77..4f6f5d4745 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1706,6 +1706,7 @@ config.cache_config = Cache Configuration config.cache_adapter = Cache Adapter config.cache_interval = Cache Interval config.cache_conn = Cache Connection +config.cache_item_ttl = Cache Item TTL config.session_config = Session Configuration config.session_provider = Session Provider diff --git a/routers/admin/admin.go b/routers/admin/admin.go index 7d98e1af36..fa895b600c 100644 --- a/routers/admin/admin.go +++ b/routers/admin/admin.go @@ -232,6 +232,7 @@ func Config(ctx *context.Context) { ctx.Data["CacheAdapter"] = setting.CacheService.Adapter ctx.Data["CacheInterval"] = setting.CacheService.Interval ctx.Data["CacheConn"] = setting.CacheService.Conn + ctx.Data["CacheItemTTL"] = setting.CacheService.TTL ctx.Data["SessionConfig"] = setting.SessionConfig diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index becaca61e5..e65419d476 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -222,11 +222,15 @@
{{.i18n.Tr "admin.config.cache_adapter"}}
{{.CacheAdapter}}
+ {{if eq .CacheAdapter "memory"}}
{{.i18n.Tr "admin.config.cache_interval"}}
{{.CacheInterval}} {{.i18n.Tr "tool.raw_seconds"}}
+ {{end}} {{if .CacheConn}}
{{.i18n.Tr "admin.config.cache_conn"}}
{{.CacheConn}}
+
{{.i18n.Tr "admin.config.cache_item_ttl"}}
+
{{.CacheItemTTL}}
{{end}}