Files
kiauh/scripts/ui/update_menu.sh
th33xitus 562d7df416 style: add copyright header
Signed-off-by: Dominik Willner th33xitus@gmail.com
2022-05-12 20:57:59 +02:00

76 lines
3.0 KiB
Bash
Executable File

#!/bin/bash
#=======================================================================#
# Copyright (C) 2020 - 2022 Dominik Willner <th33xitus@gmail.com> #
# #
# This file is part of KIAUH - Klipper Installation And Update Helper #
# https://github.com/th33xitus/kiauh #
# #
# This file may be distributed under the terms of the GNU GPLv3 license #
#=======================================================================#
set -e
update_ui(){
ui_print_versions
top_border
echo -e "| ${green}~~~~~~~~~~~~~~ [ Update Menu ] ~~~~~~~~~~~~~~${white} | "
hr
echo -e "| 0) ${BB4U_STATUS}| "
hr
echo -e "| a) [Update all] | | | "
echo -e "| | Installed: | Latest: | "
echo -e "| Klipper & API : |---------------|--------------| "
echo -e "| 1) [Klipper] |$(compare_klipper_versions)| "
echo -e "| 2) [Moonraker] |$(compare_moonraker_versions)| "
echo -e "| | | | "
echo -e "| Webinterface: |---------------|--------------| "
echo -e "| 3) [Mainsail] | $MAINSAIL_LOCAL_VER | $MAINSAIL_REMOTE_VER | "
echo -e "| 4) [Fluidd] | $FLUIDD_LOCAL_VER | $FLUIDD_REMOTE_VER | "
echo -e "| | | | "
echo -e "| Touchscreen GUI: |---------------|--------------| "
echo -e "| 5) [KlipperScreen] | $LOCAL_KLIPPERSCREEN_COMMIT | $REMOTE_KLIPPERSCREEN_COMMIT | "
echo -e "| | | | "
echo -e "| Other: |---------------|--------------| "
echo -e "| 6) [PrettyGCode] | $LOCAL_PGC_COMMIT | $REMOTE_PGC_COMMIT | "
echo -e "| 7) [Telegram Bot] | $LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT | $REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT | "
echo -e "| |------------------------------| "
echo -e "| 8) [System] | $DISPLAY_SYS_UPDATE | "
back_footer
}
update_menu(){
read_bb4u_stat
do_action "" "update_ui"
while true; do
read -p "${cyan}Perform action:${white} " action; echo
case "${action}" in
0)
do_action "toggle_backups" "update_ui";;
1)
do_action "update_klipper" "update_ui";;
2)
do_action "update_moonraker" "update_ui";;
3)
do_action "update_mainsail" "update_ui";;
4)
do_action "update_fluidd" "update_ui";;
5)
do_action "update_klipperscreen" "update_ui";;
6)
do_action "update_pgc_for_klipper" "update_ui";;
7)
do_action "update_MoonrakerTelegramBot" "update_ui";;
8)
do_action "update_system" "update_ui";;
a)
do_action "update_all" "update_ui";;
B|b)
clear; main_menu; break;;
*)
deny_action "update_ui";;
esac
done
update_menu
}