Added helps

This commit is contained in:
manuel 2019-05-09 13:43:53 +02:00
parent f5759abcad
commit 143def5d87
6 changed files with 240 additions and 18 deletions

View File

@ -591,7 +591,7 @@ ui_toggle(
); );
ui_toggle( ui_toggle(
html_print_table($table_macros, true), html_print_table($table_macros, true),
__('Custom macros').ui_print_help_icon('module_macros', true) __('Custom macros')
); );
if ($moduletype != 13) { if ($moduletype != 13) {

View File

@ -159,6 +159,7 @@ if ($disabledBecauseInPolicy) {
} }
$update_module_id = (int) get_parameter_get('update_module'); $update_module_id = (int) get_parameter_get('update_module');
$edit_module = (bool) get_parameter_get('edit_module');
$table_simple = new stdClass(); $table_simple = new stdClass();
$table_simple->id = 'simple'; $table_simple->id = 'simple';
$table_simple->width = '100%'; $table_simple->width = '100%';
@ -270,7 +271,7 @@ if (!$in_policy) {
} }
} }
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon('module_type', true); $table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_type, true, '', 'images/help_green.png', '', 'module_type_help');
$table_simple->data[2][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true); $table_simple->data[2][0] .= html_print_input_hidden('id_module_type_hidden', $id_module_type, true);
if (isset($id_agent_module)) { if (isset($id_agent_module)) {
@ -350,6 +351,35 @@ if (!$edit) {
$table_simple->data[2][1] .= html_print_input_hidden('type_names', base64_encode(io_json_mb_encode($type_names_hash)), true); $table_simple->data[2][1] .= html_print_input_hidden('type_names', base64_encode(io_json_mb_encode($type_names_hash)), true);
} }
if ($edit_module) {
$id_module_type = (int) $id_module_type;
if (($id_module_type >= 1 && $id_module_type <= 5)
|| ($id_module_type >= 21 && $id_module_type <= 23)
|| ($id_module_type == 100)
) {
$help_header = 'local_module';
}
if ($id_module_type === 6 || $id_module_type === 7
) {
$help_header = 'icmp_module_tab';
}
if ($id_module_type >= 15 && $id_module_type <= 18) {
$help_header = 'snmp_module_tab';
}
if ($id_module_type >= 8 && $id_module_type <= 11) {
$help_header = 'tcp_module_tab';
}
if ($id_module_type >= 30 && $id_module_type <= 33) {
$help_header = 'webserver_module_tab';
}
$table_simple->data[2][0] = __('Type').' '.ui_print_help_icon($help_header, true);
}
if ($disabledBecauseInPolicy) { if ($disabledBecauseInPolicy) {
$table_simple->data[2][3] .= html_print_input_hidden('id_module_group', $id_module_group, true); $table_simple->data[2][3] .= html_print_input_hidden('id_module_group', $id_module_group, true);
} }
@ -1223,7 +1253,124 @@ $(document).ready (function () {
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val())); var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
var type_name_selected = type_names[type_selected]; var type_name_selected = type_names[type_selected];
var element = document.getElementById("module_type_help");
var language = "<?php echo $config['language']; ?>" ;
element.onclick = function (event) {
if(type_name_selected == 'async_data' ||
type_name_selected == 'async_proc' ||
type_name_selected == 'async_string' ||
type_name_selected == 'generic_proc'||
type_name_selected == 'generic_data' ||
type_name_selected == 'generic_data_inc' ||
type_name_selected == 'generic_data_inc_abs'||
type_name_selected == 'generic_data_string' ||
type_name_selected == 'keep_alive'
){
if (language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Operacion&printable=yes#Tipos_de_m.C3.B3dulos',
'_blank',
"width=800,height=400"
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Operations&printable=yes#Types_of_Modules',
'_blank',
"width=800,height=400"
);
}
}
if(type_name_selected == 'remote_icmp' ||
type_name_selected == 'remote_icmp_proc'
){
if(language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_ICMP',
'_blank',
"width=800,height=400"
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#ICMP_Monitoring',
'_blank',
"width=800,height=400"
);
}
}
if(type_name_selected == 'remote_snmp_string' ||
type_name_selected == 'remote_snmp_proc' ||
type_name_selected == 'remote_snmp_inc' ||
type_name_selected == 'remote_snmp'
){
if(language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizando_con_m.C3.B3dulos_de_red_tipo_SNMP',
'_blank',
"width=800,height=400"
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#Monitoring_by_Network_Modules_with_SNMP',
'_blank',
"width=800,height=400"
);
}
}
if(type_name_selected == 'remote_tcp_string' ||
type_name_selected == 'remote_tcp_proc' ||
type_name_selected == 'remote_tcp_inc' ||
type_name_selected == 'remote_tcp'
){
if(language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_TCP',
'_blank',
"width=800,height=400"
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Remote_Monitoring&printable=yes#TCP_Monitoring',
'_blank',
"width=800,height=400"
);
}
}
if(type_name_selected == 'web_data' ||
type_name_selected == 'web_proc' ||
type_name_selected == 'web_content_data' ||
type_name_selected == 'web_content_string'
){
if(language == 'es'){
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_es:Monitorizacion_web&printable=yes#Creaci.C3.B3n_de_m.C3.B3dulos_web',
'_blank',
"width=800,height=400"
);
}
else{
window.open(
'https://wiki.pandorafms.com/index.php?title=Pandora:Documentation_en:Web_Monitoring&printable=yes#Creating_Web_Modules',
'_blank',
"width=800,height=400"
);
}
}
}
if (type_name_selected.match(/_string$/) == null) { if (type_name_selected.match(/_string$/) == null) {
// Numeric types // Numeric types
$('#string_critical').hide(); $('#string_critical').hide();

View File

@ -42,7 +42,7 @@ if (empty($update_module_id)) {
} }
$data = []; $data = [];
$data[0] = __('Target IP'); $data[0] = __('Target IP').' '.ui_print_help_icon('wmi_module_tab', true);
$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);
$data[2] = __('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true); $data[2] = __('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true);
$data[3] = html_print_input_text( $data[3] = html_print_input_text(

View File

@ -743,7 +743,7 @@ $class = 'databox filters';
<tr id="row_name" style="" class="datos"> <tr id="row_name" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php echo __('Name').ui_print_help_icon('reports_label_field', true); ?> <?php echo __('Name'); ?>
</td> </td>
<td style=""> <td style="">
<?php <?php

View File

@ -4573,16 +4573,6 @@ function get_help_info($section_name)
break; break;
case 'module_type':
if ($es) {
$result = 2042;
$result['section'][] = 'Tipos_de_m.C3.B3dulos';
} else {
$result = 2681;
$result['section'][] = 'Types_of_Modules';
}
break;
case 'network_component': case 'network_component':
break; break;
@ -4672,7 +4662,11 @@ function get_help_info($section_name)
break; break;
case 'plugin_macros': case 'plugin_macros':
if ($es) {
$result .= 'Monitorizacion_remota&printable=yes#Macros_internas';
} else {
$result .= 'Remote_Monitoring&printable=yes#Internal_Macros';
}
break; break;
case 'plugin_parameters': case 'plugin_parameters':
@ -4704,7 +4698,19 @@ function get_help_info($section_name)
break; break;
case 'prediction_source_module': case 'prediction_source_module':
if ($es) {
$result .= 'Monitorizacion_otra&printable=yes#Tipos_de_monitorizaci.C3.B3n_predictiva';
} else {
$result .= 'Other_Monitoring&printable=yes#Types_of_predictive_monitoring';
}
break;
case 'wmi_module_tab':
if ($es) {
$result .= 'Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_de_Windows_remotos_con_WMI';
} else {
$result .= 'Remote_Monitoring&printable=yes#Windows_Remote_Monitoring_with_WMI';
}
break; break;
case 'profile': case 'profile':
@ -4944,7 +4950,11 @@ function get_help_info($section_name)
break; break;
case 'snmpwalk': case 'snmpwalk':
if ($es) {
$result .= 'Monitorizacion_remota&printable=yes#Navegador_SNMP_de_Pandora_FMS';
} else {
$result .= 'Remote_Monitoring&printable=yes#Pandora_FMS_SNMP_MIB_Browser';
}
break; break;
case 'tags_config': case 'tags_config':
@ -5507,6 +5517,38 @@ function get_help_info($section_name)
} }
break; break;
case 'local_module':
if ($es) {
$result .= 'Documentation_es:Operacion&printable=yes#Tipos_de_m.C3.B3dulos';
} else {
$result .= 'Operations&printable=yes#Types_of_Modules';
}
break;
case 'data_server_module_tab':
if ($es) {
$result .= 'Operacion&printable=yes#Tipos_de_m.C3.B3dulos';
} else {
$result .= 'Operations&printable=yes#Types_of_Modules';
}
break;
case 'network_module_tab':
if ($es) {
$result .= 'Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_ICMP';
} else {
$result .= 'Remote_Monitoring&printable=yes#ICMP_Monitoring';
}
break;
case 'wux_console':
if ($es) {
$result .= 'Monitorizacion_Usuario&printable=yes#Crear_un_m.C3.B3dulo_de_an.C3.A1lisis_web_en_Pandora_FMS_Console';
} else {
$result .= 'User_Monitorization&printable=yes#Creating_a_Web_Analytics_module_in_Pandora_FMS_Console';
}
break;
case 'gis_basic_configurations_tab': case 'gis_basic_configurations_tab':
if ($es) { if ($es) {
$result .= 'Pandora_GIS&printable=yes#Configuraci.C3.B3n_B.C3.A1sica'; $result .= 'Pandora_GIS&printable=yes#Configuraci.C3.B3n_B.C3.A1sica';
@ -5523,6 +5565,38 @@ function get_help_info($section_name)
} }
break; break;
case 'icmp_module_tab':
if ($es) {
$result .= 'Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_ICMP';
} else {
$result .= 'Remote_Monitoring&printable=yes#ICMP_Monitoring';
}
break;
case 'snmp_module_tab':
if ($es) {
$result .= 'Monitorizacion_remota&printable=yes#Monitorizando_con_m.C3.B3dulos_de_red_tipo_SNMP';
} else {
$result .= 'Remote_Monitoring&printable=yes#Monitoring_by_Network_Modules_with_SNMP';
}
break;
case 'tcp_module_tab':
if ($es) {
$result .= 'Monitorizacion_remota&printable=yes#Monitorizaci.C3.B3n_TCP';
} else {
$result .= 'Remote_Monitoring&printable=yes#TCP_Monitoring';
}
break;
case 'webserver_module_tab':
if ($es) {
$result .= 'Monitorizacion_web&printable=yes#Creaci.C3.B3n_de_m.C3.B3dulos_web';
} else {
$result .= 'Web_Monitoring&printable=yes#Creating_Web_Modules';
}
break;
case 'web_checks': case 'web_checks':
break; break;

View File

@ -1266,7 +1266,7 @@ function ui_print_alert_template_example($id_alert_template, $return=false, $pri
* *
* @return string The help tip * @return string The help tip
*/ */
function ui_print_help_icon($help_id, $return=false, $home_url='', $image='images/help_green.png', $is_relative=false) function ui_print_help_icon($help_id, $return=false, $home_url='', $image='images/help_green.png', $is_relative=false, $id='')
{ {
global $config; global $config;
@ -1292,6 +1292,7 @@ function ui_print_help_icon($help_id, $return=false, $home_url='', $image='image
'class' => 'img_help', 'class' => 'img_help',
'title' => __('Help'), 'title' => __('Help'),
'onclick' => "open_help ('".$url."')", 'onclick' => "open_help ('".$url."')",
'id' => $id,
], ],
false, false,
$is_relative && is_metaconsole() $is_relative && is_metaconsole()