mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
2014-02-11 Sergio Martin <sergio.martin@artica.es>
* mobile/operation/agent.php mobile/operation/events.php mobile/operation/home.php mobile/operation/modules.php mobile/operation/alerts.php mobile/include/style/main.css: Improve user feedback with warnings when no modules or events found, and drawing in the header the id user logged (only in home screen) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9427 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
dc55c473ea
commit
32f32096e0
@ -1,3 +1,15 @@
|
|||||||
|
2014-02-11 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* mobile/operation/agent.php
|
||||||
|
mobile/operation/events.php
|
||||||
|
mobile/operation/home.php
|
||||||
|
mobile/operation/modules.php
|
||||||
|
mobile/operation/alerts.php
|
||||||
|
mobile/include/style/main.css: Improve user feedback
|
||||||
|
with warnings when no modules or events found, and
|
||||||
|
drawing in the header the id user logged (only in home
|
||||||
|
screen)
|
||||||
|
|
||||||
2014-02-10 Sergio Martin <sergio.martin@artica.es>
|
2014-02-10 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* mobile/include/style/main.css: Fix ugly close dialog
|
* mobile/include/style/main.css: Fix ugly close dialog
|
||||||
|
@ -773,7 +773,7 @@ table.event_details td.cell_event_name {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
#list_Modules td {
|
#list_Modules td, #list_agent_Modules td {
|
||||||
height: 35px;
|
height: 35px;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
@ -782,6 +782,16 @@ table.event_details td.cell_event_name {
|
|||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#user_logged {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 11px !important;
|
||||||
|
right: 10px;
|
||||||
|
top: 8px;
|
||||||
|
background: url(../../../images/header_user.png) no-repeat right;
|
||||||
|
padding-right: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 25em) {
|
@media screen and (max-width: 25em) {
|
||||||
#list_agent_Modules .ui-table-cell-label,
|
#list_agent_Modules .ui-table-cell-label,
|
||||||
#list_agent_Modules .cell_2,
|
#list_agent_Modules .cell_2,
|
||||||
@ -1187,6 +1197,7 @@ DIV.nodata_text {
|
|||||||
display: table-cell;
|
display: table-cell;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
font-size: 14px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
DIV.nodata_container {
|
DIV.nodata_container {
|
||||||
@ -1194,7 +1205,7 @@ DIV.nodata_container {
|
|||||||
height:100px;
|
height:100px;
|
||||||
background-repeat:no-repeat;
|
background-repeat:no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
margin: auto auto;
|
margin: 15px auto;
|
||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1210,6 +1221,12 @@ DIV.nodata_container {
|
|||||||
.ui-icon-delete {
|
.ui-icon-delete {
|
||||||
margin-top: -3px !important;
|
margin-top: -3px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.empty_advice {
|
||||||
|
color: #ff0000;
|
||||||
|
margin-top: 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* JQuery Mobile responsive hack to tables with */
|
/* JQuery Mobile responsive hack to tables with */
|
||||||
.ui-table-reflow.ui-responsive {
|
.ui-table-reflow.ui-responsive {
|
||||||
display: table !important;
|
display: table !important;
|
||||||
|
@ -159,7 +159,9 @@ class Agent {
|
|||||||
$graph_js = ob_get_clean();
|
$graph_js = ob_get_clean();
|
||||||
$html = $graph_js . $html;
|
$html = $graph_js . $html;
|
||||||
unset($this->agent['fired_count']);
|
unset($this->agent['fired_count']);
|
||||||
$html .= '<span class="agents_tiny_stats agents_tiny_stats_tactical">' . reporting_tiny_stats($this->agent, true) . ' </span><br>';
|
if ($this->agent['total_count'] > 0) {
|
||||||
|
$html .= '<span class="agents_tiny_stats agents_tiny_stats_tactical">' . reporting_tiny_stats($this->agent, true) . ' </span><br>';
|
||||||
|
}
|
||||||
$html .= "<b>" . __('Events (24h)') . "</b><br /><br />";
|
$html .= "<b>" . __('Events (24h)') . "</b><br /><br />";
|
||||||
$html .= '<div id="events_bar"></div>';
|
$html .= '<div id="events_bar"></div>';
|
||||||
$html .= '<br>';
|
$html .= '<br>';
|
||||||
@ -246,6 +248,9 @@ class Agent {
|
|||||||
postvars,
|
postvars,
|
||||||
function (data) {
|
function (data) {
|
||||||
$('#events_bar').html(data);
|
$('#events_bar').html(data);
|
||||||
|
if ($('.ui-block-a').css('float') != 'none') {
|
||||||
|
set_same_heigth();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
\"html\");
|
\"html\");
|
||||||
}
|
}
|
||||||
@ -269,6 +274,10 @@ class Agent {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($('.ui-block-a').css('float') != 'none') {
|
||||||
|
set_same_heigth();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>");
|
</script>");
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ class Alerts {
|
|||||||
|
|
||||||
$ui = UI::getInstance();
|
$ui = UI::getInstance();
|
||||||
if (empty($table)) {
|
if (empty($table)) {
|
||||||
$html = '<p style="color: #ff0000;">' . __('No alerts') . '</p>';
|
$html = '<p class="empty_advice">' . __('No alerts') . '</p>';
|
||||||
if (!$return) {
|
if (!$return) {
|
||||||
$ui->contentAddHtml($html);
|
$ui->contentAddHtml($html);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,9 @@ class Events {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($event['criticity'] == EVENT_CRIT_WARNING || $event['criticity'] == EVENT_CRIT_MAINTENANCE ) {
|
if($event['criticity'] == EVENT_CRIT_WARNING ||
|
||||||
|
$event['criticity'] == EVENT_CRIT_MAINTENANCE ||
|
||||||
|
$event['criticity'] == EVENT_CRIT_MINOR) {
|
||||||
$img_st = str_replace("white.png", "dark.png", $img_st);
|
$img_st = str_replace("white.png", "dark.png", $img_st);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -742,42 +744,30 @@ class Events {
|
|||||||
|
|
||||||
public function listEventsHtml($page = 0, $return = false, $id_table = 'list_events') {
|
public function listEventsHtml($page = 0, $return = false, $id_table = 'list_events') {
|
||||||
$system = System::getInstance();
|
$system = System::getInstance();
|
||||||
|
|
||||||
$listEvents = $this->getListEvents($page);
|
|
||||||
$events_db = $listEvents['events'];
|
|
||||||
$total_events = $listEvents['total'];
|
|
||||||
|
|
||||||
$ui = Ui::getInstance();
|
$ui = Ui::getInstance();
|
||||||
if (empty($events_db)) {
|
|
||||||
if (!$return) {
|
// Create an empty table to be filled from ajax
|
||||||
$ui->contentAddHtml('<p style="color: #ff0000;">' . __('No events') . '</p>');
|
$table = new Table();
|
||||||
}
|
$table->id = $id_table;
|
||||||
else {
|
|
||||||
return '<p style="color: #ff0000;">' . __('No events') . '</p>';
|
$no_events = '<p id="empty_advice_events" class="empty_advice" style="display: none;">' . __('No events') . '</p>';
|
||||||
}
|
|
||||||
|
if (!$return) {
|
||||||
|
$ui->contentAddHtml($table->getHTML());
|
||||||
|
|
||||||
|
$ui->contentAddHtml('<div id="loading_rows">' .
|
||||||
|
html_print_image('images/spinner.gif', true) .
|
||||||
|
' ' . __('Loading...') .
|
||||||
|
'</div>' . $no_events);
|
||||||
|
|
||||||
|
$this->addJavascriptAddBottom();
|
||||||
|
|
||||||
|
$this->addJavascriptDialog();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Create an empty table to be filled from ajax
|
$this->addJavascriptAddBottom();
|
||||||
$table = new Table();
|
|
||||||
$table->id = $id_table;
|
|
||||||
|
|
||||||
if (!$return) {
|
|
||||||
$ui->contentAddHtml($table->getHTML());
|
|
||||||
|
|
||||||
$ui->contentAddHtml('<div id="loading_rows">' .
|
|
||||||
html_print_image('images/spinner.gif', true) .
|
|
||||||
' ' . __('Loading...') .
|
|
||||||
'</div>');
|
|
||||||
|
|
||||||
$this->addJavascriptAddBottom();
|
|
||||||
|
|
||||||
$this->addJavascriptDialog();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->addJavascriptAddBottom();
|
|
||||||
|
|
||||||
return array('table' => $table->getHTML(), 'data' => $events_db);
|
return array('table' => $table->getHTML() . $no_events, 'data' => $events_db);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ui->contentAddLinkListener('list_events');
|
$ui->contentAddLinkListener('list_events');
|
||||||
@ -983,6 +973,10 @@ class Events {
|
|||||||
ajax_load_rows();
|
ajax_load_rows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.events.length == 0 && page == 1) {
|
||||||
|
$('#empty_advice_events').show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
\"json\");
|
\"json\");
|
||||||
}
|
}
|
||||||
@ -1001,6 +995,10 @@ class Events {
|
|||||||
postvars,
|
postvars,
|
||||||
function (data) {
|
function (data) {
|
||||||
add_rows(data, 'last_agent_events');
|
add_rows(data, 'last_agent_events');
|
||||||
|
if (data.events.length == 0) {
|
||||||
|
$('#last_agent_events').css('visibility', 'hidden');
|
||||||
|
$('#empty_advice_events').show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
\"json\");
|
\"json\");
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,13 @@ class Home {
|
|||||||
'text' => __('Logout'),
|
'text' => __('Logout'),
|
||||||
'href' => 'index.php?action=logout'));
|
'href' => 'index.php?action=logout'));
|
||||||
}
|
}
|
||||||
$ui->createHeader(__("Home"), $left_button);
|
|
||||||
|
$user_logged = '';
|
||||||
|
if (isset($config['id_user'])) {
|
||||||
|
$user_logged = '<span id="user_logged">' . $config['id_user'] . '</span>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$ui->createHeader(__("Home") . $user_logged, $left_button);
|
||||||
$ui->showFooter(false);
|
$ui->showFooter(false);
|
||||||
$ui->beginContent();
|
$ui->beginContent();
|
||||||
$ui->beginForm("index.php?page=agents");
|
$ui->beginForm("index.php?page=agents");
|
||||||
|
@ -548,10 +548,13 @@ class Modules {
|
|||||||
//$ui->debug($listModules, true);
|
//$ui->debug($listModules, true);
|
||||||
|
|
||||||
if ($listModules['total'] == 0) {
|
if ($listModules['total'] == 0) {
|
||||||
$html = '<p style="color: #ff0000;">' . __('No modules') . '</p>';
|
$html = '<p class="empty_advice">' . __('No modules') . '</p>';
|
||||||
if (!$return) {
|
if (!$return) {
|
||||||
$ui->contentAddHtml($html);
|
$ui->contentAddHtml($html);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!$return) {
|
if (!$return) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user