mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
Fixed form php VC
This commit is contained in:
parent
f08e92b6ad
commit
d4207ef67c
@ -1420,7 +1420,6 @@ function createOrUpdateVisualConsoleItem(
|
|||||||
title = "Update item";
|
title = "Update item";
|
||||||
}
|
}
|
||||||
// var props = item.props || {};
|
// var props = item.props || {};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
var elementsVc = visualConsole.elements
|
var elementsVc = visualConsole.elements
|
||||||
.filter(function(item) {
|
.filter(function(item) {
|
||||||
@ -1433,7 +1432,6 @@ function createOrUpdateVisualConsoleItem(
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
|
||||||
load_modal({
|
load_modal({
|
||||||
target: $("#modalVCItemForm"),
|
target: $("#modalVCItemForm"),
|
||||||
form: ["itemForm-label", "itemForm-general", "itemForm-specific"],
|
form: ["itemForm-label", "itemForm-general", "itemForm-specific"],
|
||||||
@ -1478,7 +1476,7 @@ function createOrUpdateVisualConsoleItem(
|
|||||||
/*{
|
/*{
|
||||||
name: "elementsVc",
|
name: "elementsVc",
|
||||||
value: elementsVc
|
value: elementsVc
|
||||||
},*/
|
}*/
|
||||||
],
|
],
|
||||||
onshow: {
|
onshow: {
|
||||||
page: "include/rest-api/index",
|
page: "include/rest-api/index",
|
||||||
|
@ -338,4 +338,109 @@ final class BarsGraph extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @param array $values Default values.
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public static function getFormInputs(array $values): array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = Item::getFormInputs($values);
|
||||||
|
|
||||||
|
if (is_array($inputs) !== true) {
|
||||||
|
throw new Exception(
|
||||||
|
'[BarsGraph]::getFormInputs parent class return is not an array'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// Background color.
|
||||||
|
$fields = [
|
||||||
|
'white' => __('White'),
|
||||||
|
'black' => __('Black'),
|
||||||
|
'transparent' => __('Transparent'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Background color'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'backgroundColor',
|
||||||
|
'selected' => $values['backgroundColor'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Graph Type.
|
||||||
|
$fields = [
|
||||||
|
'horizontal' => __('Horizontal'),
|
||||||
|
'vertical' => __('Vertical'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Graph Type'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'typeGraph',
|
||||||
|
'selected' => $values['typeGraph'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Grid color.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Grid color'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'gridColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'value' => $values['gridColor'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Autocomplete agents.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Agent'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'autocomplete_agent',
|
||||||
|
'name' => 'agentAlias',
|
||||||
|
'id_agent_hidden' => $values['agentId'],
|
||||||
|
'name_agent_hidden' => 'agentId',
|
||||||
|
'server_id_hidden' => $values['metaconsoleId'],
|
||||||
|
'name_server_hidden' => 'metaconsoleId',
|
||||||
|
'return' => true,
|
||||||
|
'module_input' => true,
|
||||||
|
'module_name' => 'moduleId',
|
||||||
|
'module_none' => 'false',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Autocomplete module.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Module'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'autocomplete_module',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'moduleId',
|
||||||
|
'selected' => $values['moduleId'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
'agent_id' => $values['agentId'],
|
||||||
|
'metaconsole_id' => $values['metaconsoleId'],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,4 +82,63 @@ final class Box extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @param array $values Default values.
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public static function getFormInputs(array $values): array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = Item::getFormInputs($values);
|
||||||
|
|
||||||
|
if (is_array($inputs) !== true) {
|
||||||
|
throw new Exception(
|
||||||
|
'[Box]::getFormInputs parent class return is not an array'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// Border color.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Border color'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'borderColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'value' => $values['borderColor'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Border Width.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Border Width'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'borderWidth',
|
||||||
|
'type' => 'number',
|
||||||
|
'value' => $values['borderWidth'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Fill color.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Fill color'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'fillColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'value' => $values['fillColor'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -151,4 +151,114 @@ final class Clock extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @param array $values Default values.
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public static function getFormInputs(array $values): array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = Item::getFormInputs($values);
|
||||||
|
|
||||||
|
if (is_array($inputs) !== true) {
|
||||||
|
throw new Exception(
|
||||||
|
'[Clock]::getFormInputs parent class return is not an array'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// Clock animation.
|
||||||
|
$fields = [
|
||||||
|
'analogic' => __('Simple analogic'),
|
||||||
|
'digital' => __('Simple digital'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Clock animation'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'clockType',
|
||||||
|
'selected' => $values['clockType'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Time format.
|
||||||
|
$fields = [
|
||||||
|
'time' => __('Only time'),
|
||||||
|
'datetime' => __('Time and date'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Time format'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'clockFormat',
|
||||||
|
'selected' => $values['clockFormat'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Width.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Width'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'width',
|
||||||
|
'type' => 'number',
|
||||||
|
'value' => $values['width'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Time zone.
|
||||||
|
$fields = [
|
||||||
|
'Africa' => __('Africa'),
|
||||||
|
'America' => __('America'),
|
||||||
|
'Antarctica' => __('Antarctica'),
|
||||||
|
'Arctic' => __('Arctic'),
|
||||||
|
'Asia' => __('Asia'),
|
||||||
|
'Atlantic' => __('Atlantic'),
|
||||||
|
'Australia' => __('Australia'),
|
||||||
|
'Europe' => __('Europe'),
|
||||||
|
'Indian' => __('Indian'),
|
||||||
|
'Pacific' => __('Pacific'),
|
||||||
|
'UTC' => __('UTC'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Time zone'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'clockTimezone',
|
||||||
|
'selected' => $values['clockTimezone'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Element color.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Fill color'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'color',
|
||||||
|
'type' => 'color',
|
||||||
|
'value' => $values['color'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -190,4 +190,75 @@ final class DonutGraph extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @param array $values Default values.
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public static function getFormInputs(array $values): array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = Item::getFormInputs($values);
|
||||||
|
|
||||||
|
if (is_array($inputs) !== true) {
|
||||||
|
throw new Exception(
|
||||||
|
'[DonutGraph]::getFormInputs parent class return is not an array'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// Autocomplete agents.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Agent'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'autocomplete_agent',
|
||||||
|
'name' => 'agentAlias',
|
||||||
|
'id_agent_hidden' => $values['agentId'],
|
||||||
|
'name_agent_hidden' => 'agentId',
|
||||||
|
'server_id_hidden' => $values['metaconsoleId'],
|
||||||
|
'name_server_hidden' => 'metaconsoleId',
|
||||||
|
'return' => true,
|
||||||
|
'module_input' => true,
|
||||||
|
'module_name' => 'moduleId',
|
||||||
|
'module_none' => 'false',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Autocomplete module.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Module'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'autocomplete_module',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'moduleId',
|
||||||
|
'selected' => $values['moduleId'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
'agent_id' => $values['agentId'],
|
||||||
|
'metaconsole_id' => $values['metaconsoleId'],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Resume data color.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Resume data color'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'legendBackgroundColor',
|
||||||
|
'type' => 'color',
|
||||||
|
'value' => $values['legendBackgroundColor'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// TODO:XXXX LinkConsoleInputGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -156,4 +156,85 @@ final class EventsHistory extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @param array $values Default values.
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public static function getFormInputs(array $values): array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = Item::getFormInputs($values);
|
||||||
|
|
||||||
|
if (is_array($inputs) !== true) {
|
||||||
|
throw new Exception(
|
||||||
|
'[EventHistory]::getFormInputs parent class return is not an array'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// Autocomplete agents.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Agent'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'autocomplete_agent',
|
||||||
|
'name' => 'agentAlias',
|
||||||
|
'id_agent_hidden' => $values['agentId'],
|
||||||
|
'name_agent_hidden' => 'agentId',
|
||||||
|
'server_id_hidden' => $values['metaconsoleId'],
|
||||||
|
'name_server_hidden' => 'metaconsoleId',
|
||||||
|
'return' => true,
|
||||||
|
'module_input' => true,
|
||||||
|
'module_name' => 'moduleId',
|
||||||
|
'module_none' => 'false',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Autocomplete module.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Module'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'autocomplete_module',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'moduleId',
|
||||||
|
'selected' => $values['moduleId'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
'agent_id' => $values['agentId'],
|
||||||
|
'metaconsole_id' => $values['metaconsoleId'],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Type percentile.
|
||||||
|
$fields = [
|
||||||
|
'86400' => __('24h'),
|
||||||
|
'43200' => __('12h'),
|
||||||
|
'28800' => __('8h'),
|
||||||
|
'7200' => __('2h'),
|
||||||
|
'3600' => __('1h'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Max. Time'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'maxTime',
|
||||||
|
'selected' => $values['maxTime'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// TODO:XXXX LinkConsoleInputGroup.
|
||||||
|
}
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -447,4 +447,56 @@ final class Group extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @param array $values Default values.
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public static function getFormInputs(array $values): array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = Item::getFormInputs($values);
|
||||||
|
|
||||||
|
if (is_array($inputs) !== true) {
|
||||||
|
throw new Exception(
|
||||||
|
'[Group]::getFormInputs parent class return is not an array'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// List images VC.
|
||||||
|
// TODO: Show images.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Image'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => self::getListImagesVC(),
|
||||||
|
'name' => 'imageSrc',
|
||||||
|
'selected' => $values['imageSrc'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Show statistics.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Show statistics'),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'showStatistics',
|
||||||
|
'id' => 'showStatistics',
|
||||||
|
'type' => 'switch',
|
||||||
|
'value' => $values['showStatistics'],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// TODO:XXXX LinkConsoleInputGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -129,4 +129,45 @@ final class Icon extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @param array $values Default values.
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public static function getFormInputs(array $values): array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = Item::getFormInputs($values);
|
||||||
|
|
||||||
|
if (is_array($inputs) !== true) {
|
||||||
|
throw new Exception(
|
||||||
|
'[Icon]::getFormInputs parent class return is not an array'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// List images VC.
|
||||||
|
// TODO: Show images.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Image'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => self::getListImagesVC(),
|
||||||
|
'name' => 'imageSrc',
|
||||||
|
'selected' => $values['imageSrc'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// TODO:XXXX LinkConsoleInputGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ final class ModuleGraph extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($values['tabSelected'] === 'specific') {
|
if ($values['tabSelected'] === 'specific') {
|
||||||
// Type percentile.
|
// Background color.
|
||||||
$fields = [
|
$fields = [
|
||||||
'white' => __('White'),
|
'white' => __('White'),
|
||||||
'black' => __('Black'),
|
'black' => __('Black'),
|
||||||
@ -352,15 +352,15 @@ final class ModuleGraph extends Item
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$classModule = '';
|
$hiddenModule = false;
|
||||||
$classCustom = 'displayNone';
|
$hiddenCustom = true;
|
||||||
$checkedModule = true;
|
$checkedModule = true;
|
||||||
$checkedCustom = false;
|
$checkedCustom = false;
|
||||||
if (isset($values['customGraphId']) === true
|
if (isset($values['customGraphId']) === true
|
||||||
&& $values['customGraphId'] !== 0
|
&& $values['customGraphId'] !== 0
|
||||||
) {
|
) {
|
||||||
$classModule = 'displayNone';
|
$hiddenModule = true;
|
||||||
$classCustom = '';
|
$hiddenCustom = false;
|
||||||
$checkedModule = false;
|
$checkedModule = false;
|
||||||
$checkedCustom = true;
|
$checkedCustom = true;
|
||||||
}
|
}
|
||||||
@ -401,7 +401,7 @@ final class ModuleGraph extends Item
|
|||||||
// Autocomplete agents.
|
// Autocomplete agents.
|
||||||
$inputs[] = [
|
$inputs[] = [
|
||||||
'id' => 'MGautoCompleteAgent',
|
'id' => 'MGautoCompleteAgent',
|
||||||
'class' => $classModule,
|
'hidden' => $hiddenModule,
|
||||||
'label' => __('Agent'),
|
'label' => __('Agent'),
|
||||||
'arguments' => [
|
'arguments' => [
|
||||||
'type' => 'autocomplete_agent',
|
'type' => 'autocomplete_agent',
|
||||||
@ -420,7 +420,7 @@ final class ModuleGraph extends Item
|
|||||||
// Autocomplete module.
|
// Autocomplete module.
|
||||||
$inputs[] = [
|
$inputs[] = [
|
||||||
'id' => 'MGautoCompleteModule',
|
'id' => 'MGautoCompleteModule',
|
||||||
'class' => $classModule,
|
'hidden' => $hiddenModule,
|
||||||
'label' => __('Module'),
|
'label' => __('Module'),
|
||||||
'arguments' => [
|
'arguments' => [
|
||||||
'type' => 'autocomplete_module',
|
'type' => 'autocomplete_module',
|
||||||
@ -438,7 +438,7 @@ final class ModuleGraph extends Item
|
|||||||
$fields = self::getListCustomGraph();
|
$fields = self::getListCustomGraph();
|
||||||
$inputs[] = [
|
$inputs[] = [
|
||||||
'id' => 'MGcustomGraph',
|
'id' => 'MGcustomGraph',
|
||||||
'class' => $classCustom,
|
'hidden' => $hiddenCustom,
|
||||||
'label' => __('Custom graph'),
|
'label' => __('Custom graph'),
|
||||||
'arguments' => [
|
'arguments' => [
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
|
@ -296,4 +296,84 @@ final class SimpleValue extends Item
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates inputs for form (specific).
|
||||||
|
*
|
||||||
|
* @param array $values Default values.
|
||||||
|
*
|
||||||
|
* @return array Of inputs.
|
||||||
|
*
|
||||||
|
* @throws Exception On error.
|
||||||
|
*/
|
||||||
|
public static function getFormInputs(array $values): array
|
||||||
|
{
|
||||||
|
// Retrieve global - common inputs.
|
||||||
|
$inputs = Item::getFormInputs($values);
|
||||||
|
|
||||||
|
if (is_array($inputs) !== true) {
|
||||||
|
throw new Exception(
|
||||||
|
'[SimpleValue]::getFormInputs parent class return is not an array'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($values['tabSelected'] === 'specific') {
|
||||||
|
// Autocomplete agents.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Agent'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'autocomplete_agent',
|
||||||
|
'name' => 'agentAlias',
|
||||||
|
'id_agent_hidden' => $values['agentId'],
|
||||||
|
'name_agent_hidden' => 'agentId',
|
||||||
|
'server_id_hidden' => $values['metaconsoleId'],
|
||||||
|
'name_server_hidden' => 'metaconsoleId',
|
||||||
|
'return' => true,
|
||||||
|
'module_input' => true,
|
||||||
|
'module_name' => 'moduleId',
|
||||||
|
'module_none' => 'false',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Autocomplete module.
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Module'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'autocomplete_module',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'moduleId',
|
||||||
|
'selected' => $values['moduleId'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
'agent_id' => $values['agentId'],
|
||||||
|
'metaconsole_id' => $values['metaconsoleId'],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Process.
|
||||||
|
$fields = [
|
||||||
|
'none' => __('None'),
|
||||||
|
'avg' => __('Avg Value'),
|
||||||
|
'max' => __('Max Value'),
|
||||||
|
'min' => __('Min Value'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$inputs[] = [
|
||||||
|
'label' => __('Process'),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'fields' => $fields,
|
||||||
|
'name' => 'processValue',
|
||||||
|
'selected' => $values['processValue'],
|
||||||
|
'return' => true,
|
||||||
|
'sort' => false,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// TODO:XXXX LinkConsoleInputGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
return $inputs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -43,14 +43,18 @@ class View extends \HTML
|
|||||||
|
|
||||||
public function loadTabs()
|
public function loadTabs()
|
||||||
{
|
{
|
||||||
$type = get_parameter('type', 0);
|
$type = (int) \get_parameter('type', 0);
|
||||||
$itemId = (int) get_parameter('itemId', 0);
|
hd($type, true);
|
||||||
|
$itemId = (int) \get_parameter('itemId', 0);
|
||||||
|
$vCId = (int) \get_parameter('vCId', 0);
|
||||||
|
// TODO:XXX;
|
||||||
|
// $elementsVc = io_safe_output(\get_parameter('elementsVc'));
|
||||||
$url = ui_get_full_url(false, false, false, false);
|
$url = ui_get_full_url(false, false, false, false);
|
||||||
$url .= 'ajax.php?page=include/rest-api/index';
|
$url .= 'ajax.php?page=include/rest-api/index';
|
||||||
$url .= '&loadtabs=1';
|
$url .= '&loadtabs=2';
|
||||||
$url .= '&type='.$type;
|
$url .= '&type='.$type;
|
||||||
$url .= '&itemId='.$itemId;
|
$url .= '&itemId='.$itemId;
|
||||||
|
$url .= '&vCId='.$vCId;
|
||||||
|
|
||||||
$tabs = [
|
$tabs = [
|
||||||
[
|
[
|
||||||
@ -71,6 +75,22 @@ class View extends \HTML
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if ($type === LABEL) {
|
||||||
|
$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',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
$result = html_print_tabs($tabs);
|
$result = html_print_tabs($tabs);
|
||||||
|
|
||||||
// TODO:Change other place.
|
// TODO:Change other place.
|
||||||
@ -115,6 +135,7 @@ class View extends \HTML
|
|||||||
$type = get_parameter('type', null);
|
$type = get_parameter('type', null);
|
||||||
$tabSelected = get_parameter('tabSelected', 'label');
|
$tabSelected = get_parameter('tabSelected', 'label');
|
||||||
$itemId = (int) get_parameter('itemId', 0);
|
$itemId = (int) get_parameter('itemId', 0);
|
||||||
|
$vCId = (int) \get_parameter('vCId', 0);
|
||||||
|
|
||||||
$itemClass = VisualConsole::getItemClass($type);
|
$itemClass = VisualConsole::getItemClass($type);
|
||||||
|
|
||||||
@ -157,6 +178,9 @@ class View extends \HTML
|
|||||||
// TODO:XXX very ugly.
|
// TODO:XXX very ugly.
|
||||||
$jsforms = '<script>';
|
$jsforms = '<script>';
|
||||||
$jsforms .= "function typeModuleGraph(type){
|
$jsforms .= "function typeModuleGraph(type){
|
||||||
|
$('#MGautoCompleteAgent').removeClass('hidden');
|
||||||
|
$('#MGautoCompleteModule').removeClass('hidden');
|
||||||
|
$('#MGcustomGraph').removeClass('hidden');
|
||||||
if (type == 'module') {
|
if (type == 'module') {
|
||||||
$('#MGautoCompleteAgent').show();
|
$('#MGautoCompleteAgent').show();
|
||||||
$('#MGautoCompleteModule').show();
|
$('#MGautoCompleteModule').show();
|
||||||
@ -183,6 +207,8 @@ class View extends \HTML
|
|||||||
*/
|
*/
|
||||||
public function processForm()
|
public function processForm()
|
||||||
{
|
{
|
||||||
|
hd($_POST, true);
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
// Inserted data in new item.
|
// Inserted data in new item.
|
||||||
$vCId = \get_parameter('vCId', 0);
|
$vCId = \get_parameter('vCId', 0);
|
||||||
@ -219,7 +245,6 @@ class View extends \HTML
|
|||||||
$data['imageSrc'] = \get_parameter('imageSrc');
|
$data['imageSrc'] = \get_parameter('imageSrc');
|
||||||
$data['agentId'] = \get_parameter('agentId');
|
$data['agentId'] = \get_parameter('agentId');
|
||||||
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
||||||
$data['agentAlias'] = \get_parameter('agentAlias');
|
|
||||||
$data['showLastValueTooltip'] = \get_parameter(
|
$data['showLastValueTooltip'] = \get_parameter(
|
||||||
'showLastValueTooltip'
|
'showLastValueTooltip'
|
||||||
);
|
);
|
||||||
@ -229,7 +254,6 @@ class View extends \HTML
|
|||||||
$data['backgroundType'] = \get_parameter('backgroundType');
|
$data['backgroundType'] = \get_parameter('backgroundType');
|
||||||
$data['agentId'] = \get_parameter('agentId');
|
$data['agentId'] = \get_parameter('agentId');
|
||||||
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
||||||
$data['agentAlias'] = \get_parameter('agentAlias');
|
|
||||||
$data['moduleId'] = \get_parameter('moduleId');
|
$data['moduleId'] = \get_parameter('moduleId');
|
||||||
$data['customGraphId'] = \get_parameter('customGraphId');
|
$data['customGraphId'] = \get_parameter('customGraphId');
|
||||||
$data['graphType'] = \get_parameter('graphType');
|
$data['graphType'] = \get_parameter('graphType');
|
||||||
@ -239,6 +263,10 @@ class View extends \HTML
|
|||||||
case SIMPLE_VALUE_MAX:
|
case SIMPLE_VALUE_MAX:
|
||||||
case SIMPLE_VALUE_MIN:
|
case SIMPLE_VALUE_MIN:
|
||||||
case SIMPLE_VALUE_AVG:
|
case SIMPLE_VALUE_AVG:
|
||||||
|
$data['agentId'] = \get_parameter('agentId');
|
||||||
|
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
||||||
|
$data['moduleId'] = \get_parameter('moduleId');
|
||||||
|
$data['processValue'] = \get_parameter('processValue');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PERCENTILE_BAR:
|
case PERCENTILE_BAR:
|
||||||
@ -254,45 +282,79 @@ class View extends \HTML
|
|||||||
$data['labelColor'] = \get_parameter('labelColor');
|
$data['labelColor'] = \get_parameter('labelColor');
|
||||||
$data['agentId'] = \get_parameter('agentId');
|
$data['agentId'] = \get_parameter('agentId');
|
||||||
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
||||||
$data['agentAlias'] = \get_parameter('agentAlias');
|
|
||||||
$data['moduleId'] = \get_parameter('moduleId');
|
$data['moduleId'] = \get_parameter('moduleId');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LABEL:
|
case LABEL:
|
||||||
|
// Nothing. no specific items.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ICON:
|
case ICON:
|
||||||
|
$data['imageSrc'] = \get_parameter('imageSrc');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Enterprise item. It may not exist.
|
|
||||||
case SERVICE:
|
case SERVICE:
|
||||||
|
// TODO:Enterprise item. It may not exist.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GROUP_ITEM:
|
case GROUP_ITEM:
|
||||||
|
$data['imageSrc'] = \get_parameter('imageSrc');
|
||||||
|
$data['showStatistics'] = \get_parameter_switch(
|
||||||
|
'showStatistics',
|
||||||
|
0
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BOX_ITEM:
|
case BOX_ITEM:
|
||||||
|
$data['borderColor'] = \get_parameter('borderColor');
|
||||||
|
$data['borderWidth'] = \get_parameter('borderWidth');
|
||||||
|
$data['fillColor'] = \get_parameter('fillColor');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LINE_ITEM:
|
case LINE_ITEM:
|
||||||
|
// Nothing. no specific items.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AUTO_SLA_GRAPH:
|
case AUTO_SLA_GRAPH:
|
||||||
|
$data['agentId'] = \get_parameter('agentId');
|
||||||
|
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
||||||
|
$data['agentAlias'] = \get_parameter('agentAlias');
|
||||||
|
$data['moduleId'] = \get_parameter('moduleId');
|
||||||
|
$data['maxTime'] = \get_parameter('maxTime');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DONUT_GRAPH:
|
case DONUT_GRAPH:
|
||||||
|
$data['agentId'] = \get_parameter('agentId');
|
||||||
|
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
||||||
|
$data['moduleId'] = \get_parameter('moduleId');
|
||||||
|
$data['legendBackgroundColor'] = \get_parameter(
|
||||||
|
'legendBackgroundColor'
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BARS_GRAPH:
|
case BARS_GRAPH:
|
||||||
|
$data['backgroundColor'] = \get_parameter('backgroundColor');
|
||||||
|
$data['typeGraph'] = \get_parameter('typeGraph');
|
||||||
|
$data['gridColor'] = \get_parameter('gridColor');
|
||||||
|
$data['agentId'] = \get_parameter('agentId');
|
||||||
|
$data['metaconsoleId'] = \get_parameter('metaconsoleId');
|
||||||
|
$data['moduleId'] = \get_parameter('moduleId');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLOCK:
|
case CLOCK:
|
||||||
|
$data['clockType'] = \get_parameter('clockType');
|
||||||
|
$data['clockFormat'] = \get_parameter('clockFormat');
|
||||||
|
$data['width'] = \get_parameter('width');
|
||||||
|
$data['clockTimezone'] = \get_parameter('clockTimezone');
|
||||||
|
$data['color'] = \get_parameter('color');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COLOR_CLOUD:
|
case COLOR_CLOUD:
|
||||||
|
// TODO:XXX.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
// Not posible.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ li.discovery > a label {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.data_container > label {
|
div.data_container > label {
|
||||||
font-family: "lato-bolder", "Open Sans", sans-serif;
|
font-family: "lato", "Open Sans", sans-serif;
|
||||||
font-weight: lighter;
|
font-weight: lighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +204,9 @@ label {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
li > input[type="number"],
|
||||||
li > input[type="text"],
|
li > input[type="text"],
|
||||||
|
li > input[type="email"],
|
||||||
li > input[type="password"],
|
li > input[type="password"],
|
||||||
.discovery_text_input > input[type="password"],
|
.discovery_text_input > input[type="password"],
|
||||||
.discovery_text_input > input[type="text"],
|
.discovery_text_input > input[type="text"],
|
||||||
@ -274,17 +276,14 @@ a.ext_link {
|
|||||||
/*
|
/*
|
||||||
* Discovery > Wizard css global style
|
* Discovery > Wizard css global style
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ul.wizard {
|
|
||||||
}
|
|
||||||
|
|
||||||
ul.wizard li {
|
ul.wizard li {
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
|
margin-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.wizard li > label:not(.p-switch) {
|
ul.wizard li > label:not(.p-switch) {
|
||||||
width: 250px;
|
width: auto;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
@ -300,8 +299,8 @@ ul.wizard li > textarea {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.wizard li > label:not(.p-switch) {
|
form.modal ul.wizard li.hidden {
|
||||||
width: auto;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
form.top-action-buttons ul.wizard {
|
form.top-action-buttons ul.wizard {
|
||||||
@ -309,10 +308,6 @@ form.top-action-buttons ul.wizard {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.wizard li {
|
|
||||||
margin-right: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.modal ul.wizard li {
|
form.modal ul.wizard li {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -329,3 +324,56 @@ ul.wizard li.flex-indep {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tooltip message errors*/
|
||||||
|
div.ui-tooltip.ui-corner-all.ui-widget-shadow.ui-widget.ui-widget-content.uitooltip {
|
||||||
|
background: grey;
|
||||||
|
opacity: 0.9;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 6px 5px 9px -9px black;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-tooltip-content {
|
||||||
|
background: transparent;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
font-family: "lato-lighter", "Open Sans", sans-serif;
|
||||||
|
letter-spacing: 0.03pt;
|
||||||
|
font-size: 8pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrow {
|
||||||
|
width: 70px;
|
||||||
|
height: 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -35px;
|
||||||
|
bottom: -16px;
|
||||||
|
}
|
||||||
|
.arrow.top {
|
||||||
|
top: -16px;
|
||||||
|
bottom: auto;
|
||||||
|
}
|
||||||
|
.arrow.left {
|
||||||
|
left: 50%;
|
||||||
|
}
|
||||||
|
.arrow:after {
|
||||||
|
background: grey;
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 20px;
|
||||||
|
top: -20px;
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
box-shadow: 6px 5px 9px -9px black;
|
||||||
|
-webkit-transform: rotate(45deg);
|
||||||
|
-ms-transform: rotate(45deg);
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
.arrow.top:after {
|
||||||
|
bottom: -20px;
|
||||||
|
top: auto;
|
||||||
|
}
|
||||||
|
/* END Tooltip message errors*/
|
||||||
|
@ -6015,7 +6015,3 @@ form#modal_form_feedback ul.wizard li > textarea {
|
|||||||
#controls_table > tbody > tr > td input {
|
#controls_table > tbody > tr > td input {
|
||||||
margin-left: 3px;
|
margin-left: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.displayNone {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user