mdoify dialog maxxy

This commit is contained in:
Ing 2024-07-26 15:25:20 +08:00
parent 1717c89851
commit a6a08af551

View File

@ -897,10 +897,8 @@ function cmdlineMenu() {
while read -r line; do LINENUM=$((LINENUM + 1 + ${#line} / 96)); done <<<"$(printf "${MSG}")" # When the width is 100, each line displays 96 characters. while read -r line; do LINENUM=$((LINENUM + 1 + ${#line} / 96)); done <<<"$(printf "${MSG}")" # When the width is 100, each line displays 96 characters.
LINENUM=$((${LINENUM:-0} + 9)) # When there are 2 parameters, 9 is the minimum value to include 1 line of MSG. LINENUM=$((${LINENUM:-0} + 9)) # When there are 2 parameters, 9 is the minimum value to include 1 line of MSG.
dialog --print-maxsize 2>"${TMP_PATH}/maxsize" DIALOG_MAXX=$(ttysize 2>/dev/null | awk '{print $1}')
DIALOG_MAXX=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f2 | xargs) DIALOG_MAXY=$(ttysize 2>/dev/null | awk '{print $2}')
DIALOG_MAXY=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f1 | xargs)
if [ ${LINENUM:-0} -ge ${DIALOG_MAXY:-0} ]; then if [ ${LINENUM:-0} -ge ${DIALOG_MAXY:-0} ]; then
MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")" MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")"
LINENUM=9 LINENUM=9
@ -1044,10 +1042,8 @@ function synoinfoMenu() {
while read -r line; do LINENUM=$((LINENUM + 1 + ${#line} / 96)); done <<<"$(printf "${MSG}")" # When the width is 100, each line displays 96 characters. while read -r line; do LINENUM=$((LINENUM + 1 + ${#line} / 96)); done <<<"$(printf "${MSG}")" # When the width is 100, each line displays 96 characters.
LINENUM=$((${LINENUM:-0} + 9)) # When there are 2 parameters, 9 is the minimum value to include 1 line of MSG. LINENUM=$((${LINENUM:-0} + 9)) # When there are 2 parameters, 9 is the minimum value to include 1 line of MSG.
dialog --print-maxsize 2>"${TMP_PATH}/maxsize" DIALOG_MAXX=$(ttysize 2>/dev/null | awk '{print $1}')
DIALOG_MAXX=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f2 | xargs) DIALOG_MAXY=$(ttysize 2>/dev/null | awk '{print $2}')
DIALOG_MAXY=$(cat "${TMP_PATH}/maxsize" 2>/dev/null | grep "MaxSize" | awk -F: '{print $2}' | cut -d, -f1 | xargs)
if [ ${LINENUM:-0} -ge ${DIALOG_MAXY:-0} ]; then if [ ${LINENUM:-0} -ge ${DIALOG_MAXY:-0} ]; then
MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")" MSG="$(TEXT "Please enter the parameter key and value you need to add.\n")"
LINENUM=9 LINENUM=9