Merge branch 'ent-7442-Metaconsole-Dashboard-WUX-Transaction-Stats-no-encuentra-trans' into 'develop'

Ent 7442 metaconsole dashboard wux transaction stats no encuentra trans

Closes pandora_enterprise#7442

See merge request artica/pandorafms!4295
This commit is contained in:
Daniel Rodriguez 2021-08-06 12:53:06 +00:00
commit 604ef4bc89
5 changed files with 24 additions and 13 deletions

View File

@ -5047,11 +5047,7 @@ function ui_print_agent_autocomplete_input($parameters)
$metaconsole_enabled = $parameters['metaconsole_enabled']; $metaconsole_enabled = $parameters['metaconsole_enabled'];
} else { } else {
// If metaconsole_enabled param is not setted then pick source configuration. // If metaconsole_enabled param is not setted then pick source configuration.
if (defined('METACONSOLE')) { $metaconsole_enabled = is_metaconsole();
$metaconsole_enabled = true;
} else {
$metaconsole_enabled = false;
}
} }
$get_only_string_modules = false; $get_only_string_modules = false;
@ -5161,15 +5157,22 @@ function ui_print_agent_autocomplete_input($parameters)
} }
'; ';
} else if ($from_wux_transaction != '') { } else if ($from_wux_transaction != '') {
if (is_metaconsole() === true) {
$inputNode = 'inputs.push ("server_id=" + $("#'.$input_id_server_id.'").val());';
} else {
$inputNode = '';
}
$javascript_code_function_select = ' $javascript_code_function_select = '
function function_select_'.$input_name.'(agent_name) { function function_select_'.$input_name.'(agent_name) {
$("#'.$selectbox_id.'").empty(); $("#'.$selectbox_id.'").empty();
var inputs = []; var inputs = [];
inputs.push ("id_agent=" + $("#'.$hidden_input_idagent_id.'").val()); inputs.push ("id_agent=" + $("#'.$hidden_input_idagent_id.'").val());
inputs.push ("get_agent_transactions=1"); inputs.push ("get_agent_transactions=1");
inputs.push ("page=enterprise/include/ajax/wux_transaction.ajax"); inputs.push ("page=enterprise/include/ajax/wux_transaction.ajax");
'.$inputNode.'
jQuery.ajax ({ jQuery.ajax ({
data: inputs.join ("&"), data: inputs.join ("&"),
type: "POST", type: "POST",
@ -5457,14 +5460,11 @@ function ui_print_agent_autocomplete_input($parameters)
server_name = ui.item.ip; server_name = ui.item.ip;
} }
if (('.((int) $use_input_id_server).') if (('.((int) $use_input_id_server).')
|| ('.((int) $print_input_id_server).')) { || ('.((int) $print_input_id_server).')) {
server_id = ui.item.id_server; server_id = ui.item.id_server;
} }
//Put the name //Put the name
$(this).val(agent_name); $(this).val(agent_name);

View File

@ -169,6 +169,11 @@ function pandoraFlotPieCustom(
var label_conf; var label_conf;
var show_legend = true; var show_legend = true;
// Set default value if not come like a number.
if (isNaN(width) === true) {
width = 451;
}
if (width <= 450) { if (width <= 450) {
show_legend = false; show_legend = false;
label_conf = { label_conf = {
@ -222,6 +227,9 @@ function pandoraFlotPieCustom(
conf_pie.series.pie.label = { show: false }; conf_pie.series.pie.label = { show: false };
} }
// Avoid issues with 0 width values.
$("#" + graph_id).width(width);
var plot = $.plot($("#" + graph_id), data, conf_pie); var plot = $.plot($("#" + graph_id), data, conf_pie);
if (no_data == data.length) { if (no_data == data.length) {
$("#" + graph_id + " .overlay").remove(); $("#" + graph_id + " .overlay").remove();

View File

@ -809,6 +809,7 @@ function dashboardLoadWuxStats(settings) {
page: settings.page, page: settings.page,
wux_transaction_stats: 1, wux_transaction_stats: 1,
id_agent: settings.id_agent, id_agent: settings.id_agent,
server_id: settings.server_id,
transaction: settings.transaction, transaction: settings.transaction,
view_all_stats: settings.view_all_stats, view_all_stats: settings.view_all_stats,
auth_class: settings.auth_class, auth_class: settings.auth_class,

View File

@ -259,7 +259,7 @@ class WuxWidget extends Widget
'label' => __('Wux transaction'), 'label' => __('Wux transaction'),
'arguments' => [ 'arguments' => [
'type' => 'autocomplete_module', 'type' => 'autocomplete_module',
'fields' => $fields, 'fields' => [],
'name' => 'transactionId', 'name' => 'transactionId',
'selected' => $values['transactionId'], 'selected' => $values['transactionId'],
'return' => true, 'return' => true,

View File

@ -270,7 +270,7 @@ class WuxStatsWidget extends Widget
'label' => __('Wux transaction'), 'label' => __('Wux transaction'),
'arguments' => [ 'arguments' => [
'type' => 'autocomplete_module', 'type' => 'autocomplete_module',
'fields' => $fields, 'fields' => [],
'name' => 'transactionId', 'name' => 'transactionId',
'selected' => $values['transactionId'], 'selected' => $values['transactionId'],
'return' => true, 'return' => true,
@ -326,6 +326,7 @@ class WuxStatsWidget extends Widget
{ {
global $config; global $config;
$server_id = ($this->values['node'] ?? '0');
$id_agent = $this->values['agentId']; $id_agent = $this->values['agentId'];
$transaction = $this->values['transactionId']; $transaction = $this->values['transactionId'];
$view_all_stats = $this->values['allStats']; $view_all_stats = $this->values['allStats'];
@ -340,6 +341,7 @@ class WuxStatsWidget extends Widget
false false
), ),
'page' => 'enterprise/include/ajax/wux_transaction.ajax', 'page' => 'enterprise/include/ajax/wux_transaction.ajax',
'server_id' => $server_id,
'id_agent' => $id_agent, 'id_agent' => $id_agent,
'transaction' => $transaction, 'transaction' => $transaction,
'view_all_stats' => $view_all_stats, 'view_all_stats' => $view_all_stats,