1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-25 07:47:05 +00: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
No known key found for this signature in database
GPG Key ID: 2F327738A3C0AE3A

View File

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