add ipv6 support to openBrowser method #263
This commit is contained in:
parent
3c24e5d34c
commit
b928cfc0d5
1 changed files with 4 additions and 1 deletions
|
@ -325,7 +325,10 @@ def openBrowser(agent):
|
||||||
if agent and agent != "False":
|
if agent and agent != "False":
|
||||||
print(f"Opening browser: {agent}...")
|
print(f"Opening browser: {agent}...")
|
||||||
ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1"
|
ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1"
|
||||||
url = f'http://{ui_ip}:{config.ui_port}/{config.homepage}'
|
if ':' in ui_ip: # IPv6
|
||||||
|
url = f'http://[{ui_ip}]:{config.ui_port}/{config.homepage}'
|
||||||
|
else: # IPv4
|
||||||
|
url = f'http://{ui_ip}:{config.ui_port}/{config.homepage}'
|
||||||
try:
|
try:
|
||||||
import subprocess
|
import subprocess
|
||||||
return subprocess.Popen([config.open_browser, url])
|
return subprocess.Popen([config.open_browser, url])
|
||||||
|
|
Loading…
Reference in a new issue