2013-04-02 Miguel de Dios <miguel.dedios@artica.es>

* mobile/operation/groups.php, mobile/include/style/main.css,
	include/functions_ui.php, include/functions_groups.php: change the
	skin of list groups.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7911 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-04-02 13:44:48 +00:00
parent fefe09c424
commit 9a5881c5af
5 changed files with 256 additions and 61 deletions

View File

@ -1,3 +1,9 @@
2013-04-02 Miguel de Dios <miguel.dedios@artica.es>
* mobile/operation/groups.php, mobile/include/style/main.css,
include/functions_ui.php, include/functions_groups.php: change the
skin of list groups.
2013-04-02 Mario Pulido <mario.pulido@artica.es>
* godmode/category/category.php,

View File

@ -684,7 +684,7 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
$row["status"] = "group_view_unk";
}
}
elseif ($data["monitor_ok"] > 0) {
elseif ($data["monitor_ok"] > 0) {
if ($html) {
echo "<tr class='group_view_ok' style='height: 35px;'>";
}
@ -711,11 +711,25 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
echo "</td>";
}
else {
$row[__('Group')] = $group['prefix'];
$row[__('Group')] .= "<a href='index.php?page=agents&id_group=" . $id_group . "'>";
$row[__('Group')] .= ui_print_group_icon ($id_group, true, "groups_small", '', false);
$row[__('Group')] .= ui_print_truncate_text($group['name']);
$row[__('Group')] .= "</a>";
$group_cell = __('Group');
$row[$group_cell] = $group['prefix'];
$row[$group_cell] .= "<a href='index.php?page=agents&id_group=" . $id_group . "'>";
$row[$group_cell] .= ui_print_group_icon ($id_group, true, "groups_small", '', false);
$row[$group_cell] .= ui_print_truncate_text($group['name']);
$row[$group_cell] .= "</a>";
$row['group_name'] = ui_print_truncate_text($group['name']);
if ($id_group > 0)
$icon = (string) db_get_value ('icon', 'tgrupo', 'id_grupo', (int) $id_group);
else
$icon = "world";
$row['group_icon'] = html_print_image("images/groups_small/" . $icon . ".png",
true, false, true);
//$row['group_icon'] = ui_print_group_icon ($id_group, true, "groups_small", '', false);
}
@ -759,7 +773,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
echo "</a>";
}
else {
if ($data["total_agents"] > 0) {
//if ($data["total_agents"] > 0) {
if (true) {
$row[__('Agents')] = "<a href='index.php?page=agents&id_group=" . $id_group . "'>";
$row[__('Agents')] .= $data["total_agents"];
$row[__('Agents')] .= "</a>";
@ -787,7 +802,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
}
}
else {
if ($data["agents_unknown"] > 0) {
//if ($data["agents_unknown"] > 0) {
if (true) {
$row[__('Agents unknown')] = "<a href='index.php?page=agents&id_group=" . $id_group . "&status=3'>";
$row[__('Agents unknown')] .= $data["agents_unknown"];
$row[__('Agents unknown')] .= "</a>";
@ -812,7 +828,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
}
}
else {
if ($data["monitor_unknown"] > 0) {
//if ($data["monitor_unknown"] > 0) {
if (true) {
$row[__('Unknown')] = "<a href='index.php?page=modules&id_group=" . $id_group . "&status=3'>";
$row[__('Unknown')] .= $data["monitor_unknown"];
$row[__('Unknown')] .= "</a>";
@ -838,7 +855,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
}
}
else {
if ($data["monitor_not_init"] > 0) {
//if ($data["monitor_not_init"] > 0) {
if (true) {
$row[__('Not init')] = "<a href='index.php?page=modules&id_group=" . $id_group . "&status=5'>";
$row[__('Not init')] .= $data["monitor_not_init"];
$row[__('Not init')] .= "</a>";
@ -863,7 +881,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
echo "</td>";
}
else {
if ($data["monitor_ok"] > 0) {
//if ($data["monitor_ok"] > 0) {
if (true) {
$row[__('Normal')] = "<a href='index.php?page=modules&id_group=" . $id_group . "&status=0'>";
$row[__('Normal')] .= $data["monitor_ok"];
$row[__('Normal')] .= "</a>";
@ -889,7 +908,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
}
}
else {
if ($data["monitor_warning"] > 0) {
//if ($data["monitor_warning"] > 0) {
if (true) {
$row[__('Warning')] = "<a href='index.php?page=modules&id_group=" . $id_group . "&status=1'>";
$row[__('Warning')] .= $data["monitor_warning"];
$row[__('Warning')] .= "</a>";
@ -915,7 +935,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
}
}
else {
if ($data["monitor_critical"] > 0) {
//if ($data["monitor_critical"] > 0) {
if (true) {
$row[__('Critical')] = "<a href='index.php?page=modules&id_group=" . $id_group . "&status=2'>";
$row[__('Critical')] .= $data["monitor_critical"];
$row[__('Critical')] .= "</a>";
@ -941,7 +962,8 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups, $
}
}
else {
if ($data["monitor_alerts_fired"] > 0) {
//if ($data["monitor_alerts_fired"] > 0) {
if (true) {
$row[__('Alerts fired')] = "<a href='index.php?page=alerts&group=" . $id_group . "&status=fired'>";;
$row[__('Alerts fired')] .= $data["monitor_alerts_fired"];
$row[__('Alerts fired')] .= "</a>";

View File

@ -487,12 +487,12 @@ function ui_print_tags_warning ($return = false) {
* @return string HTML code if return parameter is true.
*/
function ui_print_group_icon ($id_group, $return = false, $path = "groups_small", $style='', $link = true) {
if($id_group > 0)
if ($id_group > 0)
$icon = (string) db_get_value ('icon', 'tgrupo', 'id_grupo', (int) $id_group);
else
$icon = "world";
if($style == '')
if ($style == '')
$style = 'width: 16px; height: 16px;';
$output = '';

View File

@ -31,14 +31,31 @@ label, input, .ui-btn-inner {
border-bottom: 3px solid white !important;
}
tr.group_view_crit, .group_view_crit {
background-color: #FA3030;
color: #000000 !important;
}
.group_view_crit * {
color: #000000 !important;
}
.ui-btn-up-group_view_crit {
background: linear-gradient(#D50505, #FA3030) repeat scroll 0 0 #FA3030;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
.ui-btn-hover-group_view_crit {
background: linear-gradient(#C41616, #E94141) repeat scroll 0 0 #E94141;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
.group_view_normal, .group_view_normal *,
.group_view_norm, .group_view_norm * {
@ -48,6 +65,24 @@ tr.group_view_crit, .group_view_crit {
.group_view_norm * {
color: #000000 !important;
}
.ui-btn-up-group_view_normal,
.ui-btn-up-group_view_norm {
background: linear-gradient(#D7D7D7, #FFFFFF) repeat scroll 0 0 #FFFFFF;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
.ui-btn-hover-group_view_normal,
.ui-btn-hover-group_view_normal {
background: linear-gradient(#D7D7D7, #FFFFFF) repeat scroll 0 0 #FFFFFF;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
.group_view_ok, .group_view_ok * {
background-color: #00C000;
@ -56,6 +91,22 @@ tr.group_view_crit, .group_view_crit {
.group_view_ok * {
color: #000000 !important;
}
.ui-btn-up-group_view_ok {
background: linear-gradient(#007000, #00C000) repeat scroll 0 0 #00C000;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
.ui-btn-hover-group_view_ok {
background: linear-gradient(#096709, #0FB10F) repeat scroll 0 0 #0FB10F;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
tr.group_view_warn, .group_view_warn, tr.group_view_warn.a, a.group_view_warn, tr.a.group_view_warn {
background-color: #F5E535;
@ -63,6 +114,22 @@ tr.group_view_warn, .group_view_warn, tr.group_view_warn.a, a.group_view_warn, t
a.group_view_warn {
color: #000000 !important;
}
.ui-btn-up-group_view_warn {
background: linear-gradient(#D0BF0A, #F5E535) repeat scroll 0 0 #F5E535;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
.ui-btn-hover-group_view_warn {
background: linear-gradient(#BFB11B, #E4D746) repeat scroll 0 0 #E4D746;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
tr.group_view_alrm, .group_view_alrm {
background-color: #ED8701;
@ -70,6 +137,22 @@ tr.group_view_alrm, .group_view_alrm {
.group_view_alrm * {
color: #000000 !important;
}
.ui-btn-up-group_view_alrm {
background: linear-gradient(#9D5A01, #ED8701) repeat scroll 0 0 #ED8701;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
.ui-btn-hover-group_view_alrm {
background: linear-gradient(#91580D, #DA8414) repeat scroll 0 0 #DA8414;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
tr.group_view_unk, .group_view_unk {
background-color: #C4C4C4;
@ -77,6 +160,22 @@ tr.group_view_unk, .group_view_unk {
.group_view_unk * {
color: #000000 !important;
}
.ui-btn-up-group_view_unk {
background: linear-gradient(#9C9C9C, #C4C4C4) repeat scroll 0 0 #C4C4C4;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
.ui-btn-hover-group_view_unk {
background: linear-gradient(#888888, #B0B0B0) repeat scroll 0 0 #ECECEC;
border: 1px solid #111111;
color: #000000;
font-weight: bold;
text-shadow: none;
}
tr.group_view_data, .group_view_data {
color: #000000 !important;
@ -107,40 +206,40 @@ tr.group_view_data, .group_view_data {
/*INIT----------Events styles-----------------------------------------*/
.datos_green, .datos_greenf9, .datos_green a, .datos_greenf9 a {
background-color: #52A000;
color: #FFFFFF !important;
text-shadow: none !important;
background-color: #52A000;
color: #FFFFFF !important;
text-shadow: none !important;
}
.datos_red, .datos_redf9, .datos_red a, .datos_redf9 a {
background-color: #FF3E41;
color: #FFFFFF !important;
text-shadow: none !important;
background-color: #FF3E41;
color: #FFFFFF !important;
text-shadow: none !important;
}
.datos_yellow, .datos_yellowf9, .datos_yellow a, .datos_yellowf9 a {
background-color: #F5E535;
color: #000000 !important;
text-shadow: none !important;
background-color: #F5E535;
color: #000000 !important;
text-shadow: none !important;
}
.datos_blue, .datos_bluef9, .datos_blue a, .datos_bluef9 a {
background-color: #77E2F2;
color: #000000 !important;
text-shadow: none !important;
background-color: #77E2F2;
color: #000000 !important;
text-shadow: none !important;
}
.datos_grey, .datos_greyf9, .datos_grey a, .datos_greyf9 a {
background-color: #E4E4E4;
color: #000000 !important;
text-shadow: none !important;
background-color: #E4E4E4;
color: #000000 !important;
text-shadow: none !important;
}
.datos_pink, .datos_pinkf9, .datos_pink a, .datos_pinkf9 a {
background-color: #FF92E9;
color: #000000 !important;
text-shadow: none !important;
background-color: #FF92E9;
color: #000000 !important;
text-shadow: none !important;
}
.datos_brown, .datos_brownf9, .datos_brown a, .datos_brownf9 a {
background-color: #C97A4A;
color: #000000 !important;
text-shadow: none !important;
background-color: #C97A4A;
color: #000000 !important;
text-shadow: none !important;
}
tr.events {
@ -295,21 +394,23 @@ table#list_events th {
/*INIT-----------Agents styles----------------------------------------*/
.red, .redb, .redi, .error {
color: #CC0000;
color: #CC0000;
}
.green {
color: #5A8629;
color: #5A8629;
}
.grey {
color: #808080;
font-weight: bold;
color: #808080;
font-weight: bold;
}
/*END-----------Agents styles-----------------------------------------*/
/*INIT---------Fix the square border in search input------------------*/
.ui-input-search {
border-radius: 0.6em 0.6em 0.6em 0.6em !important;
@ -323,6 +424,13 @@ table#list_events th {
ul.ui-listview li.ui-btn div.ui-btn-inner div.ui-btn-text {
padding-top: 5px;
padding-left: 5px;
}
/*INIT---------Fix the tons of air between the rows in small table----*/
.head_vertical {
margin-top: 0px !important;
@ -343,19 +451,21 @@ table#list_events th {
/*INIT---------Fix to avoid clicks under loading message--------------*/
.ui-loader-background {
width:100% !important;
height:100% !important;
top:0 !important;
margin: 0 !important;
background: rgba(0, 0, 0, 0.3) !important;
display:none !important;
position: fixed !important;
z-index:100 !important;
width:100% !important;
height:100% !important;
top:0 !important;
margin: 0 !important;
background: rgba(0, 0, 0, 0.3) !important;
display:none !important;
position: fixed !important;
z-index:100 !important;
}
.ui-loading .ui-loader-background {
display:block !important;
display:block !important;
}
/*END----------Fix to avoid clicks under loading message--------------*/

View File

@ -27,11 +27,10 @@ class Groups {
$this->correct_acl = true;
$this->groups = $this->getListGroups();
foreach ($this->groups as $key => $group) {
$this->status[$key] = $group['status'];
unset($this->groups[$key]['status']);
}
//~ foreach ($this->groups as $key => $group) {
//~ $this->status[$key] = $group['status'];
//~ unset($this->groups[$key]['status']);
//~ }
}
else {
$this->correct_acl = false;
@ -68,11 +67,68 @@ class Groups {
$ui->showFooter(false);
$ui->beginContent();
$table = new Table();
$table->setClass('group_view');
$table->importFromHash($this->groups);
$table->setRowClass($this->status);
$ui->contentAddHtml($table->getHTML());
$ui->contentAddHtml('<div data-role="collapsible-set" data-theme="a" data-content-theme="d">');
$count = 0;
foreach ($this->groups as $group) {
$ui->contentAddHtml('
<style type="text/css">
.ui-icon-group_' . $count . ' {
background: url("' . $group['group_icon'] . '") no-repeat scroll 0 0 transparent !important;
}
</style>
');
$ui->contentAddHtml('<div data-collapsed-icon="group_' . $count . '" ' .
'data-expanded-icon="group_' . $count . '" ' .
'data-iconpos="right" data-role="collapsible" ' .
'data-collapsed="true" data-theme="' . $group['status'] . '" data-content-theme="d">');
$ui->contentAddHtml('<h4>' . $group['group_name'] . '</h4>');
$ui->contentAddHtml('<ul data-role="listview">');
$ui->contentAddHtml('<li>' .
__('Agents') .
' ' . $group[__('Agents')] .
'</li>');
$ui->contentAddHtml('<li>' .
__('Agents unknown') .
' ' . $group[__('Agents unknown')] .
'</li>');
$ui->contentAddHtml('<li>' .
__('Unknown') .
' ' . $group[__('Unknown')] .
'</li>');
$ui->contentAddHtml('<li>' .
__('Not init') .
' ' . $group[__('Not init')] .
'</li>');
$ui->contentAddHtml('<li>' .
__('Normal') .
' ' . $group[__('Normal')] .
'</li>');
$ui->contentAddHtml('<li>' .
__('Warning') .
' ' . $group[__('Warning')] .
'</li>');
$ui->contentAddHtml('<li>' .
__('Critical') .
' ' . $group[__('Critical')] .
'</li>');
$ui->contentAddHtml('<li>' .
__('Alerts fired') .
' ' . $group[__('Alerts fired')] .
'</li>');
$ui->contentAddHtml('</ul>');
$ui->contentAddHtml('</div>');
$count++;
}
$ui->contentAddHtml('</div>');
//$ui->contentAddHtml(ob_get_clean());
//~ $table = new Table();
//~ $table->setId('list_groups');
//~ $table->setClass('group_view');
//~ $table->importFromHash($this->groups);
//~ $table->setRowClass($this->status);
//~ $ui->contentAddHtml($table->getHTML());
$ui->endContent();
$ui->showPage();
@ -105,6 +161,7 @@ class Groups {
// For each valid group for this user, take data from agent and modules
foreach ($groups as $id_group => $group) {
$rows = groups_get_group_row($id_group, $groups, $group, $printed_groups, false);
if (!empty($rows))
$return = array_merge($return, $rows);
}