Vertical Drive Bays

This commit is contained in:
2025-03-01 12:15:51 -05:00
parent 07e64d50fc
commit a6cb3400be

View File

@ -91,42 +91,40 @@ generate_medium2_layout() {
local sata_drives=$(ls -l /dev/disk/by-path/pci-0000:0c:00.0-ata-[0-9]$ 2>/dev/null | awk -F'/' '{print $NF}') local sata_drives=$(ls -l /dev/disk/by-path/pci-0000:0c:00.0-ata-[0-9]$ 2>/dev/null | awk -F'/' '{print $NF}')
local nvme_drive=$(ls -l /dev/disk/by-path/pci-0000:0d:00.0* 2>/dev/null | awk -F'/' '{print $NF}') local nvme_drive=$(ls -l /dev/disk/by-path/pci-0000:0d:00.0* 2>/dev/null | awk -F'/' '{print $NF}')
# Print header
printf "┌──────────────────────────────────────────────────────────────┐\n" printf "┌──────────────────────────────────────────────────────────────┐\n"
printf "│ B650D4U3-2Q/BCM │\n"
printf "│ │\n" printf "│ │\n"
# Print NVMe section
printf "│ NVMe [0d:00.0] │\n"
if [ -n "$nvme_drive" ]; then
local nvme_info=$(get_drive_smart_info "$nvme_drive")
printf "│ ┌────────────────────┐ │\n"
printf "│ │ %-18s │ │\n" "$nvme_drive"
printf "│ │ %-18s │ │\n" "$nvme_info"
printf "│ └────────────────────┘ │\n"
fi
# Print SATA drives section
printf "│ │\n" printf "│ │\n"
printf "│ Front Hot-swap Bays [0c:00.0] │\n" printf "│ │\n"
printf "│ │\n"
printf "│ medium2 │\n"
printf "│ │\n"
printf "│ │\n"
printf "│ │\n"
printf "│ ┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐┌────┐ │\n"
for i in {1..10}; do # Print drive info in vertical layout
local drive=$(echo "$sata_drives" | grep "ata-$i" || echo "") for row in {1..8}; do
printf "│ ┌────────────────────┐ │\n" printf "│ "
if [ -n "$drive" ]; then for bay in {1..10}; do
local size=$(get_drive_details "$drive") local drive=$(echo "$sata_drives" | grep "ata-$bay" || echo "")
if [ $row -eq 4 ]; then
printf "│ %-3d │" "$bay"
elif [ -n "$drive" ] && [ $row -eq 5 ]; then
local smart_info=$(get_drive_smart_info "$drive") local smart_info=$(get_drive_smart_info "$drive")
printf "│ │ Bay %-2d: %-10s │ │\n" "$i" "$drive" printf "│ %-3s │" "${smart_info:0:3}"
printf "│ │ %-18s │ │\n" "$size $smart_info"
else else
printf "│ │ Bay %-2d: [EMPTY] │ │\n" "$i" printf "│ │"
fi fi
printf "│ └────────────────────┘ │\n" done
printf " │\n"
done done
printf "│ └────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘ │\n"
printf "│ │\n"
printf "└──────────────────────────────────────────────────────────────┘\n" printf "└──────────────────────────────────────────────────────────────┘\n"
} }
microGeneric=''' microGeneric='''
┌─┐ ┌─┐ ┌─┐ ┌─┐
┌└─┘──└─┘┐ ┌└─┘──└─┘┐