$class, 'mode' => 'onlyIcon', 'data-title' => $label, 'data-use_title_for_force_title' => '1', ], false, true ); } ui_require_css_file('visual_maps'); ui_require_css_file('register'); // Query parameters. $visualConsoleId = (int) get_parameter('id'); // To hide the menus. $pure = (bool) get_parameter('pure', $config['pure']); // Refresh interval in seconds. $refr = (int) get_parameter('refr', $config['vc_refr']); $width = (int) get_parameter('width', 0); $height = (int) get_parameter('height', 0); // Load Visual Console. use Models\VisualConsole\Container as VisualConsole; $visualConsole = null; try { $visualConsole = VisualConsole::fromDB(['id' => $visualConsoleId]); } catch (Throwable $e) { db_pandora_audit( AUDIT_LOG_ACL_VIOLATION, 'Trying to access visual console without Id' ); include 'general/noaccess.php'; exit; } $visualConsoleData = $visualConsole->toArray(); $groupId = $visualConsoleData['groupId']; $visualConsoleName = io_safe_input(strip_tags(io_safe_output($visualConsoleData['name']))); // ACL. $aclRead = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VR'); $aclWrite = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VW'); $aclManage = (bool) check_acl_restricted_all($config['id_user'], $groupId, 'VM'); // Maintenance Mode. $maintenanceMode = $visualConsoleData['maintenanceMode']; if ($aclRead === false && $aclWrite === false && $aclManage === false) { db_pandora_audit( AUDIT_LOG_ACL_VIOLATION, 'Trying to access visual console without group access' ); include 'general/noaccess.php'; exit; } // Render map. $options = []; $baseUrlList = 'index.php?sec=network&sec2=godmode/reporting/map_builder'; if (is_metaconsole() === true) { $baseUrlList = 'index.php?sec=screen&sec2=screens/screens&action=visualmap'; } $options['consoles_list']['text'] = ''.html_print_image( 'images/logs@svg.svg', true, [ 'title' => __('Visual consoles list'), 'class' => 'main_menu_icon invert_filter', ] ).''; if ($aclWrite === true || $aclManage === true) { $action = get_parameterBetweenListValues( (is_metaconsole() === true) ? 'action2' : 'action', [ 'new', 'save', 'edit', 'update', 'delete', ], 'edit' ); $baseUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action='.$action; if (is_metaconsole() === true) { $baseUrl = 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&action2='.$action; } $hash = md5($config['dbpass'].$visualConsoleId.$config['id_user']); $options['public_link']['text'] = ''.html_print_image( 'images/item-icon.svg', true, [ 'title' => __('Show link to public Visual Console'), 'class' => 'main_menu_icon invert_filter', ] ).''; $options['public_link']['active'] = false; $options['data']['text'] = ''.html_print_image( 'images/bars-graph.svg', true, [ 'title' => __('Main data'), 'class' => 'main_menu_icon invert_filter', ] ).''; $options['list_elements']['text'] = ''.html_print_image( 'images/edit_columns@svg.svg', true, [ 'title' => __('List elements'), 'class' => 'main_menu_icon invert_filter', ] ).''; if (enterprise_installed() === true) { $options['wizard_services']['text'] = ''.html_print_image( 'images/wand_services.png', true, [ 'title' => __('Services wizard'), 'class' => 'main_menu_icon invert_filter', ] ).''; } $options['wizard']['text'] = ''.html_print_image( 'images/wizard@svg.svg', true, [ 'title' => __('Wizard'), 'class' => 'main_menu_icon invert_filter', ] ).''; } $options['view']['text'] = ''.html_print_image( 'images/enable.svg', true, [ 'title' => __('View'), 'class' => 'main_menu_icon invert_filter', ] ).''; $options['view']['active'] = true; if (is_metaconsole() === false) { // Set the hidden value for the javascript. html_print_input_hidden('metaconsole', 0); } else { // Set the hidden value for the javascript. html_print_input_hidden('metaconsole', 1); } if (!$config['pure']) { $options['pure']['text'] = ''.html_print_image( 'images/fullscreen@svg.svg', true, [ 'title' => __('Full screen mode'), 'class' => 'main_menu_icon invert_filter', ] ).''; // Header. ui_print_standard_header( $visualConsoleName, 'images/visual_console.png', false, 'visual_console_view', false, $options, [ [ 'link' => '', 'label' => __('Topology maps'), ], [ 'link' => '', 'label' => __('Visual console'), ], ], [ 'id_element' => $visualConsoleId, 'url' => 'operation/visual_console/render_view&id='.$visualConsoleId, 'label' => $visualConsoleName, 'section' => 'Visual_Console', ] ); } $edit_capable = (bool) ( check_acl($config['id_user'], 0, 'VM') || check_acl($config['id_user'], 0, 'VW') ); if ($pure === false) { if ($edit_capable === true) { echo '
'; echo ''; if ($aclWrite === true || $aclManage === true) { echo '
'; if (is_metaconsole() === false) { echo ''; } $disabled_edit_mode = false; if ($aclManage === true) { $value_maintenance_mode = true; if ($maintenanceMode === null) { $value_maintenance_mode = false; } else { if ($maintenanceMode['user'] !== $config['id_user']) { $disabled_edit_mode = true; } } echo '
'; echo html_print_label( __('Maintenance'), 'maintenance-mode', true ); echo html_print_checkbox_switch( 'maintenance-mode', 1, $value_maintenance_mode, true ); echo '
'; } echo '
'; echo html_print_label(__('Edit'), 'edit-mode', true); echo html_print_checkbox_switch('edit-mode', 1, false, true, $disabled_edit_mode); echo '
'; echo '
'; } echo '
'; } } $bg_color = ''; if ($config['style'] === 'pandora_black' && !is_metaconsole()) { $bg_color = 'style="background-color: #222"'; } echo '
'; echo '
'; echo '
'; if ($pure === true) { // Floating menu - Start. echo '
'; echo ''; echo '
'; // Floating menu - End. ?> 0 && $pure == 1) { $widthRatio = ($width / $visualConsoleData['width']); if ($visualConsoleData['width'] > $height) { ?>