mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
#10347 added modal in heatmap agent
This commit is contained in:
parent
ea51399460
commit
a4a5650a01
@ -160,7 +160,7 @@ ui_toggle(
|
|||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
echo '<div id="modal-info-agent"></div>'
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -2464,7 +2464,6 @@ function groups_get_heat_map_agents(array $id_group, float $width=0, float $heig
|
|||||||
$sql = 'SELECT * FROM tagente WHERE id_grupo IN('.implode(',', $id_group).')';
|
$sql = 'SELECT * FROM tagente WHERE id_grupo IN('.implode(',', $id_group).')';
|
||||||
|
|
||||||
$all_agents = db_get_all_rows_sql($sql);
|
$all_agents = db_get_all_rows_sql($sql);
|
||||||
hd($sql, true);
|
|
||||||
if (empty($all_agents)) {
|
if (empty($all_agents)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -2807,19 +2806,3 @@ function groups_get_stats_modules_status($id_groups, $graph_width=250, $graph_he
|
|||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function groups_get_agents_group($id_groups)
|
|
||||||
{
|
|
||||||
global $config;
|
|
||||||
|
|
||||||
if (is_array($id_groups) === false) {
|
|
||||||
$id_groups = [$id_groups];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($rows === false) {
|
|
||||||
$rows = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $rows;
|
|
||||||
}
|
|
@ -1 +1,18 @@
|
|||||||
function showInfoAgent(id_agent) {}
|
/* global $ */
|
||||||
|
function showInfoAgent(id_agent) {
|
||||||
|
load_modal({
|
||||||
|
target: $("#modal-info-agent"),
|
||||||
|
url: "ajax.php",
|
||||||
|
modal: {
|
||||||
|
title: "Info agent",
|
||||||
|
cancel: "close"
|
||||||
|
},
|
||||||
|
onshow: {
|
||||||
|
page: "include/ajax/group",
|
||||||
|
method: "loadInfoAgent",
|
||||||
|
extradata: {
|
||||||
|
idAgent: id_agent
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -47,6 +47,7 @@ class Group extends Entity
|
|||||||
'getGroupsForSelect',
|
'getGroupsForSelect',
|
||||||
'distributionBySoGraph',
|
'distributionBySoGraph',
|
||||||
'groupEventsByAgent',
|
'groupEventsByAgent',
|
||||||
|
'loadInfoAgent',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -505,4 +506,74 @@ class Group extends Entity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function loadInfoAgent()
|
||||||
|
{
|
||||||
|
$extradata = get_parameter('extradata', '');
|
||||||
|
echo '<div class="info-agent">';
|
||||||
|
|
||||||
|
if (empty($extradata) === false) {
|
||||||
|
$extradata = json_decode(io_safe_output($extradata), true);
|
||||||
|
$agent = agents_get_agent($extradata['idAgent']);
|
||||||
|
|
||||||
|
if (is_array($agent)) {
|
||||||
|
$status_img = agents_tree_view_status_img(
|
||||||
|
$agent['critical_count'],
|
||||||
|
$agent['warning_count'],
|
||||||
|
$agent['unknown_count'],
|
||||||
|
$agent['total_count'],
|
||||||
|
$agent['notinit_count']
|
||||||
|
);
|
||||||
|
$table = new \stdClass();
|
||||||
|
$table->class = 'table_modal_alternate';
|
||||||
|
$table->data = [
|
||||||
|
[
|
||||||
|
__('Id'),
|
||||||
|
$agent['id_agente'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Agent name'),
|
||||||
|
'<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$agent['id_agente'].'"><b>'.$agent['nombre'].'</b></a>',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Alias'),
|
||||||
|
$agent['alias'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Ip Address'),
|
||||||
|
$agent['direccion'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Status'),
|
||||||
|
$status_img,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Group'),
|
||||||
|
groups_get_name($agent['id_grupo']),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Interval'),
|
||||||
|
$agent['intervalo'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Operative system'),
|
||||||
|
get_os_name($agent['id_os']),
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Server name'),
|
||||||
|
$agent['server_name'],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
__('Description'),
|
||||||
|
$agent['comentarios'],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
html_print_table($table);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,3 +13,13 @@
|
|||||||
rect {
|
rect {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.info-agent {
|
||||||
|
width: 100%;
|
||||||
|
max-height: 400px;
|
||||||
|
}
|
||||||
|
.info-agent table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#modal-info-agent {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user