Also indicate if content server is running with HTTP or HTTPS

This commit is contained in:
Kovid Goyal 2019-11-10 17:58:07 +05:30
parent ffab572a9e
commit 228453fb48
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -68,11 +68,12 @@ class ShareConnMenu(QMenu): # {{{
from calibre.srv.opts import server_config
opts = server_config()
listen_on = verify_ipV4_address(opts.listen_on) or get_external_ip()
protocol = 'HTTPS' if opts.ssl_certfile and opts.ssl_keyfile else 'HTTP'
try:
ip_text = _(' [%(ip)s, port %(port)d]')%dict(
ip=listen_on, port=opts.port)
ip_text = ' ' + _('[{ip}, port {port}, {protocol}]').format(
ip=listen_on, port=opts.port, protocol=protocol)
except Exception:
ip_text = ' [%s]'%listen_on
ip_text = ' [{} {}]'.format(listen_on, protocol)
self.ip_text = ip_text
self.server_state_changed_signal.emit(running, ip_text)
text = _('Stop Content server') + ip_text