mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Merge remote-tracking branch 'origin/develop' into ent-8290-Crear-nueva-seccion-Operaciones-Masivas-borrado-agentes-en-Metaconsola
This commit is contained in:
commit
9a799a838d
@ -202,9 +202,7 @@ function extension_api_checker()
|
|||||||
echo '</fieldset>';
|
echo '</fieldset>';
|
||||||
echo "<div class='right'>";
|
echo "<div class='right'>";
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '</form>';
|
|
||||||
|
|
||||||
echo "<form method='post'>";
|
|
||||||
echo '<fieldset>';
|
echo '<fieldset>';
|
||||||
echo '<legend>'.__('Custom URL').'</legend>';
|
echo '<legend>'.__('Custom URL').'</legend>';
|
||||||
html_print_table($table3);
|
html_print_table($table3);
|
||||||
|
@ -113,6 +113,7 @@ define('SECONDS_3YEARS', 94608000);
|
|||||||
// Separator constats.
|
// Separator constats.
|
||||||
define('SEPARATOR_COLUMN', ';');
|
define('SEPARATOR_COLUMN', ';');
|
||||||
define('SEPARATOR_ROW', chr(10));
|
define('SEPARATOR_ROW', chr(10));
|
||||||
|
define('SEPARATOR_META_MODULE', '|-|-|-|');
|
||||||
// Chr(10) is \n.
|
// Chr(10) is \n.
|
||||||
define('SEPARATOR_COLUMN_CSV', '#');
|
define('SEPARATOR_COLUMN_CSV', '#');
|
||||||
define('SEPARATOR_ROW_CSV', "@\n");
|
define('SEPARATOR_ROW_CSV', "@\n");
|
||||||
|
@ -1157,7 +1157,7 @@ function events_get_all(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($tags[0] === $id_tag) {
|
if ($tags[0] === $id_tag) {
|
||||||
$_tmp .= ' AND ( ';
|
$_tmp .= ' AND (( ';
|
||||||
} else {
|
} else {
|
||||||
$_tmp .= ' OR ( ';
|
$_tmp .= ' OR ( ';
|
||||||
}
|
}
|
||||||
@ -1185,7 +1185,7 @@ function events_get_all(
|
|||||||
$_tmp .= ') ';
|
$_tmp .= ') ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_filters[] = $_tmp;
|
$sql_filters[] = $_tmp.')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1480,7 +1480,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||||||
'return' => true,
|
'return' => true,
|
||||||
'nothing' => __('All'),
|
'nothing' => __('All'),
|
||||||
'nothing_value' => 0,
|
'nothing_value' => 0,
|
||||||
'script' => 'fmModuleChange(\''.$uniqId.'\')',
|
'script' => 'fmModuleChange(\''.$uniqId.'\', '.is_metaconsole().')',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$output .= '</div>';
|
$output .= '</div>';
|
||||||
@ -1533,7 +1533,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||||||
'return' => true,
|
'return' => true,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'style' => 'min-width: 200px;max-width:200px;',
|
'style' => 'min-width: 200px;max-width:200px;',
|
||||||
'script' => 'fmModuleChange(\''.$uniqId.'\')',
|
'script' => 'fmModuleChange(\''.$uniqId.'\', '.is_metaconsole().')',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1550,39 +1550,29 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||||||
'name' => 'filtered-module-show-common-modules-'.$uniqId,
|
'name' => 'filtered-module-show-common-modules-'.$uniqId,
|
||||||
'selected' => $data['mShowCommonModules'],
|
'selected' => $data['mShowCommonModules'],
|
||||||
'return' => true,
|
'return' => true,
|
||||||
'script' => 'fmModuleChange(\''.$uniqId.'\')',
|
'script' => 'fmModuleChange(\''.$uniqId.'\', '.is_metaconsole().')',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($data['mAgents'] !== null) {
|
if ($data['mAgents'] !== null) {
|
||||||
$all_modules = select_modules_for_agent_group(
|
$all_modules = get_modules_agents(
|
||||||
$data['mModuleGroup'],
|
$data['mModuleGroup'],
|
||||||
explode(',', $data['mAgents']),
|
explode(',', $data['mAgents']),
|
||||||
$data['mShowCommonModules'],
|
$data['mShowCommonModules'],
|
||||||
false
|
false,
|
||||||
|
true
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$all_modules = [];
|
$all_modules = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data['mShowSelectedOtherGroups']) {
|
|
||||||
$selected_modules_ids = explode(',', $data['mModules']);
|
|
||||||
|
|
||||||
foreach ($selected_modules_ids as $id) {
|
|
||||||
if (!array_key_exists($id, $all_modules)) {
|
|
||||||
$module_data = modules_get_agentmodule($id);
|
|
||||||
$all_modules[$id] = $module_data['nombre'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$output .= html_print_input(
|
$output .= html_print_input(
|
||||||
[
|
[
|
||||||
'label' => __('Modules'),
|
'label' => __('Modules'),
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'fields' => $all_modules,
|
'fields' => $all_modules,
|
||||||
'name' => 'filtered-module-modules-'.$uniqId,
|
'name' => 'filtered-module-modules-'.$uniqId,
|
||||||
'selected' => explode(',', $data['mModules']),
|
'selected' => explode((is_metaconsole() === true) ? SEPARATOR_META_MODULE : ',', $data['mModules']),
|
||||||
'return' => true,
|
'return' => true,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'style' => 'min-width: 200px;max-width:200px;',
|
'style' => 'min-width: 200px;max-width:200px;',
|
||||||
|
@ -3231,9 +3231,10 @@ function modules_get_first_date($id_agent_module, $datelimit=0)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// check datatype string or normal
|
// Check datatype string or normal.
|
||||||
$table = 'tagente_datos';
|
$table = 'tagente_datos';
|
||||||
$module_type_str = modules_get_agentmodule_type($id_agent_module);
|
$module_type = modules_get_agentmodule_type($id_agent_module);
|
||||||
|
$module_type_str = modules_get_type_name($module_type);
|
||||||
if (strstr($module_type_str, 'string') !== false) {
|
if (strstr($module_type_str, 'string') !== false) {
|
||||||
$table = 'tagente_datos_string';
|
$table = 'tagente_datos_string';
|
||||||
}
|
}
|
||||||
@ -3555,7 +3556,7 @@ function modules_get_agentmodule_mininterval_no_async($id_agent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_modules_agents($id_module_group, $id_agents, $selection, $select_mode=true)
|
function get_modules_agents($id_module_group, $id_agents, $selection, $select_mode=true, $useName=false)
|
||||||
{
|
{
|
||||||
if ((bool) is_metaconsole() === true) {
|
if ((bool) is_metaconsole() === true) {
|
||||||
if ($select_mode === true) {
|
if ($select_mode === true) {
|
||||||
@ -3675,8 +3676,14 @@ function get_modules_agents($id_module_group, $id_agents, $selection, $select_mo
|
|||||||
|
|
||||||
$modules = array_reduce(
|
$modules = array_reduce(
|
||||||
$modules,
|
$modules,
|
||||||
function ($carry, $item) {
|
function ($carry, $item) use ($useName) {
|
||||||
$carry[$item['id_node'].'|'.$item['id_agente_modulo']] = $item['nombre'];
|
// Only works in select mode.
|
||||||
|
if ($useName === true) {
|
||||||
|
$carry[io_safe_input($item['nombre'])] = $item['nombre'];
|
||||||
|
} else {
|
||||||
|
$carry[$item['id_node'].'|'.$item['id_agente_modulo']] = $item['nombre'];
|
||||||
|
}
|
||||||
|
|
||||||
return $carry;
|
return $carry;
|
||||||
},
|
},
|
||||||
[]
|
[]
|
||||||
|
@ -683,10 +683,10 @@ function update_link(row_index, id_link) {
|
|||||||
temp_link["text_end"] = data["text_end"];
|
temp_link["text_end"] = data["text_end"];
|
||||||
|
|
||||||
$.each(graph.nodes, function(k, node) {
|
$.each(graph.nodes, function(k, node) {
|
||||||
if (node["id_agent"] == data["id_db_target"]) {
|
if (node["id_db"] == data["id_db_target"]) {
|
||||||
temp_link["target"] = graph.nodes[k];
|
temp_link["target"] = graph.nodes[k];
|
||||||
}
|
}
|
||||||
if (node["id_agent"] == data["id_db_source"]) {
|
if (node["id_db"] == data["id_db_source"]) {
|
||||||
temp_link["source"] = graph.nodes[k];
|
temp_link["source"] = graph.nodes[k];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -703,9 +703,21 @@ function update_link(row_index, id_link) {
|
|||||||
.append("g")
|
.append("g")
|
||||||
.attr("id", "layer_graph_nodes_" + networkmap_id);
|
.attr("id", "layer_graph_nodes_" + networkmap_id);
|
||||||
|
|
||||||
|
var graph_links_aux = graph.links.filter(function(d, i) {
|
||||||
|
if (typeof d["source"] === "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof d["target"] === "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return d;
|
||||||
|
});
|
||||||
|
|
||||||
force
|
force
|
||||||
.nodes(graph.nodes)
|
.nodes(graph.nodes)
|
||||||
.links(graph.links)
|
.links(graph_links_aux)
|
||||||
.start();
|
.start();
|
||||||
|
|
||||||
window.node = layer_graph_nodes.selectAll(".node");
|
window.node = layer_graph_nodes.selectAll(".node");
|
||||||
@ -2353,9 +2365,21 @@ function refresh_holding_area() {
|
|||||||
.append("g")
|
.append("g")
|
||||||
.attr("id", "layer_graph_nodes_" + networkmap_id);
|
.attr("id", "layer_graph_nodes_" + networkmap_id);
|
||||||
|
|
||||||
|
var graph_links_aux = graph.links.filter(function(d, i) {
|
||||||
|
if (typeof d["source"] === "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof d["target"] === "undefined") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return d;
|
||||||
|
});
|
||||||
|
|
||||||
force
|
force
|
||||||
.nodes(graph.nodes)
|
.nodes(graph.nodes)
|
||||||
.links(graph.links)
|
.links(graph_links_aux)
|
||||||
.start();
|
.start();
|
||||||
|
|
||||||
window.node = layer_graph_nodes.selectAll(".node");
|
window.node = layer_graph_nodes.selectAll(".node");
|
||||||
|
@ -211,7 +211,7 @@ function fmAgentChange(uniqId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
function fmModuleChange(uniqId) {
|
function fmModuleChange(uniqId, isMeta) {
|
||||||
var idModuleGroup = $("#filtered-module-module-group-" + uniqId).val();
|
var idModuleGroup = $("#filtered-module-module-group-" + uniqId).val();
|
||||||
var idAgents = $("#filtered-module-agents-" + uniqId).val();
|
var idAgents = $("#filtered-module-agents-" + uniqId).val();
|
||||||
var showCommonModules = $(
|
var showCommonModules = $(
|
||||||
@ -230,14 +230,20 @@ function fmModuleChange(uniqId) {
|
|||||||
$("#filtered-module-modules-" + uniqId).html("");
|
$("#filtered-module-modules-" + uniqId).html("");
|
||||||
if (data) {
|
if (data) {
|
||||||
jQuery.each(data, function(id, value) {
|
jQuery.each(data, function(id, value) {
|
||||||
var option = $("<option></option>")
|
var option = $("<option></option>");
|
||||||
.attr(
|
if (isMeta === true) {
|
||||||
"value",
|
option
|
||||||
value["id_node"]
|
.attr(
|
||||||
? value["id_node"] + "|" + value["id_agente_modulo"]
|
"value",
|
||||||
: value["id_agente_modulo"]
|
value["id_node"]
|
||||||
)
|
? value["id_node"] + "|" + value["id_agente_modulo"]
|
||||||
.html(value["nombre"]);
|
: value["id_agente_modulo"]
|
||||||
|
)
|
||||||
|
.html(value["nombre"]);
|
||||||
|
} else {
|
||||||
|
option.attr("value", value).html(value);
|
||||||
|
}
|
||||||
|
|
||||||
$("#filtered-module-modules-" + uniqId).append(option);
|
$("#filtered-module-modules-" + uniqId).append(option);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,7 @@ function initialiceLayout(data) {
|
|||||||
dashboardId: data.dashboardId,
|
dashboardId: data.dashboardId,
|
||||||
widgetId: widgetId
|
widgetId: widgetId
|
||||||
},
|
},
|
||||||
width: widgetId == 14 || widgetId == 2 ? 750 : 450,
|
width: widgetId == 14 || widgetId == 2 || widgetId == 23 ? 750 : 450,
|
||||||
maxHeight: 610,
|
maxHeight: 610,
|
||||||
minHeight: 400
|
minHeight: 400
|
||||||
},
|
},
|
||||||
|
@ -35,7 +35,6 @@ use PandoraFMS\Module;
|
|||||||
*/
|
*/
|
||||||
class AgentModuleWidget extends Widget
|
class AgentModuleWidget extends Widget
|
||||||
{
|
{
|
||||||
const MODULE_SEPARATOR = '|-|-|-|';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name widget.
|
* Name widget.
|
||||||
@ -309,16 +308,12 @@ class AgentModuleWidget extends Widget
|
|||||||
|
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
$values['mModules'] = implode(
|
$values['mModules'] = implode(
|
||||||
self::MODULE_SEPARATOR,
|
SEPARATOR_META_MODULE,
|
||||||
array_reduce(
|
array_reduce(
|
||||||
$values['mModules'],
|
$values['mModules'],
|
||||||
function ($carry, $item) {
|
function ($carry, $item) {
|
||||||
$d = explode('|', $item);
|
$d = explode('|', $item);
|
||||||
if (isset($d[1]) === true) {
|
$carry[] = (isset($d[1]) === true) ? $d[1] : $item;
|
||||||
$carry[] = \io_safe_output($d[1]);
|
|
||||||
} else {
|
|
||||||
$carry[] = \io_safe_output($item);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $carry;
|
return $carry;
|
||||||
},
|
},
|
||||||
@ -639,7 +634,7 @@ class AgentModuleWidget extends Widget
|
|||||||
$target_modules = $this->values['mModules'];
|
$target_modules = $this->values['mModules'];
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
$target_modules = explode(
|
$target_modules = explode(
|
||||||
self::MODULE_SEPARATOR,
|
SEPARATOR_META_MODULE,
|
||||||
$this->values['mModules']
|
$this->values['mModules']
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -648,8 +643,17 @@ class AgentModuleWidget extends Widget
|
|||||||
if (is_array($target_modules) === true
|
if (is_array($target_modules) === true
|
||||||
|| is_numeric($target_modules) === true
|
|| is_numeric($target_modules) === true
|
||||||
) {
|
) {
|
||||||
|
$target_modules = array_reduce(
|
||||||
|
$target_modules,
|
||||||
|
function ($carry, $item) {
|
||||||
|
$carry[] = io_safe_output($item);
|
||||||
|
|
||||||
|
return $carry;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
$all_modules = Module::search(
|
$all_modules = Module::search(
|
||||||
['id_agente_modulo' => $target_modules]
|
['nombre' => $target_modules]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// From previous definitions.
|
// From previous definitions.
|
||||||
@ -660,29 +664,28 @@ class AgentModuleWidget extends Widget
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($all_modules !== null) {
|
if ($all_modules !== null) {
|
||||||
$reduceAllModules = array_reduce(
|
if (is_metaconsole() === true
|
||||||
$all_modules,
|
&& $this->values['mShowCommonModules'] === '1'
|
||||||
function ($carry, $item) {
|
) {
|
||||||
if ($item === null) {
|
$reduceAllModules = [];
|
||||||
|
} else {
|
||||||
|
$reduceAllModules = array_reduce(
|
||||||
|
$all_modules,
|
||||||
|
function ($carry, $item) {
|
||||||
|
if ($item === null) {
|
||||||
|
return $carry;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_object($item) === true) {
|
||||||
|
$carry[$item->name()] = null;
|
||||||
|
} else {
|
||||||
|
$carry[io_safe_output($item)] = null;
|
||||||
|
}
|
||||||
|
|
||||||
return $carry;
|
return $carry;
|
||||||
}
|
}
|
||||||
|
);
|
||||||
if (is_object($item) === true) {
|
}
|
||||||
$carry[$item->name()] = null;
|
|
||||||
} else {
|
|
||||||
if ((is_metaconsole() === true
|
|
||||||
&& $this->values['mShowCommonModules'] !== '1')
|
|
||||||
|| is_metaconsole() === false
|
|
||||||
) {
|
|
||||||
$carry[$item] = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $carry;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$reduceAllModules = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$visualData = [];
|
$visualData = [];
|
||||||
@ -709,14 +712,26 @@ class AgentModuleWidget extends Widget
|
|||||||
$visualData[$agent_id]['agent_status'] = $agent->lastStatus();
|
$visualData[$agent_id]['agent_status'] = $agent->lastStatus();
|
||||||
$visualData[$agent_id]['agent_name'] = $agent->name();
|
$visualData[$agent_id]['agent_name'] = $agent->name();
|
||||||
$visualData[$agent_id]['agent_alias'] = $agent->alias();
|
$visualData[$agent_id]['agent_alias'] = $agent->alias();
|
||||||
|
$visualData[$agent_id]['modules'] = [];
|
||||||
|
|
||||||
if (is_metaconsole() === true
|
if (is_metaconsole() === true
|
||||||
&& $this->values['mShowCommonModules'] === '1'
|
&& $this->values['mShowCommonModules'] === '1'
|
||||||
) {
|
) {
|
||||||
// MC should connect to nodes and retrieve information
|
// MC should connect to nodes and retrieve information
|
||||||
// from targets.
|
// from targets.
|
||||||
|
$tmpModules = array_reduce(
|
||||||
|
$target_modules,
|
||||||
|
function ($carry, $item) {
|
||||||
|
// In this case, the modules come with '» ' chain.
|
||||||
|
$tmpCarry = explode('» ', $item);
|
||||||
|
$carry[trim($tmpCarry[1])] = null;
|
||||||
|
|
||||||
|
return $carry;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
$modules = $agent->searchModules(
|
$modules = $agent->searchModules(
|
||||||
['id_agente_modulo' => $target_modules]
|
['nombre' => array_keys($tmpModules)]
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($modules as $module) {
|
foreach ($modules as $module) {
|
||||||
|
@ -1026,12 +1026,12 @@ if (is_ajax() === true) {
|
|||||||
// Source_value is id_agente.
|
// Source_value is id_agente.
|
||||||
$source_text = '';
|
$source_text = '';
|
||||||
$source_agent = $interface_source;
|
$source_agent = $interface_source;
|
||||||
$source_type = NODE_AGENT;
|
$source_type = ($interface_source == 0) ? NODE_PANDORA : NODE_AGENT;
|
||||||
$source_link_value = $source_agent;
|
$source_link_value = $source_agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search node id in map.
|
// Search node id in map.
|
||||||
$child_id = db_get_value_filter(
|
$parent_id = db_get_value_filter(
|
||||||
'id',
|
'id',
|
||||||
'titem',
|
'titem',
|
||||||
[
|
[
|
||||||
@ -1073,7 +1073,7 @@ if (is_ajax() === true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Search node id in map.
|
// Search node id in map.
|
||||||
$parent_id = db_get_value_filter(
|
$child_id = db_get_value_filter(
|
||||||
'id',
|
'id',
|
||||||
'titem',
|
'titem',
|
||||||
[
|
[
|
||||||
@ -1089,10 +1089,10 @@ if (is_ajax() === true) {
|
|||||||
$link['id_item'] = 0;
|
$link['id_item'] = 0;
|
||||||
$link['deleted'] = 0;
|
$link['deleted'] = 0;
|
||||||
$link['id_map'] = $networkmap_id;
|
$link['id_map'] = $networkmap_id;
|
||||||
$link['parent_type'] = $target_type;
|
$link['parent_type'] = $source_type;
|
||||||
$link['id_parent_source_data'] = $target_link_value;
|
$link['id_parent_source_data'] = $source_link_value;
|
||||||
$link['child_type'] = $source_type;
|
$link['child_type'] = $target_type;
|
||||||
$link['id_child_source_data'] = $source_link_value;
|
$link['id_child_source_data'] = $target_link_value;
|
||||||
|
|
||||||
$insert_result = db_process_sql_insert('trel_item', $link);
|
$insert_result = db_process_sql_insert('trel_item', $link);
|
||||||
|
|
||||||
@ -1123,8 +1123,8 @@ if (is_ajax() === true) {
|
|||||||
$return['text_start'] = $source_text;
|
$return['text_start'] = $source_text;
|
||||||
$return['text_end'] = $target_text;
|
$return['text_end'] = $target_text;
|
||||||
$return['id_db_link'] = $insert_result;
|
$return['id_db_link'] = $insert_result;
|
||||||
$return['id_db_source'] = $source_agent;
|
$return['id_db_source'] = $parent_id;
|
||||||
$return['id_db_target'] = $target_agent;
|
$return['id_db_target'] = $child_id;
|
||||||
$return['type_source'] = $source_type;
|
$return['type_source'] = $source_type;
|
||||||
$return['type_target'] = $target_type;
|
$return['type_target'] = $target_type;
|
||||||
} else {
|
} else {
|
||||||
|
@ -454,20 +454,26 @@ if ($view_graph) {
|
|||||||
data['threshold'] = 1;
|
data['threshold'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
(function (stacked) {
|
||||||
type: "POST",
|
$.ajax({
|
||||||
url: "ajax.php",
|
type: "POST",
|
||||||
dataType: "html",
|
url: "ajax.php",
|
||||||
data: data,
|
dataType: "html",
|
||||||
success: function (data) {
|
data: data,
|
||||||
document.getElementById("div-container").innerHTML = "";
|
success: function (data) {
|
||||||
$("#spinner_loading").hide();
|
if (stacked === "<?php echo CUSTOM_GRAPH_VBARS; ?>") {
|
||||||
$("#div-container").append(data);
|
document.getElementById("div-container").classList.add('w100p', 'height_600px');
|
||||||
},
|
}
|
||||||
error: function (data) {
|
|
||||||
console.error("Fatal error")
|
document.getElementById("div-container").innerHTML = "";
|
||||||
}
|
$("#spinner_loading").hide();
|
||||||
});
|
$("#div-container").append(data);
|
||||||
|
},
|
||||||
|
error: function (data) {
|
||||||
|
console.error("Fatal error")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(data['stacked']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user