If interface "*" is used open correctly on click
This commit is contained in:
parent
b961a3fb0a
commit
708acdf6f7
2 changed files with 5 additions and 3 deletions
|
@ -37,6 +37,8 @@ class ActionsPlugin(object):
|
|||
def hideIcon():
|
||||
icon.die()
|
||||
|
||||
ui_ip = config.ui_ip if config.ui_ip != "*" else "127.0.0.1"
|
||||
|
||||
icon.items = (
|
||||
(self.titleIp, False),
|
||||
(self.titleConnections, False),
|
||||
|
@ -49,13 +51,13 @@ class ActionsPlugin(object):
|
|||
("ZeroNet Github", lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet")),
|
||||
("Report bug/request feature", lambda: self.opensite("https://github.com/HelloZeroNet/ZeroNet/issues")),
|
||||
"--",
|
||||
("!Open ZeroNet", lambda: self.opensite("http://%s:%s" % (config.ui_ip, config.ui_port))),
|
||||
("!Open ZeroNet", lambda: self.opensite("http://%s:%s" % (ui_ip, config.ui_port))),
|
||||
"--",
|
||||
("Quit", self.quit),
|
||||
|
||||
)
|
||||
|
||||
icon.clicked = lambda: self.opensite("http://%s:%s" % (config.ui_ip, config.ui_port))
|
||||
icon.clicked = lambda: self.opensite("http://%s:%s" % (ui_ip, config.ui_port))
|
||||
gevent.threadpool.start_new_thread(icon._run, ()) # Start in real thread (not gevent compatible)
|
||||
super(ActionsPlugin, self).main()
|
||||
icon._die = True
|
||||
|
|
|
@ -115,7 +115,7 @@ class UiServer:
|
|||
browser = webbrowser.get()
|
||||
else:
|
||||
browser = webbrowser.get(config.open_browser)
|
||||
browser.open("http://%s:%s" % (config.ui_ip, config.ui_port), new=2)
|
||||
browser.open("http://%s:%s" % (config.ui_ip if config.ui_ip != "*" else "127.0.0.1", config.ui_port), new=2)
|
||||
|
||||
self.server = WSGIServer((self.ip.replace("*", ""), self.port), handler, handler_class=UiWSGIHandler, log=self.log)
|
||||
self.server.sockets = {}
|
||||
|
|
Loading…
Reference in a new issue