2013-02-25 Miguel de Dios <miguel.dedios@artica.es>
* godmode/modules/manage_network_components_form_common.php, godmode/massive/massive_edit_modules.php, include/functions_api.php: improved the form of modules the part of critical and warning widgets. Fixes: #3605482 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7710 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
df66e4ecb6
commit
24e1fe692e
|
@ -1,3 +1,12 @@
|
||||||
|
2013-02-25 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* godmode/modules/manage_network_components_form_common.php,
|
||||||
|
godmode/massive/massive_edit_modules.php,
|
||||||
|
include/functions_api.php: improved the form of modules the part
|
||||||
|
of critical and warning widgets.
|
||||||
|
|
||||||
|
Fixes: #3605482
|
||||||
|
|
||||||
2013-02-22 Sergio Martin <sergio.martin@artica.es>
|
2013-02-22 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/functions_html.php
|
* include/functions_html.php
|
||||||
|
|
|
@ -276,25 +276,78 @@ $table->data[4][3] = html_print_select (array(), 'module[]',
|
||||||
|
|
||||||
|
|
||||||
$table->data['edit1'][0] = __('Warning status');
|
$table->data['edit1'][0] = __('Warning status');
|
||||||
$table->data['edit1'][1] = '<em>' . __('Min.') . '</em>';
|
$table->data['edit1'][1] = '<table width="100%">';
|
||||||
$table->data['edit1'][1] .= html_print_input_text('min_warning', '', '',
|
$table->data['edit1'][1] .= '<tr>';
|
||||||
5, 15, true);
|
$table->data['edit1'][1] .= '<td>';
|
||||||
$table->data['edit1'][1] .= '<br /><em>' . __('Max.') . '</em>';
|
$table->data['edit1'][1] .= '<em>' . __('Min.') . '</em>';
|
||||||
|
$table->data['edit1'][1] .= '</td>';
|
||||||
|
$table->data['edit1'][1] .= '<td align="right">';
|
||||||
|
$table->data['edit1'][1] .= html_print_input_text('min_warning',
|
||||||
|
'', '', 5, 15, true);
|
||||||
|
$table->data['edit1'][1] .= '</td>';
|
||||||
|
$table->data['edit1'][1] .= '</tr>';
|
||||||
|
$table->data['edit1'][1] .= '<tr>';
|
||||||
|
$table->data['edit1'][1] .= '<td>';
|
||||||
|
$table->data['edit1'][1] .= '<em>' . __('Max.') . '</em>';
|
||||||
|
$table->data['edit1'][1] .= '</td>';
|
||||||
|
$table->data['edit1'][1] .= '<td align="right">';
|
||||||
$table->data['edit1'][1] .= html_print_input_text ('max_warning', '', '', 5, 15, true);
|
$table->data['edit1'][1] .= html_print_input_text ('max_warning', '', '', 5, 15, true);
|
||||||
$table->data['edit1'][1] .= '<br /><em>'.__('Str.').'</em>';
|
$table->data['edit1'][1] .= '</td>';
|
||||||
|
$table->data['edit1'][1] .= '</tr>';
|
||||||
|
$table->data['edit1'][1] .= '<tr>';
|
||||||
|
$table->data['edit1'][1] .= '<td>';
|
||||||
|
$table->data['edit1'][1] .= '<em>'.__('Str.').'</em>';
|
||||||
|
$table->data['edit1'][1] .= '</td>';
|
||||||
|
$table->data['edit1'][1] .= '<td align="right">';
|
||||||
$table->data['edit1'][1] .= html_print_input_text ('str_warning', '', '', 5, 15, true);
|
$table->data['edit1'][1] .= html_print_input_text ('str_warning', '', '', 5, 15, true);
|
||||||
$table->data['edit1'][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
$table->data['edit1'][1] .= '</td>';
|
||||||
|
$table->data['edit1'][1] .= '</tr>';
|
||||||
|
$table->data['edit1'][1] .= '<tr>';
|
||||||
|
$table->data['edit1'][1] .= '<td>';
|
||||||
|
$table->data['edit1'][1] .= '<em>'.__('Inverse interval').'</em>';
|
||||||
|
$table->data['edit1'][1] .= '</td>';
|
||||||
|
$table->data['edit1'][1] .= '<td align="right">';
|
||||||
$table->data['edit1'][1] .= html_print_checkbox ("warning_inverse", 1, '', true);
|
$table->data['edit1'][1] .= html_print_checkbox ("warning_inverse", 1, '', true);
|
||||||
|
$table->data['edit1'][1] .= '</td>';
|
||||||
|
$table->data['edit1'][1] .= '</tr>';
|
||||||
|
$table->data['edit1'][1] .= '</table>';
|
||||||
|
|
||||||
$table->data['edit1'][2] = __('Critical status');
|
$table->data['edit1'][2] = __('Critical status');
|
||||||
$table->data['edit1'][3] = '<em>'.__('Min.').'</em>';
|
$table->data['edit1'][3] = '<table width="100%">';
|
||||||
$table->data['edit1'][3] .= html_print_input_text ('min_critical', '', '', 5, 15, true);
|
$table->data['edit1'][3] .= '<tr>';
|
||||||
$table->data['edit1'][3] .= '<br /><em>'.__('Max.').'</em>';
|
$table->data['edit1'][3] .= '<td>';
|
||||||
|
$table->data['edit1'][3] .= '<em>' . __('Min.') . '</em>';
|
||||||
|
$table->data['edit1'][3] .= '</td>';
|
||||||
|
$table->data['edit1'][3] .= '<td align="right">';
|
||||||
|
$table->data['edit1'][3] .= html_print_input_text('min_critical',
|
||||||
|
'', '', 5, 15, true);
|
||||||
|
$table->data['edit1'][3] .= '</td>';
|
||||||
|
$table->data['edit1'][3] .= '</tr>';
|
||||||
|
$table->data['edit1'][3] .= '<tr>';
|
||||||
|
$table->data['edit1'][3] .= '<td>';
|
||||||
|
$table->data['edit1'][3] .= '<em>' . __('Max.') . '</em>';
|
||||||
|
$table->data['edit1'][3] .= '</td>';
|
||||||
|
$table->data['edit1'][3] .= '<td align="right">';
|
||||||
$table->data['edit1'][3] .= html_print_input_text ('max_critical', '', '', 5, 15, true);
|
$table->data['edit1'][3] .= html_print_input_text ('max_critical', '', '', 5, 15, true);
|
||||||
$table->data['edit1'][3] .= '<br /><em>'.__('Str.').'</em>';
|
$table->data['edit1'][3] .= '</td>';
|
||||||
|
$table->data['edit1'][3] .= '</tr>';
|
||||||
|
$table->data['edit1'][3] .= '<tr>';
|
||||||
|
$table->data['edit1'][3] .= '<td>';
|
||||||
|
$table->data['edit1'][3] .= '<em>'.__('Str.').'</em>';
|
||||||
|
$table->data['edit1'][3] .= '</td>';
|
||||||
|
$table->data['edit1'][3] .= '<td align="right">';
|
||||||
$table->data['edit1'][3] .= html_print_input_text ('str_critical', '', '', 5, 15, true);
|
$table->data['edit1'][3] .= html_print_input_text ('str_critical', '', '', 5, 15, true);
|
||||||
$table->data['edit1'][3] .= '<br /><em>'.__('Inverse interval').'</em>';
|
$table->data['edit1'][3] .= '</td>';
|
||||||
|
$table->data['edit1'][3] .= '</tr>';
|
||||||
|
$table->data['edit1'][3] .= '<tr>';
|
||||||
|
$table->data['edit1'][3] .= '<td>';
|
||||||
|
$table->data['edit1'][3] .= '<em>'.__('Inverse interval').'</em>';
|
||||||
|
$table->data['edit1'][3] .= '</td>';
|
||||||
|
$table->data['edit1'][3] .= '<td align="right">';
|
||||||
$table->data['edit1'][3] .= html_print_checkbox ("critical_inverse", 1, '', true);
|
$table->data['edit1'][3] .= html_print_checkbox ("critical_inverse", 1, '', true);
|
||||||
|
$table->data['edit1'][3] .= '</td>';
|
||||||
|
$table->data['edit1'][3] .= '</tr>';
|
||||||
|
$table->data['edit1'][3] .= '</table>';
|
||||||
|
|
||||||
$table->data['edit2'][0] = __('Interval');
|
$table->data['edit2'][0] = __('Interval');
|
||||||
$table->data['edit2'][1] = html_print_extended_select_for_time ('module_interval', 0, '', __('No change'), '0', 10, true, 'width: 150px');
|
$table->data['edit2'][1] = html_print_extended_select_for_time ('module_interval', 0, '', __('No change'), '0', 10, true, 'width: 150px');
|
||||||
|
|
|
@ -71,9 +71,25 @@ $sql = sprintf ('SELECT id_tipo, descripcion
|
||||||
ORDER BY descripcion',
|
ORDER BY descripcion',
|
||||||
implode (',', $categories));
|
implode (',', $categories));
|
||||||
$table->data[1][1] = html_print_select_from_sql ($sql, 'type',
|
$table->data[1][1] = html_print_select_from_sql ($sql, 'type',
|
||||||
$type, ($id_component_type == 2 ? 'type_change()' : ''), '', '', true,
|
$type, '', '', '', true,
|
||||||
false, false, false, true, false, false, false, 0);
|
false, false, false, true, false, false, false, 0);
|
||||||
|
|
||||||
|
// Store the relation between id and name of the types on a hidden field
|
||||||
|
$sql = sprintf ('SELECT id_tipo, nombre
|
||||||
|
FROM ttipo_modulo
|
||||||
|
WHERE categoria IN (%s)
|
||||||
|
ORDER BY descripcion',
|
||||||
|
implode (',', $categories));
|
||||||
|
$type_names = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
|
$type_names_hash = array();
|
||||||
|
foreach($type_names as $tn) {
|
||||||
|
$type_names_hash[$tn['id_tipo']] = $tn['nombre'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->data[1][1] .= html_print_input_hidden('type_names',
|
||||||
|
base64_encode(json_encode($type_names_hash)),true);
|
||||||
|
|
||||||
$table->data[1][2] = __('Module group');
|
$table->data[1][2] = __('Module group');
|
||||||
$table->data[1][3] = html_print_select_from_sql ('SELECT id_mg, name
|
$table->data[1][3] = html_print_select_from_sql ('SELECT id_mg, name
|
||||||
FROM tmodule_group ORDER BY name',
|
FROM tmodule_group ORDER BY name',
|
||||||
|
@ -88,28 +104,28 @@ $table->data[2][3] = html_print_extended_select_for_time ('module_interval' , $m
|
||||||
|
|
||||||
|
|
||||||
$table->data[3][0] = __('Warning status');
|
$table->data[3][0] = __('Warning status');
|
||||||
$table->data[3][1] = '<em>'.__('Min.').'</em>';
|
$table->data[3][1] = '<span id="minmax_warning"><em>'.__('Min.').' </em> ';
|
||||||
$table->data[3][1] .= html_print_input_text ('min_warning', $min_warning,
|
$table->data[3][1] .= html_print_input_text ('min_warning', $min_warning,
|
||||||
'', 5, 15, true);
|
'', 5, 15, true);
|
||||||
$table->data[3][1] .= '<br /><em>'.__('Max.').'</em>';
|
$table->data[3][1] .= '<br /><em>'.__('Max.').'</em> ';
|
||||||
$table->data[3][1] .= html_print_input_text ('max_warning', $max_warning,
|
$table->data[3][1] .= html_print_input_text ('max_warning', $max_warning,
|
||||||
'', 5, 15, true);
|
'', 5, 15, true) . '</span>';
|
||||||
$table->data[3][1] .= '<br /><em>'.__('Str.').'</em>';
|
$table->data[3][1] .= '<span id="string_warning"><em>'.__('Str.').' </em> ';
|
||||||
$table->data[3][1] .= html_print_input_text ('str_warning', $str_warning,
|
$table->data[3][1] .= html_print_input_text ('str_warning', $str_warning,
|
||||||
'', 5, 15, true);
|
'', 5, 15, true) . '</span>';
|
||||||
$table->data[3][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
$table->data[3][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||||
$table->data[3][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true);
|
$table->data[3][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true);
|
||||||
|
|
||||||
$table->data[3][2] = __('Critical status');
|
$table->data[3][2] = __('Critical status');
|
||||||
$table->data[3][3] = '<em>'.__('Min.').'</em>';
|
$table->data[3][3] = '<span id="minmax_critical"><em>'.__('Min.').' </em> ';
|
||||||
$table->data[3][3] .= html_print_input_text ('min_critical', $min_critical,
|
$table->data[3][3] .= html_print_input_text ('min_critical', $min_critical,
|
||||||
'', 5, 15, true);
|
'', 5, 15, true);
|
||||||
$table->data[3][3] .= '<br /><em>'.__('Max.').'</em>';
|
$table->data[3][3] .= '<br /><em>'.__('Max.').'</em> ';
|
||||||
$table->data[3][3] .= html_print_input_text ('max_critical', $max_critical,
|
$table->data[3][3] .= html_print_input_text ('max_critical', $max_critical,
|
||||||
'', 5, 15, true);
|
'', 5, 15, true) . '</span>';
|
||||||
$table->data[3][3] .= '<br /><em>'.__('Str.').'</em>';
|
$table->data[3][3] .= '<span id="string_critical"><em>'.__('Str.').' </em> ';
|
||||||
$table->data[3][3] .= html_print_input_text ('str_critical', $str_critical,
|
$table->data[3][3] .= html_print_input_text ('str_critical', $str_critical,
|
||||||
'', 5, 15, true);
|
'', 5, 15, true) . '</span>';
|
||||||
$table->data[3][3] .= '<br /><em>'.__('Inverse interval').'</em>';
|
$table->data[3][3] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||||
$table->data[3][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
|
$table->data[3][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
|
||||||
|
|
||||||
|
@ -185,3 +201,30 @@ $table->data[$next_row][3] .= html_print_select_from_sql (
|
||||||
|
|
||||||
$next_row++;
|
$next_row++;
|
||||||
?>
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready (function () {
|
||||||
|
$("#type").change(function () {
|
||||||
|
var type_selected = $(this).val();
|
||||||
|
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
|
||||||
|
|
||||||
|
var type_name_selected = type_names[type_selected];
|
||||||
|
|
||||||
|
if (type_name_selected.match(/_string$/) == null) {
|
||||||
|
// Numeric types
|
||||||
|
$('#string_critical').hide();
|
||||||
|
$('#string_warning').hide();
|
||||||
|
$('#minmax_critical').show();
|
||||||
|
$('#minmax_warning').show();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// String types
|
||||||
|
$('#string_critical').show();
|
||||||
|
$('#string_warning').show();
|
||||||
|
$('#minmax_critical').hide();
|
||||||
|
$('#minmax_warning').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#type").trigger('change');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue