fixed errors in graph container

This commit is contained in:
daniel 2017-07-24 10:53:04 +02:00
parent f3d6d7262e
commit 741cc05268
5 changed files with 49 additions and 15 deletions

View File

@ -41,7 +41,7 @@ if (is_ajax()){
$id_agent = get_parameter('id_agent');
$id_agent_module = get_parameter('id_agent_module');
$time_lapse = get_parameter('time_lapse');
$only_avg = (int) get_parameter('only_avg');
$only_avg = (bool) get_parameter('only_avg');
$values = array(
'id_container' => $id_container2,
@ -76,6 +76,7 @@ if (is_ajax()){
$agent_alias = get_parameter('agent_alias','');
$module_name = get_parameter('module_name','');
$tag = get_parameter('tag',0);
$only_avg = (bool) get_parameter('only_avg');
$values = array(
'id_container' => $id_container2,
@ -85,8 +86,8 @@ if (is_ajax()){
'id_module_group' => $module_group,
'agent' => $agent_alias,
'module' => $module_name,
'id_tag' => $tag);
'id_tag' => $tag,
'only_average' => $only_avg);
$id_item = db_process_sql_insert('tcontainer_item', $values);
return;
}
@ -433,7 +434,13 @@ if($edit_container){
$tag, '', __('Any'), 0, true, false, false);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = __('Only average');
$data[1] = html_print_checkbox('only_avg', 1, false,true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array();
$data[0] = "";
$data[1] = "<input style='float:right;' type=submit name='add_dynamic' class='sub add' value='".__('Add item')."'>";
@ -592,6 +599,7 @@ echo html_print_input_hidden('id_agent', 0);
var group = $("#container_id_group1").val();
var module_group = $("#combo_modulegroup").val();
var tag = $("#tag").val();
var only_avg = $("#checkbox-only_avg1").prop("checked");
var id_container = <?php echo $id_container; ?>;
jQuery.post ("ajax.php",
{"page" : "godmode/reporting/create_container",
@ -603,6 +611,7 @@ echo html_print_input_hidden('id_agent', 0);
"module_name" : module_name,
"tag" : tag,
"id_container" : id_container,
"only_avg" : only_avg,
},
function (data, status) {
var url = location.href.replace('&update_container=1', "");

View File

@ -94,7 +94,7 @@ echo "</div>";
},
success: function(data) {
$("#div_"+hash).remove();
$("#tgl_div_"+hash).prepend("<div id='div_"+hash+"' style='width: 100%;padding-left: 63px; padding-top: 7px;'>"+data+"</div>");
$("#tgl_div_"+hash).prepend("<div id='div_"+hash+"' class='graph_conteiner_inside' style='width: 99%;padding-left: 63px; padding-top: 7px;'>"+data+"</div>");
if($('div[class *= graph]').length == 0 && $('div[class *= bullet]').length == 0 && $('div[id *= gauge_]').length == 0){
$("#div_"+hash).remove();

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -162,12 +162,12 @@ if ($get_graphs){
tagente_modulo WHERE id_agente_modulo = ". $value['id_agent_module']);
$sql_alias = db_get_all_rows_sql("SELECT alias from tagente
WHERE id_agente = ". $sql_modulo[0]['id_agente']);
$table .= "<div style='width: 800px'><h4>AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."</h4><hr></div>";
$table .= "<div style='width: 90%'><h4>AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."</h4><hr></div>";
$table .= grafico_modulo_sparse(
$value['id_agent_module'],
$value['time_lapse'],
0,
800,
1000,
300,
'',
'',
@ -225,11 +225,11 @@ if ($get_graphs){
} else {
$height = 300;
}
$table .= "<div style='width: 800px'><h4>CUSTOM GRAPH ".$graph[0]['name']."</h4><hr></div>";
$table .= "<div style='width: 90%'><h4>".$graph[0]['name']."</h4><hr></div>";
$table .= graphic_combined_module($modules,
$weights,
$value['time_lapse'],
800,
1000,
$height,
'',
'',
@ -259,8 +259,10 @@ if ($get_graphs){
}
break;
case 'dynamic_graph':
$alias = " AND alias like '%".io_safe_output($value['agent'])."%'";
if($value['agent'] != ''){
$alias = " AND alias REGEXP '".$value['agent']."'";
}
if($value['id_group'] === '0'){
$id_group = "";
} else {
@ -281,8 +283,10 @@ if ($get_graphs){
$id_tag = " AND ttag_module.id_tag = ".$value['id_tag'];
}
$module_name = " AND nombre like '%".io_safe_output($value['module'])."%'";
if($value['module'] != ''){
$module_name = " AND nombre REGEXP '".$value['module']."'";
}
$id_agent_module = db_get_all_rows_sql("SELECT tagente_modulo.id_agente_modulo FROM tagente_modulo
". $tag . "WHERE 1=1" . $id_module_group . $module_name .
" AND id_agente IN (SELECT id_agente FROM tagente WHERE 1=1" .$alias.$id_group.")"
@ -296,13 +300,13 @@ if ($get_graphs){
$sql_alias2 = db_get_all_rows_sql("SELECT alias from tagente
WHERE id_agente = ". $sql_modulo2[0]['id_agente']);
$table .= "<div style='width: 800px'><h4>AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."</h4><hr></div>";
$table .= "<div style='width: 90%'><h4>AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."</h4><hr></div>";
$table .= grafico_modulo_sparse(
$value2['id_agente_modulo'],
$value['time_lapse'],
0,
800,
1000,
300,
'',
'',

View File

@ -4159,4 +4159,25 @@ div#footer_help{
/*view-agents lastest events for this agent*/
#div_all_events_24h{
padding: 4px;
}
/*styles graph conteiner*/
.graph_conteiner_inside > .parent_graph{
width: 100% !important;
}
.graph_conteiner_inside > .parent_graph > .menu_graph{
left: 90% !important;
}
.graph_conteiner_inside > .parent_graph > .noresizevc{
width: 90% !important;
}
.graph_conteiner_inside > div > .nodata_container > .nodata_text {
display: none;
}
.graph_conteiner_inside > div > .nodata_container{
background-size: 120px 80px !important;
}