Fix 10-bay ASCII box alignment
Border was 130 columns wide but bay lines were 138. Widened border and all interior format strings to match the bay content width (136 interior = 138 total). Long controller descriptions are now truncated to prevent overflow. Ref #25 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -344,26 +344,29 @@ generate_10bay_layout() {
|
|||||||
# Fixed width for consistent box drawing (fits device names like "nvme0n1")
|
# Fixed width for consistent box drawing (fits device names like "nvme0n1")
|
||||||
local drive_width=10
|
local drive_width=10
|
||||||
|
|
||||||
|
# Box interior width = 136 (determined by 10 bay boxes: 4 + 10*13 + 2)
|
||||||
|
# Total box width = 138 (136 interior + 2 for │ borders)
|
||||||
|
|
||||||
# Main chassis section
|
# Main chassis section
|
||||||
printf "┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐\n"
|
printf "┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐\n"
|
||||||
printf "│ %-126s │\n" "$hostname - Sliger CX4712 (10x 3.5\" Hot-swap)"
|
printf "│ %-132s │\n" "$hostname - Sliger CX4712 (10x 3.5\" Hot-swap)"
|
||||||
printf "│ │\n"
|
printf "│%-136s│\n" ""
|
||||||
|
|
||||||
# Show storage controllers
|
# Show storage controllers
|
||||||
printf "│ Storage Controllers: │\n"
|
printf "│ %-134s│\n" "Storage Controllers:"
|
||||||
while IFS= read -r ctrl; do
|
while IFS= read -r ctrl; do
|
||||||
[[ -n "$ctrl" ]] && printf "│ %-126s│\n" "$ctrl"
|
[[ -n "$ctrl" ]] && printf "│ %-134.134s│\n" "$ctrl"
|
||||||
done < <(get_storage_controllers)
|
done < <(get_storage_controllers)
|
||||||
printf "│ │\n"
|
printf "│%-136s│\n" ""
|
||||||
|
|
||||||
# M.2 NVMe slot if present
|
# M.2 NVMe slot if present
|
||||||
if [[ -n "${DRIVE_MAP[m2-1]}" ]]; then
|
if [[ -n "${DRIVE_MAP[m2-1]}" ]]; then
|
||||||
printf "│ M.2 NVMe: %-10s │\n" "${DRIVE_MAP[m2-1]}"
|
printf "│ %-134s│\n" " M.2 NVMe: ${DRIVE_MAP[m2-1]}"
|
||||||
printf "│ │\n"
|
printf "│%-136s│\n" ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "│ Front Hot-swap Bays: │\n"
|
printf "│ %-134s│\n" " Front Hot-swap Bays:"
|
||||||
printf "│ │\n"
|
printf "│%-136s│\n" ""
|
||||||
|
|
||||||
# Bay top borders
|
# Bay top borders
|
||||||
printf "│ "
|
printf "│ "
|
||||||
@@ -386,7 +389,7 @@ generate_10bay_layout() {
|
|||||||
done
|
done
|
||||||
printf " │\n"
|
printf " │\n"
|
||||||
|
|
||||||
printf "└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n"
|
printf "└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user