fixed errors VC
This commit is contained in:
parent
570ebd9a0a
commit
6ddb501b08
pandora_console/include
visual_console_client/src
|
@ -4862,7 +4862,7 @@ function graph_nodata_image($width=300, $height=110, $type='area', $text='')
|
|||
// if ($text == '') {
|
||||
// $text = __('No data to show');
|
||||
// }
|
||||
$text_div = '<div class="nodata_text" style="text-align:center; padding: 30px 0; display:block; font-size:9.5pt;">'.$text.'</div>';
|
||||
$text_div = '<div class="nodata_text" style="text-align:center; padding: 30px 0; display:block; font-size:9.5pt;">'.$text.'</div>';
|
||||
|
||||
$image_div = $text_div.'<div class="nodata_container" style="background-position: top; width:40%;height:40%;background-size: contain;background-image: url(\''.$image.'\');"><div></div></div>';
|
||||
|
||||
|
|
|
@ -352,7 +352,7 @@ function hbar_graph(
|
|||
) {
|
||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||
|
||||
if (empty($chart_data)) {
|
||||
if ($chart_data === false || empty($chart_data) === true) {
|
||||
return graph_nodata_image($width, $height, 'hbar');
|
||||
}
|
||||
|
||||
|
|
|
@ -223,14 +223,6 @@ final class BarsGraph extends Item
|
|||
$moduleId = $linkedModule['moduleId'];
|
||||
$metaconsoleId = $linkedModule['metaconsoleId'];
|
||||
|
||||
if ($agentId === null) {
|
||||
throw new \InvalidArgumentException('missing agent Id');
|
||||
}
|
||||
|
||||
if ($moduleId === null) {
|
||||
throw new \InvalidArgumentException('missing module Id');
|
||||
}
|
||||
|
||||
// Add colors that will use the graphics.
|
||||
$color = [];
|
||||
|
||||
|
@ -313,9 +305,9 @@ final class BarsGraph extends Item
|
|||
// Maybe connect to node.
|
||||
$nodeConnected = false;
|
||||
if (\is_metaconsole() === true && $metaconsoleId !== null) {
|
||||
$server = \metaconsole_get_connection_by_id($metaconsoleId);
|
||||
$nodeConnected = \metaconsole_connect(
|
||||
null,
|
||||
$metaconsoleId
|
||||
$server
|
||||
) === NOERR;
|
||||
|
||||
if ($nodeConnected === false) {
|
||||
|
@ -326,7 +318,9 @@ final class BarsGraph extends Item
|
|||
}
|
||||
|
||||
$moduleData = \get_bars_module_data($moduleId);
|
||||
array_pop($moduleData);
|
||||
if ($moduleData !== false && is_array($moduleData) === true) {
|
||||
array_pop($moduleData);
|
||||
}
|
||||
|
||||
$waterMark = [
|
||||
'file' => $config['homedir'].'/images/logo_vertical_water.png',
|
||||
|
|
|
@ -124,9 +124,9 @@ final class DonutGraph extends Item
|
|||
// Maybe connect to node.
|
||||
$nodeConnected = false;
|
||||
if (\is_metaconsole() === true && $metaconsoleId !== null) {
|
||||
$server = \metaconsole_get_connection_by_id($metaconsoleId);
|
||||
$nodeConnected = \metaconsole_connect(
|
||||
null,
|
||||
$metaconsoleId
|
||||
$server
|
||||
) === NOERR;
|
||||
|
||||
if ($nodeConnected === false) {
|
||||
|
@ -147,12 +147,8 @@ final class DonutGraph extends Item
|
|||
$agentId,
|
||||
$moduleId
|
||||
);
|
||||
$isString = (bool) \db_get_value_sql($sql);
|
||||
|
||||
// Restore connection.
|
||||
if ($nodeConnected === true) {
|
||||
\metaconsole_restore_db();
|
||||
}
|
||||
$isString = (bool) \db_get_value_sql($sql);
|
||||
|
||||
$width = (int) $data['width'];
|
||||
$height = (int) $data['height'];
|
||||
|
@ -177,6 +173,11 @@ final class DonutGraph extends Item
|
|||
$data['html'] = '<img src="'.$src.'" style="'.$style.'">';
|
||||
}
|
||||
|
||||
// Restore connection.
|
||||
if ($nodeConnected === true) {
|
||||
\metaconsole_restore_db();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -257,7 +257,7 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||
// This function will only run the 2nd arg function after the time
|
||||
// of the first arg have passed after its last execution.
|
||||
private debouncedMovementSave = debounce(
|
||||
300, // ms.
|
||||
500, // ms.
|
||||
(x: Position["x"], y: Position["y"]) => {
|
||||
// Update the metadata information.
|
||||
// Don't use the .meta property cause we don't need DOM updates.
|
||||
|
@ -338,7 +338,7 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||
// This function will only run the 2nd arg function after the time
|
||||
// of the first arg have passed after its last execution.
|
||||
private debouncedResizementSave = debounce(
|
||||
300, // ms.
|
||||
500, // ms.
|
||||
(width: Size["width"], height: Size["height"]) => {
|
||||
// Update the metadata information.
|
||||
// Don't use the .meta property cause we don't need DOM updates.
|
||||
|
|
|
@ -96,7 +96,7 @@ export default class Line extends Item<LineProps> {
|
|||
// This function will only run the 2nd arg function after the time
|
||||
// of the first arg have passed after its last execution.
|
||||
private debouncedStartPositionMovementSave = debounce(
|
||||
300, // ms.
|
||||
500, // ms.
|
||||
(x: Position["x"], y: Position["y"]) => {
|
||||
this.isMoving = false;
|
||||
const startPosition = { x, y };
|
||||
|
@ -154,7 +154,7 @@ export default class Line extends Item<LineProps> {
|
|||
// This function will only run the 2nd arg function after the time
|
||||
// of the first arg have passed after its last execution.
|
||||
private debouncedEndPositionMovementSave = debounce(
|
||||
300, // ms.
|
||||
500, // ms.
|
||||
(x: Position["x"], y: Position["y"]) => {
|
||||
this.isMoving = false;
|
||||
const endPosition = { x, y };
|
||||
|
|
Loading…
Reference in New Issue