#8049 Fixed get visual console with selected node

This commit is contained in:
Daniel Maya 2021-10-06 16:49:21 +02:00
parent 3f86528c80
commit eab82aa6d1
1 changed files with 13 additions and 0 deletions

View File

@ -304,8 +304,21 @@ class MapsMadeByUser extends Widget
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
$node_id = $this->nodeId;
if (\is_metaconsole() === true && $node_id > 0) {
if (\metaconsole_connect(null, $node_id) !== NOERR) {
echo json_encode(
['error' => __('Failed to connect to node %d', $node_id) ]
);
}
}
$fields = $this->getVisualConsoles();
if (\is_metaconsole() === true && $node_id > 0) {
\metaconsole_restore_db();
}
// Visual console.
$inputs[] = [
'label' => __('Visual console'),