From 066568e1d4a85e846f02e650ba11c134a41428a6 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 16 Mar 2022 17:50:46 +0100 Subject: [PATCH] fixed CV in console mobile metaconsole #8676 --- .../mobile/operation/visualmap.php | 40 +++++-------------- .../mobile/operation/visualmaps.php | 18 ++++++++- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/pandora_console/mobile/operation/visualmap.php b/pandora_console/mobile/operation/visualmap.php index c08e16461d..1bb1c0ed57 100644 --- a/pandora_console/mobile/operation/visualmap.php +++ b/pandora_console/mobile/operation/visualmap.php @@ -141,11 +141,7 @@ class Visualmap if (empty($this->width) === true && empty($this->height) === true ) { - // Reload forcing user to send width and height. - $ui = Ui::getInstance(); - $ui->retrieveViewPort(); - $this->show_visualmap(); - return; + $this->show_fail_acl(); } // Padding. @@ -208,29 +204,7 @@ class Visualmap */ public function ajax(string $parameter2='') { - $system = System::getInstance(); - $this->checkVisualmapACL($this->visualmap['id_group']); - if ((bool) $this->validAcl === false) { - $this->show_fail_acl(); - } else { - switch ($parameter2) { - case 'render_map': - $map_id = $system->getRequest('map_id', '0'); - $width = $system->getRequest('width', '400'); - $height = $system->getRequest('height', '400'); - visual_map_print_visual_map( - $map_id, - false, - true, - $width, - $height - ); - exit; - - default: - exit; - } - } + return; } @@ -385,11 +359,15 @@ class Visualmap $output .= "$('.container-center').css('transform', 'rotate(90deg)');"; } - $output .= '$( window ).on( "orientationchange", function( event )'; - $output .= ' { window.location.href = "'; + $output .= '$( window ).on( "orientationchange", function( event ) {'; + $output .= ' $(".container-center").empty();'; + $output .= ' $.mobile.loading("show");'; + $output .= ' var dimensions = "&width="+$(window).height();'; + $output .= ' dimensions += "&height="+$(window).width();'; + $output .= ' window.location.href = "'; $output .= ui_get_full_url('/', false, false, false); $output .= 'mobile/index.php?page=visualmap&id='.$visualConsoleId; - $output .= '" });'; + $output .= '"+dimensions; });'; $output .= ''; diff --git a/pandora_console/mobile/operation/visualmaps.php b/pandora_console/mobile/operation/visualmaps.php index 575b5865d6..8ec70afb59 100644 --- a/pandora_console/mobile/operation/visualmaps.php +++ b/pandora_console/mobile/operation/visualmaps.php @@ -188,6 +188,20 @@ class Visualmaps $ui->showFooter(false); $ui->beginContent(); $this->listVisualmapsHtml(); + + $output = ''; + + $ui->contentAddHtml($output); + $ui->endContent(); $ui->showPage(); } @@ -214,8 +228,8 @@ class Visualmaps $table->id = 'list_visualmaps'; foreach ($visualmaps as $map) { $link = ''.io_safe_output($map['name']).''; + $link .= ' href="#" onclick="loadVisualConsole('; + $link .= $map['id'].')">'.io_safe_output($map['name']).''; $row = $link; $row .= ui_print_group_icon(