From 674bcd956af57d527199431af1928c20d1aa2ae7 Mon Sep 17 00:00:00 2001 From: Dominik Dzienia Date: Sun, 20 Oct 2024 20:52:35 +0000 Subject: [PATCH] Fixed update dialog --- install.sh | 23 ++++++++++++++++------- src/lib.sh | 23 ++++++++++++++++------- updated | 2 +- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/install.sh b/install.sh index 05d1998..844cf5d 100644 --- a/install.sh +++ b/install.sh @@ -1085,7 +1085,7 @@ update_if_needed() { if [ "$onlineUpdated" == "$lastUpdate" ] || [ $# -eq 0 ]; then msgok "Scripts and config files are up to date" if [ $# -eq 1 ]; then - whiptail --title "Aktualizacja skryptów" --msgbox "$1" 7 50 + okdlg "Aktualizacja skryptów" "$1" fi else ohai "Updating scripts and config files" @@ -1139,16 +1139,25 @@ update_if_needed() { if [ "$changed" -eq 0 ]; then if [ $# -eq 1 ]; then - whiptail --title "Aktualizacja skryptów" --msgbox "$1" 7 50 + okdlg "Aktualizacja skryptów" "$1" fi else local okTxt="" if [ "$redeploy" -gt 0 ]; then - okTxt="${TL}${uni_warn} Aktualizacja spowoduje też restart i aktualizację kontenerów ${uni_warn}" + okTxt="${TL}${uni_warn} Aktualizacja zrestartuje i zaktualizuje kontenery ${uni_warn}" fi - whiptail --title "Aktualizacja skryptów" --yesno "Zalecana jest aktualizacja plików:\n\n${uni_bullet}Skrypt instalacyjny: $msgInst \n${uni_bullet}Konfiguracja deploymentu: $msgDep\n${uni_bullet}Konfiguracja Nightscout: $msgNs \n${uni_bullet}Kompozycja usług: $msgComp $okTxt" \ - --yes-button "$uni_confirm_upd" --no-button "$uni_resign" 15 70 + yesnodlg "Aktualizacja skryptów" "$uni_confirm_upd" "$uni_resign" \ + "Zalecana jest aktualizacja plików:" \ + "$( + pad_multiline \ + "${TL}${uni_bullet}Skrypt instalacyjny: $msgInst" \ + "${NL}${uni_bullet}Konfiguracja deploymentu: $msgDep" \ + "${NL}${uni_bullet}Konfiguracja Nightscout: $msgNs" \ + "${NL}${uni_bullet}Kompozycja usług: $msgComp${NL}" + )" \ + "$okTxt" + if ! [ $? -eq 1 ]; then if [ "$redeploy" -gt 0 ]; then docker_compose_down @@ -1174,7 +1183,7 @@ update_if_needed() { if ! [ "$instOnlineVer" == "$instLocalVer" ]; then ohai "Updating $TOOL_FILE" cp -fr "$UPDATES_DIR/install.sh" "$TOOL_FILE" - whiptail --title "Aktualizacja zakończona" --msgbox "Narzędzie zostanie uruchomione ponownie" 7 50 + okdlg "Aktualizacja zakończona" "Narzędzie zostanie uruchomione ponownie" ohai "Restarting tool" exec "$TOOL_FILE" fi @@ -2196,7 +2205,7 @@ uninstall_menu() { okdlg "Odinstalowano" \ "Odinstalowano Nightscout z Mikr.us-a" \ "${TL}Aby ponownie zainstalować, postępuj według instrukcji na stronie:" \ - "${NL}https://t1d.dzienia.pl/mikrus" \ + "${NL}https://t1d.dzienia.pl/nightscout_mikrus_tutorial" \ "${TL}Dziękujemy i do zobaczenia!" exit 0 diff --git a/src/lib.sh b/src/lib.sh index 1c6e459..057e297 100644 --- a/src/lib.sh +++ b/src/lib.sh @@ -1069,7 +1069,7 @@ update_if_needed() { if [ "$onlineUpdated" == "$lastUpdate" ] || [ $# -eq 0 ]; then msgok "Scripts and config files are up to date" if [ $# -eq 1 ]; then - whiptail --title "Aktualizacja skryptów" --msgbox "$1" 7 50 + okdlg "Aktualizacja skryptów" "$1" fi else ohai "Updating scripts and config files" @@ -1123,16 +1123,25 @@ update_if_needed() { if [ "$changed" -eq 0 ]; then if [ $# -eq 1 ]; then - whiptail --title "Aktualizacja skryptów" --msgbox "$1" 7 50 + okdlg "Aktualizacja skryptów" "$1" fi else local okTxt="" if [ "$redeploy" -gt 0 ]; then - okTxt="${TL}${uni_warn} Aktualizacja spowoduje też restart i aktualizację kontenerów ${uni_warn}" + okTxt="${TL}${uni_warn} Aktualizacja zrestartuje i zaktualizuje kontenery ${uni_warn}" fi - whiptail --title "Aktualizacja skryptów" --yesno "Zalecana jest aktualizacja plików:\n\n${uni_bullet}Skrypt instalacyjny: $msgInst \n${uni_bullet}Konfiguracja deploymentu: $msgDep\n${uni_bullet}Konfiguracja Nightscout: $msgNs \n${uni_bullet}Kompozycja usług: $msgComp $okTxt" \ - --yes-button "$uni_confirm_upd" --no-button "$uni_resign" 15 70 + yesnodlg "Aktualizacja skryptów" "$uni_confirm_upd" "$uni_resign" \ + "Zalecana jest aktualizacja plików:" \ + "$( + pad_multiline \ + "${TL}${uni_bullet}Skrypt instalacyjny: $msgInst" \ + "${NL}${uni_bullet}Konfiguracja deploymentu: $msgDep" \ + "${NL}${uni_bullet}Konfiguracja Nightscout: $msgNs" \ + "${NL}${uni_bullet}Kompozycja usług: $msgComp${NL}" + )" \ + "$okTxt" + if ! [ $? -eq 1 ]; then if [ "$redeploy" -gt 0 ]; then docker_compose_down @@ -1158,7 +1167,7 @@ update_if_needed() { if ! [ "$instOnlineVer" == "$instLocalVer" ]; then ohai "Updating $TOOL_FILE" cp -fr "$UPDATES_DIR/install.sh" "$TOOL_FILE" - whiptail --title "Aktualizacja zakończona" --msgbox "Narzędzie zostanie uruchomione ponownie" 7 50 + okdlg "Aktualizacja zakończona" "Narzędzie zostanie uruchomione ponownie" ohai "Restarting tool" exec "$TOOL_FILE" fi @@ -2180,7 +2189,7 @@ uninstall_menu() { okdlg "Odinstalowano" \ "Odinstalowano Nightscout z Mikr.us-a" \ "${TL}Aby ponownie zainstalować, postępuj według instrukcji na stronie:" \ - "${NL}https://t1d.dzienia.pl/mikrus" \ + "${NL}https://t1d.dzienia.pl/nightscout_mikrus_tutorial" \ "${TL}Dziękujemy i do zobaczenia!" exit 0 diff --git a/updated b/updated index 302a8c9..06733ce 100644 --- a/updated +++ b/updated @@ -1 +1 @@ -2024-10-20T12:07:40.865Z \ No newline at end of file +2024-10-20T20:51:23.353Z \ No newline at end of file