mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-13 18:44:29 +05:00
refactor!: update KIAUH for recent moonraker changes (#245)
This commit is contained in:
@@ -55,17 +55,35 @@ function install_menu() {
|
||||
4)
|
||||
do_action "install_fluidd" "install_ui";;
|
||||
5)
|
||||
do_action "install_klipperscreen" "install_ui";;
|
||||
#do_action "install_klipperscreen" "install_ui";;
|
||||
clear && print_header
|
||||
print_error "Function currently disabled! Sorry!"
|
||||
install_ui;;
|
||||
6)
|
||||
do_action "octoprint_setup_dialog" "install_ui";;
|
||||
#do_action "octoprint_setup_dialog" "install_ui";;
|
||||
clear && print_header
|
||||
print_error "Function currently disabled! Sorry!"
|
||||
install_ui;;
|
||||
7)
|
||||
do_action "install_pgc_for_klipper" "install_ui";;
|
||||
#do_action "install_pgc_for_klipper" "install_ui";;
|
||||
clear && print_header
|
||||
print_error "Function currently disabled! Sorry!"
|
||||
install_ui;;
|
||||
8)
|
||||
do_action "telegram_bot_setup_dialog" "install_ui";;
|
||||
#do_action "telegram_bot_setup_dialog" "install_ui";;
|
||||
clear && print_header
|
||||
print_error "Function currently disabled! Sorry!"
|
||||
install_ui;;
|
||||
9)
|
||||
do_action "moonraker_obico_setup_dialog" "install_ui";;
|
||||
#do_action "moonraker_obico_setup_dialog" "install_ui";;
|
||||
clear && print_header
|
||||
print_error "Function currently disabled! Sorry!"
|
||||
install_ui;;
|
||||
10)
|
||||
do_action "install_mjpg-streamer" "install_ui";;
|
||||
#do_action "install_mjpg-streamer" "install_ui";;
|
||||
clear && print_header
|
||||
print_error "Function currently disabled! Sorry!"
|
||||
install_ui;;
|
||||
B|b)
|
||||
clear; main_menu; break;;
|
||||
*)
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
set -e
|
||||
|
||||
function main_ui() {
|
||||
echo -e "${yellow}/=======================================================\\"
|
||||
echo -e "| Please read the newest changelog carefully: |"
|
||||
echo -e "| https://git.io/JnmlX |"
|
||||
echo -e "\=======================================================/${white}"
|
||||
top_border
|
||||
echo -e "| $(title_msg "~~~~~~~~~~~~~~~ [ Main Menu ] ~~~~~~~~~~~~~~~") |"
|
||||
hr
|
||||
@@ -83,7 +87,8 @@ function print_klipper_repo() {
|
||||
|
||||
|
||||
function main_menu() {
|
||||
print_header && main_ui
|
||||
clear && print_header
|
||||
main_ui
|
||||
|
||||
### initialize kiauh.ini
|
||||
init_ini
|
||||
@@ -103,8 +108,9 @@ function main_menu() {
|
||||
"restart octoprint") do_action_service "restart" "octoprint"; main_ui;;
|
||||
update) do_action "update_kiauh" "main_ui";;
|
||||
0)clear && print_header
|
||||
upload_selection
|
||||
break;;
|
||||
#upload_selection
|
||||
print_error "Function currently disabled! Sorry!"
|
||||
main_ui;;
|
||||
1)clear && print_header
|
||||
install_menu
|
||||
break;;
|
||||
@@ -118,8 +124,9 @@ function main_menu() {
|
||||
advanced_menu
|
||||
break;;
|
||||
5)clear && print_header
|
||||
backup_menu
|
||||
break;;
|
||||
#backup_menu
|
||||
print_error "Function currently disabled! Sorry!"
|
||||
main_ui;;
|
||||
6)clear && print_header
|
||||
settings_menu
|
||||
break;;
|
||||
@@ -130,5 +137,5 @@ function main_menu() {
|
||||
deny_action "main_ui";;
|
||||
esac
|
||||
done
|
||||
clear; main_menu
|
||||
main_menu
|
||||
}
|
||||
|
||||
@@ -14,20 +14,12 @@ set -e
|
||||
function settings_ui() {
|
||||
read_kiauh_ini "${FUNCNAME[0]}"
|
||||
|
||||
local custom_cfg_loc="${custom_klipper_cfg_loc}"
|
||||
local custom_repo="${custom_klipper_repo}"
|
||||
local custom_branch="${custom_klipper_repo_branch}"
|
||||
local ms_pre_rls="${mainsail_install_unstable}"
|
||||
local fl_pre_rls="${fluidd_install_unstable}"
|
||||
local bbu="${backup_before_update}"
|
||||
|
||||
### config location
|
||||
if [[ -z ${custom_cfg_loc} ]]; then
|
||||
custom_cfg_loc="${cyan}${KLIPPER_CONFIG}${white}"
|
||||
else
|
||||
custom_cfg_loc="${cyan}${custom_cfg_loc}${white}"
|
||||
fi
|
||||
|
||||
### custom repository
|
||||
custom_repo=$(echo "${custom_repo}" | sed "s/https:\/\/github\.com\///" | sed "s/\.git$//" )
|
||||
if [[ -z ${custom_repo} ]]; then
|
||||
@@ -67,8 +59,6 @@ function settings_ui() {
|
||||
echo -e "| $(title_msg "~~~~~~~~~~~~ [ KIAUH Settings ] ~~~~~~~~~~~~~") |"
|
||||
hr
|
||||
echo -e "| Klipper: |"
|
||||
echo -e "| ● Config folder: |"
|
||||
printf "| %-60s|\n" "${custom_cfg_loc}"
|
||||
echo -e "| ● Repository: |"
|
||||
printf "| %-70s|\n" "${custom_repo} (${custom_branch})"
|
||||
hr
|
||||
@@ -77,24 +67,23 @@ function settings_ui() {
|
||||
hr
|
||||
printf "| Backup before updating: %-42s|\n" "${bbu}"
|
||||
hr
|
||||
echo -e "| 1) Change Klipper config folder location |"
|
||||
echo -e "| 2) Set custom Klipper repository |"
|
||||
echo -e "| 1) Set custom Klipper repository |"
|
||||
blank_line
|
||||
if [[ ${mainsail_install_unstable} == "false" ]]; then
|
||||
echo -e "| 3) ${green}Allow${white} unstable Mainsail releases |"
|
||||
echo -e "| 2) ${green}Allow${white} unstable Mainsail releases |"
|
||||
else
|
||||
echo -e "| 3) ${red}Disallow${white} unstable Mainsail releases |"
|
||||
echo -e "| 2) ${red}Disallow${white} unstable Mainsail releases |"
|
||||
fi
|
||||
if [[ ${fluidd_install_unstable} == "false" ]]; then
|
||||
echo -e "| 4) ${green}Allow${white} unstable Fluidd releases |"
|
||||
echo -e "| 3) ${green}Allow${white} unstable Fluidd releases |"
|
||||
else
|
||||
echo -e "| 4) ${red}Disallow${white} unstable Fluidd releases |"
|
||||
echo -e "| 3) ${red}Disallow${white} unstable Fluidd releases |"
|
||||
fi
|
||||
blank_line
|
||||
if [[ ${backup_before_update} == "false" ]]; then
|
||||
echo -e "| 5) ${green}Enable${white} automatic backups before updates |"
|
||||
echo -e "| 4) ${green}Enable${white} automatic backups before updates |"
|
||||
else
|
||||
echo -e "| 5) ${red}Disable${white} automatic backups before updates |"
|
||||
echo -e "| 4) ${red}Disable${white} automatic backups before updates |"
|
||||
fi
|
||||
back_help_footer
|
||||
}
|
||||
@@ -105,16 +94,6 @@ function show_settings_help() {
|
||||
top_border
|
||||
echo -e "| ~~~~~~ < ? > Help: KIAUH Settings < ? > ~~~~~~ |"
|
||||
hr
|
||||
echo -e "| ${cyan}Klipper config folder:${white} |"
|
||||
echo -e "| The location of your printer.cfg and all other config |"
|
||||
echo -e "| files that gets used during installation of Klipper |"
|
||||
echo -e "| and all other components which need that location. |"
|
||||
echo -e "| It is not recommended to change this location. |"
|
||||
echo -e "| Be advised, that negative side effects could occur. |"
|
||||
blank_line
|
||||
printf "| Default: %-55s|\n" "${default_cfg}"
|
||||
blank_line
|
||||
hr
|
||||
echo -e "| ${cyan}Install unstable releases:${white} |"
|
||||
echo -e "| If set to ${green}true${white}, KIAUH installs/updates the software |"
|
||||
echo -e "| with the latest, currently available release. |"
|
||||
@@ -160,20 +139,16 @@ function settings_menu() {
|
||||
read -p "${cyan}####### Perform action:${white} " action
|
||||
case "${action}" in
|
||||
1)
|
||||
clear && print_header
|
||||
change_klipper_cfg_folder
|
||||
settings_ui;;
|
||||
2)
|
||||
clear && print_header
|
||||
change_klipper_repo_menu
|
||||
settings_ui;;
|
||||
3)
|
||||
2)
|
||||
switch_mainsail_releasetype
|
||||
settings_menu;;
|
||||
4)
|
||||
3)
|
||||
switch_fluidd_releasetype
|
||||
settings_menu;;
|
||||
5)
|
||||
4)
|
||||
toggle_backup_before_update
|
||||
settings_menu;;
|
||||
B|b)
|
||||
|
||||
Reference in New Issue
Block a user