mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
add fullscale container graph
This commit is contained in:
parent
f867f74290
commit
e2ee8a555d
@ -7,6 +7,8 @@ UPDATE tsnmp_filter tsf,(SELECT @max:= @max) m SET tsf.unified_filters_id = @max
|
|||||||
|
|
||||||
ALTER TABLE tgraph ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '0';
|
ALTER TABLE tgraph ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '0';
|
||||||
|
|
||||||
|
ALTER TABLE tcontainer_item ADD COLUMN `fullscale` tinyint(1) UNSIGNED NOT NULL default '0';
|
||||||
|
|
||||||
ALTER TABLE treport_content ADD COLUMN hide_no_data tinyint(1) DEFAULT 0;
|
ALTER TABLE treport_content ADD COLUMN hide_no_data tinyint(1) DEFAULT 0;
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
@ -1408,6 +1408,7 @@ CREATE TABLE IF NOT EXISTS `tcontainer_item` (
|
|||||||
`agent` varchar(100) NOT NULL default '',
|
`agent` varchar(100) NOT NULL default '',
|
||||||
`module` varchar(100) NOT NULL default '',
|
`module` varchar(100) NOT NULL default '',
|
||||||
`id_tag` integer(10) unsigned NOT NULL DEFAULT 0,
|
`id_tag` integer(10) unsigned NOT NULL DEFAULT 0,
|
||||||
|
`fullscale` tinyint(1) UNSIGNED NOT NULL default 0,
|
||||||
PRIMARY KEY(`id_ci`),
|
PRIMARY KEY(`id_ci`),
|
||||||
FOREIGN KEY (`id_container`) REFERENCES tcontainer(`id_container`)
|
FOREIGN KEY (`id_container`) REFERENCES tcontainer(`id_container`)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
|
@ -42,19 +42,30 @@ if (is_ajax()){
|
|||||||
$id_agent_module = get_parameter('id_agent_module');
|
$id_agent_module = get_parameter('id_agent_module');
|
||||||
$time_lapse = get_parameter('time_lapse');
|
$time_lapse = get_parameter('time_lapse');
|
||||||
$only_avg = get_parameter('only_avg');
|
$only_avg = get_parameter('only_avg');
|
||||||
|
$fullscale = get_parameter('fullscale');
|
||||||
if($only_avg != 'false'){
|
if($only_avg != 'false'){
|
||||||
$only_avg = 1;
|
$only_avg = 1;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$only_avg = 0;
|
$only_avg = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($fullscale != 'false'){
|
||||||
|
$fullscale = 1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$fullscale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$values = array(
|
$values = array(
|
||||||
'id_container' => $id_container2,
|
'id_container' => $id_container2,
|
||||||
'type' => "simple_graph",
|
'type' => "simple_graph",
|
||||||
'id_agent' => $id_agent,
|
'id_agent' => $id_agent,
|
||||||
'id_agent_module' => $id_agent_module,
|
'id_agent_module' => $id_agent_module,
|
||||||
'time_lapse' => $time_lapse,
|
'time_lapse' => $time_lapse,
|
||||||
'only_average' => $only_avg);
|
'only_average' => $only_avg,
|
||||||
|
'fullscale' => $fullscale
|
||||||
|
);
|
||||||
|
|
||||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||||
return;
|
return;
|
||||||
@ -63,12 +74,21 @@ if (is_ajax()){
|
|||||||
if($add_custom){
|
if($add_custom){
|
||||||
$time_lapse = get_parameter('time_lapse');
|
$time_lapse = get_parameter('time_lapse');
|
||||||
$id_custom = get_parameter('id_custom');
|
$id_custom = get_parameter('id_custom');
|
||||||
|
$fullscale = get_parameter('fullscale');
|
||||||
|
if($fullscale != 'false'){
|
||||||
|
$fullscale = 1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$fullscale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$values = array(
|
$values = array(
|
||||||
'id_container' => $id_container2,
|
'id_container' => $id_container2,
|
||||||
'type' => "custom_graph",
|
'type' => "custom_graph",
|
||||||
'time_lapse' => $time_lapse,
|
'time_lapse' => $time_lapse,
|
||||||
'id_graph' => $id_custom);
|
'id_graph' => $id_custom,
|
||||||
|
'fullscale' => $fullscale,
|
||||||
|
);
|
||||||
|
|
||||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||||
return;
|
return;
|
||||||
@ -88,6 +108,15 @@ if (is_ajax()){
|
|||||||
else{
|
else{
|
||||||
$only_avg = 0;
|
$only_avg = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$fullscale = get_parameter('fullscale');
|
||||||
|
if($fullscale != 'false'){
|
||||||
|
$fullscale = 1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$fullscale = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$values = array(
|
$values = array(
|
||||||
'id_container' => $id_container2,
|
'id_container' => $id_container2,
|
||||||
'type' => "dynamic_graph",
|
'type' => "dynamic_graph",
|
||||||
@ -97,7 +126,9 @@ if (is_ajax()){
|
|||||||
'agent' => $agent_alias,
|
'agent' => $agent_alias,
|
||||||
'module' => $module_name,
|
'module' => $module_name,
|
||||||
'id_tag' => $tag,
|
'id_tag' => $tag,
|
||||||
'only_average' => $only_avg);
|
'only_average' => $only_avg,
|
||||||
|
'fullscale' => $fullscale
|
||||||
|
);
|
||||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -270,7 +301,7 @@ if($edit_container){
|
|||||||
|
|
||||||
$single_table = "<table width='100%' cellpadding=4 cellspacing=4>";
|
$single_table = "<table width='100%' cellpadding=4 cellspacing=4>";
|
||||||
$single_table .= "<tr id='row_time_lapse' style='' class='datos'>";
|
$single_table .= "<tr id='row_time_lapse' style='' class='datos'>";
|
||||||
$single_table .= "<td style='font-weight:bold;width: 12%;'>";
|
$single_table .= "<td style='font-weight:bold;width: 13%;'>";
|
||||||
$single_table .= __('Time lapse');
|
$single_table .= __('Time lapse');
|
||||||
$single_table .= ui_print_help_tip(__('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '),true);
|
$single_table .= ui_print_help_tip(__('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '),true);
|
||||||
$single_table .= "</td>";
|
$single_table .= "</td>";
|
||||||
@ -328,6 +359,14 @@ if($edit_container){
|
|||||||
$single_table .= html_print_checkbox('only_avg', 1, true,true);
|
$single_table .= html_print_checkbox('only_avg', 1, true,true);
|
||||||
$single_table .= "</td>";
|
$single_table .= "</td>";
|
||||||
$single_table .= "</tr>";
|
$single_table .= "</tr>";
|
||||||
|
$single_table .= "<tr id='row_fullscale' style='' class='datos'>";
|
||||||
|
$single_table .= "<td style='font-weight:bold;'>";
|
||||||
|
$single_table .= __('Show full scale graph (TIP)') . ui_print_help_tip('This option may cause performance issues', true);
|
||||||
|
$single_table .= "</td>";
|
||||||
|
$single_table .= "<td>";
|
||||||
|
$single_table .= html_print_checkbox('fullscale', 1, false,true);
|
||||||
|
$single_table .= "</td>";
|
||||||
|
$single_table .= "</tr>";
|
||||||
$single_table .= "<tr>";
|
$single_table .= "<tr>";
|
||||||
$single_table .= "<td >";
|
$single_table .= "<td >";
|
||||||
$single_table .= "</td>";
|
$single_table .= "</td>";
|
||||||
@ -353,7 +392,7 @@ if($edit_container){
|
|||||||
$table->class = 'dat';
|
$table->class = 'dat';
|
||||||
|
|
||||||
$table->styleTable = 'font-weight: bold;';
|
$table->styleTable = 'font-weight: bold;';
|
||||||
$table->style[0] = 'width: 12%';
|
$table->style[0] = 'width: 13%';
|
||||||
$table->data = array();
|
$table->data = array();
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
@ -377,6 +416,13 @@ if($edit_container){
|
|||||||
$table->data[] = $data;
|
$table->data[] = $data;
|
||||||
$table->rowclass[] = '';
|
$table->rowclass[] = '';
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
$data[0] = __('Show full scale graph (TIP)') .
|
||||||
|
ui_print_help_tip('This option may cause performance issues', true);
|
||||||
|
$data[1] = html_print_checkbox('fullscale_2', 1, false,true);
|
||||||
|
$table->data[] = $data;
|
||||||
|
$table->rowclass[] = '';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = "";
|
$data[0] = "";
|
||||||
$data[1] = "<input style='float:right;' type=submit name='add_custom' class='sub add' value='".__('Add item')."'>";
|
$data[1] = "<input style='float:right;' type=submit name='add_custom' class='sub add' value='".__('Add item')."'>";
|
||||||
@ -401,7 +447,7 @@ if($edit_container){
|
|||||||
$table->class = 'dat';
|
$table->class = 'dat';
|
||||||
|
|
||||||
$table->styleTable = 'font-weight: bold;';
|
$table->styleTable = 'font-weight: bold;';
|
||||||
$table->style[0] = 'width: 12%';
|
$table->style[0] = 'width: 13%';
|
||||||
$table->data = array();
|
$table->data = array();
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
@ -451,6 +497,13 @@ if($edit_container){
|
|||||||
$table->data[] = $data;
|
$table->data[] = $data;
|
||||||
$table->rowclass[] = '';
|
$table->rowclass[] = '';
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
$data[0] = __('Show full scale graph (TIP)') .
|
||||||
|
ui_print_help_tip('This option may cause performance issues', true);
|
||||||
|
$data[1] = html_print_checkbox('fullscale_3', 1, false,true);
|
||||||
|
$table->data[] = $data;
|
||||||
|
$table->rowclass[] = '';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = "";
|
$data[0] = "";
|
||||||
$data[1] = "<input style='float:right;' type=submit name='add_dynamic' class='sub add' value='".__('Add item')."'>";
|
$data[1] = "<input style='float:right;' type=submit name='add_dynamic' class='sub add' value='".__('Add item')."'>";
|
||||||
@ -561,6 +614,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
var id_agent = $("#hidden-id_agent").attr('value');
|
var id_agent = $("#hidden-id_agent").attr('value');
|
||||||
var time_lapse = $("#hidden-period_single").attr('value');
|
var time_lapse = $("#hidden-period_single").attr('value');
|
||||||
var only_avg = $("#checkbox-only_avg").prop("checked");
|
var only_avg = $("#checkbox-only_avg").prop("checked");
|
||||||
|
var fullscale = $("#checkbox-fullscale").prop("checked");
|
||||||
var id_container = <?php echo $id_container; ?>;
|
var id_container = <?php echo $id_container; ?>;
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
{"page" : "godmode/reporting/create_container",
|
{"page" : "godmode/reporting/create_container",
|
||||||
@ -569,6 +623,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
"id_agent_module" : id_agent_module,
|
"id_agent_module" : id_agent_module,
|
||||||
"time_lapse" : time_lapse,
|
"time_lapse" : time_lapse,
|
||||||
"only_avg" : only_avg,
|
"only_avg" : only_avg,
|
||||||
|
"fullscale" : fullscale,
|
||||||
"id_container" : id_container,
|
"id_container" : id_container,
|
||||||
},
|
},
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
@ -580,9 +635,9 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$("input[name=add_custom]").click (function () {
|
$("input[name=add_custom]").click (function () {
|
||||||
var id_custom = $("#id_custom_graph").val();
|
var id_custom = $("#id_custom_graph").val();
|
||||||
|
var fullscale = $("#checkbox-fullscale_2").prop("checked");
|
||||||
if (id_custom !== '0'){
|
if (id_custom !== '0'){
|
||||||
var time_lapse = $("#hidden-period_custom").attr('value');
|
var time_lapse = $("#hidden-period_custom").attr('value');
|
||||||
var id_container = <?php echo $id_container; ?>;
|
var id_container = <?php echo $id_container; ?>;
|
||||||
@ -592,6 +647,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
"time_lapse" : time_lapse,
|
"time_lapse" : time_lapse,
|
||||||
"id_custom" : id_custom,
|
"id_custom" : id_custom,
|
||||||
"id_container" : id_container,
|
"id_container" : id_container,
|
||||||
|
"fullscale" : fullscale,
|
||||||
},
|
},
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
var url = location.href.replace('&update_container=1', "");
|
var url = location.href.replace('&update_container=1', "");
|
||||||
@ -611,6 +667,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
var tag = $("#tag").val();
|
var tag = $("#tag").val();
|
||||||
var only_avg = $("#checkbox-only_avg_2").prop("checked");
|
var only_avg = $("#checkbox-only_avg_2").prop("checked");
|
||||||
var id_container = <?php echo $id_container; ?>;
|
var id_container = <?php echo $id_container; ?>;
|
||||||
|
var fullscale = $("#checkbox-fullscale_3").prop("checked");
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
{"page" : "godmode/reporting/create_container",
|
{"page" : "godmode/reporting/create_container",
|
||||||
"add_dynamic" : 1,
|
"add_dynamic" : 1,
|
||||||
@ -622,6 +679,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
"tag" : tag,
|
"tag" : tag,
|
||||||
"id_container" : id_container,
|
"id_container" : id_container,
|
||||||
"only_avg" : only_avg,
|
"only_avg" : only_avg,
|
||||||
|
"fullscale" : fullscale,
|
||||||
},
|
},
|
||||||
function (data, status) {
|
function (data, status) {
|
||||||
var url = location.href.replace('&update_container=1', "");
|
var url = location.href.replace('&update_container=1', "");
|
||||||
|
@ -123,13 +123,12 @@ if($report_r && $report_w){
|
|||||||
if(e.which == 13) {
|
if(e.which == 13) {
|
||||||
var time = $('input[id *= hidden-period_container_'+hash+']').val();
|
var time = $('input[id *= hidden-period_container_'+hash+']').val();
|
||||||
get_graphs_container(id_container,hash,time);
|
get_graphs_container(id_container,hash,time);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
$('a[id *= tgl]').click(function(e) {
|
$('a[id *= tgl]').click(function(e) {
|
||||||
var id = e.currentTarget.id;
|
var id = e.currentTarget.id;
|
||||||
|
@ -31,9 +31,10 @@ if ($save_custom_graph) {
|
|||||||
$height = get_parameter('height', 0);
|
$height = get_parameter('height', 0);
|
||||||
$events = get_parameter('events', 0);
|
$events = get_parameter('events', 0);
|
||||||
$period = get_parameter('period', 0);
|
$period = get_parameter('period', 0);
|
||||||
|
$fullscale = get_parameter('fullscale', 0);
|
||||||
|
|
||||||
$result = (bool)custom_graphs_create($id_modules, $name,
|
$result = (bool)custom_graphs_create($id_modules, $name,
|
||||||
$description, $stacked, $width, $height, $events, $period);
|
$description, $stacked, $width, $height, $events, $period, 0, 0, false, $fullscale);
|
||||||
|
|
||||||
|
|
||||||
$return['correct'] = $result;
|
$return['correct'] = $result;
|
||||||
@ -64,6 +65,7 @@ if ($print_custom_graph) {
|
|||||||
$ttl = (int) get_parameter('ttl', 1);
|
$ttl = (int) get_parameter('ttl', 1);
|
||||||
$dashboard = (bool) get_parameter('dashboard');
|
$dashboard = (bool) get_parameter('dashboard');
|
||||||
$vconsole = (bool) get_parameter('vconsole');
|
$vconsole = (bool) get_parameter('vconsole');
|
||||||
|
$fullscale = (bool) get_parameter('fullscale');
|
||||||
|
|
||||||
echo custom_graphs_print($id_graph, $height, $width, $period, $stacked,
|
echo custom_graphs_print($id_graph, $height, $width, $period, $stacked,
|
||||||
true, $date, $only_image, $background_color, $modules_param,
|
true, $date, $only_image, $background_color, $modules_param,
|
||||||
@ -103,13 +105,14 @@ if ($print_sparse_graph) {
|
|||||||
$dashboard = (bool) get_parameter('dashboard');
|
$dashboard = (bool) get_parameter('dashboard');
|
||||||
$vconsole = (bool) get_parameter('vconsole');
|
$vconsole = (bool) get_parameter('vconsole');
|
||||||
$type_g = get_parameter('type_g', $config['type_module_charts']);
|
$type_g = get_parameter('type_g', $config['type_module_charts']);
|
||||||
|
$fullscale = get_parameter('fullscale', 0);
|
||||||
|
|
||||||
echo grafico_modulo_sparse($agent_module_id, $period, $show_events,
|
echo grafico_modulo_sparse($agent_module_id, $period, $show_events,
|
||||||
$width, $height , $title, $unit_name, $show_alerts, $avg_only,
|
$width, $height , $title, $unit_name, $show_alerts, $avg_only,
|
||||||
$pure, $date, $unit, $baseline, $return_data, $show_title,
|
$pure, $date, $unit, $baseline, $return_data, $show_title,
|
||||||
$only_image, $homeurl, $ttl, $projection, $adapt_key, $compare,
|
$only_image, $homeurl, $ttl, $projection, $adapt_key, $compare,
|
||||||
$show_unknown, $menu, $backgroundColor, $percentil,
|
$show_unknown, $menu, $backgroundColor, $percentil,
|
||||||
$dashboard, $vconsole, $type_g);
|
$dashboard, $vconsole, $type_g, $fullscale);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +195,9 @@ if ($get_graphs){
|
|||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
'area');
|
'area',
|
||||||
|
$value['fullscale']
|
||||||
|
);
|
||||||
$contador --;
|
$contador --;
|
||||||
}
|
}
|
||||||
// $table .= "</br>";
|
// $table .= "</br>";
|
||||||
@ -255,7 +260,10 @@ if ($get_graphs){
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
null,
|
null,
|
||||||
false);
|
false,
|
||||||
|
false,
|
||||||
|
$value['fullscale']
|
||||||
|
);
|
||||||
$contador --;
|
$contador --;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -331,7 +339,9 @@ if ($get_graphs){
|
|||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
'area');
|
'area',
|
||||||
|
$value['fullscale']
|
||||||
|
);
|
||||||
$contador --;
|
$contador --;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ require_once ($config['homedir'] . '/include/functions_users.php');
|
|||||||
function custom_graphs_create($id_modules = array(), $name = "",
|
function custom_graphs_create($id_modules = array(), $name = "",
|
||||||
$description = "", $stacked = CUSTOM_GRAPH_AREA, $width = 0,
|
$description = "", $stacked = CUSTOM_GRAPH_AREA, $width = 0,
|
||||||
$height = 0, $events = 0 , $period = 0, $private = 0, $id_group = 0,
|
$height = 0, $events = 0 , $period = 0, $private = 0, $id_group = 0,
|
||||||
$user = false) {
|
$user = false, $fullscale = 0) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
@ -51,7 +51,8 @@ function custom_graphs_create($id_modules = array(), $name = "",
|
|||||||
'events' => $events,
|
'events' => $events,
|
||||||
'stacked' => $stacked,
|
'stacked' => $stacked,
|
||||||
'id_group' => $id_group,
|
'id_group' => $id_group,
|
||||||
'id_graph_template' => 0
|
'id_graph_template' => 0,
|
||||||
|
'fullscale' => $fullscale,
|
||||||
));
|
));
|
||||||
|
|
||||||
if (empty($id_graph)) {
|
if (empty($id_graph)) {
|
||||||
|
@ -604,6 +604,7 @@ CREATE TABLE IF NOT EXISTS `tcontainer_item` (
|
|||||||
`agent` varchar(100) NOT NULL default '',
|
`agent` varchar(100) NOT NULL default '',
|
||||||
`module` varchar(100) NOT NULL default '',
|
`module` varchar(100) NOT NULL default '',
|
||||||
`id_tag` integer(10) unsigned NOT NULL DEFAULT 0,
|
`id_tag` integer(10) unsigned NOT NULL DEFAULT 0,
|
||||||
|
`fullscale` tinyint(1) UNSIGNED NOT NULL default 0,
|
||||||
PRIMARY KEY(`id_ci`),
|
PRIMARY KEY(`id_ci`),
|
||||||
FOREIGN KEY (`id_container`) REFERENCES tcontainer(`id_container`)
|
FOREIGN KEY (`id_container`) REFERENCES tcontainer(`id_container`)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user