mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Fixed visual console
This commit is contained in:
parent
b9f87597fb
commit
4ebe075ace
@ -231,7 +231,7 @@ function readFields() {
|
|||||||
values['module'] = $("select[name=module]").val();
|
values['module'] = $("select[name=module]").val();
|
||||||
values['process_simple_value'] = $("select[name=process_value]").val();
|
values['process_simple_value'] = $("select[name=process_value]").val();
|
||||||
values['background'] = $("#background_image").val();
|
values['background'] = $("#background_image").val();
|
||||||
values['period'] = $("select[name=period]").val();
|
values['period'] = $("#hidden-period").val();
|
||||||
values['width'] = $("input[name=width]").val();
|
values['width'] = $("input[name=width]").val();
|
||||||
values['height'] = $("input[name=height]").val();
|
values['height'] = $("input[name=height]").val();
|
||||||
values['parent'] = $("select[name=parent]").val();
|
values['parent'] = $("select[name=parent]").val();
|
||||||
@ -841,6 +841,8 @@ function getModuleGraph(id_data) {
|
|||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
async: false,
|
||||||
|
timeout: 1000,
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
id_agente_modulo = data['id_agente_modulo'];
|
id_agente_modulo = data['id_agente_modulo'];
|
||||||
@ -876,6 +878,8 @@ function getModuleGraph(id_data) {
|
|||||||
url: url_ajax,
|
url: url_ajax,
|
||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
async: false,
|
||||||
|
timeout: 1000,
|
||||||
dataType: 'text', //The ajax return the data as text.
|
dataType: 'text', //The ajax return the data as text.
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
@ -906,6 +910,8 @@ function getModuleValue(id_data, process_simple_value, period) {
|
|||||||
url: url_ajax,
|
url: url_ajax,
|
||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
async: false,
|
||||||
|
timeout: 1000,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
@ -940,6 +946,8 @@ function getPercentileBar(id_data, values) {
|
|||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
async: false,
|
||||||
|
timeout: 1000,
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
module_value = data['value'];
|
module_value = data['value'];
|
||||||
@ -965,6 +973,8 @@ function getPercentileBar(id_data, values) {
|
|||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
async: false,
|
||||||
|
timeout: 1000,
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
font = data['font'];
|
font = data['font'];
|
||||||
@ -1015,6 +1025,8 @@ function getPercentileBubble(id_data, values) {
|
|||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
async: false,
|
||||||
|
timeout: 1000,
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
module_value = data['value'];
|
module_value = data['value'];
|
||||||
@ -1037,6 +1049,8 @@ function getPercentileBubble(id_data, values) {
|
|||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
async: false,
|
||||||
|
timeout: 1000,
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
font = data['font'];
|
font = data['font'];
|
||||||
@ -1084,6 +1098,8 @@ function getImageElement(id_data) {
|
|||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
timeout: 1000,
|
||||||
|
async: false,
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
img = data['image'];
|
img = data['image'];
|
||||||
@ -1179,6 +1195,8 @@ function createItem(type, values, id_data) {
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: url_ajax,
|
url: url_ajax,
|
||||||
data: parameter,
|
data: parameter,
|
||||||
|
timeout: 1000,
|
||||||
|
async: false,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
img_src = data;
|
img_src = data;
|
||||||
}
|
}
|
||||||
@ -1276,6 +1294,8 @@ function createItem(type, values, id_data) {
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: url_ajax,
|
url: url_ajax,
|
||||||
data: parameter,
|
data: parameter,
|
||||||
|
timeout: 1000,
|
||||||
|
async:false,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
img_src = data;
|
img_src = data;
|
||||||
}
|
}
|
||||||
@ -1425,6 +1445,8 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
|||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: url_ajax,
|
url: url_ajax,
|
||||||
|
async: false,
|
||||||
|
timeout: 10000,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$("#image_" + idElement).attr('src', data);
|
$("#image_" + idElement).attr('src', data);
|
||||||
}
|
}
|
||||||
@ -1436,8 +1458,8 @@ function updateDB_visual(type, idElement , values, event, top, left) {
|
|||||||
case 'icon':
|
case 'icon':
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
|
|
||||||
if (type == 'module_graph')
|
/*if (type == 'module_graph')
|
||||||
$("#image_" + idElement).attr("src", getModuleGraph(idElement));
|
$("#image_" + idElement).attr("src", getModuleGraph(idElement));*/
|
||||||
|
|
||||||
if ((typeof(values['mov_left']) != 'undefined') &&
|
if ((typeof(values['mov_left']) != 'undefined') &&
|
||||||
(typeof(values['mov_top']) != 'undefined')) {
|
(typeof(values['mov_top']) != 'undefined')) {
|
||||||
@ -1582,6 +1604,8 @@ function updateDB(type, idElement , values, event) {
|
|||||||
data: parameter,
|
data: parameter,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
dataType: 'text',
|
dataType: 'text',
|
||||||
|
async: false,
|
||||||
|
timeout: 1000,
|
||||||
success: function (data)
|
success: function (data)
|
||||||
{
|
{
|
||||||
updateDB_visual(type, idElement , values, event, top, left);
|
updateDB_visual(type, idElement , values, event, top, left);
|
||||||
|
@ -22,7 +22,7 @@ if ($get_image_path) {
|
|||||||
$img_src = get_parameter("img_src");
|
$img_src = get_parameter("img_src");
|
||||||
$only_src = get_parameter("only_src", 0);
|
$only_src = get_parameter("only_src", 0);
|
||||||
|
|
||||||
return html_print_image($img_src, false, '', $only_src);
|
echo html_print_image($img_src, false, '', $only_src);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -559,8 +559,8 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
$elementFields['width_module_graph'] = $elementFields['width'];
|
$elementFields['width_module_graph'] = (int)$elementFields['width'];
|
||||||
$elementFields['height_module_graph'] = $elementFields['height'];
|
$elementFields['height_module_graph'] = (int)$elementFields['height'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -596,7 +596,7 @@ switch ($action) {
|
|||||||
|
|
||||||
case 'insert':
|
case 'insert':
|
||||||
$values = array();
|
$values = array();
|
||||||
$values['id_layout'] = $id_visual_console;
|
$values['id_layout'] = (int)$id_visual_console;
|
||||||
$values['label'] = $label;
|
$values['label'] = $label;
|
||||||
$values['pos_x'] = $left;
|
$values['pos_x'] = $left;
|
||||||
$values['pos_y'] = $top;
|
$values['pos_y'] = $top;
|
||||||
@ -617,20 +617,20 @@ switch ($action) {
|
|||||||
else
|
else
|
||||||
$values['id_agent'] = 0;
|
$values['id_agent'] = 0;
|
||||||
}
|
}
|
||||||
$values['id_agente_modulo'] = $id_module;
|
$values['id_agente_modulo'] = (int)$id_module;
|
||||||
$values['id_layout_linked'] = $map_linked;
|
$values['id_layout_linked'] = (int)$map_linked;
|
||||||
$values['label_color'] = $label_color;
|
$values['label_color'] = $label_color;
|
||||||
$values['parent_item'] = $parent;
|
$values['parent_item'] = (int)$parent;
|
||||||
$values['no_link_color'] = 1;
|
$values['no_link_color'] = 1;
|
||||||
$values['enable_link'] = $enable_link;
|
$values['enable_link'] = (int)$enable_link;
|
||||||
|
|
||||||
$values['id_custom_graph'] = $id_custom_graph;
|
$values['id_custom_graph'] = $id_custom_graph;
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'module_graph':
|
case 'module_graph':
|
||||||
$values['type'] = MODULE_GRAPH;
|
$values['type'] = MODULE_GRAPH;
|
||||||
$values['height'] = $height_module_graph;
|
$values['height'] = (int)$height_module_graph;
|
||||||
$values['width'] = $width_module_graph;
|
$values['width'] = (int)$width_module_graph;
|
||||||
$values['period'] = $period;
|
$values['period'] = $period;
|
||||||
break;
|
break;
|
||||||
case 'percentile_item':
|
case 'percentile_item':
|
||||||
|
@ -540,7 +540,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||||||
|
|
||||||
// Get module data
|
// Get module data
|
||||||
$data = db_get_all_rows_filter ('tagente_datos',
|
$data = db_get_all_rows_filter ('tagente_datos',
|
||||||
array ('id_agente_modulo' => $agent_module_id,
|
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||||
"utimestamp > $datelimit",
|
"utimestamp > $datelimit",
|
||||||
"utimestamp < $date",
|
"utimestamp < $date",
|
||||||
'order' => 'utimestamp ASC'),
|
'order' => 'utimestamp ASC'),
|
||||||
|
@ -236,7 +236,7 @@ function visual_map_print_item($layoutData) {
|
|||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img);
|
//$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img);
|
||||||
|
|
||||||
echo '<div id="' . $id . '" class="item module_graph" style="z-index: 1; color: ' . $color . '; text-align: center; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
|
echo '<div id="' . $id . '" class="item module_graph" style="z-index: 1; color: ' . $color . '; text-align: center; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
|
||||||
echo io_safe_output($text) . '<br />';
|
echo io_safe_output($text) . '<br />';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user