1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-07 16:17:23 +01:00

Load SMTP settings when entering the page

This commit is contained in:
David Duque
2020-04-14 10:03:44 +01:00
parent 14ee44e8e2
commit 687721caf8

View File

@@ -8,15 +8,6 @@
const relay_auth_user = document.getElementById("relay_auth_user")
const relay_auth_pass = document.getElementById("relay_auth_pass")
api(
"/system/smtp/relay",
"GET",
{},
data => {
}
)
function checkfields() {
let relay_enabled = use_relay.checked
let auth_enabled = relay_use_auth.checked
@@ -27,8 +18,20 @@
relay_auth_pass.disabled = !(relay_enabled && auth_enabled)
}
checkfields()
api(
"/system/smtp/relay",
"GET",
{},
data => {
use_relay.checked = data.enabled
relay_host.value = data.host
relay_use_auth.checked = data.auth_enabled
relay_auth_user.value = data.user
relay_auth_pass.value = ""
checkfields()
}
)
</script>