Skip to content

Commit

Permalink
added breadcrumbs to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Tearran committed Sep 27, 2024
1 parent 7fd7d1d commit 9bf1871
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions lib/armbian-configng/config.ng.functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,13 @@ module_options+=(
#
generate_top_menu() {
local json_data=$1

local backtitle="$ARMBIAN $DISTRO $DISTROID $KERNELID"
while true; do
local menu_options=()

parse_menu_items menu_options

local OPTION=$($DIALOG --title "$TITLE" --backtitle "$BACKTITLE" --menu "Main" 0 80 9 "${menu_options[@]}" \
local OPTION=$($DIALOG --title "$TITLE" --backtitle "$backtitle" --menu "Choose an option:" 0 80 9 "${menu_options[@]}" \
--ok-button Select --cancel-button Exit 3>&1 1>&2 2>&3)
local exitstatus=$?

Expand All @@ -549,14 +549,19 @@ module_options+=(
# Function to generate the submenu
#
function generate_menu() {
local parent_id=$1
local parent_id="$1"
local top_parent_id="$2"
local backtitle="$ARMBIAN $DISTRO $DISTROID $KERNELID"
local status="$TITLE"

[[ "$parent_id" == "System" ]] && status=""

while true; do
# Get the submenu options for the current parent_id
local submenu_options=()
parse_menu_items submenu_options

local OPTION=$($DIALOG --title "$TITLE ($parent_id)" --backtitle "$BACKTITLE" --menu "$parent_id" 0 80 9 "${submenu_options[@]}" \
local OPTION=$($DIALOG --title "$status" --backtitle "$backtitle" --menu "$top_parent_id $parent_id options:" 0 80 9 "${submenu_options[@]}" \
--ok-button Select --cancel-button Back 3>&1 1>&2 2>&3)

local exitstatus=$?
Expand All @@ -570,7 +575,8 @@ function generate_menu() {
if [ "$submenu_count" -gt 0 ]; then
# If it does, generate a new menu for the submenu
[[ -n "$debug" ]] && echo "$OPTION"
generate_menu "$OPTION"
generate_menu "$OPTION" "$parent_id"

else
# If it doesn't, execute the command
[[ -n "$debug" ]] && echo "$OPTION"
Expand Down
4 changes: 2 additions & 2 deletions lib/armbian-configng/config.ng.jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"condition": "[[ -n $(ls /sbin/armbian-install) ]]"
},
{
"id": "S07.1",
"id": "SSH",
"description": "Manage SSH login options",
"sub": [
{
Expand Down Expand Up @@ -971,4 +971,4 @@
]
}
]
}
}

0 comments on commit 9bf1871

Please sign in to comment.