mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
fixed errors VC
This commit is contained in:
parent
902c42b559
commit
68dd01ba09
@ -213,6 +213,9 @@ if ($config['menu_type'] == 'classic') {
|
|||||||
$select[0]['autorefresh_white_list']
|
$select[0]['autorefresh_white_list']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($_GET['sec2'] === 'operation/visual_console/render_view'
|
||||||
|
&& $config['legacy_vc']
|
||||||
|
) {
|
||||||
if ($autorefresh_list !== null
|
if ($autorefresh_list !== null
|
||||||
&& array_search($_GET['sec2'], $autorefresh_list) !== false
|
&& array_search($_GET['sec2'], $autorefresh_list) !== false
|
||||||
) {
|
) {
|
||||||
@ -332,6 +335,7 @@ if ($config['menu_type'] == 'classic') {
|
|||||||
$header_autorefresh_counter .= $autorefresh_link_close;
|
$header_autorefresh_counter .= $autorefresh_link_close;
|
||||||
$header_autorefresh_counter .= $autorefresh_additional;
|
$header_autorefresh_counter .= $autorefresh_additional;
|
||||||
$header_autorefresh_counter .= '</div>';
|
$header_autorefresh_counter .= '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
// Button for feedback pandora.
|
// Button for feedback pandora.
|
||||||
if (enterprise_installed()) {
|
if (enterprise_installed()) {
|
||||||
|
@ -1885,6 +1885,7 @@ class Item extends CachedModel
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if ($values['type'] !== LABEL) {
|
||||||
// Link enabled.
|
// Link enabled.
|
||||||
$inputs[] = [
|
$inputs[] = [
|
||||||
'label' => __('Link enabled'),
|
'label' => __('Link enabled'),
|
||||||
@ -1895,6 +1896,7 @@ class Item extends CachedModel
|
|||||||
'value' => $values['isLinkEnabled'],
|
'value' => $values['isLinkEnabled'],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
// Show on top.
|
// Show on top.
|
||||||
$inputs[] = [
|
$inputs[] = [
|
||||||
@ -2232,7 +2234,21 @@ class Item extends CachedModel
|
|||||||
{
|
{
|
||||||
// LinkConsoleInputGroup.
|
// LinkConsoleInputGroup.
|
||||||
$fields = self::getAllVisualConsole($values['vCId']);
|
$fields = self::getAllVisualConsole($values['vCId']);
|
||||||
\array_unshift($fields, ['id' => 0, 'name' => __('None')]);
|
|
||||||
|
if ($fields === false) {
|
||||||
|
$fields = [];
|
||||||
|
} else {
|
||||||
|
$fields = \array_reduce(
|
||||||
|
$fields,
|
||||||
|
function ($carry, $item) {
|
||||||
|
$carry[$item['id']] = $item['name'];
|
||||||
|
return $carry;
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$fields[0] = __('None');
|
||||||
|
|
||||||
$getAllVisualConsoleValue = $values['linkedLayoutId'];
|
$getAllVisualConsoleValue = $values['linkedLayoutId'];
|
||||||
if (\is_metaconsole() === true) {
|
if (\is_metaconsole() === true) {
|
||||||
|
@ -60,6 +60,16 @@ final class Label extends Item
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// Inputs LinkedVisualConsole.
|
||||||
|
$inputsLinkedVisualConsole = self::inputsLinkedVisualConsole(
|
||||||
|
$values
|
||||||
|
);
|
||||||
|
foreach ($inputsLinkedVisualConsole as $key => $value) {
|
||||||
|
$inputs[] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $inputs;
|
return $inputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,10 +85,6 @@ final class Label extends Item
|
|||||||
*/
|
*/
|
||||||
public function getDefaultGeneralValues(array $values): array
|
public function getDefaultGeneralValues(array $values): array
|
||||||
{
|
{
|
||||||
if (isset($values['isLinkEnabled']) === false) {
|
|
||||||
$values['isLinkEnabled'] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Retrieve global - common inputs.
|
// Retrieve global - common inputs.
|
||||||
$values = parent::getDefaultGeneralValues($values);
|
$values = parent::getDefaultGeneralValues($values);
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ final class ModuleGraph extends Item
|
|||||||
\enterprise_include_once('include/functions_metaconsole.php');
|
\enterprise_include_once('include/functions_metaconsole.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
$imageOnly = true;
|
$imageOnly = false;
|
||||||
|
|
||||||
$backgroundType = static::extractBackgroundType($data);
|
$backgroundType = static::extractBackgroundType($data);
|
||||||
$period = static::extractPeriod($data);
|
$period = static::extractPeriod($data);
|
||||||
@ -344,7 +344,10 @@ final class ModuleGraph extends Item
|
|||||||
'modules_series' => $customGraph['modules_series'],
|
'modules_series' => $customGraph['modules_series'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if ($imageOnly !== false) {
|
||||||
$imgbase64 = 'data:image/jpg;base64,';
|
$imgbase64 = 'data:image/jpg;base64,';
|
||||||
|
}
|
||||||
|
|
||||||
$imgbase64 .= \graphic_combined_module(
|
$imgbase64 .= \graphic_combined_module(
|
||||||
false,
|
false,
|
||||||
$params,
|
$params,
|
||||||
@ -356,8 +359,6 @@ final class ModuleGraph extends Item
|
|||||||
throw new \InvalidArgumentException('missing module Id');
|
throw new \InvalidArgumentException('missing module Id');
|
||||||
}
|
}
|
||||||
|
|
||||||
$imageOnly = false;
|
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'agent_module_id' => $moduleId,
|
'agent_module_id' => $moduleId,
|
||||||
'period' => $period,
|
'period' => $period,
|
||||||
@ -416,9 +417,18 @@ final class ModuleGraph extends Item
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = array_reduce(
|
||||||
|
$data,
|
||||||
|
function ($carry, $item) {
|
||||||
|
$carry[$item['id_graph']] = $item['name'];
|
||||||
|
return $carry;
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
$data[0] = __('None');
|
$data[0] = __('None');
|
||||||
|
|
||||||
return array_reverse($data);
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -451,6 +461,10 @@ final class ModuleGraph extends Item
|
|||||||
$values['period'] = 3600;
|
$values['period'] = 3600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($values['showLegend']) === false) {
|
||||||
|
$values['showLegend'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Background color.
|
// Background color.
|
||||||
$fields = [
|
$fields = [
|
||||||
'white' => __('White'),
|
'white' => __('White'),
|
||||||
|
@ -81,19 +81,6 @@ class View extends \HTML
|
|||||||
$activetabs = 2;
|
$activetabs = 2;
|
||||||
if ($type === LABEL) {
|
if ($type === LABEL) {
|
||||||
$activetabs = 0;
|
$activetabs = 0;
|
||||||
$tabs = [
|
|
||||||
[
|
|
||||||
'name' => __('Label settings'),
|
|
||||||
'id' => 'tab-label',
|
|
||||||
'href' => $url.'&tabSelected=label',
|
|
||||||
'img' => 'zoom.png',
|
|
||||||
],[
|
|
||||||
'name' => __('General settings'),
|
|
||||||
'id' => 'tab-general',
|
|
||||||
'href' => $url.'&tabSelected=general',
|
|
||||||
'img' => 'pencil.png',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
} else if ($type === LINE_ITEM) {
|
} else if ($type === LINE_ITEM) {
|
||||||
$activetabs = 0;
|
$activetabs = 0;
|
||||||
$tabs = [
|
$tabs = [
|
||||||
@ -501,6 +488,9 @@ class View extends \HTML
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LABEL:
|
case LABEL:
|
||||||
|
$data['isLinkEnabled'] = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// Not posible.
|
// Not posible.
|
||||||
break;
|
break;
|
||||||
|
@ -699,7 +699,8 @@ li#li-timeZone-item > select:not(:first-child) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.label,
|
div.label,
|
||||||
div.simple-value {
|
div.simple-value,
|
||||||
|
div.module-graph {
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
min-width: -webkit-fit-content;
|
min-width: -webkit-fit-content;
|
||||||
min-width: -moz-fit-content;
|
min-width: -moz-fit-content;
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -516,7 +516,7 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
} else {
|
} else {
|
||||||
// Add loading click item.
|
// Add loading click item.
|
||||||
if (this.itemProps.isLinkEnabled) {
|
if (this.itemProps.isLinkEnabled && this.itemProps.link != null) {
|
||||||
const divParent = document.createElement("div");
|
const divParent = document.createElement("div");
|
||||||
divParent.className = "div-visual-console-spinner";
|
divParent.className = "div-visual-console-spinner";
|
||||||
const divSpinner = document.createElement("div");
|
const divSpinner = document.createElement("div");
|
||||||
|
@ -96,6 +96,7 @@ export default class ModuleGraph extends Item<ModuleGraphProps> {
|
|||||||
//}px`;
|
//}px`;
|
||||||
|
|
||||||
element.innerHTML = this.props.html;
|
element.innerHTML = this.props.html;
|
||||||
|
element.className = "module-graph";
|
||||||
|
|
||||||
// Remove the overview graph.
|
// Remove the overview graph.
|
||||||
const legendP = element.getElementsByTagName("p");
|
const legendP = element.getElementsByTagName("p");
|
||||||
|
@ -525,7 +525,8 @@ li#li-timeZone-item > select:not(:first-child) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.label,
|
div.label,
|
||||||
div.simple-value {
|
div.simple-value,
|
||||||
|
div.module-graph {
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
min-width: fit-content;
|
min-width: fit-content;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user