Merge branch 'ent-10650-bugs-funcionales-en-consolas-visuales' into 'develop'

Ent 10650 bugs funcionales en consolas visuales

See merge request artica/pandorafms!5601
This commit is contained in:
Matias Didier 2023-03-24 09:11:26 +00:00
commit 5529c33f0c
2 changed files with 13 additions and 5 deletions

View File

@ -226,7 +226,7 @@ final class DonutGraph extends Item
'module_input' => true,
'module_name' => 'moduleId',
'module_none' => false,
'get_only_string_modules' => true,
'get_only_string_modules' => false,
],
];
@ -235,14 +235,13 @@ final class DonutGraph extends Item
'label' => __('Module'),
'arguments' => [
'type' => 'autocomplete_module',
'fields' => $fields,
'name' => 'moduleId',
'selected' => $values['moduleId'],
'return' => true,
'sort' => false,
'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'],
'get_only_string_modules' => true,
'get_only_string_modules' => false,
],
];

View File

@ -62,7 +62,13 @@ require_once 'include/functions_visual_map.php';
$hash = (string) get_parameter('hash');
$visualConsoleId = (int) get_parameter('id_layout');
$config['id_user'] = (string) get_parameter('id_user');
$userAccessMaintenance = null;
if (empty($config['id_user']) === true) {
$config['id_user'] = (string) get_parameter('id_user');
} else {
$userAccessMaintenance = $config['id_user'];
}
$refr = (int) get_parameter('refr', ($config['refr'] ?? null));
if (!isset($config['pure'])) {
@ -179,6 +185,7 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
<script type="text/javascript">
var container = document.getElementById("visual-console-container");
var user = "<?php echo $userAccessMaintenance; ?>";
var props = <?php echo (string) $visualConsole; ?>;
var items = <?php echo '['.implode(',', $visualConsoleItems).']'; ?>;
var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>";
@ -282,7 +289,9 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
);
if(props.maintenanceMode != null) {
visualConsoleManager.visualConsole.enableMaintenanceMode();
if(props.maintenanceMode.user !== user) {
visualConsoleManager.visualConsole.enableMaintenanceMode();
}
}
var controls = document.getElementById('vc-controls');