Error fixes
This commit is contained in:
parent
c02f3bacf4
commit
65a425859e
|
@ -2751,14 +2751,19 @@ function showPreview(image) {
|
|||
|
||||
function showPreviewStaticGraph(staticGraph) {
|
||||
metaconsole = $("input[name='metaconsole']").val();
|
||||
var $spinner = $("<img />");
|
||||
$spinner.prop("src", "images/spinner.gif");
|
||||
|
||||
var url_ajax = "ajax.php";
|
||||
if (metaconsole != 0) {
|
||||
url_ajax = "../../ajax.php";
|
||||
$spinner.prop("src", "../../images/spinner.gif");
|
||||
}
|
||||
|
||||
$("#preview").empty();
|
||||
$("#preview").css('text-align', 'right');
|
||||
$("#preview")
|
||||
.empty()
|
||||
.css('text-align', 'right')
|
||||
.append($spinner);
|
||||
|
||||
if (staticGraph != '') {
|
||||
imgBase = "images/console/icons/" + staticGraph;
|
||||
|
@ -2772,28 +2777,38 @@ function showPreviewStaticGraph(staticGraph) {
|
|||
type: 'POST',
|
||||
url: url_ajax,
|
||||
data: parameter,
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
timeout: 10000,
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
$("#preview").empty();console.log(errorThrown);
|
||||
},
|
||||
success: function (data) {
|
||||
$("#preview").empty();
|
||||
|
||||
jQuery.each(data, function(i, line) {
|
||||
$("#preview").append(line);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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";
|
||||
if (metaconsole != 0) {
|
||||
url_ajax = "../../ajax.php";
|
||||
$spinner.prop("src", "../../images/spinner.gif");
|
||||
}
|
||||
|
||||
$("#preview").empty();
|
||||
$("#preview").css('text-align', 'left');
|
||||
$("#preview")
|
||||
.empty()
|
||||
.css('text-align', 'left')
|
||||
.append($spinner);
|
||||
|
||||
if (icon != '') {
|
||||
imgBase = "images/console/icons/" + icon;
|
||||
|
@ -2806,10 +2821,14 @@ function showPreviewIcon(icon) {
|
|||
data: params.join ("&"),
|
||||
type: 'POST',
|
||||
url: url_ajax,
|
||||
async: false,
|
||||
timeout: 10000,
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
$("#preview").empty();
|
||||
},
|
||||
success: function (data) {
|
||||
$("#preview").append(data);
|
||||
$("#preview")
|
||||
.empty()
|
||||
.append(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -17,6 +17,23 @@ global $config;
|
|||
|
||||
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);
|
||||
|
||||
// WARNING: CHECK THE ENTIRE FUNCTIONALITY
|
||||
|
@ -111,7 +128,6 @@ $line_width = (int)get_parameter('line_width', 0);
|
|||
$line_color = get_parameter('line_color', '');
|
||||
|
||||
$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);
|
||||
|
||||
|
@ -902,19 +918,4 @@ if ($get_element_status) {
|
|||
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…
Reference in New Issue