From: Calin Crisan Date: Tue, 31 Mar 2015 16:20:57 +0000 (+0300) Subject: added support for ?title= argument; the hostname is now used as title by X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=914619bc3d646df8c86340deb4e0ddeeaf1938a6;p=motioneye-debian added support for ?title= argument; the hostname is now used as title by default --- diff --git a/src/handlers.py b/src/handlers.py index 12a302a..8f61823 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -154,6 +154,7 @@ class MainHandler(BaseHandler): main_sections=main_sections, camera_sections=camera_sections, hostname=socket.gethostname(), + title=self.get_argument('title', None), admin_username=config.get_main().get('@admin_username'), old_motion=config.is_old_motion()) diff --git a/static/js/main.js b/static/js/main.js index 96731b5..aeaf8a0 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -3654,7 +3654,7 @@ $(document).ready(function () { } else { - baseUri = qualifyUri(''); + baseUri = splitUrl(qualifyUri('')).baseUrl; /* restore the username from cookie */ window.username = getCookie('username'); diff --git a/templates/main.html b/templates/main.html index 7760b2c..1bbf8eb 100644 --- a/templates/main.html +++ b/templates/main.html @@ -46,7 +46,7 @@ {%- endmacro %} -{% block title %}{% if title %}{{title}}{% else %}motionEye{% endif %}{% endblock %} +{% block title %}{% if title %}{{title}}{% else %}{{hostname}}{% endif %}{% endblock %} {% block style %} {{super()}}