Fixed some errors in visual console

This commit is contained in:
Daniel Maya 2019-09-05 11:58:15 +02:00
parent c0a0364164
commit 86cf025317
4 changed files with 34 additions and 20 deletions

View File

@ -2471,7 +2471,7 @@ function html_print_image(
if (!is_readable($working_dir.'/enterprise/meta'.$src)) { if (!is_readable($working_dir.'/enterprise/meta'.$src)) {
if ($isExternalLink) { if ($isExternalLink) {
$src = ui_get_full_url($src); $src = ui_get_full_url($src, false, false, false);
} else { } else {
$src = ui_get_full_url('../..'.$src); $src = ui_get_full_url('../..'.$src);
} }

View File

@ -3278,12 +3278,7 @@ function visual_map_get_color_line_status($layoutData)
*/ */
function visual_map_get_image_status_element($layoutData, $status=false) function visual_map_get_image_status_element($layoutData, $status=false)
{ {
$metaconsole_hack = ''; $img = 'images/console/icons/'.$layoutData['image'];
if (is_metaconsole()) {
$metaconsole_hack = '../../';
}
$img = $metaconsole_hack.'images/console/icons/'.$layoutData['image'];
if ($layoutData['type'] == 5) { if ($layoutData['type'] == 5) {
// ICON ELEMENT // ICON ELEMENT

View File

@ -40,6 +40,9 @@ ob_start('ui_process_page_head');
// Enterprise main // Enterprise main
enterprise_include('index.php'); enterprise_include('index.php');
$url_css = ui_get_full_url('include/styles/visual_maps.css', false, false, false);
echo '<link rel="stylesheet" href="'.$url_css.'" type="text/css" />';
require_once 'include/functions_visual_map.php'; require_once 'include/functions_visual_map.php';
$hash = get_parameter('hash'); $hash = get_parameter('hash');
@ -96,31 +99,40 @@ if ($layout) {
echo '<div id="vc-container"></div>'; echo '<div id="vc-container"></div>';
} }
// Floating menu - Start // Floating menu - Start.
echo '<div id="vc-controls" style="z-index:300;">'; echo '<div id="vc-controls" style="z-index:300;">';
echo '<div id="menu_tab">'; echo '<div id="menu_tab">';
echo '<ul class="mn">'; echo '<ul class="mn white-box-content box-shadow flex-row">';
// QR code // QR code.
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<a href="javascript: show_dialog_qrcode();">'; echo '<a href="javascript: show_dialog_qrcode();">';
echo '<img class="vc-qr" src="../../images/qrcode_icon_2.jpg"/>'; echo '<img class="vc-qr" src="../../images/qrcode_icon_2.jpg"/>';
echo '</a>'; echo '</a>';
echo '</li>'; echo '</li>';
// Countdown // Countdown.
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<div class="vc-refr">'; echo '<div class="vc-refr">';
echo '<div class="vc-countdown"></div>';
echo '<div id="vc-refr-form">'; echo '<div id="vc-refr-form">';
echo __('Refresh').':'; echo __('Refresh').':';
echo html_print_select(get_refresh_time_array(), 'refr', $refr, '', '', 0, true, false, false); echo html_print_select(
get_refresh_time_array(),
'vc-refr',
$refr,
'',
'',
0,
true,
false,
false
);
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</li>'; echo '</li>';
// Console name // Console name.
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<div class="vc-title">'.$layout_name.'</div>'; echo '<div class="vc-title">'.$layout_name.'</div>';
echo '</li>'; echo '</li>';
@ -129,15 +141,15 @@ echo '</ul>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
// Floating menu - End
// QR code dialog // QR code dialog.
echo '<div style="display: none;" id="qrcode_container" title="'.__('QR code of the page').'">'; echo '<div style="display: none;" id="qrcode_container" title="'.__('QR code of the page').'">';
echo '<div id="qrcode_container_image"></div>'; echo '<div id="qrcode_container_image"></div>';
echo '</div>'; echo '</div>';
ui_require_jquery_file('countdown'); ui_require_jquery_file('countdown', 'include/javascript/', true);
ui_require_javascript_file('wz_jsgraphics'); ui_require_javascript_file('wz_jsgraphics', 'include/javascript/', true);
ui_require_javascript_file('pandora_visual_console'); ui_require_javascript_file('pandora_visual_console', 'include/javascript/', true);
$ignored_params['refr'] = ''; $ignored_params['refr'] = '';
?> ?>

View File

@ -42,6 +42,9 @@ ob_start('ui_process_page_head');
// Enterprise main. // Enterprise main.
enterprise_include('index.php'); enterprise_include('index.php');
$url_css = ui_get_full_url('include/styles/visual_maps.css', false, false, false);
echo '<link rel="stylesheet" href="'.$url_css.'" type="text/css" />';
require_once 'include/functions_visual_map.php'; require_once 'include/functions_visual_map.php';
$hash = (string) get_parameter('hash'); $hash = (string) get_parameter('hash');
@ -134,7 +137,7 @@ if (!users_can_manage_group_all('AR')) {
} }
$ignored_params['refr'] = ''; $ignored_params['refr'] = '';
ui_require_javascript_file('pandora_visual_console'); ui_require_javascript_file('pandora_visual_console', 'include/javascript/', true);
include_javascript_d3(); include_javascript_d3();
visual_map_load_client_resources(); visual_map_load_client_resources();
@ -157,6 +160,10 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
var props = <?php echo (string) $visualConsole; ?>; var props = <?php echo (string) $visualConsole; ?>;
var items = <?php echo '['.implode($visualConsoleItems, ',').']'; ?>; var items = <?php echo '['.implode($visualConsoleItems, ',').']'; ?>;
var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>"; var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>";
var controls = document.getElementById('vc-controls');
autoHideElement(controls, 1000);
var handleUpdate = function (prevProps, newProps) { var handleUpdate = function (prevProps, newProps) {
if (!newProps) return; if (!newProps) return;