Merge pull request #2 from shavrin777/master

merge
This commit is contained in:
Evgenii Shavrin
2021-09-19 17:26:34 +03:00
committed by GitHub
10 changed files with 50 additions and 47 deletions

View File

@@ -38,14 +38,14 @@ ms_theme_ui(){
echo -e "| | "
echo -e "| R) [Remove Theme] | "
#echo -e "| | "
quit_footer
back_footer
}
ms_theme_menu(){
ms_theme_ui
while true; do
read -p "${cyan}Install theme:${default} " a; echo
if [ $a = "q" ] || [ $a = "Q" ]; then
if [ $a = "b" ] || [ $a = "B" ]; then
clear && advanced_menu && break
elif [ $a = "r" ] || [ $a = "R" ]; then
ms_theme_delete

View File

@@ -50,6 +50,25 @@ load_klipper_state(){
rollback_klipper
}
rollback_ui(){
top_border
echo -e "| $(title_msg "~~~~~~~~~~~~~ [ Rollback Menu ] ~~~~~~~~~~~~~") | "
hr
echo -e "| If serious errors occured after updating Klipper, | "
echo -e "| you can use this menu to return to the previously | "
echo -e "| used commit from which you have updated. | "
bottom_border
top_border
echo -e "| Active branch: ${green}$PRINT_BRANCH${default} | "
hr
echo -e "| Currently on commit: | "
echo -e "| $CURR_UI | "
hr
echo -e "| Commit last updated from: | "
echo -e "| $PREV_UI | "
back_footer
}
rollback_klipper(){
if [ "$PREVIOUS_COMMIT" != "0" ] && [ "$CURRENT_COMMIT" != "$PREVIOUS_COMMIT" ]; then
while true; do
@@ -66,7 +85,7 @@ rollback_klipper(){
load_klipper_state
break;;
N|n|No|no) clear; advanced_menu; break;;
Q|q) clear; advanced_menu; break;;
B|b) clear; advanced_menu; break;;
*)
print_unkown_cmd
print_msg && clear_msg;;

View File

@@ -18,7 +18,7 @@ advanced_ui(){
echo -e "| 6) [Get MCU ID] | | "
echo -e "| | CustomPiOS: | "
echo -e "| | 10) [Migration Helper] | "
quit_footer
back_footer
}
advanced_menu(){
@@ -72,7 +72,7 @@ advanced_menu(){
do_action "setup_gcode_shell_command" "advanced_ui";;
10)
do_action "migration_menu";;
Q|q)
B|b)
clear; main_menu; break;;
*)
deny_action "advanced_ui";;
@@ -99,7 +99,7 @@ switch_ui(){
echo -e "| dmbutyugin: | "
echo -e "| 2) [--> scurve-shaping] | "
echo -e "| 3) [--> scurve-smoothing] | "
quit_footer
back_footer
}
switch_menu(){
@@ -137,7 +137,7 @@ switch_menu(){
read_branch
print_msg && clear_msg
switch_ui;;
Q|q)
B|b)
clear; advanced_menu; break;;
*)
deny_action "switch_ui";;
@@ -151,28 +151,6 @@ switch_menu(){
#############################################################
#############################################################
rollback_ui(){
top_border
echo -e "| $(title_msg "~~~~~~~~~~~~~ [ Rollback Menu ] ~~~~~~~~~~~~~") | "
hr
echo -e "| If serious errors occured after updating Klipper, | "
echo -e "| you can use this menu to return to the previously | "
echo -e "| used commit from which you have updated. | "
bottom_border
top_border
echo -e "| Active branch: ${green}$PRINT_BRANCH${default} | "
hr
echo -e "| Currently on commit: | "
echo -e "| $CURR_UI | "
hr
echo -e "| Commit last updated from: | "
echo -e "| $PREV_UI | "
quit_footer
}
#############################################################
#############################################################
migration_ui(){
top_border
echo -e "| $(title_msg "~~~~~~~~~ [ CustomPiOS Migration ] ~~~~~~~~~~") | "
@@ -190,7 +168,7 @@ migration_ui(){
echo -e "| 1) [Migrate MainsailOS] | "
echo -e "| 2) [Migrate FluiddPi] | "
echo -e "| | "
quit_footer
back_footer
}
migration_menu(){
@@ -201,8 +179,8 @@ migration_menu(){
case "$action" in
1) migrate_custompios "mainsail"; migration_menu;;
2) migrate_custompios "fluiddpi"; migration_menu;;
Q|q) clear; advanced_menu; break;;
B|b) clear; advanced_menu; break;;
*) print_unkown_cmd; migration_menu;;
esac
done
}
}

View File

@@ -15,7 +15,7 @@ backup_ui(){
echo -e "| 3) [Moonraker DB] | 7) [Duet Web Control] | "
echo -e "| | 8) [OctoPrint] | "
echo -e "| | 9) [MoonrakerTelegramBot] | "
quit_footer
back_footer
}
backup_menu(){
@@ -43,11 +43,11 @@ backup_menu(){
do_action "backup_octoprint" "backup_ui";;
9)
do_action "backup_MoonrakerTelegramBot" "backup_ui";;
Q|q)
B|b)
clear; main_menu; break;;
*)
deny_action "backup_ui";;
esac
done
backup_menu
}
}

View File

@@ -21,6 +21,12 @@ quit_footer(){
bottom_border
}
back_footer(){
hr
echo -e "| ${green}B) Back${default} | "
bottom_border
}
print_header(){
top_border
echo -e "| $(title_msg "~~~~~~~~~~~~~~~~~ [ KIAUH ] ~~~~~~~~~~~~~~~~~") |"
@@ -60,4 +66,4 @@ deny_action(){
print_unkown_cmd
print_msg && clear_msg
$1
}
}

View File

@@ -17,7 +17,7 @@ install_ui(){
echo -e "| 4) [Fluidd] | | "
echo -e "| | Webcam: | "
echo -e "| | 10) [MJPG-Streamer] | "
quit_footer
back_footer
}
install_menu(){
@@ -45,7 +45,7 @@ install_menu(){
do_action "install_MoonrakerTelegramBot" "install_ui";;
10)
do_action "install_mjpg-streamer" "install_ui";;
Q|q)
B|b)
clear; main_menu; break;;
*)
deny_action "install_ui";;

View File

@@ -17,7 +17,7 @@ remove_ui(){
echo -e "| 4) [Fluidd] | 10) [MTelegramBot] | "
echo -e "| | | "
echo -e "| | 11) [NGINX] | "
quit_footer
back_footer
}
remove_menu(){
@@ -47,7 +47,7 @@ remove_menu(){
do_action "remove_MoonrakerTelegramBot" "remove_ui";;
11)
do_action "remove_nginx" "remove_ui";;
Q|q)
B|b)
clear; main_menu; break;;
*)
deny_action "remove_ui";;

View File

@@ -20,7 +20,7 @@ settings_ui(){
else
echo -e "| 1) Change config folder | "
fi
quit_footer
back_footer
}
settings_menu(){
@@ -34,7 +34,7 @@ settings_menu(){
else
deny_action "settings_ui"
fi;;
Q|q)
B|b)
clear; main_menu; break;;
*)
deny_action "settings_ui";;

View File

@@ -25,7 +25,7 @@ update_ui(){
echo -e "| 9) [MTelegramBot] | $LOCAL_MOONRAKERTELEGRAMBOT_COMMIT | $REMOTE_MOONRAKERTELEGRAMBOT_COMMIT | "
echo -e "| |------------------------------| "
echo -e "| 10) [System] | $DISPLAY_SYS_UPDATE | "
quit_footer
back_footer
}
update_menu(){
@@ -58,7 +58,7 @@ update_menu(){
do_action "update_system" "update_ui";;
a)
do_action "update_all" "update_ui";;
Q|q)
B|b)
clear; main_menu; break;;
*)
deny_action "update_ui";;

View File

@@ -71,10 +71,10 @@ upload_selection(){
printf "| $i) %-50s|\n" "${logfiles[$i]}"
i=$((i + 1))
done
quit_footer
back_footer
while true; do
read -p "${cyan}Please select:${default} " choice
if [ $choice = "q" ] || [ $choice = "Q" ]; then
if [ $choice = "b" ] || [ $choice = "B" ]; then
clear && main_menu && break
elif [ $choice -le ${#logfiles[@]} ]; then
upload_log "${logfiles[$choice]}"
@@ -101,4 +101,4 @@ upload_log(){
ERROR_MSG="File not found!" && print_msg && clear_msg
upload_selection
fi
}
}