summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-06-07 02:13:42 +0300
committerLunny Xiao <xiaolunwen@gmail.com>2018-06-06 18:13:42 -0500
commita89d6253e081923ad26e2303f8c543c53c9ed39c (patch)
tree7a41df9810d8ebb87c232ed9e4bc8537fde062f4 /templates
parente5fd43c231ed1884f491db14183427f1b0ec7bc0 (diff)
downloadgitea-a89d6253e081923ad26e2303f8c543c53c9ed39c.tar.gz
gitea-a89d6253e081923ad26e2303f8c543c53c9ed39c.zip
Show only needed values in database configuration section depending on type (#4164)
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/config.tmpl10
1 files changed, 8 insertions, 2 deletions
diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl
index d8292a9e6b..21aa8756fd 100644
--- a/templates/admin/config.tmpl
+++ b/templates/admin/config.tmpl
@@ -92,16 +92,22 @@
<dl class="dl-horizontal admin-dl-horizontal">
<dt>{{.i18n.Tr "admin.config.db_type"}}</dt>
<dd>{{.DbCfg.Type}}</dd>
+ {{if not (or (eq .DbCfg.Type "sqlite3") (eq .DbCfg.Type "tidb"))}}
<dt>{{.i18n.Tr "admin.config.db_host"}}</dt>
<dd>{{if .DbCfg.Host}}{{.DbCfg.Host}}{{else}}-{{end}}</dd>
<dt>{{.i18n.Tr "admin.config.db_name"}}</dt>
<dd>{{if .DbCfg.Name}}{{.DbCfg.Name}}{{else}}-{{end}}</dd>
<dt>{{.i18n.Tr "admin.config.db_user"}}</dt>
<dd>{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}</dd>
+ {{end}}
+ {{if eq .DbCfg.Type "postgres"}}
<dt>{{.i18n.Tr "admin.config.db_ssl_mode"}}</dt>
- <dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}} {{.i18n.Tr "admin.config.db_ssl_mode_helper"}}</dd>
+ <dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}}</dd>
+ {{end}}
+ {{if or (eq .DbCfg.Type "sqlite3") (eq .DbCfg.Type "tidb")}}
<dt>{{.i18n.Tr "admin.config.db_path"}}</dt>
- <dd>{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}} {{.i18n.Tr "admin.config.db_path_helper"}}</dd>
+ <dd>{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}}</dd>
+ {{end}}
</dl>
</div>