mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
Error fixes
This commit is contained in:
parent
c02f3bacf4
commit
65a425859e
@ -2751,14 +2751,19 @@ function showPreview(image) {
|
|||||||
|
|
||||||
function showPreviewStaticGraph(staticGraph) {
|
function showPreviewStaticGraph(staticGraph) {
|
||||||
metaconsole = $("input[name='metaconsole']").val();
|
metaconsole = $("input[name='metaconsole']").val();
|
||||||
|
var $spinner = $("<img />");
|
||||||
|
$spinner.prop("src", "images/spinner.gif");
|
||||||
|
|
||||||
var url_ajax = "ajax.php";
|
var url_ajax = "ajax.php";
|
||||||
if (metaconsole != 0) {
|
if (metaconsole != 0) {
|
||||||
url_ajax = "../../ajax.php";
|
url_ajax = "../../ajax.php";
|
||||||
|
$spinner.prop("src", "../../images/spinner.gif");
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#preview").empty();
|
$("#preview")
|
||||||
$("#preview").css('text-align', 'right');
|
.empty()
|
||||||
|
.css('text-align', 'right')
|
||||||
|
.append($spinner);
|
||||||
|
|
||||||
if (staticGraph != '') {
|
if (staticGraph != '') {
|
||||||
imgBase = "images/console/icons/" + staticGraph;
|
imgBase = "images/console/icons/" + staticGraph;
|
||||||
@ -2772,28 +2777,38 @@ function showPreviewStaticGraph(staticGraph) {
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: url_ajax,
|
url: url_ajax,
|
||||||
data: parameter,
|
data: parameter,
|
||||||
async: false,
|
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
|
error: function (xhr, textStatus, errorThrown) {
|
||||||
|
$("#preview").empty();console.log(errorThrown);
|
||||||
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
$("#preview").empty();
|
||||||
|
|
||||||
jQuery.each(data, function(i, line) {
|
jQuery.each(data, function(i, line) {
|
||||||
$("#preview").append(line);
|
$("#preview").append(line);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPreviewIcon(icon) {
|
function showPreviewIcon(icon) {
|
||||||
metaconsole = $("input[name='metaconsole']").val();
|
var metaconsole = $("input[name='metaconsole']").val();
|
||||||
|
var $spinner = $("<img />");
|
||||||
|
$spinner.prop("src", "images/spinner.gif");
|
||||||
|
|
||||||
var url_ajax = "ajax.php";
|
var url_ajax = "ajax.php";
|
||||||
if (metaconsole != 0) {
|
if (metaconsole != 0) {
|
||||||
url_ajax = "../../ajax.php";
|
url_ajax = "../../ajax.php";
|
||||||
|
$spinner.prop("src", "../../images/spinner.gif");
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#preview").empty();
|
$("#preview")
|
||||||
$("#preview").css('text-align', 'left');
|
.empty()
|
||||||
|
.css('text-align', 'left')
|
||||||
|
.append($spinner);
|
||||||
|
|
||||||
if (icon != '') {
|
if (icon != '') {
|
||||||
imgBase = "images/console/icons/" + icon;
|
imgBase = "images/console/icons/" + icon;
|
||||||
@ -2806,10 +2821,14 @@ function showPreviewIcon(icon) {
|
|||||||
data: params.join ("&"),
|
data: params.join ("&"),
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: url_ajax,
|
url: url_ajax,
|
||||||
async: false,
|
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
|
error: function (xhr, textStatus, errorThrown) {
|
||||||
|
$("#preview").empty();
|
||||||
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$("#preview").append(data);
|
$("#preview")
|
||||||
|
.empty()
|
||||||
|
.append(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,23 @@ global $config;
|
|||||||
|
|
||||||
check_login ();
|
check_login ();
|
||||||
|
|
||||||
|
$get_image_path_status = get_parameter('get_image_path_status', 0);
|
||||||
|
if ($get_image_path_status){
|
||||||
|
$img_src = get_parameter("img_src");
|
||||||
|
$only_src = get_parameter("only_src", 0);
|
||||||
|
|
||||||
|
$result = array();
|
||||||
|
|
||||||
|
$result['bad'] = html_print_image($img_src . '_bad.png', true, '', $only_src);
|
||||||
|
$result['ok'] = html_print_image($img_src . '_ok.png', true, '', $only_src);
|
||||||
|
$result['warning'] = html_print_image($img_src . '_warning.png', true, '', $only_src);
|
||||||
|
$result['ok'] = html_print_image($img_src . '_ok.png', true, '', $only_src);
|
||||||
|
$result['normal'] = html_print_image($img_src . '.png', true, '', $only_src);
|
||||||
|
|
||||||
|
echo json_encode($result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$id_visual_console = get_parameter('id_visual_console', null);
|
$id_visual_console = get_parameter('id_visual_console', null);
|
||||||
|
|
||||||
// WARNING: CHECK THE ENTIRE FUNCTIONALITY
|
// WARNING: CHECK THE ENTIRE FUNCTIONALITY
|
||||||
@ -111,7 +128,6 @@ $line_width = (int)get_parameter('line_width', 0);
|
|||||||
$line_color = get_parameter('line_color', '');
|
$line_color = get_parameter('line_color', '');
|
||||||
|
|
||||||
$get_element_status = get_parameter('get_element_status', 0);
|
$get_element_status = get_parameter('get_element_status', 0);
|
||||||
$get_image_path_status = get_parameter('get_image_path_status', 0);
|
|
||||||
|
|
||||||
$enable_link = get_parameter('enable_link', 1);
|
$enable_link = get_parameter('enable_link', 1);
|
||||||
|
|
||||||
@ -902,19 +918,4 @@ if ($get_element_status) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($get_image_path_status){
|
|
||||||
$img_src = get_parameter("img_src");
|
|
||||||
$only_src = get_parameter("only_src", 0);
|
|
||||||
|
|
||||||
$result = array();
|
|
||||||
|
|
||||||
$result['bad'] = html_print_image($img_src . '_bad.png', true, '', $only_src);
|
|
||||||
$result['ok'] = html_print_image($img_src . '_ok.png', true, '', $only_src);
|
|
||||||
$result['warning'] = html_print_image($img_src . '_warning.png', true, '', $only_src);
|
|
||||||
$result['ok'] = html_print_image($img_src . '_ok.png', true, '', $only_src);
|
|
||||||
$result['normal'] = html_print_image($img_src . '.png', true, '', $only_src);
|
|
||||||
|
|
||||||
echo json_encode($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user