Source
xxxxxxxxxx
* Calling 'click' would reverse the property that was just set, and calling a manual 'click' even is just a not
<?php
/*
** Zabbix
** 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 General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/**
* @var CView $this
*/
?>
<script type="text/javascript">
jQuery(function($) {
// proxy mode: active or passive
$('#status').change(function() {
$('#ip').closest('li').toggle($('input[name=status]:checked').val() == <?= HOST_STATUS_PROXY_PASSIVE ?>);
$('#proxy_address')
.closest('li')
.toggle($('input[name=status]:checked').val() == <?= HOST_STATUS_PROXY_ACTIVE ?>);
toggleEncryptionFields();
});
$(':radio[name=useip]').change(function() {
$(':text[name=ip],:text[name=dns]')
.removeAttr('aria-required')
.filter(($(this).val() == <?= INTERFACE_USE_IP ?>) ? '[name=ip]' : '[name=dns]')
.attr('aria-required', 'true');
});
// clone button, special processing because of list of hosts
$('#clone').click(function() {
var url = new Curl('zabbix.php?action=proxy.edit');
url.setArgument('host', $('#host').val());
url.setArgument('status', $('input[name=status]:checked').val());
url.setArgument('proxy_address', $('#proxy_address').val());
url.setArgument('description', $('#description').val());
url.setArgument('ip', $('#ip').val());
url.setArgument('dns', $('#dns').val());
url.setArgument('useip', $('input[name=useip]:checked').val());
url.setArgument('port', $('#port').val());
url.setArgument('tls_connect', $('input[name=tls_connect]:checked').val());
url.setArgument('tls_psk_identity', $('#tls_psk_identity').val());
url.setArgument('tls_psk', $('#tls_psk').val());
url.setArgument('psk_edit_mode', $('#psk_edit_mode').val());
url.setArgument('tls_issuer', $('#tls_issuer').val());
url.setArgument('tls_subject', $('#tls_subject').val());
url.setArgument('tls_accept', getTlsAccept());