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 && is_array($node_visual_maps) === true
) { ) {
foreach ($node_visual_maps as $node_visual_map) { foreach ($node_visual_maps as $node_visual_map) {
// Add nodeID.
$node_visual_map['nodeId'] = (int) $server['id'];
// ID. // ID.
$node_visual_map['id'] = $node_visual_map['id']; $id = $node_visual_map['id'];
$node_visual_map['id'] .= '|'; $id .= '|';
$node_visual_map['id'] .= $server['id']; $id .= $server['id'];
// Name = vc_name - (node). // Name = vc_name - (node).
$node_visual_map['name'] = $node_visual_map['name']; $name = $node_visual_map['name'];
$node_visual_map['name'] .= ' - ('; $name .= ' - (';
$node_visual_map['name'] .= $server['server_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; $values['height'] = 100;
} }
if (isset($values['isLinkEnabled']) === false) {
$values['isLinkEnabled'] = false;
}
return $values; 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; $values['height'] = 10;
} }
if (isset($values['isLinkEnabled']) === false) {
$values['isLinkEnabled'] = false;
}
return $values; return $values;
} }

View File

@ -507,7 +507,6 @@ class View extends \HTML
} }
if (isset($itemId) === false || $itemId === 0) { if (isset($itemId) === false || $itemId === 0) {
// TODO: ACL.
// CreateVC. // CreateVC.
$class = VisualConsole::getItemClass((int) $data['type']); $class = VisualConsole::getItemClass((int) $data['type']);
try { 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(); e.stopPropagation();
} else { } else {
// Add loading click item. // Add loading click item.
const divParent = document.createElement("div"); if (this.itemProps.isLinkEnabled) {
divParent.className = "div-visual-console-spinner"; const divParent = document.createElement("div");
const divSpinner = document.createElement("div"); divParent.className = "div-visual-console-spinner";
divSpinner.className = "visual-console-spinner"; const divSpinner = document.createElement("div");
divParent.appendChild(divSpinner); divSpinner.className = "visual-console-spinner";
const containerVC = document.getElementById("visual-console-container"); divParent.appendChild(divSpinner);
if (containerVC != null) { const containerVC = document.getElementById(
containerVC.classList.add("is-updating"); "visual-console-container"
containerVC.appendChild(divParent); );
if (containerVC != null) {
containerVC.classList.add("is-updating");
containerVC.appendChild(divParent);
}
} }
} }