feat: KIAUH v4.0.0 (#191)

This commit is contained in:
th33xitus
2022-05-29 20:11:15 +02:00
committed by GitHub
parent 4bf9e8f0a8
commit fcf059df73
64 changed files with 6489 additions and 5889 deletions

View File

@@ -1,39 +1,49 @@
update_ui(){
ui_print_versions
#!/usr/bin/env 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
function update_ui() {
top_border
echo -e "| ${green}~~~~~~~~~~~~~~ [ Update Menu ] ~~~~~~~~~~~~~~${default} | "
echo -e "| ${green}~~~~~~~~~~~~~~ [ Update Menu ] ~~~~~~~~~~~~~~${white} |"
hr
echo -e "| 0) $BB4U_STATUS| "
hr
echo -e "| a) [Update all] | | | "
echo -e "| | Local Vers: | Remote Vers: | "
echo -e "| Klipper/Klipper API: |---------------|--------------| "
echo -e "| 1) [Klipper] | $LOCAL_COMMIT | $REMOTE_COMMIT | "
echo -e "| 2) [Moonraker] | $LOCAL_MOONRAKER_COMMIT | $REMOTE_MOONRAKER_COMMIT | "
echo -e "| | | | "
echo -e "| Klipper 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) [DWC2-for-Klipper] | $LOCAL_DWC2FK_COMMIT | $REMOTE_DWC2FK_COMMIT | "
echo -e "| 7) [DWC2 Web UI] | $DWC2_LOCAL_VER | $DWC2_REMOTE_VER | "
echo -e "| 8) [PrettyGCode] | $LOCAL_PGC_COMMIT | $REMOTE_PGC_COMMIT | "
echo -e "| 9) [Telegram Bot] | $LOCAL_MOONRAKER_TELEGRAM_BOT_COMMIT | $REMOTE_MOONRAKER_TELEGRAM_BOT_COMMIT | "
echo -e "| |------------------------------| "
echo -e "| 10) [System] | $DISPLAY_SYS_UPDATE | "
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 "| Klipper Webinterface: |---------------|--------------|"
echo -e "| 3) [Mainsail] |$(compare_mainsail_versions)|"
echo -e "| 4) [Fluidd] |$(compare_fluidd_versions)|"
echo -e "| | | |"
echo -e "| Touchscreen GUI: |---------------|--------------|"
echo -e "| 5) [KlipperScreen] |$(compare_klipperscreen_versions)|"
echo -e "| | | |"
echo -e "| Other: |---------------|--------------|"
echo -e "| 6) [PrettyGCode] |$(compare_prettygcode_versions)|"
echo -e "| 7) [Telegram Bot] |$(compare_telegram_bot_versions)|"
echo -e "| |------------------------------|"
echo -e "| 8) [System] | $(check_system_updates) |"
back_footer
}
update_menu(){
read_bb4u_stat
function update_menu() {
unset update_arr
do_action "" "update_ui"
local action
while true; do
read -p "${cyan}Perform action:${default} " action; echo
case "$action" in
read -p "${cyan}####### Perform action:${white} " action
case "${action}" in
0)
do_action "toggle_backups" "update_ui";;
1)
@@ -47,14 +57,10 @@ update_menu(){
5)
do_action "update_klipperscreen" "update_ui";;
6)
do_action "update_dwc2fk" "update_ui";;
7)
do_action "update_dwc2" "update_ui";;
8)
do_action "update_pgc_for_klipper" "update_ui";;
9)
do_action "update_MoonrakerTelegramBot" "update_ui";;
10)
7)
do_action "update_telegram_bot" "update_ui";;
8)
do_action "update_system" "update_ui";;
a)
do_action "update_all" "update_ui";;
@@ -66,3 +72,60 @@ update_menu(){
done
update_menu
}
function update_all() {
while true; do
if (( ${#update_arr[@]} == 0 )); then
print_confirm "Everything is already up-to-date!"
echo; break
fi
echo
top_border
echo -e "| The following installations will be updated: |"
if [[ "${KLIPPER_UPDATE_AVAIL}" = "true" ]]; then
echo -e "| ${cyan}● Klipper${white} |"
fi
if [[ "${MOONRAKER_UPDATE_AVAIL}" = "true" ]]; then
echo -e "| ${cyan}● Moonraker${white} |"
fi
if [[ "${MAINSAIL_UPDATE_AVAIL}" = "true" ]]; then
echo -e "| ${cyan}● Mainsail${white} |"
fi
if [[ "${FLUIDD_UPDATE_AVAIL}" = "true" ]]; then
echo -e "| ${cyan}● Fluidd${white} |"
fi
if [[ "${KLIPPERSCREEN_UPDATE_AVAIL}" = "true" ]]; then
echo -e "| ${cyan}● KlipperScreen${white} |"
fi
if [[ "${PGC_UPDATE_AVAIL}" = "true" ]]; then
echo -e "| ${cyan}● PrettyGCode for Klipper${white} |"
fi
if [[ "${MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL}" = "true" ]]; then
echo -e "| ${cyan}● MoonrakerTelegramBot${white} |"
fi
if [[ "${SYS_UPDATE_AVAIL}" = "true" ]]; then
echo -e "| ${cyan}● System${white} |"
fi
bottom_border
local yn
if (( ${#update_arr[@]} != 0 )); then
read -p "${cyan}###### Do you want to proceed? (Y/n):${white} " yn
case "${yn}" in
Y|y|Yes|yes|"")
for update in "${update_arr[@]}"
do
#shellcheck disable=SC2250
$update
done
break;;
N|n|No|no)
break;;
*)
print_unkown_cmd
print_msg && clear_msg;;
esac
fi
done
}