Added services view widget 2

This commit is contained in:
Daniel Maya 2021-08-17 13:32:54 +02:00
parent d70752baa1
commit 0fd076810d
2 changed files with 28 additions and 13 deletions

View File

@ -237,6 +237,9 @@ class ServiceViewWidget extends Widget
$inputs = parent::getFormInputs(); $inputs = parent::getFormInputs();
$values = $this->values; $values = $this->values;
if (empty($values['type']) === true) {
$values['type'] = 'tree';
}
// Type services view. // Type services view.
$fields = [ $fields = [
@ -288,7 +291,7 @@ class ServiceViewWidget extends Widget
$size = parent::getSize(); $size = parent::getSize();
$output = ''; $output = '';
if ($values['type'] === 'tree') { if ($values['type'] === 'tree' || empty($values['type'])) {
if (check_acl($config['id_user'], 0, 'AR') === 0) { if (check_acl($config['id_user'], 0, 'AR') === 0) {
$output .= '<div class="container-center">'; $output .= '<div class="container-center">';
$output .= \ui_print_error_message( $output .= \ui_print_error_message(
@ -347,8 +350,8 @@ class ServiceViewWidget extends Widget
} }
$order = [ $order = [
'field' => 'name'.$order_collation, 'field' => 'name',
'field2' => 'name'.$order_collation, 'field2' => 'name',
'order' => 'ASC', 'order' => 'ASC',
]; ];
@ -362,7 +365,7 @@ class ServiceViewWidget extends Widget
); );
$output .= '<div class="white_box mgn_btt_20px mrgn_top_20px pddng_50px services_table" >'; $output .= '<div class="white_box mgn_btt_20px mrgn_top_20px pddng_50px services_table" >';
$output .= '<div id="table_services">'; $output .= '<div id="table_services_dashboard">';
foreach ($services as $service) { foreach ($services as $service) {
switch ($service['status']) { switch ($service['status']) {
case SERVICE_STATUS_NORMAL: case SERVICE_STATUS_NORMAL:
@ -383,17 +386,18 @@ class ServiceViewWidget extends Widget
break; break;
} }
// hd($service); $output .= '<a id="service_'.$service['id'].'" style="background-color: '.$color.'; color: #fff;" class="table_services_item_link_dashboard" href="index.php?'.'sec=network&'.'sec2=enterprise/operation/services/services&tab=service_map&'.'id_service='.$service['id'].'">
$output .= '<a id="service_'.$service['id'].'" style="background-color: '.$color.'; color: #fff;" class="table_services_item_link" href="index.php?'.'sec=network&'.'sec2=enterprise/operation/services/services&tab=service_map&'.'id_service='.$service['id'].'"> <div class="table_services_item">
<div class="table_services_item" style="display:flex">
<div style="width:50px; text-align:center;">'; <div style="width:50px; text-align:center;">';
\ui_print_group_icon($service['id_group'], false, 'groups_small_white', '', false); $output .= \ui_print_group_icon($service['id_group'], true, 'groups_small_white', '', false);
$output .= '</div> $output .= '</div>
<div class="tooltip" style="color: #fff">'.$service['description'].' <div class="tooltip" style="color: #fff;position: relative;opacity: 1">'.$service['description'].'
</div>
<div class="tooltip" style="color: #fff">'.\html_print_image('images/help_w.png', true, ['class' => 'img_help', 'title' => __($service['name']), 'id' => $id], false, $is_relative && is_metaconsole()).'
</div> </div>
<div class="tooltip" style="color: #fff;position: relative;opacity: 1">';
$output .= \html_print_image('images/help_w.png', true, ['class' => 'img_help', 'title' => __($service['name']), 'id' => $service['id']]);
$output .= '</div>
</div> </div>
</a>'; </a>';
} }

View File

@ -5817,12 +5817,15 @@ div#status_pie {
margin-bottom: 30px; margin-bottom: 30px;
} }
.services_table { #table_services_dashboard {
display: grid; display: grid;
grid-gap: 20px; grid-gap: 20px;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
grid-template-rows: 1fr; grid-template-rows: 1fr;
margin-bottom: 30px; margin-bottom: 30px;
}
.services_table {
width: 97%; width: 97%;
} }
@ -5834,6 +5837,14 @@ div#status_pie {
padding: 10px 10px 10px 0; padding: 10px 10px 10px 0;
} }
.table_services_item_link_dashboard {
font-size: 16px;
display: grid;
min-height: 50px;
box-sizing: border-box;
padding: 10px 10px 10px 0;
}
.table_services_item { .table_services_item {
display: grid; display: grid;
align-items: center; align-items: center;