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 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 "│ B650D4U3-2Q/BCM │\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 "│ 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
local drive=$(echo "$sata_drives" | grep "ata-$i" || echo "")
printf "│ ┌────────────────────┐ │\n"
if [ -n "$drive" ]; then
local size=$(get_drive_details "$drive")
local smart_info=$(get_drive_smart_info "$drive")
printf "│ │ Bay %-2d: %-10s │ │\n" "$i" "$drive"
printf "│ │ %-18s │ │\n" "$size $smart_info"
else
printf "│ │ Bay %-2d: [EMPTY] │ │\n" "$i"
fi
printf "│ └────────────────────┘ │\n"
# Print drive info in vertical layout
for row in {1..8}; do
printf "│ "
for bay in {1..10}; do
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")
printf "│ %-3s │" "${smart_info:0:3}"
else
printf "│ "
fi
done
printf " │\n"
done
printf "│ └────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘└────┘ │\n"
printf "│ │\n"
printf "└──────────────────────────────────────────────────────────────┘\n"
}
microGeneric='''
┌─┐ ┌─┐
┌└─┘──└─┘┐