fixed errors VC

This commit is contained in:
Daniel Barbero Martin 2020-01-28 17:52:40 +01:00
parent 3f5e418d98
commit 5906273271
8 changed files with 52 additions and 22 deletions

View File

@ -2194,20 +2194,17 @@ class Item extends CachedModel
&& is_array($node_visual_maps) === true
) {
foreach ($node_visual_maps as $node_visual_map) {
// Add nodeID.
$node_visual_map['nodeId'] = (int) $server['id'];
// ID.
$node_visual_map['id'] = $node_visual_map['id'];
$node_visual_map['id'] .= '|';
$node_visual_map['id'] .= $server['id'];
$id = $node_visual_map['id'];
$id .= '|';
$id .= $server['id'];
// Name = vc_name - (node).
$node_visual_map['name'] = $node_visual_map['name'];
$node_visual_map['name'] .= ' - (';
$node_visual_map['name'] .= $server['server_name'].')';
$name = $node_visual_map['name'];
$name .= ' - (';
$name .= $server['server_name'].')';
$result[] = $node_visual_map;
$result[$id] = $name;
}
}

View File

@ -399,6 +399,10 @@ final class Clock extends Item
$values['height'] = 100;
}
if (isset($values['isLinkEnabled']) === false) {
$values['isLinkEnabled'] = false;
}
return $values;
}

View File

@ -204,4 +204,26 @@ final class Icon extends Item
}
/**
* Default values.
*
* @param array $values Array values.
*
* @return array Array with default values.
*
* @overrides Item->getDefaultGeneralValues.
*/
public function getDefaultGeneralValues(array $values): array
{
// Retrieve global - common inputs.
$values = parent::getDefaultGeneralValues($values);
if (isset($values['isLinkEnabled']) === false) {
$values['isLinkEnabled'] = false;
}
return $values;
}
}

View File

@ -87,6 +87,10 @@ final class Label extends Item
$values['height'] = 10;
}
if (isset($values['isLinkEnabled']) === false) {
$values['isLinkEnabled'] = false;
}
return $values;
}

View File

@ -507,7 +507,6 @@ class View extends \HTML
}
if (isset($itemId) === false || $itemId === 0) {
// TODO: ACL.
// CreateVC.
$class = VisualConsole::getItemClass((int) $data['type']);
try {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -516,15 +516,19 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
e.stopPropagation();
} else {
// Add loading click item.
const divParent = document.createElement("div");
divParent.className = "div-visual-console-spinner";
const divSpinner = document.createElement("div");
divSpinner.className = "visual-console-spinner";
divParent.appendChild(divSpinner);
const containerVC = document.getElementById("visual-console-container");
if (containerVC != null) {
containerVC.classList.add("is-updating");
containerVC.appendChild(divParent);
if (this.itemProps.isLinkEnabled) {
const divParent = document.createElement("div");
divParent.className = "div-visual-console-spinner";
const divSpinner = document.createElement("div");
divSpinner.className = "visual-console-spinner";
divParent.appendChild(divSpinner);
const containerVC = document.getElementById(
"visual-console-container"
);
if (containerVC != null) {
containerVC.classList.add("is-updating");
containerVC.appendChild(divParent);
}
}
}