mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-6336-ifHCXXXX-nuevo-wizard-snmp-interfaces-fix' into 'develop'
Fixed oid for getting x64 interfaces module. Fixed visual (module order) bug See merge request artica/pandorafms!3556
This commit is contained in:
commit
0fad0d7f01
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Agent Wizard for SNMP and WMI
|
* Agent Wizard for SNMP and WMI
|
||||||
*
|
*
|
||||||
@ -273,7 +274,7 @@ class AgentWizard extends HTML
|
|||||||
// Check access.
|
// Check access.
|
||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
if (! check_acl($config['id_user'], 0, 'AR')) {
|
if (!check_acl($config['id_user'], 0, 'AR')) {
|
||||||
db_pandora_audit(
|
db_pandora_audit(
|
||||||
'ACL Violation',
|
'ACL Violation',
|
||||||
'Trying to access event viewer'
|
'Trying to access event viewer'
|
||||||
@ -865,7 +866,6 @@ class AgentWizard extends HTML
|
|||||||
],
|
],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -992,10 +992,51 @@ class AgentWizard extends HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->wizardSection === 'snmp_interfaces_explorer') {
|
if ($this->wizardSection === 'snmp_interfaces_explorer') {
|
||||||
// First, try x64 interfaces.
|
// Check if thereis x64 counters.
|
||||||
$this->interfacesx64 = true;
|
$snmp_tmp = '.1.3.6.1.2.1.31.1.1.1.6';
|
||||||
|
$check_x64 = get_snmpwalk(
|
||||||
|
$this->targetIp,
|
||||||
|
$this->version,
|
||||||
|
$this->community,
|
||||||
|
$this->authUserV3,
|
||||||
|
$this->securityLevelV3,
|
||||||
|
$this->authMethodV3,
|
||||||
|
$this->authPassV3,
|
||||||
|
$this->privacyMethodV3,
|
||||||
|
$this->privacyPassV3,
|
||||||
|
0,
|
||||||
|
$snmp_tmp,
|
||||||
|
$this->targetPort,
|
||||||
|
$this->server,
|
||||||
|
$this->extraArguments
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($check_x64) {
|
||||||
|
$this->interfacesx64 = true;
|
||||||
|
$oidExplore = '.1.3.6.1.2.1.31.1.1.1.1';
|
||||||
|
} else {
|
||||||
|
$this->interfacesx64 = false;
|
||||||
|
$oidExplore = '1.3.6.1.2.1.2.2.1.2';
|
||||||
|
}
|
||||||
|
|
||||||
// Explore interface names.
|
// Explore interface names.
|
||||||
$oidExplore = '.1.3.6.1.2.1.31.1.1.1.1';
|
$oidExplore = '.1.3.6.1.2.1.31.1.1.1.1';
|
||||||
|
$receivedOid = get_snmpwalk(
|
||||||
|
$this->targetIp,
|
||||||
|
$this->version,
|
||||||
|
$this->community,
|
||||||
|
$this->authUserV3,
|
||||||
|
$this->securityLevelV3,
|
||||||
|
$this->authMethodV3,
|
||||||
|
$this->authPassV3,
|
||||||
|
$this->privacyMethodV3,
|
||||||
|
$this->privacyPassV3,
|
||||||
|
0,
|
||||||
|
$oidExplore,
|
||||||
|
$this->targetPort,
|
||||||
|
$this->server,
|
||||||
|
$this->extraArguments
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// Get the device PEN.
|
// Get the device PEN.
|
||||||
$oidExplore = '.1.3.6.1.2.1.1.2.0';
|
$oidExplore = '.1.3.6.1.2.1.1.2.0';
|
||||||
@ -1310,7 +1351,7 @@ class AgentWizard extends HTML
|
|||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function candidateModuleToCreate(array $data):array
|
public function candidateModuleToCreate(array $data): array
|
||||||
{
|
{
|
||||||
$modulesActivated = [];
|
$modulesActivated = [];
|
||||||
$generalInterface = false;
|
$generalInterface = false;
|
||||||
@ -1560,8 +1601,8 @@ class AgentWizard extends HTML
|
|||||||
if ($this->securityLevelV3 === 'authNoPriv'
|
if ($this->securityLevelV3 === 'authNoPriv'
|
||||||
|| $this->securityLevelV3 === 'authPriv'
|
|| $this->securityLevelV3 === 'authPriv'
|
||||||
) {
|
) {
|
||||||
$values['plugin_parameter'] = $this->authMethodV3;
|
$values['plugin_parameter'] = $this->authMethodV3;
|
||||||
$values['plugin_pass'] = $this->authPassV3;
|
$values['plugin_pass'] = $this->authPassV3;
|
||||||
if ($this->securityLevelV3 === 'authPriv') {
|
if ($this->securityLevelV3 === 'authPriv') {
|
||||||
$values['custom_string_1'] = $this->privacyMethodV3;
|
$values['custom_string_1'] = $this->privacyMethodV3;
|
||||||
$values['custom_string_2'] = $this->privacyPassV3;
|
$values['custom_string_2'] = $this->privacyPassV3;
|
||||||
@ -2261,7 +2302,7 @@ class AgentWizard extends HTML
|
|||||||
private function replacementMacrosPlugin(
|
private function replacementMacrosPlugin(
|
||||||
string $text,
|
string $text,
|
||||||
array $macros
|
array $macros
|
||||||
):string {
|
): string {
|
||||||
// Only agents.
|
// Only agents.
|
||||||
if (empty($this->idPolicy) === true) {
|
if (empty($this->idPolicy) === true) {
|
||||||
// Common.
|
// Common.
|
||||||
@ -2308,7 +2349,7 @@ class AgentWizard extends HTML
|
|||||||
?string $value,
|
?string $value,
|
||||||
?string $unit='',
|
?string $unit='',
|
||||||
?int $moduleType=0
|
?int $moduleType=0
|
||||||
):string {
|
): string {
|
||||||
if ($moduleType !== MODULE_TYPE_REMOTE_SNMP_INC
|
if ($moduleType !== MODULE_TYPE_REMOTE_SNMP_INC
|
||||||
&& $moduleType !== MODULE_TYPE_GENERIC_DATA_INC
|
&& $moduleType !== MODULE_TYPE_GENERIC_DATA_INC
|
||||||
&& $moduleType !== MODULE_TYPE_REMOTE_TCP_INC
|
&& $moduleType !== MODULE_TYPE_REMOTE_TCP_INC
|
||||||
@ -2562,7 +2603,7 @@ class AgentWizard extends HTML
|
|||||||
// Unpack the extra fields
|
// Unpack the extra fields
|
||||||
// and include with key field in a field set.
|
// and include with key field in a field set.
|
||||||
$macros = json_decode($module['macros'], true);
|
$macros = json_decode($module['macros'], true);
|
||||||
$fieldSet = [ '0' => $module['query_key_field'] ];
|
$fieldSet = ['0' => $module['query_key_field']];
|
||||||
foreach ($macros as $fieldKey => $fieldMacro) {
|
foreach ($macros as $fieldKey => $fieldMacro) {
|
||||||
if (preg_match('/extra_field_/', $fieldKey) !== 0) {
|
if (preg_match('/extra_field_/', $fieldKey) !== 0) {
|
||||||
$tmpKey = explode('_', $fieldKey);
|
$tmpKey = explode('_', $fieldKey);
|
||||||
@ -3100,7 +3141,6 @@ class AgentWizard extends HTML
|
|||||||
// Add Create Modules form.
|
// Add Create Modules form.
|
||||||
$this->createModulesForm();
|
$this->createModulesForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3209,7 +3249,6 @@ class AgentWizard extends HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3306,7 +3345,7 @@ class AgentWizard extends HTML
|
|||||||
*
|
*
|
||||||
* @return array Inputs for common data.
|
* @return array Inputs for common data.
|
||||||
*/
|
*/
|
||||||
private function getCommonDataInputs():array
|
private function getCommonDataInputs(): array
|
||||||
{
|
{
|
||||||
$inputs[] = [
|
$inputs[] = [
|
||||||
'id' => 'create-modules-action',
|
'id' => 'create-modules-action',
|
||||||
@ -4116,13 +4155,13 @@ class AgentWizard extends HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function return the definition of modules for SNMP Interfaces
|
* This function return the definition of modules for SNMP Interfaces
|
||||||
*
|
*
|
||||||
* @param array $data Data.
|
* @param array $data Data.
|
||||||
*
|
*
|
||||||
* @return array Return modules for defect.
|
* @return array Return modules for defect.
|
||||||
*/
|
*/
|
||||||
private function getInterfacesModules(array $data=[])
|
private function getInterfacesModules(array $data=[])
|
||||||
{
|
{
|
||||||
$moduleDescription = '';
|
$moduleDescription = '';
|
||||||
@ -4207,6 +4246,34 @@ class AgentWizard extends HTML
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Get x86 or x64 modules.
|
||||||
|
if ($this->interfacesx64 === true) {
|
||||||
|
$definition_temp = $this->getInterfacesModulesx64($data);
|
||||||
|
} else {
|
||||||
|
$definition_temp = $this->getInterfacesModulesx86($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// General monitoring names.
|
||||||
|
$general_module_names = [
|
||||||
|
'ifInOctets / ifHCInOctets',
|
||||||
|
'ifOutOctets / ifHCOutOctets',
|
||||||
|
'ifInUcastPkts / ifHCInUcastPkts',
|
||||||
|
'ifOutUcastPkts / ifHCOutUcastPkts',
|
||||||
|
'ifInNUcastPkts / ifHCInNUcastPkts',
|
||||||
|
'ifOutNUcastPkts / ifHCOutNUcastPkts',
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($name == '') {
|
||||||
|
foreach ($definition_temp as $module => $module_def) {
|
||||||
|
$definition_temp[$module]['module_name'] = array_shift($general_module_names);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($definition_temp) === false) {
|
||||||
|
$definition = array_merge($definition, $definition_temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Continue with common x86 and x84 modules.
|
||||||
// IfAdminStatus.
|
// IfAdminStatus.
|
||||||
$moduleName = $name.'ifAdminStatus';
|
$moduleName = $name.'ifAdminStatus';
|
||||||
$definition['ifAdminStatus'] = [
|
$definition['ifAdminStatus'] = [
|
||||||
@ -4333,19 +4400,6 @@ class AgentWizard extends HTML
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
// Get x86 or x64 modules.
|
|
||||||
if ($this->interfacesx64 === true) {
|
|
||||||
$definitionx64 = $this->getInterfacesModulesx64($data);
|
|
||||||
if (empty($definitionx64) === false) {
|
|
||||||
$definition = array_merge($definition, $definitionx64);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$definitionx86 = $this->getInterfacesModulesx86($data);
|
|
||||||
if (empty($definitionx86) === false) {
|
|
||||||
$definition = array_merge($definition, $definitionx86);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $definition;
|
return $definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4815,7 +4869,7 @@ class AgentWizard extends HTML
|
|||||||
try {
|
try {
|
||||||
exec($execution, $output);
|
exec($execution, $output);
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
$output = [ '0' => 'ERROR: Failed execution: '.(string) $ex];
|
$output = ['0' => 'ERROR: Failed execution: '.(string) $ex];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
@ -4913,7 +4967,7 @@ class AgentWizard extends HTML
|
|||||||
// Meta.
|
// Meta.
|
||||||
var meta = "<?php echo is_metaconsole(); ?>";
|
var meta = "<?php echo is_metaconsole(); ?>";
|
||||||
var hack_meta = '';
|
var hack_meta = '';
|
||||||
if(meta){
|
if (meta) {
|
||||||
hack_meta = '../../';
|
hack_meta = '../../';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4921,15 +4975,15 @@ class AgentWizard extends HTML
|
|||||||
showV3Form();
|
showV3Form();
|
||||||
|
|
||||||
// Filter search interfaces snmp.
|
// Filter search interfaces snmp.
|
||||||
$('#text-filter-search').keyup(function () {
|
$('#text-filter-search').keyup(function() {
|
||||||
var string = $('#text-filter-search').val();
|
var string = $('#text-filter-search').val();
|
||||||
var regex = new RegExp(string);
|
var regex = new RegExp(string);
|
||||||
var interfaces = $('.interfaces_search');
|
var interfaces = $('.interfaces_search');
|
||||||
interfaces.each(function(){
|
interfaces.each(function() {
|
||||||
if(string == ''){
|
if (string == '') {
|
||||||
$(this).removeClass('hidden');
|
$(this).removeClass('hidden');
|
||||||
} else {
|
} else {
|
||||||
if(this.id.match(regex)) {
|
if (this.id.match(regex)) {
|
||||||
$(this).removeClass('hidden');
|
$(this).removeClass('hidden');
|
||||||
} else {
|
} else {
|
||||||
$(this).addClass('hidden');
|
$(this).addClass('hidden');
|
||||||
@ -4939,12 +4993,12 @@ class AgentWizard extends HTML
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Loading.
|
// Loading.
|
||||||
$('#submit-sub-protocol').click(function () {
|
$('#submit-sub-protocol').click(function() {
|
||||||
$('.wizard-result').remove();
|
$('.wizard-result').remove();
|
||||||
$('#form-create-modules').remove();
|
$('#form-create-modules').remove();
|
||||||
$('.textodialogo').remove();
|
$('.textodialogo').remove();
|
||||||
$('.loading-wizard')
|
$('.loading-wizard')
|
||||||
.html('<center><span style="font-size:25px;">Loading...</span><img style="width:25px;heigth:25px;" src="'+hack_meta+'images/spinner.gif"></center>');
|
.html('<center><span style="font-size:25px;">Loading...</span><img style="width:25px;heigth:25px;" src="' + hack_meta + 'images/spinner.gif"></center>');
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -4962,17 +5016,17 @@ class AgentWizard extends HTML
|
|||||||
|
|
||||||
function showSecurityLevelForm() {
|
function showSecurityLevelForm() {
|
||||||
var selector = $('#securityLevelV3').val();
|
var selector = $('#securityLevelV3').val();
|
||||||
if(selector === 'authNoPriv' || selector === 'authPriv'){
|
if (selector === 'authNoPriv' || selector === 'authPriv') {
|
||||||
$('#txt-authMethodV3').removeClass('invisible');
|
$('#txt-authMethodV3').removeClass('invisible');
|
||||||
$('#txt-authPassV3').removeClass('invisible');
|
$('#txt-authPassV3').removeClass('invisible');
|
||||||
if(selector === 'authPriv'){
|
if (selector === 'authPriv') {
|
||||||
$('#txt-privacyMethodV3').removeClass('invisible');
|
$('#txt-privacyMethodV3').removeClass('invisible');
|
||||||
$('#txt-privacyPassV3').removeClass('invisible');
|
$('#txt-privacyPassV3').removeClass('invisible');
|
||||||
} else {
|
} else {
|
||||||
$('#txt-privacyMethodV3').addClass('invisible');
|
$('#txt-privacyMethodV3').addClass('invisible');
|
||||||
$('#txt-privacyPassV3').addClass('invisible');
|
$('#txt-privacyPassV3').addClass('invisible');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$('#txt-authMethodV3').addClass('invisible');
|
$('#txt-authMethodV3').addClass('invisible');
|
||||||
$('#txt-authPassV3').addClass('invisible');
|
$('#txt-authPassV3').addClass('invisible');
|
||||||
$('#txt-privacyMethodV3').addClass('invisible');
|
$('#txt-privacyMethodV3').addClass('invisible');
|
||||||
@ -4986,45 +5040,42 @@ class AgentWizard extends HTML
|
|||||||
var text = "";
|
var text = "";
|
||||||
var failed = 0;
|
var failed = 0;
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
text = data["result"];
|
text = data["result"];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
title = "<?php echo __('Failed'); ?>";
|
title = "<?php echo __('Failed'); ?>";
|
||||||
text = err.message;
|
text = err.message;
|
||||||
failed = 1;
|
failed = 1;
|
||||||
}
|
}
|
||||||
if (!failed && data["error"] != undefined) {
|
if (!failed && data["error"] != undefined) {
|
||||||
title = "<?php echo __('Failed'); ?>";
|
title = "<?php echo __('Failed'); ?>";
|
||||||
text = data["error"];
|
text = data["error"];
|
||||||
failed = 1;
|
failed = 1;
|
||||||
}
|
}
|
||||||
if (data["report"] != undefined) {
|
if (data["report"] != undefined) {
|
||||||
data["report"].forEach(function(item) {
|
data["report"].forEach(function(item) {
|
||||||
text += "<br>" + item;
|
text += "<br>" + item;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#msg").empty();
|
$("#msg").empty();
|
||||||
$("#msg").html(text);
|
$("#msg").html(text);
|
||||||
$("#msg").dialog({
|
$("#msg").dialog({
|
||||||
width: 450,
|
width: 450,
|
||||||
position: {
|
position: {
|
||||||
my: "center",
|
my: "center",
|
||||||
at: "center",
|
at: "center",
|
||||||
of: window,
|
of: window,
|
||||||
collision: "fit"
|
collision: "fit"
|
||||||
},
|
},
|
||||||
title: title,
|
title: title,
|
||||||
buttons: [
|
buttons: [{
|
||||||
{
|
class: "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
|
||||||
class:
|
|
||||||
"ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
|
|
||||||
text: "OK",
|
text: "OK",
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
$("#msg").close();
|
$("#msg").close();
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -5044,8 +5095,8 @@ class AgentWizard extends HTML
|
|||||||
var markedCount = 0;
|
var markedCount = 0;
|
||||||
if (type == 'block') {
|
if (type == 'block') {
|
||||||
selectedBlock
|
selectedBlock
|
||||||
.parent()
|
.parent()
|
||||||
.removeClass("alpha50");
|
.removeClass("alpha50");
|
||||||
if (selectedBlock.prop("checked")) {
|
if (selectedBlock.prop("checked")) {
|
||||||
// Set to active the values of fields.
|
// Set to active the values of fields.
|
||||||
$("[id*=hidden-module-active-"+blockNumber+"]")
|
$("[id*=hidden-module-active-"+blockNumber+"]")
|
||||||
@ -5054,9 +5105,9 @@ class AgentWizard extends HTML
|
|||||||
});
|
});
|
||||||
// Set checked.
|
// Set checked.
|
||||||
$("[id*=checkbox-sel_module_" + blockNumber + "]")
|
$("[id*=checkbox-sel_module_" + blockNumber + "]")
|
||||||
.each(function(){
|
.each(function() {
|
||||||
$(this).prop("checked", true);
|
$(this).prop("checked", true);
|
||||||
});
|
});
|
||||||
imageInfoModules.removeClass('hidden');
|
imageInfoModules.removeClass('hidden');
|
||||||
} else {
|
} else {
|
||||||
// Set to inactive the values of fields.
|
// Set to inactive the values of fields.
|
||||||
@ -5066,15 +5117,15 @@ class AgentWizard extends HTML
|
|||||||
});
|
});
|
||||||
// Set unchecked.
|
// Set unchecked.
|
||||||
$("[id*=checkbox-sel_module_" + blockNumber + "]")
|
$("[id*=checkbox-sel_module_" + blockNumber + "]")
|
||||||
.each(function(){
|
.each(function() {
|
||||||
$(this).prop("checked", false);
|
$(this).prop("checked", false);
|
||||||
});
|
});
|
||||||
imageInfoModules.addClass('hidden');
|
imageInfoModules.addClass('hidden');
|
||||||
}
|
}
|
||||||
} else if (type == 'module') {
|
} else if (type == 'module') {
|
||||||
// Getting the element.
|
// Getting the element.
|
||||||
var thisModuleHidden = document.getElementById("hidden-module-active-"+switchName[2]+"_"+moduleNumber);
|
var thisModuleHidden = document.getElementById("hidden-module-active-" + switchName[2] + "_" + moduleNumber);
|
||||||
var thisModule = $("#checkbox-sel_module_"+blockNumber+"_"+moduleNumber);
|
var thisModule = $("#checkbox-sel_module_" + blockNumber + "_" + moduleNumber);
|
||||||
// Setting the individual field
|
// Setting the individual field
|
||||||
if (thisModule.prop('checked')) {
|
if (thisModule.prop('checked')) {
|
||||||
thisModuleHidden.value = '1';
|
thisModuleHidden.value = '1';
|
||||||
@ -5084,12 +5135,12 @@ class AgentWizard extends HTML
|
|||||||
|
|
||||||
// Get the list of selected modules.
|
// Get the list of selected modules.
|
||||||
$("[id*=checkbox-sel_module_" + blockNumber + "]")
|
$("[id*=checkbox-sel_module_" + blockNumber + "]")
|
||||||
.each(function() {
|
.each(function() {
|
||||||
if ($(this).prop("checked")) {
|
if ($(this).prop("checked")) {
|
||||||
markedCount++;
|
markedCount++;
|
||||||
}
|
}
|
||||||
totalCount++;
|
totalCount++;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (totalCount == markedCount) {
|
if (totalCount == markedCount) {
|
||||||
selectedBlock.prop("checked", true);
|
selectedBlock.prop("checked", true);
|
||||||
@ -5118,7 +5169,7 @@ class AgentWizard extends HTML
|
|||||||
*/
|
*/
|
||||||
function switchBlockControlInterfaces(e) {
|
function switchBlockControlInterfaces(e) {
|
||||||
var string = $('#text-filter-search').val();
|
var string = $('#text-filter-search').val();
|
||||||
if(string == ''){
|
if (string == '') {
|
||||||
if (e.checked) {
|
if (e.checked) {
|
||||||
$(".interfaz_select").prop("checked", true);
|
$(".interfaz_select").prop("checked", true);
|
||||||
} else {
|
} else {
|
||||||
@ -5127,15 +5178,15 @@ class AgentWizard extends HTML
|
|||||||
} else {
|
} else {
|
||||||
var regex = new RegExp(string);
|
var regex = new RegExp(string);
|
||||||
var interfaces = $('.interfaces_search');
|
var interfaces = $('.interfaces_search');
|
||||||
interfaces.each(function(){
|
interfaces.each(function() {
|
||||||
if(this.id.match(regex)) {
|
if (this.id.match(regex)) {
|
||||||
$(this).removeClass('hidden');
|
$(this).removeClass('hidden');
|
||||||
if (e.checked) {
|
if (e.checked) {
|
||||||
$("input[name='interfaz_select_"+this.id+"']")
|
$("input[name='interfaz_select_" + this.id + "']")
|
||||||
.prop("checked", true);
|
.prop("checked", true);
|
||||||
} else {
|
} else {
|
||||||
$("input[name='interfaz_select_"+this.id+"']")
|
$("input[name='interfaz_select_" + this.id + "']")
|
||||||
.prop("checked", false);
|
.prop("checked", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -5143,13 +5194,13 @@ class AgentWizard extends HTML
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the modal with modules for create.
|
* Show the modal with modules for create.
|
||||||
*/
|
*/
|
||||||
function processListModules() {
|
function processListModules() {
|
||||||
confirmDialog({
|
confirmDialog({
|
||||||
title: "<?php echo __('Modules about to be created'); ?>",
|
title: "<?php echo __('Modules about to be created'); ?>",
|
||||||
message: function() {
|
message: function() {
|
||||||
var id = "div-"+uniqId();
|
var id = "div-" + uniqId();
|
||||||
var loading = "<?php echo __('Loading'); ?>" + "...";
|
var loading = "<?php echo __('Loading'); ?>" + "...";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "post",
|
method: "post",
|
||||||
@ -5165,22 +5216,22 @@ class AgentWizard extends HTML
|
|||||||
},
|
},
|
||||||
datatype: "html",
|
datatype: "html",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$('#'+id).empty().append(data);
|
$('#' + id).empty().append(data);
|
||||||
},
|
},
|
||||||
error: function(e) {
|
error: function(e) {
|
||||||
showMsg(e);
|
showMsg(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return "<div id ='"+id+"'>"+loading+"</div>";
|
return "<div id ='" + id + "'>" + loading + "</div>";
|
||||||
},
|
},
|
||||||
ok: "<?php echo __('OK'); ?>",
|
ok: "<?php echo __('OK'); ?>",
|
||||||
cancel: "<?php echo __('Cancel'); ?>",
|
cancel: "<?php echo __('Cancel'); ?>",
|
||||||
onAccept: function() {
|
onAccept: function() {
|
||||||
$('#reviewed-modules').submit();
|
$('#reviewed-modules').submit();
|
||||||
},
|
},
|
||||||
size:750,
|
size: 750,
|
||||||
maxHeight:500
|
maxHeight: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user