Merge branch 'ent-10966-widget-info-de-grupo-visual' into 'develop'

Ent 10966 widget info de grupo visual

See merge request artica/pandorafms!5735
This commit is contained in:
Rafael Ameijeiras 2023-04-18 12:36:13 +00:00
commit 2d065bca9d
2 changed files with 27 additions and 10 deletions

View File

@ -362,19 +362,22 @@ class GroupsStatusWidget extends Widget
// Agent Critical. // Agent Critical.
$table->data[1][0] = $this->getCellCounter( $table->data[1][0] = $this->getCellCounter(
$stats['agent_critical'], $stats['agent_critical'],
'#e63c52' '',
'bg_ff5'
); );
// Agent Warning. // Agent Warning.
$table->data[2][0] = $this->getCellCounter( $table->data[2][0] = $this->getCellCounter(
$stats['agent_warning'], $stats['agent_warning'],
'#f3b200' '',
'bg_ffd'
); );
// Agent OK. // Agent OK.
$table->data[3][0] = $this->getCellCounter( $table->data[3][0] = $this->getCellCounter(
$stats['agent_ok'], $stats['agent_ok'],
'#82b92e' '',
'bg_82B92E'
); );
// Agent Unknown. // Agent Unknown.
@ -436,19 +439,22 @@ class GroupsStatusWidget extends Widget
// Modules Critical. // Modules Critical.
$table->data[1][0] = $this->getCellCounter( $table->data[1][0] = $this->getCellCounter(
$stats['monitor_critical'], $stats['monitor_critical'],
'#e63c52' '',
'bg_ff5'
); );
// Modules Warning. // Modules Warning.
$table->data[2][0] = $this->getCellCounter( $table->data[2][0] = $this->getCellCounter(
$stats['monitor_warning'], $stats['monitor_warning'],
'#f3b200' '',
'bg_ffd'
); );
// Modules OK. // Modules OK.
$table->data[3][0] = $this->getCellCounter( $table->data[3][0] = $this->getCellCounter(
$stats['monitor_ok'], $stats['monitor_ok'],
'#82b92e' '',
'bg_82B92E'
); );
// Modules Unknown. // Modules Unknown.
@ -490,10 +496,20 @@ class GroupsStatusWidget extends Widget
* *
* @return string * @return string
*/ */
protected function getCellCounter(?int $count, string $color):string protected function getCellCounter(?int $count, string $color='', string $div_class=''):string
{ {
$output = '<div class= ""'; $output = '<div ';
$output .= 'style= "background-color:'.$color.'">';
if ($div_class !== '') {
$output .= 'class= "'.$div_class.'" ';
}
if ($color !== '') {
$output .= 'style= "background-color:'.$color.'" ';
}
$output .= '>';
if (isset($count) === true if (isset($count) === true
&& $count !== 0 && $count !== 0
) { ) {

View File

@ -379,7 +379,8 @@ table.group_modules_status_box tr td > span {
padding-left: 10px; padding-left: 10px;
} }
table.group_modules_status_box tr td div { table.group_modules_status_box tr td div,
table.widget_groups_status tr td div {
background-color: #82b92e; background-color: #82b92e;
width: 90%; width: 90%;
padding: 3px; padding: 3px;