fixed autocomplete agent

This commit is contained in:
Daniel Barbero Martin 2019-09-19 13:45:13 +02:00
parent 0c59c89d8f
commit a3cdbd2a3a
8 changed files with 40 additions and 39 deletions

View File

@ -390,7 +390,7 @@ if ($getVisualConsole === true) {
}
} else {
$agents = agents_get_agents(
$filter_alias,
$filter,
[
'id_agente',
'nombre',

View File

@ -38,6 +38,7 @@ final class ColorCloud extends Item
private static function encodeColorRanges(array $data): array
{
$colorRangeArray = [];
if (isset($data['colorRanges']) === true) {
foreach ($data['colorRanges'] as $colorRange) {
if (\is_numeric($colorRange['fromValue']) === true
@ -72,33 +73,32 @@ final class ColorCloud extends Item
protected function encode(array $data): array
{
$return = parent::encode($data);
$defaultColor = null;
if (isset($data['defaultColor']) === true) {
$defaultColor = static::extractDefaultColor($data);
}
$colorRanges = null;
if (isset($data['colorRanges']) === true) {
$defaultColor = null;
if (isset($data['defaultColor']) === true) {
$defaultColor = static::extractDefaultColor($data);
}
$colorRanges = static::encodeColorRanges($data);
}
if (empty($data['id']) === true) {
$return['label'] = json_encode(
[
'default_color' => $defaultColor,
'color_ranges' => $colorRanges,
]
);
} else {
$prevData = $this->toArray();
if (empty($data['id']) === true) {
$return['label'] = json_encode(
[
'default_color' => $defaultColor,
'color_ranges' => $colorRanges,
]
);
} else {
$prevData = $this->toArray();
$return['label'] = json_encode(
[
'default_color' => ($defaultColor !== null) ? $defaultColor : $prevData['defaultColor'],
'color_ranges' => ($colorRanges !== null && (count($colorRanges) > 0)) ? $colorRanges : $prevData['colorRanges'],
]
);
$return['label'] = json_encode(
[
'default_color' => ($defaultColor !== null) ? $defaultColor : $prevData['defaultColor'],
'color_ranges' => ($colorRanges !== null && (count($colorRanges) > 0)) ? $colorRanges : $prevData['colorRanges'],
]
);
}
}
return $return;

View File

@ -206,16 +206,15 @@ form.visual-console-item-edition > input[type="submit"] {
/*background: pink;*/
}
.autocomplete-items {
position: absolute;
border: 1px solid #d4d4d4;
border-bottom: none;
border-top: none;
z-index: 99;
overflow: visible;
/*position the autocomplete items to be the same width as the container:*/
top: 100%;
left: 0;
right: 0;
position: fixed;
z-index: 1;
overflow: auto;
max-height: 150px;
max-width: 250px;
}
.autocomplete-items div {
padding: 10px;

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

View File

@ -993,7 +993,10 @@ export class AgentModuleInputGroup extends InputGroup<
};
const handleSelected = (item: AgentAutocompleteData): string => {
this.updateData({ agentId: item.agentId });
this.updateData({
agentId: item.agentId,
metaconsoleId: item.metaconsoleId
});
const selectedItem = item.agentAddress
? `${item.agentAlias} - ${item.agentAddress}`

View File

@ -7,16 +7,15 @@
/*background: pink;*/
}
.autocomplete-items {
position: absolute;
border: 1px solid #d4d4d4;
border-bottom: none;
border-top: none;
z-index: 99;
overflow: visible;
/*position the autocomplete items to be the same width as the container:*/
top: 100%;
left: 0;
right: 0;
position: fixed;
z-index: 1;
overflow: auto;
max-height: 150px;
max-width: 250px;
}
.autocomplete-items div {
padding: 10px;