2013-04-05 Miguel de Dios <miguel.dedios@artica.es>
* mobile/operation/agents.php, mobile/operation/tactical.php, mobile/operation/home.php, mobile/include/style/main.css, include/functions_html.php, include/functions_reporting.php: some fixes and improves in the mobile console. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7933 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7498aa39f5
commit
35e02a9028
|
@ -1,3 +1,10 @@
|
|||
2013-04-05 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* mobile/operation/agents.php, mobile/operation/tactical.php,
|
||||
mobile/operation/home.php, mobile/include/style/main.css,
|
||||
include/functions_html.php, include/functions_reporting.php: some
|
||||
fixes and improves in the mobile console.
|
||||
|
||||
2013-04-05 Junichi Satoh <junichi@rworks.jp>
|
||||
|
||||
* include/help/ja/help_recontask.php: Updated help.
|
||||
|
|
|
@ -1177,7 +1177,7 @@ function html_get_predefined_table ($model = 'transparent', $columns = 4) {
|
|||
$table->style = array_fill(0, 4, 'text-align:center; width: ' . $width_percent . '%;');
|
||||
$table->width = "100%";
|
||||
}
|
||||
|
||||
|
||||
return $table;
|
||||
}
|
||||
|
||||
|
|
|
@ -983,24 +983,35 @@ function reporting_get_stats_servers($tiny = true) {
|
|||
return $output;
|
||||
}
|
||||
|
||||
function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_height = 150) {
|
||||
function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_height = 150, $links = false) {
|
||||
global $config;
|
||||
|
||||
// Link URLS
|
||||
$urls = array();
|
||||
$urls['monitor_critical'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2";
|
||||
$urls['monitor_warning'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=1";
|
||||
$urls['monitor_ok'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=0";
|
||||
$urls['monitor_unknown'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=3";
|
||||
$urls['monitor_not_init'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=5";
|
||||
|
||||
if ($links === false) {
|
||||
$urls = array();
|
||||
$urls['monitor_critical'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2";
|
||||
$urls['monitor_warning'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=1";
|
||||
$urls['monitor_ok'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=0";
|
||||
$urls['monitor_unknown'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=3";
|
||||
$urls['monitor_not_init'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=5";
|
||||
}
|
||||
else {
|
||||
$urls = array();
|
||||
$urls['monitor_critical'] = $links['monitor_critical'];
|
||||
$urls['monitor_warning'] = $links['monitor_warning'];
|
||||
$urls['monitor_ok'] = $links['monitor_ok'];
|
||||
$urls['monitor_unknown'] = $links['monitor_unknown'];
|
||||
$urls['monitor_not_init'] = $links['monitor_not_init'];
|
||||
}
|
||||
|
||||
// Modules by status table
|
||||
$table_mbs = html_get_predefined_table();
|
||||
|
||||
$table_mbs->class = "tactical_monitors";
|
||||
|
||||
$table_mbs->style[0] = $table_mbs->style[2] = 'text-align: right; padding-right: 3px;';
|
||||
$table_mbs->style[1] = $table_mbs->style[3] = 'text-align: left; padding-left: 3px;';
|
||||
|
||||
if($data["monitor_checks"] > 0) {
|
||||
|
||||
if ($data["monitor_checks"] > 0) {
|
||||
$tdata = array();
|
||||
$table_mbs->colspan[count($table_mbs->data)][0] = 4;
|
||||
$table_mbs->cellstyle[count($table_mbs->data)][0] = 'text-align: center;';
|
||||
|
@ -1014,33 +1025,33 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he
|
|||
$tdata[0] = html_print_image('images/status_sets/default/agent_critical_ball.png', true, array('title' => __('Monitor critical'), 'width' => '20px'));
|
||||
$tdata[1] = $data["monitor_critical"] <= 0 ? '-' : $data["monitor_critical"];
|
||||
$tdata[1] = '<a style="color: ' . COL_CRITICAL . ';" class="big_data" href="' . $urls['monitor_critical'] . '">' . $tdata[1] . '</a>';
|
||||
|
||||
|
||||
$tdata[2] = html_print_image('images/status_sets/default/agent_warning_ball.png', true, array('title' => __('Monitor warning'), 'width' => '20px'));
|
||||
$tdata[3] = $data["monitor_warning"] <= 0 ? '-' : $data["monitor_warning"];
|
||||
$tdata[3] = '<a style="color: ' . COL_WARNING_DARK . ';" class="big_data" href="' . $urls['monitor_warning'] . '">' . $tdata[3] . '</a>';
|
||||
$table_mbs->rowclass[] = '';
|
||||
$table_mbs->data[] = $tdata;
|
||||
|
||||
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/status_sets/default/agent_ok_ball.png', true, array('title' => __('Monitor normal'), 'width' => '20px'));
|
||||
$tdata[1] = $data["monitor_ok"] <= 0 ? '-' : $data["monitor_ok"];
|
||||
$tdata[1] = '<a style="color: ' . COL_NORMAL . ';" class="big_data" href="' . $urls["monitor_ok"] . '">' . $tdata[1] . '</a>';
|
||||
|
||||
|
||||
$tdata[2] = html_print_image('images/status_sets/default/agent_no_monitors_ball.png', true, array('title' => __('Monitor unknown'), 'width' => '20px'));
|
||||
$tdata[3] = $data["monitor_unknown"] <= 0 ? '-' : $data["monitor_unknown"];
|
||||
$tdata[3] = '<a style="color: ' . COL_UNKNOWN . ';" class="big_data" href="' . $urls["monitor_unknown"] . '">' . $tdata[3] . '</a>';
|
||||
$table_mbs->rowclass[] = '';
|
||||
$table_mbs->data[] = $tdata;
|
||||
|
||||
|
||||
$tdata = array();
|
||||
$tdata[0] = html_print_image('images/status_sets/default/agent_no_data_ball.png', true, array('title' => __('Monitor not init'), 'width' => '20px'));
|
||||
$tdata[1] = $data["monitor_not_init"] <= 0 ? '-' : $data["monitor_not_init"];
|
||||
$tdata[1] = '<a style="color: ' . COL_NOTINIT . ';" class="big_data" href="' . $urls["monitor_not_init"] . '">' . $tdata[1] . '</a>';
|
||||
|
||||
|
||||
$tdata[2] = $tdata[3] = '';
|
||||
$table_mbs->rowclass[] = '';
|
||||
$table_mbs->data[] = $tdata;
|
||||
|
||||
|
||||
$output = '<fieldset class="databox" style="width:97%;">
|
||||
<legend style="text-align:left; color: #666;">' .
|
||||
__('Monitors by status') .
|
||||
|
|
|
@ -22,10 +22,20 @@ label, input, .ui-btn-inner {
|
|||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*INIT----------Tactical styles-----------------------------------------*/
|
||||
#tactical * {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
#tactical a {
|
||||
font-size: 25px !important;
|
||||
}
|
||||
/*END-----------Tactical styles-----------------------------------------*/
|
||||
|
||||
|
||||
|
||||
/*INIT----------Groups styles-----------------------------------------*/
|
||||
.group_view tr {
|
||||
border-bottom: 3px solid white !important;
|
||||
|
|
|
@ -82,9 +82,9 @@ class Agents {
|
|||
__('Alerts') . '</b>' . $agent[7];
|
||||
$agent[8] = '<b class="ui-table-cell-label">' .
|
||||
__('Last contact') . '</b>' . $agent[8];
|
||||
|
||||
$agents[$key] = $agent;
|
||||
}
|
||||
|
||||
$agents[$key] = $agent;
|
||||
}
|
||||
|
||||
echo json_encode(array('end' => $end, 'agents' => $agents));
|
||||
|
|
|
@ -30,9 +30,9 @@ class Home {
|
|||
$ui->createDefaultHeader(__("PandoraFMS: Home"));
|
||||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
$ui->beginForm();
|
||||
$ui->beginForm("index.php?page=agents");
|
||||
$options = array(
|
||||
'name' => 'global_search',
|
||||
'name' => 'free_search',
|
||||
'value' => $this->global_search,
|
||||
'placeholder' => __('Global search')
|
||||
);
|
||||
|
@ -60,97 +60,16 @@ class Home {
|
|||
'text' => __('Alerts'),
|
||||
'href' => 'index.php?page=alerts');
|
||||
$ui->contentAddHtml($ui->createButton($options));
|
||||
//~
|
||||
//~ $ui->contentAddHtml('
|
||||
//~ <style>
|
||||
//~ /* Basic styles */
|
||||
//~ .container div {
|
||||
//~ text-align: left;
|
||||
//~ border-color: #ddd;
|
||||
//~ }
|
||||
//~ .container p {
|
||||
//~ color: #777;
|
||||
//~ line-height: 140%
|
||||
//~ }
|
||||
//~ /* Stack all blocks to start */
|
||||
//~ .container .ui-block-a,
|
||||
//~ .container .ui-block-b,
|
||||
//~ .container .ui-block-c {
|
||||
//~ width: 100%;
|
||||
//~ float: none;
|
||||
//~ }
|
||||
//~ /* 1st breakpoint - Float B and C, leave A full width on top */
|
||||
//~ @media all and (min-width: 42em){
|
||||
//~ .container div {
|
||||
//~ min-height:14em;
|
||||
//~ }
|
||||
//~ .container .ui-block-b,
|
||||
//~ .container .ui-block-c {
|
||||
//~ float:left;
|
||||
//~ width: 49.95%;
|
||||
//~ }
|
||||
//~ .container .ui-block-b p,
|
||||
//~ .container .ui-block-c p {
|
||||
//~ font-size:.8em;
|
||||
//~ }
|
||||
//~ }
|
||||
//~ /* 2nd breakpoint - Float all, 50/25/25 */
|
||||
//~ @media all and (min-width: 55em){
|
||||
//~ .container div {
|
||||
//~ min-height:17em;
|
||||
//~ }
|
||||
//~ .container .ui-block-a,
|
||||
//~ .container .ui-block-c {
|
||||
//~ float:left;
|
||||
//~ width: 49.95%;
|
||||
//~ }
|
||||
//~ .container .ui-block-b,
|
||||
//~ .container .ui-block-c {
|
||||
//~ float:left;
|
||||
//~ width: 24.925%;
|
||||
//~ }
|
||||
//~ }
|
||||
//~ /* 3rd breakpoint - Bump up font size at very wide screens */
|
||||
//~ @media all and (min-width: 75em){
|
||||
//~ .container {
|
||||
//~ font-size:125%;
|
||||
//~ }
|
||||
//~ .container .ui-block-a,
|
||||
//~ .container .ui-block-c {
|
||||
//~ float:left;
|
||||
//~ width: 49.95%;
|
||||
//~ }
|
||||
//~ .container .ui-block-b,
|
||||
//~ .container .ui-block-c {
|
||||
//~ float:left;
|
||||
//~ width: 24.925%;
|
||||
//~ }
|
||||
//~ }
|
||||
//~ </style>
|
||||
//~ <div class="container">
|
||||
//~ <!-- Lead story block -->
|
||||
//~ <div class="ui-block-a">
|
||||
//~ <div class="ui-body ui-body-d">
|
||||
//~ <h2>Apple schedules iPad Mini event for October 23</h2>
|
||||
//~ <p>One of the worst-kept secrets in tech has been confirmed: Apple will hold an event October 23 in San Jose, California, at which the company is widely expected to unveil a smaller, cheaper version of its popular iPad called "Mini".</p>
|
||||
//~ </div>
|
||||
//~ </div>
|
||||
//~ <!-- secondary story block #1 -->
|
||||
//~ <div class="ui-block-b">
|
||||
//~ <div class="ui-body ui-body-d">
|
||||
//~ <h4>Microsoft Surface tablet goes on sale for $499</h4>
|
||||
//~ <p>The Microsoft Surface tablet picture has come into focus. The Redmond giant filled in the blanks on the new tablets availability and specs.</p>
|
||||
//~ </div>
|
||||
//~ </div>
|
||||
//~ <!-- secondary story block #2 -->
|
||||
//~ <div class="ui-block-c">
|
||||
//~ <div class="ui-body ui-body-d">
|
||||
//~ <h4>AOL unveils Alto, an email service that syncs 5 accounts</h4>
|
||||
//~ <p>AOL, struggling to shed its outdated image, is reimagining one of the most visibly aging parts of its platform: Its email service. </p>
|
||||
//~ </div>
|
||||
//~ </div>
|
||||
//~ </div>');
|
||||
|
||||
$options = array('icon' => 'grid',
|
||||
'pos' => 'right',
|
||||
'text' => __('Agents'),
|
||||
'href' => 'index.php?page=agents');
|
||||
$ui->contentAddHtml($ui->createButton($options));
|
||||
$options = array('icon' => 'check',
|
||||
'pos' => 'right',
|
||||
'text' => __('Modules'),
|
||||
'href' => 'index.php?page=modules');
|
||||
$ui->contentAddHtml($ui->createButton($options));
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
return;
|
||||
|
|
|
@ -62,19 +62,22 @@ class Tactical {
|
|||
$data = reporting_get_group_stats();
|
||||
$data['mobile'] = true;
|
||||
|
||||
$formatted_data = reporting_get_stats_indicators($data, 280, 20, false);
|
||||
$formatted_data = reporting_get_stats_indicators($data, 200, 10, false);
|
||||
/*
|
||||
$overview = '<fieldset class="databox" style="width:97%;">
|
||||
<legend style="text-align:left; color: #666;">' .
|
||||
$formatted_data['server_health']['title'] .
|
||||
'</legend>' .
|
||||
$formatted_data['server_health']['graph'] .
|
||||
'</fieldset>' .
|
||||
|
||||
'<fieldset class="databox" style="width:97%;">
|
||||
<legend style="text-align:left; color: #666;">' .
|
||||
$formatted_data['monitor_health']['title'] .
|
||||
'</legend>' .
|
||||
$formatted_data['monitor_health']['graph'] .
|
||||
'</fieldset>' .
|
||||
|
||||
'</fieldset>' .
|
||||
'<fieldset class="databox" style="width:97%;">
|
||||
<legend style="text-align:left; color: #666;">' .
|
||||
|
@ -89,11 +92,37 @@ class Tactical {
|
|||
'</legend>' .
|
||||
$formatted_data['alert_level']['graph'] .
|
||||
'</fieldset>';
|
||||
*/
|
||||
$overview = '<table>
|
||||
<tr>
|
||||
<td>' . $formatted_data['server_health']['title'] . '</td>
|
||||
<td>' . $formatted_data['server_health']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $formatted_data['monitor_health']['title'] . '</td>
|
||||
<td>' . $formatted_data['monitor_health']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $formatted_data['module_sanity']['title'] . '</td>
|
||||
<td>' . $formatted_data['module_sanity']['graph'] . '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>' . $formatted_data['alert_level']['title'] . '</td>
|
||||
<td>' . $formatted_data['alert_level']['graph'] . '</td>
|
||||
</tr>
|
||||
</table>';
|
||||
|
||||
$ui->contentGridAddCell($overview);
|
||||
|
||||
$formatted_data = reporting_get_stats_alerts($data);
|
||||
ob_start();
|
||||
$formatted_data .= reporting_get_stats_modules_status($data) . "<br />\n" .
|
||||
$links = array();
|
||||
$links['monitor_critical'] = "index.php?page=modules&status=1";
|
||||
$links['monitor_warning'] = "index.php?page=modules&status=2";
|
||||
$links['monitor_ok'] = "index.php?page=modules&status=0";
|
||||
$links['monitor_unknown'] = "index.php?page=modules&status=3";
|
||||
$links['monitor_not_init'] = "index.php?page=modules&status=5";
|
||||
$formatted_data .= reporting_get_stats_modules_status($data, 250, 150, $links) . "<br />\n" .
|
||||
reporting_get_stats_agents_monitors($data);
|
||||
$graph_js = ob_get_clean();
|
||||
$formatted_data = $graph_js . $formatted_data;
|
||||
|
|
Loading…
Reference in New Issue