www: devices: Display vendors in a sorted order
- Keep GSI at the top
Change-Id: I30b1a49b05cd115ceba6ee2333d19067c8873683
diff --git a/content/devices/leaf_gsi_arm64.yml b/content/devices/leaf_gsi_arm64.yml
index 9c199b8..120f5bc 100644
--- a/content/devices/leaf_gsi_arm64.yml
+++ b/content/devices/leaf_gsi_arm64.yml
@@ -6,5 +6,5 @@
name: Generic ARM64
release: 2022-05-23
soc: Generic
-vendor: LeafOS
+vendor: LeafOS GSI
versions: [3.2]
diff --git a/src/Service/DeviceService.php b/src/Service/DeviceService.php
index 43b935e..317614c 100644
--- a/src/Service/DeviceService.php
+++ b/src/Service/DeviceService.php
@@ -28,17 +28,24 @@
public function getDeviceVendors(): array {
$availableDevices = $this->getAvailableDevices();
+ $gsiVendor = [];
$vendors = [];
foreach ($availableDevices as $device) {
$vendor = $device['vendor'];
+
+ if ($vendor === "LeafOS GSI") {
+ $gsiVendor[] = $device;
+ continue;
+ }
if (!array_key_exists($vendor, $vendors)) {
$vendors[$vendor] = [];
}
$vendors[$vendor][] = $device;
}
- return $vendors;
+ ksort($vendors);
+ return ['LeafOS GSI' => $gsiVendor] + $vendors;
}
public function getDeviceInfo(string $device) {