mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Added type graph selection in container graph
This commit is contained in:
parent
ebc35ae791
commit
897d7bf258
@ -1403,6 +1403,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,
|
||||||
|
`type_graph` 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,10 +42,11 @@ 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');
|
||||||
|
$simple_type_graph = get_parameter('simple_type_graph');
|
||||||
|
|
||||||
if($only_avg != 'false'){
|
if($only_avg != 'false'){
|
||||||
$only_avg = 1;
|
$only_avg = 1;
|
||||||
}
|
} else{
|
||||||
else{
|
|
||||||
$only_avg = 0;
|
$only_avg = 0;
|
||||||
}
|
}
|
||||||
$values = array(
|
$values = array(
|
||||||
@ -54,7 +55,8 @@ if (is_ajax()){
|
|||||||
'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,
|
||||||
|
'type_graph' => $simple_type_graph);
|
||||||
|
|
||||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||||
return;
|
return;
|
||||||
@ -82,10 +84,10 @@ if (is_ajax()){
|
|||||||
$module_name = get_parameter('module_name','');
|
$module_name = get_parameter('module_name','');
|
||||||
$tag = get_parameter('tag',0);
|
$tag = get_parameter('tag',0);
|
||||||
$only_avg = get_parameter('only_avg');
|
$only_avg = get_parameter('only_avg');
|
||||||
|
$simple_type_graph2 = get_parameter('simple_type_graph2');
|
||||||
if($only_avg != 'false') {
|
if($only_avg != 'false') {
|
||||||
$only_avg = 1;
|
$only_avg = 1;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$only_avg = 0;
|
$only_avg = 0;
|
||||||
}
|
}
|
||||||
$values = array(
|
$values = array(
|
||||||
@ -97,7 +99,8 @@ 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,
|
||||||
|
'type_graph' => $simple_type_graph2);
|
||||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -268,6 +271,10 @@ if($edit_container){
|
|||||||
$periods[SECONDS_15DAYS] = __('15 days');
|
$periods[SECONDS_15DAYS] = __('15 days');
|
||||||
$periods[SECONDS_1MONTH] = __('1 month');
|
$periods[SECONDS_1MONTH] = __('1 month');
|
||||||
|
|
||||||
|
$type_graphs = array();
|
||||||
|
$type_graphs[0] = __('Area');
|
||||||
|
$type_graphs[1] = __('Line');
|
||||||
|
|
||||||
$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: 12%;'>";
|
||||||
@ -328,6 +335,16 @@ 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_only_avg' style='' class='datos'>";
|
||||||
|
$single_table .= "<td style='font-weight:bold;'>";
|
||||||
|
$single_table .= __('Type of graph');
|
||||||
|
$single_table .= "</td>";
|
||||||
|
$single_table .= "<td>";
|
||||||
|
$single_table .= html_print_select ($type_graphs, 'simple_type_graph', "","","",0,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>";
|
||||||
@ -445,6 +462,12 @@ if($edit_container){
|
|||||||
$table->data[] = $data;
|
$table->data[] = $data;
|
||||||
$table->rowclass[] = '';
|
$table->rowclass[] = '';
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
$data[0] = __('Type of graph');
|
||||||
|
$data[1] = html_print_select ($type_graphs, 'simple_type_graph2', "","","",0,true);
|
||||||
|
$table->data[] = $data;
|
||||||
|
$table->rowclass[] = '';
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
$data[0] = __('Only average');
|
$data[0] = __('Only average');
|
||||||
$data[1] = html_print_checkbox('only_avg_2', 1, false,true);
|
$data[1] = html_print_checkbox('only_avg_2', 1, false,true);
|
||||||
@ -560,6 +583,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
if(id_agent_module !== '0'){
|
if(id_agent_module !== '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 simple_type_graph = $("#simple_type_graph option:selected").attr('value');
|
||||||
var only_avg = $("#checkbox-only_avg").prop("checked");
|
var only_avg = $("#checkbox-only_avg").prop("checked");
|
||||||
var id_container = <?php echo $id_container; ?>;
|
var id_container = <?php echo $id_container; ?>;
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
@ -568,6 +592,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
"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,
|
||||||
|
"simple_type_graph": simple_type_graph,
|
||||||
"only_avg" : only_avg,
|
"only_avg" : only_avg,
|
||||||
"id_container" : id_container,
|
"id_container" : id_container,
|
||||||
},
|
},
|
||||||
@ -608,6 +633,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
var time_lapse = $("#hidden-period_dynamic").attr('value');
|
var time_lapse = $("#hidden-period_dynamic").attr('value');
|
||||||
var group = $("#container_id_group1").val();
|
var group = $("#container_id_group1").val();
|
||||||
var module_group = $("#combo_modulegroup").val();
|
var module_group = $("#combo_modulegroup").val();
|
||||||
|
var simple_type_graph2 = $("#simple_type_graph2 option:selected").attr('value');
|
||||||
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; ?>;
|
||||||
@ -619,6 +645,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||||||
"module_group" : module_group,
|
"module_group" : module_group,
|
||||||
"agent_alias" : agent_alias,
|
"agent_alias" : agent_alias,
|
||||||
"module_name" : module_name,
|
"module_name" : module_name,
|
||||||
|
"simple_type_graph2": simple_type_graph2,
|
||||||
"tag" : tag,
|
"tag" : tag,
|
||||||
"id_container" : id_container,
|
"id_container" : id_container,
|
||||||
"only_avg" : only_avg,
|
"only_avg" : only_avg,
|
||||||
|
@ -156,6 +156,9 @@ if ($get_graphs){
|
|||||||
if($period > 1){
|
if($period > 1){
|
||||||
$value['time_lapse'] = $period;
|
$value['time_lapse'] = $period;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$type_graph = ($value['type_graph'])? "line" : "area";
|
||||||
|
|
||||||
switch ($value['type']) {
|
switch ($value['type']) {
|
||||||
case 'simple_graph':
|
case 'simple_graph':
|
||||||
if ($contador > 0) {
|
if ($contador > 0) {
|
||||||
@ -192,7 +195,7 @@ if ($get_graphs){
|
|||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
'area');
|
$type_graph);
|
||||||
$contador --;
|
$contador --;
|
||||||
}
|
}
|
||||||
// $table .= "</br>";
|
// $table .= "</br>";
|
||||||
@ -331,7 +334,7 @@ if ($get_graphs){
|
|||||||
null,
|
null,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
'area');
|
$type_graph);
|
||||||
$contador --;
|
$contador --;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4231,7 +4231,7 @@ div#footer_help{
|
|||||||
left: 90% !important;
|
left: 90% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graph_conteiner_inside > .parent_graph > .noresizevc{
|
.graph_conteiner_inside > .parent_graph > .graph{
|
||||||
width: 90% !important;
|
width: 90% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
`type_graph` 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