fix(ui): use server-rendered inline styles for DB fields visibility

This commit is contained in:
Claus Lohmar 2026-06-15 05:08:31 +00:00
parent be566b2a88
commit 9034cdd107
2 changed files with 11 additions and 12 deletions

View file

@ -56,7 +56,6 @@ templ GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smt
document.getElementById('sqlite-fields').style.display = v === 'sqlite' ? 'block' : 'none';
document.getElementById('mariadb-fields').style.display = v === 'mariadb' ? 'block' : 'none';
}
toggleDBFields();
</script>
<div class="form-card">
<h3 style="font-size:0.95rem;font-weight:600;margin-bottom:12px">Email</h3>

View file

@ -162,14 +162,14 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\"></div></div></div><script type=\"text/javascript\">\n\t\t\t\tfunction toggleDBFields() {\n\t\t\t\t\tvar v = document.getElementById('db_type').value;\n\t\t\t\t\tdocument.getElementById('sqlite-fields').style.display = v === 'sqlite' ? 'block' : 'none';\n\t\t\t\t\tdocument.getElementById('mariadb-fields').style.display = v === 'mariadb' ? 'block' : 'none';\n\t\t\t\t}\n\t\t\t\ttoggleDBFields();\n\t\t\t</script><div class=\"form-card\"><h3 style=\"font-size:0.95rem;font-weight:600;margin-bottom:12px\">Email</h3><div class=\"form-row\"><div class=\"form-group\"><label>SMTP Host</label> <input type=\"text\" name=\"smtp_host\" class=\"input\" value=\"")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\"></div></div></div><script type=\"text/javascript\">\n\t\t\t\tfunction toggleDBFields() {\n\t\t\t\t\tvar v = document.getElementById('db_type').value;\n\t\t\t\t\tdocument.getElementById('sqlite-fields').style.display = v === 'sqlite' ? 'block' : 'none';\n\t\t\t\t\tdocument.getElementById('mariadb-fields').style.display = v === 'mariadb' ? 'block' : 'none';\n\t\t\t\t}\n\t\t\t</script><div class=\"form-card\"><h3 style=\"font-size:0.95rem;font-weight:600;margin-bottom:12px\">Email</h3><div class=\"form-row\"><div class=\"form-group\"><label>SMTP Host</label> <input type=\"text\" name=\"smtp_host\" class=\"input\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue(smtpHost)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 66, Col: 72}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 65, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
if templ_7745c5c3_Err != nil {
@ -182,7 +182,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.ResolveAttributeValue(smtpPort)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 70, Col: 72}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 69, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
@ -195,7 +195,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.ResolveAttributeValue(smtpUser)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 76, Col: 72}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 75, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
if templ_7745c5c3_Err != nil {
@ -208,7 +208,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.ResolveAttributeValue(smtpPass)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 80, Col: 76}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 79, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
if templ_7745c5c3_Err != nil {
@ -221,7 +221,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.ResolveAttributeValue(imapHost)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 86, Col: 72}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 85, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
if templ_7745c5c3_Err != nil {
@ -234,7 +234,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.ResolveAttributeValue(imapPort)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 90, Col: 72}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 89, Col: 72}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var15)
if templ_7745c5c3_Err != nil {
@ -247,7 +247,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.ResolveAttributeValue(nextwksURL)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 99, Col: 75}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 98, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var16)
if templ_7745c5c3_Err != nil {
@ -260,7 +260,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.ResolveAttributeValue(authURL)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 107, Col: 69}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 106, Col: 69}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
if templ_7745c5c3_Err != nil {
@ -273,7 +273,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(clientID)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 112, Col: 55}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 111, Col: 55}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
if templ_7745c5c3_Err != nil {
@ -286,7 +286,7 @@ func GlobalSettings(dbType, dbPath, dbHost, dbPort, dbUser, dbPass, dbName, smtp
var templ_7745c5c3_Var19 string
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.ResolveAttributeValue(callbackURL)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 122, Col: 76}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `core/admin/templates/global.templ`, Line: 121, Col: 76}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var19)
if templ_7745c5c3_Err != nil {