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; }
|
[[ -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 – type subdomain only, suffix appended automatically
|
||||||
DOMAIN=$(gum input \
|
SUBDOMAIN=$(gum input \
|
||||||
--prompt " Domain: " \
|
--prompt " Subdomain: " \
|
||||||
--prompt.foreground "$ORANGE" \
|
--prompt.foreground "$ORANGE" \
|
||||||
--value ".marlow.quest" \
|
--placeholder "e.g. homarr (will become homarr.marlow.quest)" \
|
||||||
--width 40 \
|
--width 50 \
|
||||||
--cursor.foreground "$ORANGE")
|
--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 IP:port – pre-filled with common subnet prefix
|
||||||
UPSTREAM=$(gum input \
|
UPSTREAM=$(gum input \
|
||||||
@@ -123,7 +133,6 @@ add_config() {
|
|||||||
if [[ "$USE_TINYAUTH" == "Yes" ]]; then
|
if [[ "$USE_TINYAUTH" == "Yes" ]]; then
|
||||||
CONFIG_BLOCK="${DOMAIN} {
|
CONFIG_BLOCK="${DOMAIN} {
|
||||||
import tinyauth
|
import tinyauth
|
||||||
}
|
|
||||||
|
|
||||||
reverse_proxy ${UPSTREAM}
|
reverse_proxy ${UPSTREAM}
|
||||||
}"
|
}"
|
||||||
|
|||||||
Reference in New Issue
Block a user