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']
|
||||
);
|
||||
|
||||
if ($_GET['sec2'] === 'operation/visual_console/render_view'
|
||||
&& $config['legacy_vc']
|
||||
) {
|
||||
if ($autorefresh_list !== null
|
||||
&& 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_additional;
|
||||
$header_autorefresh_counter .= '</div>';
|
||||
}
|
||||
|
||||
// Button for feedback pandora.
|
||||
if (enterprise_installed()) {
|
||||
|
@ -1885,6 +1885,7 @@ class Item extends CachedModel
|
||||
],
|
||||
];
|
||||
|
||||
if ($values['type'] !== LABEL) {
|
||||
// Link enabled.
|
||||
$inputs[] = [
|
||||
'label' => __('Link enabled'),
|
||||
@ -1895,6 +1896,7 @@ class Item extends CachedModel
|
||||
'value' => $values['isLinkEnabled'],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
// Show on top.
|
||||
$inputs[] = [
|
||||
@ -2232,7 +2234,21 @@ class Item extends CachedModel
|
||||
{
|
||||
// LinkConsoleInputGroup.
|
||||
$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'];
|
||||
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;
|
||||
}
|
||||
|
||||
@ -75,10 +85,6 @@ final class Label extends Item
|
||||
*/
|
||||
public function getDefaultGeneralValues(array $values): array
|
||||
{
|
||||
if (isset($values['isLinkEnabled']) === false) {
|
||||
$values['isLinkEnabled'] = false;
|
||||
}
|
||||
|
||||
// Retrieve global - common inputs.
|
||||
$values = parent::getDefaultGeneralValues($values);
|
||||
|
||||
|
@ -276,7 +276,7 @@ final class ModuleGraph extends Item
|
||||
\enterprise_include_once('include/functions_metaconsole.php');
|
||||
}
|
||||
|
||||
$imageOnly = true;
|
||||
$imageOnly = false;
|
||||
|
||||
$backgroundType = static::extractBackgroundType($data);
|
||||
$period = static::extractPeriod($data);
|
||||
@ -344,7 +344,10 @@ final class ModuleGraph extends Item
|
||||
'modules_series' => $customGraph['modules_series'],
|
||||
];
|
||||
|
||||
if ($imageOnly !== false) {
|
||||
$imgbase64 = 'data:image/jpg;base64,';
|
||||
}
|
||||
|
||||
$imgbase64 .= \graphic_combined_module(
|
||||
false,
|
||||
$params,
|
||||
@ -356,8 +359,6 @@ final class ModuleGraph extends Item
|
||||
throw new \InvalidArgumentException('missing module Id');
|
||||
}
|
||||
|
||||
$imageOnly = false;
|
||||
|
||||
$params = [
|
||||
'agent_module_id' => $moduleId,
|
||||
'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');
|
||||
|
||||
return array_reverse($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@ -451,6 +461,10 @@ final class ModuleGraph extends Item
|
||||
$values['period'] = 3600;
|
||||
}
|
||||
|
||||
if (isset($values['showLegend']) === false) {
|
||||
$values['showLegend'] = true;
|
||||
}
|
||||
|
||||
// Background color.
|
||||
$fields = [
|
||||
'white' => __('White'),
|
||||
|
@ -81,19 +81,6 @@ class View extends \HTML
|
||||
$activetabs = 2;
|
||||
if ($type === LABEL) {
|
||||
$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) {
|
||||
$activetabs = 0;
|
||||
$tabs = [
|
||||
@ -501,6 +488,9 @@ class View extends \HTML
|
||||
break;
|
||||
|
||||
case LABEL:
|
||||
$data['isLinkEnabled'] = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Not posible.
|
||||
break;
|
||||
|
@ -699,7 +699,8 @@ li#li-timeZone-item > select:not(:first-child) {
|
||||
}
|
||||
|
||||
div.label,
|
||||
div.simple-value {
|
||||
div.simple-value,
|
||||
div.module-graph {
|
||||
display: inline-table;
|
||||
min-width: -webkit-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();
|
||||
} else {
|
||||
// Add loading click item.
|
||||
if (this.itemProps.isLinkEnabled) {
|
||||
if (this.itemProps.isLinkEnabled && this.itemProps.link != null) {
|
||||
const divParent = document.createElement("div");
|
||||
divParent.className = "div-visual-console-spinner";
|
||||
const divSpinner = document.createElement("div");
|
||||
|
@ -96,6 +96,7 @@ export default class ModuleGraph extends Item<ModuleGraphProps> {
|
||||
//}px`;
|
||||
|
||||
element.innerHTML = this.props.html;
|
||||
element.className = "module-graph";
|
||||
|
||||
// Remove the overview graph.
|
||||
const legendP = element.getElementsByTagName("p");
|
||||
|
@ -525,7 +525,8 @@ li#li-timeZone-item > select:not(:first-child) {
|
||||
}
|
||||
|
||||
div.label,
|
||||
div.simple-value {
|
||||
div.simple-value,
|
||||
div.module-graph {
|
||||
display: inline-table;
|
||||
min-width: fit-content;
|
||||
min-height: fit-content;
|
||||
|
Loading…
x
Reference in New Issue
Block a user