mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Fixed sources in log report
This commit is contained in:
parent
e1cba85c6e
commit
04f117523b
@ -930,9 +930,9 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||||||
$agents = agents_get_group_agents($group);
|
$agents = agents_get_group_agents($group);
|
||||||
if ((empty($agents)) || $agents == -1) $agents = array();
|
if ((empty($agents)) || $agents == -1) $agents = array();
|
||||||
|
|
||||||
$sql_log = 'SELECT source
|
$sql_log = 'SELECT source AS k, source AS v
|
||||||
FROM tagente,tagent_module_log
|
FROM tagente,tagent_module_log
|
||||||
WHERE tagente.id_agente = tagent_module_log.id_agent ';
|
WHERE tagente.id_agente = tagent_module_log.id_agent AND tagente.disabled = 0';
|
||||||
|
|
||||||
if (!empty($agents)) {
|
if (!empty($agents)) {
|
||||||
$index = 0;
|
$index = 0;
|
||||||
@ -947,7 +947,7 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||||||
}
|
}
|
||||||
$sql_log .= ")";
|
$sql_log .= ")";
|
||||||
}
|
}
|
||||||
html_print_select_from_sql ($sql_log, 'source', $source, '', __('All'), '', false, false, false);
|
html_print_select_from_sql ($sql_log, 'source', $source, 'onselect=source_change_agents();', __('All'), '', false, false, false);
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -1066,9 +1066,15 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||||||
<td style="font-weight:bold;"><?php echo __('Agents'); ?></td>
|
<td style="font-weight:bold;"><?php echo __('Agents'); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
$sql_log_report = 'SELECT id_agente, alias
|
if ($source) {
|
||||||
FROM tagente, tagent_module_log
|
$sql_log_report = 'SELECT id_agente, alias
|
||||||
WHERE tagente.id_agente = tagent_module_log.id_agent';
|
FROM tagente, tagent_module_log
|
||||||
|
WHERE tagente.id_agente = tagent_module_log.id_agent AND tagente.disabled = 0 AND tagent_module_log.source like "'. $source.'"';
|
||||||
|
} else {
|
||||||
|
$sql_log_report = 'SELECT id_agente, alias
|
||||||
|
FROM tagente, tagent_module_log
|
||||||
|
WHERE tagente.id_agente = tagent_module_log.id_agent AND tagente.disabled = 0';
|
||||||
|
}
|
||||||
$all_agent_log = db_get_all_rows_sql($sql_log_report);
|
$all_agent_log = db_get_all_rows_sql($sql_log_report);
|
||||||
|
|
||||||
foreach ($all_agent_log as $key => $value) {
|
foreach ($all_agent_log as $key => $value) {
|
||||||
@ -1089,6 +1095,7 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
html_print_select($agents2, 'id_agents2[]', $agents_select, $script = '', "", 0, false, true, true, '', false, "min-width: 180px");
|
html_print_select($agents2, 'id_agents2[]', $agents_select, $script = '', "", 0, false, true, true, '', false, "min-width: 180px");
|
||||||
|
echo "<span id='spinner_hack' style='display:none;'>" . html_print_image('images/spinner.gif', true) . "</span>";
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -3522,4 +3529,22 @@ function set_last_value_period() {
|
|||||||
$("#row_period").show();
|
$("#row_period").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function source_change_agents() {
|
||||||
|
$("#id_agents2").empty();
|
||||||
|
$("#spinner_hack").show();
|
||||||
|
jQuery.post ("ajax.php",
|
||||||
|
{"page" : "operation/agentes/ver_agente",
|
||||||
|
"get_agents_source_json" : 1,
|
||||||
|
"source" : $("#source").val()
|
||||||
|
},
|
||||||
|
function (data, status) {
|
||||||
|
for (var clave in data) {
|
||||||
|
$("#id_agents2").append('<option value="'+clave+'">'+data[clave]+'</option>');
|
||||||
|
}
|
||||||
|
$("#spinner_hack").hide();
|
||||||
|
},
|
||||||
|
"json"
|
||||||
|
);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -44,6 +44,7 @@ if (is_ajax ()) {
|
|||||||
$get_agentmodule_status_tooltip = (bool) get_parameter ("get_agentmodule_status_tooltip");
|
$get_agentmodule_status_tooltip = (bool) get_parameter ("get_agentmodule_status_tooltip");
|
||||||
$get_group_status_tooltip = (bool) get_parameter ("get_group_status_tooltip");
|
$get_group_status_tooltip = (bool) get_parameter ("get_group_status_tooltip");
|
||||||
$get_agent_id = (bool) get_parameter ("get_agent_id");
|
$get_agent_id = (bool) get_parameter ("get_agent_id");
|
||||||
|
$get_agents_source_json = (bool) get_parameter ("get_agents_source_json");
|
||||||
$cluster_mode = (bool) get_parameter ("cluster_mode",0);
|
$cluster_mode = (bool) get_parameter ("cluster_mode",0);
|
||||||
$agent_alias = get_parameter('alias', '');
|
$agent_alias = get_parameter('alias', '');
|
||||||
$agents_inserted = get_parameter('agents_inserted', array());
|
$agents_inserted = get_parameter('agents_inserted', array());
|
||||||
@ -1001,6 +1002,29 @@ if (is_ajax ()) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($get_agents_source_json) {
|
||||||
|
$source = get_parameter('source', '');
|
||||||
|
|
||||||
|
if (empty($source)) {
|
||||||
|
$sql_report_log = 'SELECT id_agente, alias
|
||||||
|
FROM tagente, tagent_module_log
|
||||||
|
WHERE tagente.id_agente = tagent_module_log.id_agent AND tagente.disabled = 0';
|
||||||
|
} else {
|
||||||
|
$sql_report_log = 'SELECT id_agente, alias
|
||||||
|
FROM tagente, tagent_module_log
|
||||||
|
WHERE tagente.id_agente = tagent_module_log.id_agent AND tagente.disabled = 0 AND tagent_module_log.source like "'. $source.'"';
|
||||||
|
}
|
||||||
|
|
||||||
|
$all_agent_log = db_get_all_rows_sql($sql_report_log);
|
||||||
|
|
||||||
|
foreach ($all_agent_log as $key => $value) {
|
||||||
|
$agents2[$value['id_agente']] = $value['alias'];
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($agents2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user