diff --git a/pandora_console/include/javascript/pandora_visual_console.js b/pandora_console/include/javascript/pandora_visual_console.js index f775e5e47e..17f5080aba 100755 --- a/pandora_console/include/javascript/pandora_visual_console.js +++ b/pandora_console/include/javascript/pandora_visual_console.js @@ -179,6 +179,15 @@ function createVisualConsole( y: e.newPosition.y, type: e.item.props.type }; + + if (e.item.props.processValue != undefined) { + data.processValue = e.item.props.processValue; + } + + if (e.item.props.percentileType != undefined) { + data.percentileType = e.item.props.percentileType; + } + var taskId = "visual-console-item-update-" + id; // Persist the new position. @@ -270,6 +279,14 @@ function createVisualConsole( type: item.props.type }; + if (item.props.processValue != undefined) { + data.processValue = item.props.processValue; + } + + if (item.props.percentileType != undefined) { + data.percentileType = item.props.percentileType; + } + var taskId = "visual-console-item-update-" + id; // Persist the new size. asyncTaskManager diff --git a/pandora_console/include/rest-api/models/VisualConsole/Item.php b/pandora_console/include/rest-api/models/VisualConsole/Item.php index e9227c9ed4..a9f07ca527 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Item.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Item.php @@ -1817,6 +1817,7 @@ class Item extends CachedModel if (empty($data['id']) === true) { // Insert. $save = static::encode($data); + $result = \db_process_sql_insert('tlayout_data', $save); if ($result) { $item = static::fromDB(['id' => $result]); diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/SimpleValue.php b/pandora_console/include/rest-api/models/VisualConsole/Items/SimpleValue.php index 0df15d2e0e..47701a8b80 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/SimpleValue.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/SimpleValue.php @@ -110,6 +110,8 @@ final class SimpleValue extends Item $process_value = static::encodeProcessValue($data); if ($process_value !== null) { $return['type'] = $process_value; + } else if (isset($data['processValue']) === true) { + $return['type'] = $data['processValue']; } return $return; @@ -150,7 +152,7 @@ final class SimpleValue extends Item */ private static function extractProcessValue(array $data): string { - if (isset($data['processValue'])) { + if (isset($data['processValue']) === true) { switch ($data['processValue']) { case 'none': case 'avg':