2014-03-10 Miguel de Dios <miguel.dedios@artica.es>

* godmode/modules/manage_network_components_form.php: fixed the
	fields for wmi that was disabled.
	
	Incident: #637
	
	* godmode/modules/manage_network_components_form_common.php,
	godmode/modules/manage_network_components_form_wmi.php: 




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9544 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-03-10 17:01:08 +00:00
parent 5a13a5855d
commit 3673bef3fc
4 changed files with 25 additions and 178 deletions

View File

@ -1,3 +1,13 @@
2014-03-10 Miguel de Dios <miguel.dedios@artica.es>
* godmode/modules/manage_network_components_form.php: fixed the
fields for wmi that was disabled.
Incident: #637
* godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components_form_wmi.php:
2014-03-10 Miguel de Dios <miguel.dedios@artica.es>
* include/graphs/flot/pandora.flot.js: fixed the position of buttons

View File

@ -239,20 +239,27 @@ ui_require_javascript_file('pandora_modules');
function type_change () {
// type 1-4 - Generic_xxxxxx
if ((document.component.type.value > 0) && (document.component.type.value < 5)) {
$("input[name=snmp_oid]").css({backgroundColor: '#ddd'});
$("input[name=snmp_oid]").attr("disabled", true);
$("input[name=snmp_community]").css({backgroundColor: '#ddd'});
$("input[name=snmp_community]").attr("disabled", true);
$("input[name=tcp_send]").css({backgroundColor: '#ddd'});
$("input[name=tcp_send]").attr("disabled", true);
$("input[name=tcp_rcv]").css({backgroundColor: '#ddd'});
$("input[name=tcp_rcv]").attr("disabled", true);
$("input[name=tcp_port]").css({backgroundColor: '#ddd'});
$("input[name=tcp_port]").attr("disabled", true);
<?php
if ($id_component_type != MODULE_WMI) {
?>
$("input[name=snmp_oid]").css({backgroundColor: '#ddd'});
$("input[name=snmp_oid]").attr("disabled", true);
$("input[name=tcp_send]").css({backgroundColor: '#ddd'});
$("input[name=tcp_send]").attr("disabled", true);
$("input[name=tcp_port]").css({backgroundColor: '#ddd'});
$("input[name=tcp_port]").attr("disabled", true);
<?php
}
?>
$("input[name=snmp3_auth_user]").css({backgroundColor: '#ddd'});
$("input[name=snmp3_auth_user]").attr("disabled", true);

View File

@ -173,7 +173,7 @@ else {
$table->data[$next_row][0] = __('Tags');
if($tags == '') {
if ($tags == '') {
$tags_condition_not = '1 = 1';
$tags_condition_in = '1 = 0';
}

View File

@ -57,174 +57,4 @@ $data[0] = __('Post process') . ' ' . ui_print_help_icon ('postprocess', true, u
$data[1] = html_print_input_text ('post_process', $post_process, '', 12, 25, true);
$data[2] = $data[3] = '';
push_table_row($data, 'field_process');
return;
// Update an existing component
if (! $id) {
$module_interval = SECONDS_5MINUTES;
$tcp_port = "";
$tcp_rcv = "";
$tcp_send = "";
$snmp_community = "";
$id_module_group = "";
$id_group = "";
$type = 0;
$plugin_user = "Administrator";
$plugin_pass = "";
$plugin_parameter = "";
$max_timeout = 10;
$max_retries = 1;
}
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_components">';
echo '<table width="98%" cellspacing="4" cellpadding="4" class="databox_color">';
echo '<tr>';
// Name
echo '<tr><td class="datos2">' . __('Module name') . '</td>';
echo '<td class="datos2"><input type="text" name="name" size="25" value="' . $name . '"></td>';
// Type
echo '<td class="datos2">' . __('Module type') . '</td>';
echo '<td class="datos2">';
echo '<select name="tipo">';
echo '<option value="' . $type . '">' . modules_get_moduletype_name ($type);
$rows = db_get_all_rows_sql('SELECT id_tipo, nombre
FROM ttipo_modulo WHERE categoria IN (0,1,2) ORDER BY nombre;');
if ($rows === false) {
$rows = array();
}
foreach ($rows as $row) {
echo '<option value="' . $component['id_tipo'] . '">' . $component['nombre'] . '</option>';
}
echo '</select>';
echo '</td></tr>';
echo '<tr>';
// Component group
echo '<td class="datos">' . __('Group') . '</td>';
echo '<td class="datos">';
html_print_select (network_components_get_groups (),
'id_group', $id_group, '', '', '', false, false, false);
// Module group
echo '<td class="datos">' . __('Module group') . '</td>';
echo '<td class="datos">';
echo '<select name="id_module_group">';
if ($id) {
echo '<option value="' . $id_module_group . '">' . modules_get_modulegroup_name($id_module_group);
}
$rows = db_get_all_rows_in_table('tmodule_group');
if ($rows === false) {
$rows = array();
}
foreach ($rows as $row) {
echo '<option value="' . $component['id_mg'] . '">' . $component['name'] . '</option>';
}
echo '</select>';
echo '<tr>';
// Interval
echo '<td class="datos2">' . __('Module Interval') . '</td>';
echo '<td class="datos2">';
echo '<input type="text" name="module_interval" size="5" value="'.$module_interval.'">';
// Timeout
echo '<td class="datos2">' . __('Max. timeout') . '</td>';
echo '<td class="datos2">';
echo '<input type="text" name="max_timeout" size="5" value="' . $max_timeout . '">';
echo '</td></tr>';
// Timeout
echo '<td class="datos2">' . __('Max. retries') . '</td>';
echo '<td class="datos2">';
echo '<input type="text" name="max_retries" size="5" value="' . $max_retries . '">';
echo '</td></tr>';
// WMI Query
echo '<tr><td class="datos">' . __('WMI query') ;
ui_print_help_icon("wmiquery", true, ui_get_full_url(false, false, false, false));
echo '</td>';
echo '<td class="datos">';
echo '<input type="text" name="snmp_oid" size="25" value="' . $snmp_oid . '">';
echo '</td>';
// Key string
echo '<td class="datos">' . __('Key string');
ui_print_help_icon("wmikey", true, ui_get_full_url(false, false, false, false));
echo '</td>';
echo '<td class="datos">';
echo '<input type="text" name="snmp_community" size="25" value="' . $snmp_community . '">';
echo '</td></tr>';
// Field
echo '<td class="datos2">' . __('Field number');
ui_print_help_icon("wmifield", true, ui_get_full_url(false, false, false, false));
echo '</td>';
echo '<td class="datos2">';
echo '<input type="text" name="tcp_port" size="5" value="' . $tcp_port . '">';
echo '</td>';
// Namespace
echo '<td class="datos2">' . __('Namespace');
ui_print_help_icon("wminamespace", true, ui_get_full_url(false, false, false, false));
echo '</td>';
echo '<td class="datos2">';
echo '<input type="text" name="tcp_send" size="25" value="' . $tcp_send . '">';
echo '</td></tr>';
// Username
echo '<tr><td class="datos">' . __('Username') . '</td>';
echo '<td class="datos">';
echo '<input type="text" name="plugin_user" size="25" value="' . $plugin_user . '">';
echo '</td>';
// Password
echo '<td class="datos">' . __('Password') . '</td>';
echo '<td class="datos">';
echo '<input type="password" name="plugin_pass" size="25" value="' . $plugin_pass . '">';
echo '</td></tr>';
// Min data
echo '<tr><td class="datos2">' . __('Minimum Data') . '</td>';
echo '<td class="datos2">';
echo '<input type="text" name="modulo_min" size="5" value="' . $modulo_min . '">';
echo '</td>';
echo '<td class="datos2">' . __('Maximum Data') . '</td>';
echo '<td class="datos2">';
// Max data
echo '<input type="text" name="modulo_max" size="5" value="' . $modulo_max . '">';
echo '</td></tr>';
// Comments
echo '<tr><td class="datos">'.__('Comments') . '</td>';
echo '<td class="datos" colspan=3>';
echo '<textarea name="descripcion" cols=70 rows=2>';
echo $description;
echo '</textarea>';
echo '</td></tr>';
echo '</table>';
html_print_input_hidden ('id_modulo', $id_component_type);
// Update/Add buttons
echo '<div class="action-buttons" style="width: 95%">';
if ($id) {
html_print_input_hidden ('update_component', 1);
html_print_input_hidden ('id', $id);
html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"');
}
else {
html_print_input_hidden ('create_component', 1);
html_print_submit_button (__('Create'), 'crt', false, 'class="sub next"');
}
echo '</div>';
echo '</form>';
?>