fix cursor placement
This commit is contained in:
+16
-7
@@ -88,15 +88,25 @@ add_config() {
|
||||
|
||||
[[ -z "$SERVICE" ]] && { gum style --foreground "red" " Aborted – no service name given."; press_enter; return; }
|
||||
|
||||
# Domain – pre-filled with common suffix; type the subdomain then arrow to end
|
||||
DOMAIN=$(gum input \
|
||||
--prompt " Domain: " \
|
||||
# Domain – type subdomain only, suffix appended automatically
|
||||
SUBDOMAIN=$(gum input \
|
||||
--prompt " Subdomain: " \
|
||||
--prompt.foreground "$ORANGE" \
|
||||
--value ".marlow.quest" \
|
||||
--width 40 \
|
||||
--placeholder "e.g. homarr (will become homarr.marlow.quest)" \
|
||||
--width 50 \
|
||||
--cursor.foreground "$ORANGE")
|
||||
|
||||
[[ -z "$DOMAIN" ]] && { gum style --foreground "red" " Aborted – no domain given."; press_enter; return; }
|
||||
[[ -z "$SUBDOMAIN" ]] && { gum style --foreground "red" " Aborted – no domain given."; press_enter; return; }
|
||||
|
||||
# If they typed a full domain (contains a dot) use as-is, otherwise append suffix
|
||||
if [[ "$SUBDOMAIN" == *.* ]]; then
|
||||
DOMAIN="$SUBDOMAIN"
|
||||
else
|
||||
DOMAIN="${SUBDOMAIN}.marlow.quest"
|
||||
fi
|
||||
|
||||
gum style --foreground "$GREY_LIGHT" --margin "0 2" " → ${DOMAIN}"
|
||||
echo ""
|
||||
|
||||
# Upstream IP:port – pre-filled with common subnet prefix
|
||||
UPSTREAM=$(gum input \
|
||||
@@ -123,7 +133,6 @@ add_config() {
|
||||
if [[ "$USE_TINYAUTH" == "Yes" ]]; then
|
||||
CONFIG_BLOCK="${DOMAIN} {
|
||||
import tinyauth
|
||||
}
|
||||
|
||||
reverse_proxy ${UPSTREAM}
|
||||
}"
|
||||
|
||||
Reference in New Issue
Block a user