Change visual of any views

This commit is contained in:
m-lopez-f 2015-03-31 09:28:06 +02:00
parent 62c940986b
commit 16679256e9
4 changed files with 68 additions and 37 deletions

View File

@ -28,7 +28,7 @@ check_login ();
require_once ("include/functions_reporting.php"); require_once ("include/functions_reporting.php");
require_once ($config["homedir"] . '/include/functions_graph.php'); require_once ($config["homedir"] . '/include/functions_graph.php');
ui_print_page_header (__('Welcome to Pandora FMS Web Console')); ui_print_page_header (__('Welcome to Pandora FMS Web Console'),'',false,"",false);
if (tags_has_user_acl_tags()) { if (tags_has_user_acl_tags()) {
ui_print_tags_warning(); ui_print_tags_warning();
@ -36,7 +36,7 @@ if (tags_has_user_acl_tags()) {
?> ?>
<table border="0" width="98%"> <table border="0" width="100%">
<tr> <tr>
<td width="30%" style="padding-right: 10px;" valign="top"> <td width="30%" style="padding-right: 10px;" valign="top">
@ -61,7 +61,13 @@ if (tags_has_user_acl_tags()) {
// Indicators // Indicators
$tdata = array(); $tdata = array();
$tdata[0] = reporting_get_stats_indicators($data); $stats = reporting_get_stats_indicators($data, 120, 10,false);
$status = '<table class="status_tactical">';
foreach ( $stats as $stat ) {
$status .= '<tr><td><b>' . $stat['title'] . '</b>' . '</td><td>' . $stat['graph'] . "</td></tr>" ;
}
$status .= '</table>';
$table->data[0][0] = $status;
$table->rowclass[] = ''; $table->rowclass[] = '';
$table->data[] = $tdata; $table->data[] = $tdata;
@ -74,7 +80,7 @@ if (tags_has_user_acl_tags()) {
// Modules by status // Modules by status
$tdata = array(); $tdata = array();
$tdata[0] = reporting_get_stats_modules_status($data); $tdata[0] = reporting_get_stats_modules_status($data,180, 100);
$table->rowclass[] = ''; $table->rowclass[] = '';
$table->data[] = $tdata; $table->data[] = $tdata;
@ -114,7 +120,7 @@ if (tags_has_user_acl_tags()) {
//////////////////NEWS BOARD///////////////////////////// //////////////////NEWS BOARD/////////////////////////////
echo '<div id="news_board">'; echo '<div id="news_board">';
echo '<table cellpadding="4" cellspacing="4" class="databox">'; echo '<table cellpadding="4" width=100% cellspacing="4" class="databox">';
echo '<tr><th><span>' . __('News board') . '</span></th></tr>'; echo '<tr><th><span>' . __('News board') . '</span></th></tr>';
if ($config["prominent_time"] == "timestamp") { if ($config["prominent_time"] == "timestamp") {
$comparation_suffix = ""; $comparation_suffix = "";

View File

@ -242,9 +242,10 @@ $(document).ready( function() {
handsIn = 1; handsIn = 1;
openTime = new Date().getTime(); openTime = new Date().getTime();
if( typeof(table_noHover) != 'undefined') if( typeof(table_noHover) != 'undefined')
if ("ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id) if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide(); $("ul#sub"+table_noHover[0].id).hide();
$("ul#sub"+table_hover[0].id).show(); $("ul#sub"+table_hover[0].id).show();
}).mouseout(function(){ }).mouseout(function(){
table_noHover = $(this); table_noHover = $(this);
handsIn = 0; handsIn = 0;
@ -255,7 +256,6 @@ $(document).ready( function() {
$("ul#sub"+table_hover[0].id).hide(); $("ul#sub"+table_hover[0].id).hide();
} }
}, 3500); }, 3500);
}); });
$(document).ready(function(){ $(document).ready(function(){

View File

@ -77,11 +77,46 @@ if ($count == 1) {
unset($result_groups[0]); unset($result_groups[0]);
} }
} }
$total_agentes = 0;
$monitor_ok = 0;
$monitor_warning = 0;
$monitor_critical = 0;
$agents_unknown = 0;
foreach ($result_groups as $data) {
$total_agentes += $data["_total_agents_"];
$monitor_ok += $data["_monitors_ok_"];
$monitor_warning += $data["_monitors_warning_"];
$monitor_critical += $data["_monitors_critical_"];
$monitor_unknown += $data["_monitors_unknown_"];
}
$total = $monitor_ok + $monitor_warning + $monitor_critical;
//$total_ok = format_numeric (($total_agentes / $monitor_ok / 100), 1);
$total_ok = format_numeric (($monitor_ok*100)/$total,0);
$total_warning = format_numeric (($monitor_warning*100)/$total,0);
$total_critical = format_numeric (($monitor_critical*100)/$total,0);
$total_unknown = format_numeric (($monitor_unknown*100)/$total,0);
echo '<table cellpadding="0" cellspacing="0" border="0" width="100%" class="databox">';
echo "<tr>";
echo "<th style='text-align: center;'>" . __("Summary of the status groups") . "</th>";
echo "</tr>";
echo "<tr height=70px'>";
echo "<td align='center'>";
echo "<span id='sumary' style='background-color:#FC4444;'>". $total_critical ."%</span>";
echo "<span id='sumary' style='background-color:#FAD403;'>". $total_warning ."%</span>";
echo "<span id='sumary' style='background-color:#80BA27;'>". $total_ok ."%</span>";
echo "<span id='sumary' style='background-color:#B2B2B2;'>". $total_unknown ."%</span>";
echo "</td>";
echo "</tr>";
echo "</table>";
ui_pagination($count); ui_pagination($count);
if (!empty($result_groups)) { if (!empty($result_groups)) {
echo '<table cellpadding="0" cellspacing="0" style="margin-top:10px;" class="databox" border="0" width="98%">'; echo '<table cellpadding="0" cellspacing="0" style="margin-top:10px;" class="databox" border="0" width="100%">';
echo "<tr>"; echo "<tr>";
echo "<th style='width: 26px;'>" . __("Force") . "</th>"; echo "<th style='width: 26px;'>" . __("Force") . "</th>";
echo "<th width='30%' style='min-width: 60px;'>" . __("Group") . "</th>"; echo "<th width='30%' style='min-width: 60px;'>" . __("Group") . "</th>";

View File

@ -49,7 +49,7 @@ else {
} }
// Header // Header
ui_print_page_header (__("Tactical view"), "images/op_monitoring.png", false, "", false, $updated_time); ui_print_page_header (__("Tactical view"), "", false, "", false, $updated_time);
$all_data = group_get_groups_list($config['id_user'], $user_strict, 'AR', true, false, 'tactical'); $all_data = group_get_groups_list($config['id_user'], $user_strict, 'AR', true, false, 'tactical');
@ -172,23 +172,19 @@ $table->head = array ();
$table->data = array (); $table->data = array ();
$table->style = array (); $table->style = array ();
$table->data[0][0] = reporting_get_stats_indicators($data, 120, 20); $table->head[0] = '<span>' . __('Report of State') . '</span>';
$stats = reporting_get_stats_indicators($data, 120, 10,false);
$status = '<table class="status_tactical">';
foreach ( $stats as $stat ) {
$status .= '<tr><td><b>' . $stat['title'] . '</b>' . '</td><td>' . $stat['graph'] . "</td></tr>" ;
}
$status .= '</table>';
$table->data[0][0] = $status;
$table->rowclass[] = ''; $table->rowclass[] = '';
html_print_table ($table);
unset($table);
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Monitor checks // Monitor checks
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
$table->width = "100%";
$table->class = "";
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->border = 0;
$table->head = array ();
$table->data = array ();
$table->style = array ();
$data_agents = array( $data_agents = array(
__('Critical') => $data['monitor_critical'], __('Critical') => $data['monitor_critical'],
@ -198,36 +194,29 @@ $data_agents = array(
__('Not init') => $data['monitor_not_init'] __('Not init') => $data['monitor_not_init']
); );
$table->data[0][0] = reporting_get_stats_alerts($data); $table->data[1][0] = reporting_get_stats_alerts($data);
$table->data[0][0] .= reporting_get_stats_modules_status($data, 180, 100, false, $data_agents); $table->data[2][0] .= reporting_get_stats_modules_status($data, 180, 100, false, $data_agents);
$table->data[0][0] .= reporting_get_stats_agents_monitors($data); $table->data[3][0] .= reporting_get_stats_agents_monitors($data);
$table->rowclass[] = ''; $table->rowclass[] = '';
html_print_table($table);
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Server performance // Server performance
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
if ($is_admin) { if ($is_admin) {
$table->width = "99%";
$table->class = "";
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->border = 0;
$table->head = array ();
$table->data = array ();
$table->style = array ();
$table->data[0][0] = reporting_get_stats_servers(false); $table->data[4][0] = reporting_get_stats_servers(false);
$table->rowclass[] = ''; $table->rowclass[] = '';
html_print_table($table);
} }
html_print_table($table);
echo '</td>'; //Left column echo '</td>'; //Left column
echo '<td style="vertical-align: top; width: 75%; padding-top: 0px;" id="rightcolumn">'; echo '<td style="vertical-align: top; width: 56%; padding-top: 0px;" id="rightcolumn">';
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@ -240,7 +229,8 @@ if (!empty($acltags)) {
$tags_condition = tags_get_acl_tags_event_condition($acltags, false, $user_strict); $tags_condition = tags_get_acl_tags_event_condition($acltags, false, $user_strict);
if (!empty($tags_condition)) { if (!empty($tags_condition)) {
events_print_event_table ("estado<>1 AND ($tags_condition)", 10, "100%"); $events = events_print_event_table ("estado<>1 AND ($tags_condition)", 10, "100%",true);
ui_toggle($events, __('Latest events'));
} }
} }