diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f5725..624c42f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -120,6 +120,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Script version bumped to 1.1.0 for multi-target support ### Changed +- **Improved menu flow for viewing target details** + - "View target details" moved from main menu option 6 to sub-menu under "List all backup targets" + - After listing targets, users can choose: + - View target details (select target to see comprehensive info) + - Back to main menu + - Main menu reduced from 8 options to 7 (cleaner, more focused) + - More intuitive workflow: list → view details → back to menu - **Target selection now accepts both numbers and names** - All target selection prompts now accept either: - Target number from the displayed list (e.g., "1") diff --git a/pbs-client-installer.sh b/pbs-client-installer.sh index 7784f3d..daf076a 100755 --- a/pbs-client-installer.sh +++ b/pbs-client-installer.sh @@ -1979,14 +1979,41 @@ main() { echo " 3) Edit existing target" echo " 4) Delete target" echo " 5) Run backup now (select target)" - echo " 6) View target details" - echo " 7) Reinstall PBS client" - echo " 8) Exit" - ACTION=$(prompt "Select option [1-8]" "8") + echo " 6) Reinstall PBS client" + echo " 7) Exit" + ACTION=$(prompt "Select option [1-7]" "7") case "$ACTION" in 1) show_targets_list + echo + echo "Options:" + echo " 1) View target details" + echo " 2) Back to main menu" + SUBACTION=$(prompt "Select option [1/2]" "2") + + case "$SUBACTION" in + 1) + echo + echo "Available targets:" + list_targets | nl + echo + USER_INPUT=$(prompt "Enter target number or name to view" "") + + if [ -n "$USER_INPUT" ]; then + TARGET_NAME=$(resolve_target_input "$USER_INPUT") + if [ -n "$TARGET_NAME" ] && validate_target_name "$TARGET_NAME"; then + show_target_detail "$TARGET_NAME" + fi + fi + ;; + 2) + # Just continue to main menu + ;; + *) + warn "Invalid option, returning to main menu" + ;; + esac ;; 2) add_target @@ -2027,33 +2054,11 @@ main() { run_backup_for_target "$TARGET_NAME" ;; 6) - echo - echo "Available targets:" - list_targets | nl - echo - USER_INPUT=$(prompt "Enter target number or name to view" "") - - if [ -z "$USER_INPUT" ]; then - error "No target specified" - continue - fi - - TARGET_NAME=$(resolve_target_input "$USER_INPUT") - if [ -z "$TARGET_NAME" ]; then - error "Invalid target number: $USER_INPUT" - continue - fi - - if validate_target_name "$TARGET_NAME"; then - show_target_detail "$TARGET_NAME" - fi - ;; - 7) info "Reinstalling PBS client..." install_pbs_client log "PBS client reinstalled successfully" ;; - 8) + 7) info "Exiting" exit 0 ;;