fix config ui error about cache ttl (#6861)

This commit is contained in:
Lunny Xiao 2019-05-06 22:35:11 +08:00 committed by Lauris BH
parent 5d5eae6aea
commit 01ebd52a1f
3 changed files with 6 additions and 0 deletions

@ -1757,6 +1757,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

@ -234,6 +234,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

@ -233,11 +233,15 @@
<dl class="dl-horizontal admin-dl-horizontal">
<dt>{{.i18n.Tr "admin.config.cache_adapter"}}</dt>
<dd>{{.CacheAdapter}}</dd>
{{if eq .CacheAdapter "memory"}}
<dt>{{.i18n.Tr "admin.config.cache_interval"}}</dt>
<dd>{{.CacheInterval}} {{.i18n.Tr "tool.raw_seconds"}}</dd>
{{end}}
{{if .CacheConn}}
<dt>{{.i18n.Tr "admin.config.cache_conn"}}</dt>
<dd><code>{{.CacheConn}}</code></dd>
<dt>{{.i18n.Tr "admin.config.cache_item_ttl"}}</dt>
<dd><code>{{.CacheItemTTL}}</code></dd>
{{end}}
</dl>
</div>