mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
sort arrays before storing them in a component (#10329)
This commit is contained in:
@@ -149,6 +149,9 @@ if (empty($ports_keys)) {
|
||||
$portsc = $component->createComponent($device_id, 'portsactivity');
|
||||
}
|
||||
|
||||
// Make sure we don't readd it, just in a different order.
|
||||
sort($ports_keys);
|
||||
|
||||
$id = $component->getFirstComponentID($portsc);
|
||||
$portsc[$id]['label'] = 'Portsactivity';
|
||||
$portsc[$id]['ports'] = json_encode($ports_keys);
|
||||
|
||||
@@ -128,6 +128,9 @@ if (empty($found_dbs)) {
|
||||
$pgc = $component->createComponent($device_id, 'postgres');
|
||||
}
|
||||
|
||||
// Make sure we don't readd it, just in a different order.
|
||||
sort($found_dbs);
|
||||
|
||||
$id = $component->getFirstComponentID($pgc);
|
||||
$pgc[$id]['label'] = 'Postgres';
|
||||
$pgc[$id]['databases'] = json_encode($found_dbs);
|
||||
|
||||
@@ -9,7 +9,7 @@ $app_id = $app['app_id'];
|
||||
|
||||
echo $name;
|
||||
|
||||
// Is set to false later if missing keys are found.
|
||||
// Is set to false later if missing keys are found.
|
||||
$not_legacy=1;
|
||||
|
||||
try {
|
||||
@@ -205,6 +205,9 @@ if (empty($pools)) {
|
||||
$zfsc = $component->createComponent($device_id, 'zfs');
|
||||
}
|
||||
|
||||
// Make sure we don't readd it, just in a different order.
|
||||
sort($pools);
|
||||
|
||||
$id = $component->getFirstComponentID($zfsc);
|
||||
$zfsc[$id]['label'] = 'ZFS';
|
||||
$zfsc[$id]['pools'] = json_encode($pools);
|
||||
|
||||
Reference in New Issue
Block a user