mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch '157-compatibilidad-ante-cambios-de-ip-en-el-agente-integria-4208-parte2-open' into 'develop'
ip dinamic in policies See merge request !49
This commit is contained in:
commit
dd58ea3ee0
@ -66,10 +66,36 @@ $extra_title = __('Network server module');
|
|||||||
$data = array ();
|
$data = array ();
|
||||||
$data[0] = __('Target IP');
|
$data[0] = __('Target IP');
|
||||||
//show agent_for defect;
|
//show agent_for defect;
|
||||||
|
|
||||||
|
if($page == 'enterprise/godmode/policies/policy_modules'){
|
||||||
|
|
||||||
|
if($ip_target != 'auto' && $ip_target != ''){
|
||||||
|
$custom_ip_target = $ip_target;
|
||||||
|
$ip_target = 'custom';
|
||||||
|
}
|
||||||
|
elseif($ip_target == ''){
|
||||||
|
$ip_target = 'force_pri';
|
||||||
|
$custom_ip_target = '';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$custom_ip_target = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$target_ip_values = array();
|
||||||
|
$target_ip_values['auto'] = __('Auto');
|
||||||
|
$target_ip_values['force_pri'] = __('Force primary key');
|
||||||
|
$target_ip_values['custom'] = __('Custom');
|
||||||
|
|
||||||
|
$data[1] = html_print_select ($target_ip_values, 'ip_target', $ip_target, '', '', '',
|
||||||
|
true, false, false, '', false, 'width:200px;');
|
||||||
|
$data[1] .= html_print_input_text ('custom_ip_target', $custom_ip_target, '', 15, 60, true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
if($ip_target == 'auto'){
|
if($ip_target == 'auto'){
|
||||||
$ip_target = agents_get_address ($id_agente);
|
$ip_target = agents_get_address ($id_agente);
|
||||||
}
|
}
|
||||||
$data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
|
$data[1] = html_print_input_text ('ip_target', $ip_target, '', 15, 60, true);
|
||||||
|
}
|
||||||
|
|
||||||
// In ICMP modules, port is not configurable
|
// In ICMP modules, port is not configurable
|
||||||
if ($id_module_type >= 6 && $id_module_type <= 7) {
|
if ($id_module_type >= 6 && $id_module_type <= 7) {
|
||||||
@ -351,6 +377,18 @@ $(document).ready (function () {
|
|||||||
$('#snmp3_browser_privacy_pass').keyup(function() {
|
$('#snmp3_browser_privacy_pass').keyup(function() {
|
||||||
$('#snmp3_privacy_pass').val($(this).val());
|
$('#snmp3_privacy_pass').val($(this).val());
|
||||||
});
|
});
|
||||||
|
var custom_ip_target = "<?php echo $custom_ip_target?>";
|
||||||
|
if(custom_ip_target == ''){
|
||||||
|
$("#text-custom_ip_target").hide();
|
||||||
|
}
|
||||||
|
$('#ip_target').change(function() {
|
||||||
|
if($(this).val() == 'custom') {
|
||||||
|
$("#text-custom_ip_target").show();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$("#text-custom_ip_target").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Show the SNMP browser window
|
// Show the SNMP browser window
|
||||||
|
Loading…
x
Reference in New Issue
Block a user