From a89d6253e081923ad26e2303f8c543c53c9ed39c Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Thu, 7 Jun 2018 02:13:42 +0300 Subject: Show only needed values in database configuration section depending on type (#4164) --- templates/admin/config.tmpl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'templates') 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 @@
{{.i18n.Tr "admin.config.db_type"}}
{{.DbCfg.Type}}
+ {{if not (or (eq .DbCfg.Type "sqlite3") (eq .DbCfg.Type "tidb"))}}
{{.i18n.Tr "admin.config.db_host"}}
{{if .DbCfg.Host}}{{.DbCfg.Host}}{{else}}-{{end}}
{{.i18n.Tr "admin.config.db_name"}}
{{if .DbCfg.Name}}{{.DbCfg.Name}}{{else}}-{{end}}
{{.i18n.Tr "admin.config.db_user"}}
{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}
+ {{end}} + {{if eq .DbCfg.Type "postgres"}}
{{.i18n.Tr "admin.config.db_ssl_mode"}}
-
{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}} {{.i18n.Tr "admin.config.db_ssl_mode_helper"}}
+
{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}}
+ {{end}} + {{if or (eq .DbCfg.Type "sqlite3") (eq .DbCfg.Type "tidb")}}
{{.i18n.Tr "admin.config.db_path"}}
-
{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}} {{.i18n.Tr "admin.config.db_path_helper"}}
+
{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}}
+ {{end}}
-- cgit v1.2.3