Merge branch 'ent-9867-ips-custom-no-actualizan-al-cambiarlas-en-politica' into 'develop'

Ent 9867 ips custom no actualizan al cambiarlas en politica

See merge request artica/pandorafms!5802
This commit is contained in:
Rafael Ameijeiras 2023-06-29 09:52:09 +00:00
commit 9e6595be18
2 changed files with 12 additions and 14 deletions

View File

@ -90,14 +90,9 @@ push_table_simple($data, 'caption_target_ip');
$data = [];
// Show agent_for defect.
if ($page === 'enterprise/godmode/policies/policy_modules') {
if (empty($ip_target) === false && $ip_target !== 'auto') {
if ($ip_target !== 'auto' && $ip_target !== 'force_pri') {
$custom_ip_target = $ip_target;
$ip_target = 'custom';
} else if (empty($ip_target) === true) {
$ip_target = 'force_pri';
$custom_ip_target = '';
} else {
$custom_ip_target = '';
}
$target_ip_values = [];
@ -725,9 +720,13 @@ $(document).ready (function () {
});
var custom_ip_target = "<?php echo $custom_ip_target; ?>";
if(custom_ip_target == ''){
var ip_target = "<?php echo $ip_target; ?>";
if(ip_target === 'custom'){
$("#text-custom_ip_target").show();
} else {
$("#text-custom_ip_target").hide();
}
$('#ip_target').change(function() {
if($(this).val() === 'custom') {
$("#text-custom_ip_target").show();

View File

@ -43,14 +43,9 @@ if (empty($edit_module)) {
$data = [];
if ($page == 'enterprise/godmode/policies/policy_modules') {
if ($ip_target != 'auto' && $ip_target != '') {
if ($ip_target !== 'auto' && $ip_target !== 'force_pri') {
$custom_ip_target = $ip_target;
$ip_target = 'custom';
} else if ($ip_target == '') {
$ip_target = 'force_pri';
$custom_ip_target = '';
} else {
$custom_ip_target = '';
}
$target_ip_values = [];
@ -240,9 +235,13 @@ push_table_simple($data, 'key_field');
<script type="text/javascript">
$(document).ready (function () {
var custom_ip_target = "<?php echo $custom_ip_target; ?>";
if(custom_ip_target == ''){
var ip_target = "<?php echo $ip_target; ?>";
if(ip_target === 'custom'){
$("#text-custom_ip_target").show();
} else {
$("#text-custom_ip_target").hide();
}
$('#ip_target').change(function() {
if($(this).val() == 'custom') {
$("#text-custom_ip_target").show();