Agent Group icons adding

This commit is contained in:
Jose Gonzalez 2022-12-20 17:22:35 +01:00
parent b0997850f4
commit ffa4ec756c
25 changed files with 436 additions and 232 deletions

View File

@ -489,7 +489,7 @@ $tableAgent->data['primary_group'][0] .= html_print_div(
'content' => ui_print_group_icon(
$grupo,
true,
'groups_small',
'',
($id_agente === 0) ? 'display: none;' : '',
true,
false,

View File

@ -68,6 +68,7 @@ if (! check_acl(
enterprise_include_once('include/functions_policies.php');
require_once 'include/functions_agents.php';
require_once 'include/functions_users.php';
enterprise_include_once('include/functions_config_agents.php');
$search = get_parameter('search', '');
@ -171,17 +172,10 @@ if ($agent_to_delete) {
__('Could not be deleted.')
);
if (enterprise_installed()) {
if (enterprise_installed() === true) {
// Check if the remote config file still exist.
if (isset($config['remote_config'])) {
enterprise_include_once(
'include/functions_config_agents.php'
);
if (enterprise_hook(
'config_agents_has_remote_configuration',
[$id_agente]
)
) {
if (isset($config['remote_config']) === true) {
if ((bool) enterprise_hook('config_agents_has_remote_configuration', [$id_agente]) === true) {
ui_print_error_message(
__('Maybe the files conf or md5 could not be deleted')
);
@ -190,7 +184,7 @@ if ($agent_to_delete) {
}
}
if ($enable_agent) {
if ($enable_agent > 0) {
$result = db_process_sql_update(
'tagente',
['disabled' => 0],
@ -198,7 +192,7 @@ if ($enable_agent) {
);
$alias = io_safe_output(agents_get_alias($enable_agent));
if ($result) {
if ((bool) $result !== false) {
// Update the agent from the metaconsole cache.
enterprise_include_once('include/functions_agents.php');
$values = ['disabled' => 0];
@ -833,7 +827,7 @@ if ($agents !== false) {
echo ' | ';
if ($agent['id_os'] == CLUSTER_OS_ID) {
if (enterprise_installed()) {
if (enterprise_installed() === true) {
$cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
$agent['id_agente']
);
@ -853,11 +847,10 @@ if ($agents !== false) {
echo '</div>';
echo '</td>';
echo "<td align='left' class='$tdcolor'>";
// Has remote configuration ?
echo '<td class="'.$tdcolor.'" align="left" valign="middle">';
// Has remote configuration.
if (enterprise_installed() === true) {
enterprise_include_once('include/functions_config_agents.php');
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
if ((bool) enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']]) === true) {
html_print_menu_button(
[
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$agent['id_agente'].'&disk_conf=1',
@ -871,12 +864,17 @@ if ($agents !== false) {
echo '</td>';
// Operating System icon.
echo "<td class='$tdcolor' align='left' valign='middle'>";
ui_print_os_icon($agent['id_os'], false);
echo '<td class="'.$tdcolor.'" align="left" valign="middle">';
html_print_div(
[
'class' => 'main_menu_icon',
'content' => ui_print_os_icon($agent['id_os'], false, true),
]
);
echo '</td>';
// Type agent (Networt, Software or Satellite).
echo "<td class='$tdcolor' align='left' valign='middle'>";
echo '<td class="'.$tdcolor.'" align="left" valign="middle">';
echo ui_print_type_agent_icon(
$agent['id_os'],
$agent['ultimo_contacto_remoto'],
@ -888,7 +886,14 @@ if ($agents !== false) {
// Group icon and name.
echo "<td class='$tdcolor' align='left' valign='middle'>".ui_print_group_icon($agent['id_grupo'], true).'</td>';
echo '<td class="'.$tdcolor.'" align="left" valign="middle">';
html_print_div(
[
'class' => 'main_menu_icon',
'content' => ui_print_group_icon($agent['id_grupo'], true),
]
);
echo '</td>';
// Description.
echo "<td class='".$tdcolor."f9'><span class='".$custom_font_size."'>".ui_print_truncate_text($agent['comentarios'], 'description', true, true, true, '[&hellip;]').'</span></td>';

View File

@ -47,66 +47,54 @@ require_once $config['homedir'].'/include/functions_users.php';
enterprise_include_once('meta/include/functions_agents_meta.php');
// Default values.
$icon = '';
$name = '';
$id_parent = 0;
$group_pass = '';
$alerts_disabled = 0;
$custom_id = '';
$propagate = 0;
$skin = 0;
$contact = '';
$other = '';
$description = '';
$max_agents = 0;
$create_group = (bool) get_parameter('create_group');
$id_group = (int) get_parameter('id_group');
if ($id_group) {
$acl_parent = true;
if ($id_group > 0) {
$group = db_get_row('tgrupo', 'id_grupo', $id_group);
if ($group) {
if ($group !== false) {
$icon = $group['icon'];
$name = $group['nombre'];
if (empty($group['icon'])) {
$icon = false;
} else {
$icon = $group['icon'].'.png';
}
$id_parent = $group['parent'];
$group_pass = io_safe_output($group['password']);
$alerts_disabled = $group['disabled'];
$id_parent = $group['parent'];
$custom_id = $group['custom_id'];
$propagate = $group['propagate'];
$skin = $group['id_skin'];
$description = $group['description'];
$contact = $group['contact'];
$other = $group['other'];
$description = $group['description'];
$max_agents = $group['max_agents'];
} else {
ui_print_error_message(__('There was a problem loading group'));
echo '</table>';
echo '</div>';
echo '<div id="both">&nbsp;</div>';
echo '</div>';
echo '<div id="foot">';
// include 'general/footer.php';
echo '</div>';
echo '</div>';
db_pandora_audit(
AUDIT_LOG_SYSTEM,
'There was a problem loading group in configure agent group.'
);
include 'general/noaccess.php';
exit;
}
} else {
// Set default values.
$icon = '';
$name = '';
$id_parent = 0;
$group_pass = '';
$alerts_disabled = 0;
$custom_id = '';
$propagate = 0;
$skin = 0;
$contact = '';
$other = '';
$description = '';
$max_agents = 0;
}
// Header
// Header.
if (is_metaconsole() === true) {
agents_meta_print_header();
$sec = 'advanced';
} else {
if ($id_group) {
$title_in_header = __('Update group');
} else {
$title_in_header = __('Create group');
}
$title_in_header = ($id_group > 0) ? __('Update group') : __('Create group');
// Header.
ui_print_standard_header(
@ -130,16 +118,15 @@ if (is_metaconsole() === true) {
$sec = 'gagente';
}
// Data before table.
$files = list_files('images/', '@groups.svg', 1, 0);
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
if (defined('METACONSOLE')) {
if ($id_group) {
$table->head[0] = __('Update Group');
} else {
$table->head[0] = __('Create Group');
}
if (is_metaconsole() === true) {
$table->head[0] = ($id_group > 0) ? __('Update group') : __('Create group');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
}
@ -149,30 +136,18 @@ $table->style[0] = 'font-weight: bold';
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true);
$table->data[1][0] = __('Icon');
$files = list_files('images/groups_small/', 'png', 1, 0);
foreach ($files as $key => $f) {
// Remove from the list the non-desired .png files
if (strpos($f, '.bad.png') !== false || strpos($f, '.default.png') !== false || strpos($f, '.ok.png') !== false || strpos($f, '.warning.png') !== false) {
unset($files[$key]);
}
}
$table->data[1][1] = html_print_select($files, 'icon', $icon, '', 'None', '', true);
$table->data[1][1] .= ' <span id="icon_preview">';
if ($icon) {
$table->data[1][1] .= html_print_image('images/groups_small/'.$icon, true);
if (empty($icon) === false) {
$table->data[1][1] .= html_print_image('images/'.$icon, true);
}
$table->data[1][1] .= '</span>';
$table->data[2][0] = __('Parent');
$acl_parent = true;
if ($id_group) {
if ($id_group > 0) {
// The user can access to the parent, but she want to edit the group.
if (!check_acl($config['id_user'], $id_parent, 'AR')) {
if ((bool) check_acl($config['id_user'], $id_parent, 'AR') === false) {
$acl_parent = false;
$table->data[2][1] = __('You have not access to the parent.').html_print_input_hidden('id_parent', $id_parent, true);
@ -214,14 +189,14 @@ if ($id_group) {
$table->data[2][1] .= '</div>';
}
if ($acl_parent) {
if ($acl_parent === true) {
$table->data[2][1] .= ' <span id="parent_preview">';
$table->data[2][1] .= html_print_image('images/groups_small/'.( $id_parent != 0 ? groups_get_icon($id_parent) : 'without_group').'.png', true);
$table->data[2][1] .= html_print_image('images/'.(($id_parent !== 0) ? groups_get_icon($id_parent) : 'unknown@groups.svg'), true);
$table->data[2][1] .= '</span>';
}
$i = 3;
if ($config['enterprise_installed']) {
if ((bool) $config['enterprise_installed'] === true) {
$i = 4;
$table->data[3][0] = __('Group Password');
$table->data[3][1] = html_print_input_password('group_pass', $group_pass, '', 16, 255, true);
@ -251,20 +226,11 @@ $table->data[$i][0] = __('Other').ui_print_help_tip(__('Information accessible t
$table->data[$i][1] = html_print_textarea('other', 4, 40, $other, "class='min-height-0px'", true);
$i++;
// $isFunctionSkins = enterprise_include_once('include/functions_skins.php');
// if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) {
// $table->data[10][0] = __('Skin');
// $table->data[10][1] = skins_print_select($config['id_user'], 'skin', $skin, '', __('None'), 0, true);
// }
$table->data[$i][0] = __('Max agents allowed').'&nbsp;'.ui_print_help_tip(__('Set the maximum of agents allowed for this group. 0 is unlimited.'), true);
$table->data[$i][1] = html_print_input_text('max_agents', $max_agents, '', 10, 255, true);
$i++;
if (defined('METACONSOLE')) {
$sec = 'advanced';
} else {
$sec = 'gagente';
}
$sec = (is_metaconsole() === true) ? 'advanced' : 'gagente';
echo '<form name="grupo" method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/group_list&pure='.$config['pure'].'" >';
html_print_table($table);
@ -294,7 +260,7 @@ function icon_changed () {
if (data != "") {
var params = [];
params.push("get_image_path=1");
params.push("img_src=images/groups_small/" + data);
params.push("img_src=images/" + data);
params.push("page=include/ajax/skins.ajax");
params.push("only_src=1");
jQuery.ajax ({
@ -330,7 +296,7 @@ function parent_changed () {
}
var params = [];
params.push("get_image_path=1");
params.push("img_src=images/groups_small/" + data['icon'] + ".png");
params.push("img_src=images/" + data['icon']);
params.push("page=include/ajax/skins.ajax");
params.push("only_src=1");
jQuery.ajax ({

View File

@ -871,7 +871,7 @@ if ($tab == 'tree') {
foreach ($groups as $key => $group) {
$url = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo'];
if (is_metaconsole()) {
if (is_metaconsole() === true) {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups';
} else {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'];
@ -886,7 +886,7 @@ if ($tab == 'tree') {
if ($group['icon'] != '') {
$table->data[$key][2] = html_print_image(
'images/groups_small/'.$group['icon'].'.png',
'images/'.$group['icon'],
true,
[
'style' => '',

View File

@ -187,7 +187,7 @@ foreach ($filters as $filter) {
}
$data[2] = ui_print_group_icon($filter['id_group'], true, 'groups_small', '', !defined('METACONSOLE'));
$data[2] = ui_print_group_icon($filter['id_group'], true);
$data[3] = '';
if (check_acl_restricted_all($config['id_user'], $filter['id_group'], 'AW')) {

View File

@ -1097,10 +1097,7 @@ switch ($action) {
$data[$next] = ui_print_group_icon(
$report['id_group'],
true,
'groups_small',
'',
!defined('METACONSOLE')
true
);
$next++;
}

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / applications@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-applications" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M8,0 L1,0 C0.44771525,0 0,0.44771525 0,1 L0,8 C0,8.55228475 0.44771525,9 1,9 L8,9 C8.55228475,9 9,8.55228475 9,8 L9,1 C9,0.44771525 8.55228475,0 8,0 Z M7,2 L7,7 L2,7 L2,2 L7,2 Z" id="Rectangle" fill="#3F3F3F"></path>
<path d="M8,11 L1,11 C0.44771525,11 0,11.4477153 0,12 L0,19 C0,19.5522847 0.44771525,20 1,20 L8,20 C8.55228475,20 9,19.5522847 9,19 L9,12 C9,11.4477153 8.55228475,11 8,11 Z M7,13 L7,18 L2,18 L2,13 L7,13 Z" id="Rectangle-Copy" fill="#3F3F3F"></path>
<path d="M19,0 L12,0 C11.4477153,0 11,0.44771525 11,1 L11,8 C11,8.55228475 11.4477153,9 12,9 L19,9 C19.5522847,9 20,8.55228475 20,8 L20,1 C20,0.44771525 19.5522847,0 19,0 Z M18,2 L18,7 L13,7 L13,2 L18,2 Z" id="Rectangle" fill="#3F3F3F"></path>
<path d="M13.6128994,12.2097046 L13.7071068,12.2928932 L15.5,14.085 L17.2928932,12.2928932 C17.6834175,11.9023689 18.3165825,11.9023689 18.7071068,12.2928932 C19.0675907,12.6533772 19.0953203,13.2206082 18.7902954,13.6128994 L18.7071068,13.7071068 L16.915,15.5 L18.7071068,17.2928932 C19.0976311,17.6834175 19.0976311,18.3165825 18.7071068,18.7071068 C18.3466228,19.0675907 17.7793918,19.0953203 17.3871006,18.7902954 L17.2928932,18.7071068 L15.5,16.915 L13.7071068,18.7071068 C13.3165825,19.0976311 12.6834175,19.0976311 12.2928932,18.7071068 C11.9324093,18.3466228 11.9046797,17.7793918 12.2097046,17.3871006 L12.2928932,17.2928932 L14.085,15.5 L12.2928932,13.7071068 C11.9023689,13.3165825 11.9023689,12.6834175 12.2928932,12.2928932 C12.6233369,11.9624496 13.1275055,11.9116121 13.5114029,12.1403808 L13.6128994,12.2097046 Z" id="Path-51" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / clock@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-clock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Group" fill="#3F3F3F">
<path d="M10,0 C15.5228475,0 20,4.4771525 20,10 C20,15.5228475 15.5228475,20 10,20 C4.4771525,20 0,15.5228475 0,10 C0,4.4771525 4.4771525,0 10,0 Z M10,2.02201462 C9.44771525,2.02201462 9,2.46972987 9,3.02201462 L9,3.02201462 L9,10 L9.00867243,10.131444 C9.03740171,10.3481451 9.1366129,10.5508265 9.29289322,10.7071068 L9.29289322,10.7071068 L12.2928932,13.7071068 L12.3871006,13.7902954 C12.7793918,14.0953203 13.3466228,14.0675907 13.7071068,13.7071068 L13.7071068,13.7071068 L13.7902954,13.6128994 C14.0953203,13.2206082 14.0675907,12.6533772 13.7071068,12.2928932 L13.7071068,12.2928932 L11,9.586 L11,3.02201462 L10.9932723,2.90539349 C10.9355072,2.40805481 10.5128358,2.02201462 10,2.02201462 Z" id="Oval"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / computer@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-computer" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M14,18 C14.5522847,18 15,18.4477153 15,19 C15,19.5522847 14.5522847,20 14,20 L14,20 L6,20 C5.44771525,20 5,19.5522847 5,19 C5,18.4477153 5.44771525,18 6,18 L6,18 Z M18,0 C19.1045695,-2.02906125e-16 20,0.8954305 20,2 L20,14 C20,15.1045695 19.1045695,16 18,16 L2,16 C0.8954305,16 1.3527075e-16,15.1045695 0,14 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 L18,0 Z" id="Rectangle-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 877 B

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / database@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-database" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M2,14.58375 C2.54037713,14.9892604 3.12831666,15.3211188 3.74951252,15.57125 C5.42822859,16.27125 7.63971801,16.66625 9.99880006,16.66625 C12.360282,16.66625 14.5705715,16.27125 16.2504875,15.57125 C16.8716219,15.3215105 17.4595587,14.9900738 18,14.585 L18,14.585 L18,16.66625 C18,18.5075 14.4181791,20 10,20 C5.58182091,20 2,18.5075 2,16.66625 L2,16.66625 Z M2.00119994,7.9175 C2.54156307,8.32303369 3.12950556,8.65489367 3.75071246,8.905 C5.42942853,9.60375 7.64091795,10 10,10 C12.360282,10 14.5717714,9.605 16.2504875,8.905 C16.8716833,8.65486877 17.4596229,8.32301045 18,7.9175 L18,7.9175 L18,11.66625 C18,13.5075 14.4181791,15 10,15 C5.58182091,15 2,13.50625 2,11.6675 L2,11.6675 L2,7.9175 Z M10,-1.687539e-14 C14.4181791,-1.687539e-14 18,1.4925 18,3.33375 L18,5 C18,6.84125 14.4181791,8.33375 10,8.33375 C5.58182091,8.33375 2,6.84125 2,5 L2,3.33375 C2,1.4925 5.58182091,-1.687539e-14 10,-1.687539e-14 Z" id="Path-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / docker@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-docker" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M12,1 L8,1 L8,3.76923077 L2.66666667,3.76923077 L2.66666667,6.53846154 L0,6.53846154 L0,11.3846154 C0,15.5905231 3.28324,19 7.33333333,19 L8.03714667,19 C11.8049067,19 15.2608,16.8681077 17.0693333,13.4615385 L20,13.4615385 L20,11.3846154 C20,10.2375585 19.1045333,9.30769231 18,9.30769231 L17.3333333,9.30769231 L17.3333333,8.61538462 C17.3333333,7.46832769 16.4378667,6.53846154 15.3333333,6.53846154 L12,6.53846154 L12,1 Z M1.33333333,9.30769231 L2.66666667,9.30769231 L2.66666667,7.92307692 L1.33333333,7.92307692 L1.33333333,9.30769231 Z M4,9.30769231 L5.33333333,9.30769231 L5.33333333,7.92307692 L4,7.92307692 L4,9.30769231 Z M6.66666667,9.30769231 L8,9.30769231 L8,7.92307692 L6.66666667,7.92307692 L6.66666667,9.30769231 Z M9.33333333,9.30769231 L10.6666667,9.30769231 L10.6666667,7.92307692 L9.33333333,7.92307692 L9.33333333,9.30769231 Z M12,9.30769231 L13.3333333,9.30769231 L13.3333333,7.92307692 L12,7.92307692 L12,9.30769231 Z M10.6666667,3.76923077 L10.6666667,2.38461538 L9.33333333,2.38461538 L9.33333333,3.76923077 L10.6666667,3.76923077 Z M8,5.15384615 L6.66666667,5.15384615 L6.66666667,6.53846154 L8,6.53846154 L8,5.15384615 Z M9.33333333,6.53846154 L9.33333333,5.15384615 L10.6666667,5.15384615 L10.6666667,6.53846154 L9.33333333,6.53846154 Z M5.33333333,6.53846154 L5.33333333,5.15384615 L4,5.15384615 L4,6.53846154 L5.33333333,6.53846154 Z M4,13.4615385 L5.33333333,13.4615385 L5.33333333,12.0769231 L4,12.0769231 L4,13.4615385 Z" id="Shape" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / firewall@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-firewall" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M11,14 C11.5522847,14 12,14.4477153 12,15 L12,19 C12,19.5522847 11.5522847,20 11,20 L1,20 C0.44771525,20 6.76353751e-17,19.5522847 0,19 L0,15 C-6.76353751e-17,14.4477153 0.44771525,14 1,14 L11,14 Z M19,14 C19.5522847,14 20,14.4477153 20,15 L20,19 C20,19.5522847 19.5522847,20 19,20 L15,20 C14.4477153,20 14,19.5522847 14,19 L14,15 C14,14.4477153 14.4477153,14 15,14 L19,14 Z M19,7 C19.5522847,7 20,7.44771525 20,8 L20,8 L20,12 C20,12.5522847 19.5522847,13 19,13 L19,13 L9,13 C8.44771525,13 8,12.5522847 8,12 L8,12 L8,8 C8,7.44771525 8.44771525,7 9,7 L9,7 Z M5,7 C5.55228475,7 6,7.44771525 6,8 L6,8 L6,12 C6,12.5522847 5.55228475,13 5,13 L5,13 L1,13 C0.44771525,13 0,12.5522847 0,12 L0,12 L0,8 C0,7.44771525 0.44771525,7 1,7 L1,7 Z M11,0 C11.5522847,-1.01453063e-16 12,0.44771525 12,1 L12,5 C12,5.55228475 11.5522847,6 11,6 L1,6 C0.44771525,6 6.76353751e-17,5.55228475 0,5 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L11,0 Z M19,0 C19.5522847,-1.01453063e-16 20,0.44771525 20,1 L20,5 C20,5.55228475 19.5522847,6 19,6 L15,6 C14.4477153,6 14,5.55228475 14,5 L14,1 C14,0.44771525 14.4477153,1.01453063e-16 15,0 L19,0 Z" id="Rectangle-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / network@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-network" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,0 C11.485909,0 12.7195035,1.08028648 12.9582373,2.49831306 C16.4758772,3.72146349 19,7.06596151 19,11 C19,11.2486636 18.9899154,11.4949719 18.9701329,11.7385381 C19.6012613,12.2876327 20,13.0972511 20,14 C20,15.6568542 18.6568542,17 17,17 C16.9055962,17 16.8122109,16.9956395 16.7200345,16.987109 C15.0726581,18.8352881 12.6723456,20 10,20 C7.32765444,20 4.92734191,18.8352881 3.27899729,16.9857992 L3.17627279,16.9949073 L3.17627279,16.9949073 L3,17 C1.34314575,17 0,15.6568542 0,14 C0,13.0972511 0.398738747,12.2876327 1.02970336,11.7376575 C1.01008458,11.4949719 1,11.2486636 1,11 C1,7.06596151 3.52412284,3.72146349 7.04120959,2.49766486 C7.28049649,1.08028648 8.51409103,0 10,0 Z M12.5990769,4.4983946 L12.5329361,4.60826455 C12.0005963,5.44492446 11.0651206,6 10,6 C8.88904089,6 7.91912552,5.39611995 7.40059634,4.49870231 C4.82184799,5.53033375 3,8.05240918 3,11 C4.65685425,11 6,12.3431458 6,14 C6,14.8017991 5.68545291,15.5301318 5.17302456,16.0683323 C6.42769305,17.265193 8.12803484,18 10,18 C11.8719652,18 13.572307,17.265193 14.8283244,16.0682801 C14.3145471,15.5301318 14,14.8017991 14,14 C14,12.3431458 15.3431458,11 17,11 L17,11 L16.995941,10.7593502 C16.8998724,7.91569272 15.10768,5.5021365 12.5990769,4.4983946 Z" id="Oval-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / application-osx-terminal@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-application-osx-terminal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M14,18 C14.5522847,18 15,18.4477153 15,19 C15,19.5522847 14.5522847,20 14,20 L14,20 L6,20 C5.44771525,20 5,19.5522847 5,19 C5,18.4477153 5.44771525,18 6,18 L6,18 Z M18,0 C19.1045695,-2.02906125e-16 20,0.8954305 20,2 L20,14 C20,15.1045695 19.1045695,16 18,16 L2,16 C0.8954305,16 1.3527075e-16,15.1045695 0,14 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 L18,0 Z M16,9 L11,9 C10.4477153,9 10,9.44771525 10,10 C10,10.5522847 10.4477153,11 11,11 L11,11 L16,11 C16.5522847,11 17,10.5522847 17,10 C17,9.44771525 16.5522847,9 16,9 L16,9 Z M4.61289944,3.20970461 C4.22060824,2.90467972 3.65337718,2.93240926 3.29289322,3.29289322 L3.29289322,3.29289322 L3.20970461,3.38710056 C2.90467972,3.77939176 2.93240926,4.34662282 3.29289322,4.70710678 L3.29289322,4.70710678 L5.585,7 L3.29289322,9.29289322 L3.20970461,9.38710056 C2.90467972,9.77939176 2.93240926,10.3466228 3.29289322,10.7071068 C3.68341751,11.0976311 4.31658249,11.0976311 4.70710678,10.7071068 L4.70710678,10.7071068 L7.70710678,7.70710678 L7.79029539,7.61289944 C8.09532028,7.22060824 8.06759074,6.65337718 7.70710678,6.29289322 L7.70710678,6.29289322 L4.70710678,3.29289322 Z" id="Rectangle-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / printer@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-printer" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M14,13 C14.5522847,13 15,13.4477153 15,14 L15,20 L5,20 L5,14 C5,13.4477153 5.44771525,13 6,13 L14,13 Z M15,0 C15.5522847,-1.01453063e-16 16,0.44771525 16,1 L16,3 L17,3 C18.6568542,3 20,4.34314575 20,6 L20,11 C20,12.6568542 18.6568542,14 17,14 L17,13 C17,11.8954305 16.1045695,11 15,11 L15,11 L5,11 C3.8954305,11 3,11.8954305 3,13 L3,13 L3,14 C1.34314575,14 2.02906125e-16,12.6568542 0,11 L0,6 C-2.02906125e-16,4.34314575 1.34314575,3 3,3 L4,3 L4,1 C4,0.44771525 4.44771525,1.01453063e-16 5,0 L15,0 Z M17,5 C16.4477153,5 16,5.44771525 16,6 C16,6.55228475 16.4477153,7 17,7 C17.5522847,7 18,6.55228475 18,6 C18,5.44771525 17.5522847,5 17,5 Z" id="Rectangle-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / servers@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-servers" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M19,14 C19.5522847,14 20,14.4477153 20,15 L20,15 L20,19 C16.6666667,19.6666667 13.3333333,20 10,20 C6.66666667,20 3.33333333,19.6666667 0,19 L0,19 L0,15 C6.76353751e-17,14.4477153 0.44771525,14 1,14 L1,14 Z M3,16 C2.44771525,16 2,16.4477153 2,17 C2,17.5522847 2.44771525,18 3,18 C3.55228475,18 4,17.5522847 4,17 C4,16.4477153 3.55228475,16 3,16 Z M6,16 C5.44771525,16 5,16.4477153 5,17 C5,17.5522847 5.44771525,18 6,18 C6.55228475,18 7,17.5522847 7,17 C7,16.4477153 6.55228475,16 6,16 Z M19,7 C19.5522847,7 20,7.44771525 20,8 L20,12 C20,12.5522847 19.5522847,13 19,13 L1,13 C0.44771525,13 6.76353751e-17,12.5522847 0,12 L0,8 C-6.76353751e-17,7.44771525 0.44771525,7 1,7 L19,7 Z M10,0 C13.3333333,0 16.6666667,0.333333333 20,1 L20,5 C20,5.55228475 19.5522847,6 19,6 L1,6 C0.44771525,6 6.76353751e-17,5.55228475 0,5 L0,1 C3.33333333,0.333333333 6.66666667,0 10,0 Z M6,2 L3,2 C2.44771525,2 2,2.44771525 2,3 C2,3.51283584 2.38604019,3.93550716 2.88337887,3.99327227 L3,4 L6,4 C6.55228475,4 7,3.55228475 7,3 C7,2.44771525 6.55228475,2 6,2 Z" id="Rectangle-Copy-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / unknown@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-unknown" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M9.5,0 C14.7467051,0 19,4.4771525 19,10 C19,13.2714896 17.507582,16.1760603 15.2003091,18.000488 L19,18 C19.5522847,18 20,18.4477153 20,19 C20,19.5128358 19.6139598,19.9355072 19.1166211,19.9932723 L19,20 L9,20 C8.91562316,20 8.83368709,19.9895499 8.75541543,19.9698732 C3.85686562,19.5701177 0,15.2591742 0,10 C0,4.4771525 4.25329488,0 9.5,0 Z M9.79831933,13.1716621 C8.99159664,13.1716621 8.35294118,13.8092643 8.35294118,14.5940054 C8.35294118,15.3623978 8.99159664,16 9.79831933,16 C10.605042,16 11.2605042,15.3623978 11.2605042,14.5940054 C11.2605042,13.8092643 10.605042,13.1716621 9.79831933,13.1716621 Z M9.91596639,4 C7.46218487,4 6,5.61852861 6,7.53133515 C6,7.74386921 6.01680672,7.98910082 6.06722689,8.21798365 L8.42016807,8.29972752 C8.40336134,8.23433243 8.3697479,8.07084469 8.3697479,7.69482289 C8.3697479,6.92643052 8.94117647,6.15803815 9.91596639,6.15803815 C10.9243697,6.15803815 11.4117647,6.77929155 11.4117647,7.41689373 C11.4117647,7.84196185 11.2605042,8.23433243 10.8067227,8.5613079 L9.94957983,9.18256131 C8.99159664,9.88555858 8.67226891,10.719346 8.67226891,11.4877384 C8.67226891,11.7493188 8.68907563,11.9782016 8.7394958,12.2070845 L10.7394958,12.2070845 C10.7394958,11.4713896 11.1428571,11.0463215 11.7310924,10.6212534 L12.3697479,10.1634877 C13.3781513,9.42779292 14,8.52861035 14,7.22070845 C14,5.58583106 12.6386555,4 9.91596639,4 Z" id="Oval-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / web@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-web" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,0 C4.4771525,0 0,4.4771525 0,10 C0,15.5228475 4.4771525,20 10,20 C15.5228475,20 20,15.5228475 20,10 C19.9945565,4.47940886 15.5205911,0.00544352451 10,0 Z M10.0288333,17.4971042 C10.0246667,17.4971042 10.0206042,17.4983125 10.0163333,17.4983125 C9.68185417,17.3901458 9.011375,16.3172917 8.56475,14.3237292 C9.04327083,14.3508125 9.52308333,14.375 10,14.375 C10.4774375,14.375 10.9581042,14.3508958 11.437375,14.3237292 C10.9950208,16.3143958 10.3361458,17.3863125 10.0288333,17.4971042 Z M10,11.875 C9.35577083,11.875 8.75960417,11.8472292 8.19702083,11.8032917 C8.15291667,11.2406875 8.125,10.6442292 8.125,10 C8.125,9.35577083 8.15277083,8.75960417 8.19670833,8.19702083 C8.7593125,8.15291667 9.35577083,8.125 10,8.125 C10.6442292,8.125 11.2403958,8.15277083 11.8029792,8.19670833 C11.8470833,8.7593125 11.875,9.35577083 11.875,10 C11.875,10.6442292 11.8472292,11.2403958 11.8032917,11.8029792 C11.2406875,11.8470833 10.6442292,11.875 10,11.875 Z M2.50289583,10.0288333 C2.50289583,10.0246667 2.5016875,10.0206042 2.5016875,10.0163333 C2.60985417,9.68185417 3.68270833,9.011375 5.67627083,8.56475 C5.64927083,9.04327083 5.625,9.52316667 5.625,10 C5.625,10.4774375 5.64910417,10.9581042 5.67627083,11.437375 C3.68560417,10.9950208 2.6136875,10.3361458 2.50289583,10.0288333 Z M9.97116667,2.50289583 C9.97533333,2.50289583 9.97939583,2.5016875 9.98366667,2.5016875 C10.3181458,2.60985417 10.988625,3.68270833 11.43525,5.67627083 C10.9567292,5.64927083 10.4768333,5.625 10,5.625 C9.5225625,5.625 9.04189583,5.64910417 8.562625,5.67627083 C9.00497917,3.68560417 9.66385417,2.6136875 9.97116667,2.50289583 Z M14.3237292,8.562625 C16.3143958,9.00497917 17.3862292,9.66385417 17.4971042,9.97116667 C17.4971042,9.97533333 17.4983125,9.97939583 17.4983125,9.98366667 C17.3901458,10.3181458 16.3172917,10.988625 14.3237292,11.43525 C14.3508125,10.9567292 14.375,10.4769167 14.375,10 C14.375,9.5225625 14.3508958,9.04189583 14.3237292,8.562625 Z M16.671,6.64397917 C15.8116964,6.34280615 14.9276165,6.11763659 14.0289375,5.9710625 C13.8823634,5.07238349 13.6571938,4.18830364 13.3560208,3.329 C14.7866526,4.05165344 15.9483466,5.21334744 16.671,6.64397917 L16.671,6.64397917 Z M6.64375,3.329 C6.34261768,4.18830554 6.11749674,5.07238609 5.97097917,5.9710625 C5.0723873,6.11755451 4.18838995,6.34264769 3.32916667,6.64375 C4.05172797,5.21324363 5.21327996,4.05163323 6.64375,3.329 L6.64375,3.329 Z M3.32916667,13.35625 C4.1884091,13.6574028 5.07243613,13.8825243 5.9710625,14.0290208 C6.11753664,14.9276164 6.34263021,15.8116153 6.64375,16.6708333 C5.21325958,15.948307 4.05169302,14.7867404 3.32916667,13.35625 Z M13.35625,16.6708333 C13.6573853,15.8115856 13.8825065,14.9275601 14.0290208,14.0289375 C14.9276665,13.8824423 15.8117189,13.6573493 16.671,13.35625 C15.9483668,14.78672 14.7867564,15.948272 13.35625,16.6708333 L13.35625,16.6708333 Z" id="Shape" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / without-group@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-without-group" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M9.5,0 C14.7467051,0 19,4.4771525 19,10 C19,13.2714896 17.507582,16.1760603 15.2003091,18.000488 L19,18 C19.5522847,18 20,18.4477153 20,19 C20,19.5128358 19.6139598,19.9355072 19.1166211,19.9932723 L19,20 L9,20 C8.91562316,20 8.83368709,19.9895499 8.75541543,19.9698732 C3.85686562,19.5701177 0,15.2591742 0,10 C0,4.4771525 4.25329488,0 9.5,0 Z M9.79831933,13.1716621 C8.99159664,13.1716621 8.35294118,13.8092643 8.35294118,14.5940054 C8.35294118,15.3623978 8.99159664,16 9.79831933,16 C10.605042,16 11.2605042,15.3623978 11.2605042,14.5940054 C11.2605042,13.8092643 10.605042,13.1716621 9.79831933,13.1716621 Z M9.91596639,4 C7.46218487,4 6,5.61852861 6,7.53133515 C6,7.74386921 6.01680672,7.98910082 6.06722689,8.21798365 L8.42016807,8.29972752 C8.40336134,8.23433243 8.3697479,8.07084469 8.3697479,7.69482289 C8.3697479,6.92643052 8.94117647,6.15803815 9.91596639,6.15803815 C10.9243697,6.15803815 11.4117647,6.77929155 11.4117647,7.41689373 C11.4117647,7.84196185 11.2605042,8.23433243 10.8067227,8.5613079 L9.94957983,9.18256131 C8.99159664,9.88555858 8.67226891,10.719346 8.67226891,11.4877384 C8.67226891,11.7493188 8.68907563,11.9782016 8.7394958,12.2070845 L10.7394958,12.2070845 C10.7394958,11.4713896 11.1428571,11.0463215 11.7310924,10.6212534 L12.3697479,10.1634877 C13.3781513,9.42779292 14,8.52861035 14,7.22070845 C14,5.58583106 12.6386555,4 9.91596639,4 Z" id="Oval-2" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
<title>Dark / 20 / workstation@svg</title>
<desc>Created with Sketch.</desc>
<g id="Dark-/-20-/-workstation" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M14,18 C14.5522847,18 15,18.4477153 15,19 C15,19.5522847 14.5522847,20 14,20 L14,20 L6,20 C5.44771525,20 5,19.5522847 5,19 C5,18.4477153 5.44771525,18 6,18 L6,18 Z M17,0 C18.6568542,0 20,1.34314575 20,3 L20,3 L20,13 C20,14.6568542 18.6568542,16 17,16 L17,16 L3,16 C1.34314575,16 0,14.6568542 0,13 L0,13 L0,3 C0,1.34314575 1.34314575,0 3,0 L3,0 Z M17,2 L3,2 C2.44771525,2 2,2.44771525 2,3 L2,3 L2,11 L18,11 L18,3 C18,2.44771525 17.5522847,2 17,2 L17,2 Z M6,4 C7.1045695,4 8,4.8954305 8,6 C8,7.1045695 7.1045695,8 6,8 C4.8954305,8 4,7.1045695 4,6 C4,4.8954305 4.8954305,4 6,4 Z" id="Rectangle" fill="#3F3F3F"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -4332,6 +4332,14 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
$total_modules = count($all_modules);
if ($width !== 0 && $height !== 0) {
$measuresProvided = false;
$width = 200;
$height = 50;
} else {
$measuresProvided = true;
}
// Best square.
$high = (float) max($width, $height);
$low = 0.0;
@ -4348,6 +4356,7 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
$square_length = min(($width / floor($width / $low)), ($height / floor($height / $low)));
// $measureSymbol = ($measuresProvided === true) ? '' : '%';
// Print starmap.
$html = sprintf(
'<svg id="svg_%s" style="width: %spx; height: %spx;">',
@ -4398,6 +4407,7 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
$y,
$row,
$column,
// $square_length.$measureSymbol,
$square_length,
$square_length,
$status,

View File

@ -648,18 +648,14 @@ 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, $force_show_image=false, $show_as_image=false, $class='')
function ui_print_group_icon($id_group, $return=false, $path='', $style='', $link=true, $force_show_image=false, $show_as_image=false, $class='')
{
global $config;
if ($id_group > 0) {
$icon = (string) db_get_value('icon', 'tgrupo', 'id_grupo', (int) $id_group);
} else {
$icon = 'world';
}
$output = '';
$icon = ($id_group > 0) ? (string) db_get_value('icon', 'tgrupo', 'id_grupo', (int) $id_group) : 'unknown@groups.svg';
// Don't show link in metaconsole.
if (is_metaconsole() === true) {
$link = false;
@ -669,7 +665,7 @@ function ui_print_group_icon($id_group, $return=false, $path='groups_small', $st
$output = '<a href="'.$config['homeurl'].'index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60&amp;group_id='.$id_group.'">';
}
if ($config['show_group_name']) {
if ((bool) $config['show_group_name'] === true) {
$output .= '<span title="'.groups_get_name($id_group, true).'">'.groups_get_name($id_group, true).'&nbsp;</span>';
} else {
if (empty($icon) === true) {
@ -683,7 +679,7 @@ function ui_print_group_icon($id_group, $return=false, $path='groups_small', $st
}
$output .= html_print_image(
'images/'.$path.'/'.$icon.'.png',
'images/'.$icon,
true,
[
'style' => $style,
@ -699,15 +695,15 @@ function ui_print_group_icon($id_group, $return=false, $path='groups_small', $st
}
}
if ($link) {
if ($link === true) {
$output .= '</a>';
}
if (!$return) {
if ($return === false) {
echo $output;
} else {
return $output;
}
return $output;
}

View File

@ -5933,7 +5933,7 @@ div#status_pie path {
div#status_pie {
margin-bottom: 2em;
}
/*
.agent_details_header {
display: flex;
justify-content: flex-end;
@ -5941,7 +5941,22 @@ div#status_pie {
border-bottom: 1px solid #e2e2e2;
padding: 8px 20px;
}
*/
.agent_details_header {
display: flex;
justify-content: flex-end;
align-items: center;
border-bottom: 1px solid #e2e2e2;
padding: 8px 20px;
}
/*
.agent_details_content {
display: flex;
align-items: flex-start;
padding: 20px;
padding-bottom: 0;
}
*/
.agent_details_content {
display: flex;
align-items: flex-start;
@ -5949,15 +5964,17 @@ div#status_pie {
padding-bottom: 0;
}
.agent_details_agent_name {
display: flex;
align-items: center;
.agent_details_content .agent_details_graph {
text-align: center;
flex: 0 1 30%;
}
.agent_details_remote_cfg {
align-self: flex-start;
.agent_details_content .agent_details_info {
flex: 1 1 70%;
overflow: hidden;
min-width: 220px;
}
/*
.agent_details_graph {
text-align: center;
margin: 0 auto;
@ -5968,6 +5985,16 @@ div#status_pie {
overflow: hidden;
min-width: 220px;
}
*/
.agent_details_agent_name {
display: flex;
align-items: center;
}
.agent_details_remote_cfg {
align-self: flex-start;
}
.agent_details_info span {
text-overflow: ellipsis;

View File

@ -52,7 +52,7 @@ $id_agente = get_parameter_get('id_agente', -1);
$agent = db_get_row('tagente', 'id_agente', $id_agente);
if (empty($agent['server_name'])) {
if (empty($agent['server_name']) === true) {
ui_print_error_message(
__('The agent has not assigned server. Maybe agent does not run fine.')
);
@ -63,8 +63,8 @@ if ($agent === false) {
return;
}
if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')
&& ! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AR') === false
&& check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === false
) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
@ -74,7 +74,8 @@ if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AR')
return;
}
$alive_animation = agents_get_starmap($id_agente, 200, 50);
// $alive_animation = agents_get_starmap($id_agente, 200, 50);
$alive_animation = agents_get_starmap($id_agente, 1000, 100);
/*
* START: TABLE AGENT BUILD.
@ -94,13 +95,13 @@ $in_planned_downtime = db_get_sql(
WHERE tplanned_downtime_agents.id_agent = '.$agent['id_agente'].' AND tplanned_downtime.executed = 1'
);
if ($agent['disabled']) {
if ((bool) $agent['disabled'] === true) {
if ($in_planned_downtime) {
$agent_name = '<em>'.$agent_name.ui_print_help_tip(__('Disabled'), true);
} else {
$agent_name = '<em>'.$agent_name.'</em>'.ui_print_help_tip(__('Disabled'), true);
}
} else if ($agent['quiet']) {
} else if ((bool) $agent['quiet'] === true) {
if ($in_planned_downtime) {
$agent_name = "<em'>".$agent_name.'&nbsp;'.html_print_image(
'images/dot_blue.png',
@ -146,11 +147,11 @@ $table_agent_header = '<div class="agent_details_agent_alias">';
$table_agent_header .= $agent_name;
$table_agent_header .= '</div>';
$table_agent_header .= '<div class="agent_details_agent_name">';
if (!$config['show_group_name']) {
if ((bool) $config['show_group_name'] === false) {
$table_agent_header .= ui_print_group_icon(
$agent['id_grupo'],
true,
'groups_small',
'',
'padding-right: 6px;'
);
}
@ -193,7 +194,7 @@ $table_agent_os = '<p>'.ui_print_os_icon(
false,
['title' => __('OS').': '.get_os_name($agent['id_os'])]
);
$table_agent_os .= (empty($agent['os_version'])) ? get_os_name((int) $agent['id_os']) : $agent['os_version'].'</p>';
$table_agent_os .= (empty($agent['os_version']) === true) ? get_os_name((int) $agent['id_os']) : $agent['os_version'].'</p>';
$addresses = agents_get_addresses($id_agente);
$address = agents_get_address($id_agente);
@ -204,7 +205,7 @@ foreach ($addresses as $k => $add) {
}
}
if (!empty($address)) {
if (empty($address) === false) {
$table_agent_ip = '<p>'.html_print_image(
'images/world.png',
true,
@ -214,7 +215,7 @@ if (!empty($address)) {
]
);
$table_agent_ip .= '<span class="align-top inline">';
$table_agent_ip .= empty($address) ? '<em>'.__('N/A').'</em>' : $address;
$table_agent_ip .= (empty($address) === true) ? '<em>'.__('N/A').'</em>' : $address;
$table_agent_ip .= '</span></p>';
}
@ -227,7 +228,7 @@ $table_agent_version = '<p>'.html_print_image(
]
);
$table_agent_version .= '<span class="align-top inline">';
$table_agent_version .= empty($agent['agent_version']) ? '<i>'.__('N/A').'</i>' : $agent['agent_version'];
$table_agent_version .= (empty($agent['agent_version']) === true) ? '<i>'.__('N/A').'</i>' : $agent['agent_version'];
$table_agent_version .= '</span></p>';
$table_agent_description = '<p>'.html_print_image(
@ -239,7 +240,7 @@ $table_agent_description = '<p>'.html_print_image(
]
);
$table_agent_description .= '<span class="align-top inline">';
$table_agent_description .= empty($agent['comentarios']) ? '<em>'.__('N/A').'</em>' : $agent['comentarios'];
$table_agent_description .= (empty($agent['comentarios']) === true) ? '<em>'.__('N/A').'</em>' : $agent['comentarios'];
$table_agent_description .= '</span></p>';
$table_agent_count_modules = reporting_tiny_stats(
@ -291,6 +292,15 @@ if ($has_remote_conf) {
// $table_agent_count_modules .= ui_print_help_tip(__('Agent statuses are re-calculated by the server, they are not shown in real time.'), true);
/*
$table_agent = html_print_div(
[
'class' => 'agent_details_header',
'content' => $table_agent_header,
],
true
);
*/
$table_agent = '
<div class="agent_details_header">
'.$table_agent_header.'
@ -307,6 +317,27 @@ $table_agent = '
</div>
</div>';
/*
$table_agent = '
<div class="agent_details_header">
'.$table_agent_header.'
</div>
<div class="agent_details_content">
<div class="agent_details_graph">
'.$table_agent_graph.'
<div class="agent_details_bullets">
'.$table_agent_count_modules.'
</div>
</div>
<div class="agent_details_info">
'.$alive_animation.$table_agent_os.$table_agent_ip.$table_agent_version.$table_agent_description.$remote_cfg.'
</div>
</div>';
*/
/*
* END: TABLE AGENT BUILD.
*/
@ -328,63 +359,98 @@ $table_contact->headstyle[1] = 'padding-top:6px; padding-bottom:6px;padding-righ
$table_contact->head[0] = ' <span>'.__('Agent contact').'</span>';
$buttons_refresh_agent_view = '<div class="buttons_agent_view">';
$buttons_refresh_agent_view .= '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;refr=60">'.html_print_image(
'images/refresh.png',
true,
$buttons_refresh_agent_view .= html_print_anchor(
[
'title' => __('Refresh data'),
'class' => 'invert_filter',
'alt' => '',
]
).'</a><br>';
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
$buttons_refresh_agent_view .= '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;flag_agent=1&amp;id_agente='.$id_agente.'">'.html_print_image(
'images/target.png',
true,
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;refr=60',
'content' => html_print_image(
'images/refresh.png',
true,
[
'title' => __('Refresh data'),
'class' => 'invert_filter',
'alt' => '',
]
),
],
true
);
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
$buttons_refresh_agent_view .= html_print_anchor(
[
'title' => __('Force remote checks'),
'alt' => '',
'class' => 'invert_filter',
]
).'</a>';
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;flag_agent=1&amp;id_agente='.$id_agente,
'content' => html_print_image(
'images/target.png',
true,
[
'title' => __('Force remote checks'),
'alt' => '',
'class' => 'invert_filter',
]
),
],
true
);
}
$buttons_refresh_agent_view .= '</div>';
$table_contact->head[1] = $buttons_refresh_agent_view;
$data = [];
$data[0] = '<b>'.__('Interval').'</b>';
$data[1] = human_time_description_raw($agent['intervalo']);
$table_contact->data[] = $data;
$data = [];
$data[0] = '<b>'.__('Last contact').' / '.__('Remote').'</b>';
$data[1] = ui_print_timestamp($agent['ultimo_contacto'], true);
$data[1] .= ' / ';
if ($agent['ultimo_contacto_remoto'] == '01-01-1970 00:00:00') {
$data[1] .= __('Never');
// Data for agent contact.
$intervalHumanTime = human_time_description_raw($agent['intervalo']);
$lastContactDate = ui_print_timestamp($agent['ultimo_contacto'], true);
$remoteContactDate = ($agent['ultimo_contacto_remoto'] === '01-01-1970 00:00:00') ? __('Never') : date_w_fixed_tz($agent['ultimo_contacto_remoto']);
$lastAndRemoteContact = sprintf('%s / %s', $lastContactDate, $remoteContactDate);
$progress = agents_get_next_contact($id_agente);
$progressOverride = ($progress > 100) ? clippy_context_help('agent_out_of_limits') : '';
$tempTimeToShow = ($agent['intervalo'] - (strtotime('now') - strtotime($agent['ultimo_contacto'])));
$progressCaption = ($tempTimeToShow >= 0) ? sprintf('%d s', $tempTimeToShow) : __('Out of bounds');
$ajaxNextContactInterval = (empty($agent['intervalo']) === true) ? 0 : (100 / $agent['intervalo']);
$secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
$secondaryLinks = [];
if (empty($secondary_groups['for_select']) === true) {
$secondaryLinks[] = '<em>'.__('N/A').'</em>';
} else {
$data[1] .= date_w_fixed_tz($agent['ultimo_contacto_remoto']);
foreach ($secondary_groups['for_select'] as $id => $name) {
$secondaryLinks[] = html_print_anchor(
[
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60&amp;group_id='.$id,
'content' => $name,
],
true
);
}
}
$last_status_change_agent = agents_get_last_status_change($agent['id_agente']);
$time_elapsed = (empty($last_status_change_agent) === false) ? human_time_comparation($last_status_change_agent) : '<em>'.__('N/A').'</em>';
// Agent Interval.
$data = [];
$data[0] = '<b>'.__('Interval').'</b>';
$data[1] = $intervalHumanTime;
$table_contact->data[] = $data;
// Last & Remote contact.
$data = [];
$data[0] = '<b>'.__('Next contact').'</b>';
$progress = agents_get_next_contact($id_agente);
$data[0] = '<b>'.__('Last contact').' / '.__('Remote').'</b>';
$data[1] = $lastAndRemoteContact;
$table_contact->data[] = $data;
// Next contact progress.
$data = [];
$data[0] = '<b>'.__('Next contact').'</b>'.$progressOverride;
$data[1] = ui_progress(
$progress,
'100%',
1.8,
'#BBB',
true,
($agent['intervalo'] - (strtotime('now') - strtotime($agent['ultimo_contacto']))).' s',
$progressCaption,
[
'page' => 'operation/agentes/ver_agente',
'interval' => (empty($agent['intervalo']) === true) ? 0 : (100 / $agent['intervalo']),
'interval' => $ajaxNextContactInterval,
'data' => [
'id_agente' => $id_agente,
'refresh_contact' => 1,
@ -392,52 +458,49 @@ $data[1] = ui_progress(
]
);
if ($progress > 100) {
$data[0] .= clippy_context_help('agent_out_of_limits');
}
$table_contact->data[] = $data;
// Group line.
$data = [];
$data[0] = '<b>'.__('Group').'</b>';
$data[1] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60&amp;group_id='.$agent['id_grupo'].'">'.groups_get_name($agent['id_grupo']).'</a>';
$data[1] = html_print_anchor(
[
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60&amp;group_id='.$agent['id_grupo'],
'content' => groups_get_name($agent['id_grupo']),
],
true
);
$table_contact->data[] = $data;
// Secondary groups.
$data = [];
$data[0] = '<b>'.__('Secondary groups').'</b>';
$secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
if (empty($secondary_groups['for_select']) === true) {
$data[1] = '<em>'.__('N/A').'</em>';
} else {
$secondary_links = [];
foreach ($secondary_groups['for_select'] as $id => $name) {
$secondary_links[] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60&amp;group_id='.$id.'">'.$name.'</a>';
}
$data[1] = implode(', ', $secondary_links);
}
$data[1] = implode(', ', $secondaryLinks);
$table_contact->data[] = $data;
if (enterprise_installed()) {
// Parent agent line.
if (enterprise_installed() === true) {
$data = [];
$data[0] = '<b>'.__('Parent').'</b>';
if ($agent['id_parent'] == 0) {
if ((int) $agent['id_parent'] === 0) {
$data[1] = '<em>'.__('N/A').'</em>';
} else {
$data[1] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent['id_parent'].'">'.agents_get_alias($agent['id_parent']).'</a>';
$data[1] = html_print_anchor(
[
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent['id_parent'],
'content' => agents_get_alias($agent['id_parent']),
],
true
);
}
$table_contact->data[] = $data;
}
// Last status change line.
$data = [];
$data[0] = '<b>'.__('Last status change').'</b>';
$last_status_change_agent = agents_get_last_status_change($agent['id_agente']);
$time_elapsed = !empty($last_status_change_agent) ? human_time_comparation($last_status_change_agent) : '<em>'.__('N/A').'</em>';
$data[1] = $time_elapsed;
$table_contact->data[] = $data;
/*
@ -467,7 +530,7 @@ $table_data->head_colspan[0] = 4;
// Gis and url address.
$data_opcional = [];
// Position Information.
if ($config['activate_gis']) {
if ((bool) $config['activate_gis'] === true) {
$data_opcional[] = '<b>'.__('Position (Long, Lat)').'</b>';
$dataPositionAgent = gis_get_data_last_position_agent(
$agent['id_agente']
@ -476,44 +539,47 @@ if ($config['activate_gis']) {
if ($dataPositionAgent === false) {
$data_opcional[] = __('There is no GIS data.');
} else {
$data_opcional[] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente='.$id_agente.'">';
if ($dataPositionAgent['description'] != '') {
$data_opcional[] .= $dataPositionAgent['description'];
} else {
$data_opcional[] .= $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'];
}
$data_opcional[] .= '</a>';
$data_opcional[] = html_print_anchor(
[
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente='.$id_agente,
'content' => (empty($dataPositionAgent['description']) === false) ? $dataPositionAgent['description'] : $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'],
],
true
);
}
array_push($data_opcional);
array_push($data_opcional);
}
// If the url description is set.
if ($agent['url_address'] != '') {
// $data_opcional = [];
if (empty($agent['url_address']) === false) {
$data_opcional[] = '<b>'.__('Url address').'</b>';
if ($agent['url_address'] != '') {
$data_opcional[] = '<a href='.$agent['url_address'].'>'.$agent['url_address'].'</a>';
}
$data_opcional[] = html_print_anchor(
[
'href' => $agent['url_address'],
'content' => $agent['url_address'],
],
true
);
}
// Other IP address and timezone offset.
if (!empty($addresses)) {
// $data_opcional = [];
if (empty($addresses) === false) {
$data_opcional[] = '<b>'.__('Other IP addresses').'</b>';
if (!empty($addresses)) {
$data_opcional[] = '<div class="overflow-y mx_height50px">'.implode('<br>', $addresses).'</div>';
}
$data_opcional[] = html_print_div(
[
'class' => 'overflow-y mx_height50px',
'content' => implode('<br>', $addresses),
],
true
);
}
// Timezone Offset.
if ($agent['timezone_offset'] != 0) {
if ((int) $agent['timezone_offset'] !== 0) {
$data_opcional[] = '<b>'.__('Timezone Offset').'</b>';
if ($agent['timezone_offset'] != 0) {
$data_opcional[] = $agent['timezone_offset'];
}
$data_opcional[] = $agent['timezone_offset'];
}

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -30,14 +30,14 @@
global $config;
// Ajax tooltip to deploy modules's tag info.
if (is_ajax()) {
if (is_ajax() === true) {
$get_tag_tooltip = (bool) get_parameter('get_tag_tooltip', 0);
$get_relations_tooltip = (bool) get_parameter('get_relations_tooltip', 0);
if ($get_tag_tooltip) {
if ($get_tag_tooltip === true) {
$id_agente_modulo = (int) get_parameter('id_agente_modulo');
if ($id_agente_modulo == false) {
if ($id_agente_modulo === 0) {
return;
}
@ -80,9 +80,9 @@ if (is_ajax()) {
}
if ($get_relations_tooltip) {
if ($get_relations_tooltip === true) {
$id_agente_modulo = (int) get_parameter('id_agente_modulo');
if ($id_agente_modulo == false) {
if ($id_agente_modulo === 0) {
return;
}
@ -94,7 +94,7 @@ if (is_ajax()) {
];
$relations = modules_get_relations($params);
if (empty($relations)) {
if (empty($relations) === true) {
return;
}
@ -136,7 +136,7 @@ if (is_ajax()) {
return;
}
if (!isset($id_agente)) {
if (isset($id_agente) === false) {
// This page is included, $id_agente should be passed to it.
db_pandora_audit(
AUDIT_LOG_HACK_ATTEMPT,
@ -172,7 +172,13 @@ print_form_filter_monitors(
$status_hierachy_mode
);
echo '<div id="module_list"></div>';
echo html_print_div(
[
'id' => 'module_list',
'content' => '',
],
true
);
$html_toggle = ob_get_clean();