mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
fixed autocomplete agent
This commit is contained in:
parent
0c59c89d8f
commit
a3cdbd2a3a
@ -390,7 +390,7 @@ if ($getVisualConsole === true) {
|
||||
}
|
||||
} else {
|
||||
$agents = agents_get_agents(
|
||||
$filter_alias,
|
||||
$filter,
|
||||
[
|
||||
'id_agente',
|
||||
'nombre',
|
||||
|
@ -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;
|
||||
|
@ -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
@ -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}`
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user