Source
this.form.querySelector('#custom_timeouts input:checked').value == <?= ZBX_PROXY_CUSTOM_TIMEOUTS_ENABLED ?>;
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
?>
window.proxy_edit_popup = new class {
constructor() {
this.clone_proxyid = null;
}
init({proxyid}) {
this.proxyid = proxyid;
this.overlay = overlays_stack.getById('proxy_edit');
this.dialogue = this.overlay.$dialogue[0];
this.form = this.overlay.$dialogue.$body[0].querySelector('form');
this.footer = this.overlay.$dialogue.$footer[0];
this.display_change_psk =
this.form.querySelector('#tls_connect input:checked').value == <?= HOST_ENCRYPTION_PSK ?>
|| document.getElementById('tls_accept_psk').checked;
if (this.display_change_psk) {
document
.getElementById('tls-psk-change')
.addEventListener('click', () => this._changePsk());
for (const element of this.form.querySelectorAll('.js-tls-psk-identity, .js-tls-psk')) {
element.style.display = 'none';
}
}
jQuery('#proxy_groupid').on('change', () => this._update());
for (const id of ['operating_mode', 'tls_connect', 'tls_accept_psk', 'tls_accept_certificate',
'custom_timeouts']) {
document
.getElementById(id)
.addEventListener('change', () => this._update());
}
this._update();
document.getElementById('proxy-form').style.display = '';
document.getElementById('name').focus();
}
_changePsk() {
for (const element of this.form.querySelectorAll('.js-tls-psk-change')) {
element.remove();