Tree View fixed

This commit is contained in:
Jose Gonzalez 2023-03-10 11:09:36 +01:00
parent 92e5c4efa0
commit 3f884d9aff
2 changed files with 24 additions and 32 deletions

View File

@ -424,21 +424,21 @@ class TreeService extends Tree
switch ($item->agent()->lastStatus()) {
case AGENT_STATUS_NORMAL:
$tmp['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_ok_ball.png').'" data-title="NORMAL status." data-use_title_for_force_title="1" class="forced_title" alt="NORMAL status." />';
$tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #82b92e', 'title' => __('Normal status') ], true);
break;
case AGENT_STATUS_CRITICAL:
case AGENT_STATUS_ALERT_FIRED:
$tmp['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_critical_ball.png').'" data-title="CRITICAL status." data-use_title_for_force_title="1" class="forced_title" alt="CRITICAL status." />';
$tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #e63c52', 'title' => __('Critical status') ], true);
break;
case AGENT_STATUS_WARNING:
$tmp['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_warning_ball.png').'" data-title="WARNING status." data-use_title_for_force_title="1" class="forced_title" alt="WARNING status." />';
$tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #f3b200', 'title' => __('Warning status') ], true);
break;
case AGENT_STATUS_UNKNOWN:
default:
$tmp['statusImageHTML'] = '<img src="'.ui_get_full_url('images/status_sets/default/agent_no_data_ball.png').'" data-title="UNKNOWN status." data-use_title_for_force_title="1" class="forced_title" alt="UNKNOWN status." />';
$tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #B2B2B2', 'title' => __('Unknown status') ], true);
break;
}
@ -634,36 +634,20 @@ class TreeService extends Tree
$tmp['rootID'] = $this->rootID;
switch ($item->service()->lastStatus()) {
case SERVICE_STATUS_NORMAL:
$tmp['statusImageHTML'] = '<img src="';
$tmp['statusImageHTML'] .= ui_get_full_url(
'images/status_sets/default/agent_ok_ball.png'
);
$tmp['statusImageHTML'] .= '" data-title="NORMAL status." data-use_title_for_force_title="1" class="forced_title" alt="NORMAL status." />';
$tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #82b92e', 'title' => __('Normal status') ], true);
break;
case SERVICE_STATUS_CRITICAL:
$tmp['statusImageHTML'] = '<img src="';
$tmp['statusImageHTML'] .= ui_get_full_url(
'images/status_sets/default/agent_critical_ball.png'
);
$tmp['statusImageHTML'] .= '" data-title="CRITICAL status." data-use_title_for_force_title="1" class="forced_title" alt="CRITICAL status." />';
$tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #e63c52', 'title' => __('Critical status') ], true);
break;
case SERVICE_STATUS_WARNING:
$tmp['statusImageHTML'] = '<img src="';
$tmp['statusImageHTML'] .= ui_get_full_url(
'images/status_sets/default/agent_warning_ball.png'
);
$tmp['statusImageHTML'] .= '" data-title="WARNING status." data-use_title_for_force_title="1" class="forced_title" alt="WARNING status." />';
$tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #f3b200', 'title' => __('Warning status') ], true);
break;
case SERVICE_STATUS_UNKNOWN:
default:
$tmp['statusImageHTML'] = '<img src="';
$tmp['statusImageHTML'] .= ui_get_full_url(
'images/status_sets/default/agent_no_data_ball.png'
);
$tmp['statusImageHTML'] .= '" data-title="UNKNOWN status." data-use_title_for_force_title="1" class="forced_title" alt="UNKNOWN status." />';
$tmp['statusImageHTML'] = html_print_div(['class' => 'tree-service-status', 'style' => 'background-color: #B2B2B2', 'title' => __('Unknown status') ], true);
break;
}
break;

View File

@ -1,6 +1,6 @@
.tree-root {
margin-top: 0px;
margin-bottom: 0px;
margin-bottom: 40px;
}
.tree-node.tree-node-header {
@ -8,12 +8,6 @@
flex-direction: row;
flex-wrap: wrap;
align-items: center;
/*
width: calc(100% - 24px);
border: 1px solid #eaeaea;
border-radius: 4px;
background-color: #fff;
*/
margin-bottom: 8px;
}
@ -392,6 +386,20 @@ div#tree-controller-recipient {
.tree-node > .node-content > .agent-alerts-fired {
float: left;
position: relative;
left: 26px;
left: 13px;
top: -5px;
}
.tree-node > .node-content > div.tree-service-status {
width: 7px;
height: 20px;
margin-left: 0;
border-radius: 5px;
}
.tree-node > .node-content.node-service > div.tree-service-status {
width: 7px;
height: 20px;
margin-left: 5px;
border-radius: 5px;
}