mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-12-24 07:37:04 +00:00
HTML JS Cleanup
This commit is contained in:
parent
109d8735c7
commit
14ee44e8e2
@ -376,9 +376,10 @@
|
||||
var current_panel = null;
|
||||
var switch_back_to_panel = null;
|
||||
function show_panel(panelid) {
|
||||
if (panelid.getAttribute)
|
||||
if (panelid.getAttribute) {
|
||||
// we might be passed an HTMLElement <a>.
|
||||
panelid = panelid.getAttribute('href').substring(1);
|
||||
}
|
||||
|
||||
$('.admin_panel').hide();
|
||||
$('#panel_' + panelid).show();
|
||||
|
@ -2,15 +2,34 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function checkfields() {
|
||||
let use_relay = document.getElementById("use_relay").checked
|
||||
let use_auth = document.getElementById("relay_use_auth").checked
|
||||
const use_relay = document.getElementById("use_relay")
|
||||
const relay_host = document.getElementById("relay_host")
|
||||
const relay_use_auth = document.getElementById("relay_use_auth")
|
||||
const relay_auth_user = document.getElementById("relay_auth_user")
|
||||
const relay_auth_pass = document.getElementById("relay_auth_pass")
|
||||
|
||||
api(
|
||||
"/system/smtp/relay",
|
||||
"GET",
|
||||
{},
|
||||
data => {
|
||||
|
||||
document.getElementById("relay_host").disabled = !use_relay
|
||||
document.getElementById("relay_use_auth").disabled = !use_relay
|
||||
document.getElementById("relay_auth_user").disabled = !(use_relay && use_auth)
|
||||
document.getElementById("relay_auth_pass").disabled = !(use_relay && use_auth)
|
||||
}
|
||||
)
|
||||
|
||||
function checkfields() {
|
||||
let relay_enabled = use_relay.checked
|
||||
let auth_enabled = relay_use_auth.checked
|
||||
|
||||
relay_host.disabled = !relay_enabled
|
||||
relay_use_auth.disabled = !relay_enabled
|
||||
relay_auth_auth.disabled = !(relay_enabled && auth_enabled)
|
||||
relay_auth_pass.disabled = !(relay_enabled && auth_enabled)
|
||||
}
|
||||
|
||||
checkfields()
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<h2>SMTP Relays</h2>
|
||||
|
Loading…
Reference in New Issue
Block a user