mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Link prefetch panels (#2748)
* Add link=prefetch to index.html * Improve http request logging
This commit is contained in:
parent
98c77dc08f
commit
9a575eb6d6
@ -196,6 +196,6 @@ class IndexView(HomeAssistantView):
|
|||||||
resp = template.render(
|
resp = template.render(
|
||||||
core_url=core_url, ui_url=ui_url, no_auth=no_auth,
|
core_url=core_url, ui_url=ui_url, no_auth=no_auth,
|
||||||
icons_url=icons_url, icons=FINGERPRINTS['mdi.html'],
|
icons_url=icons_url, icons=FINGERPRINTS['mdi.html'],
|
||||||
panel_url=panel_url)
|
panel_url=panel_url, panels=PANELS)
|
||||||
|
|
||||||
return self.Response(resp, mimetype='text/html')
|
return self.Response(resp, mimetype='text/html')
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
<link rel='icon' href='/static/icons/favicon.ico'>
|
<link rel='icon' href='/static/icons/favicon.ico'>
|
||||||
<link rel='apple-touch-icon' sizes='180x180'
|
<link rel='apple-touch-icon' sizes='180x180'
|
||||||
href='/static/icons/favicon-apple-180x180.png'>
|
href='/static/icons/favicon-apple-180x180.png'>
|
||||||
|
{% for panel in panels.values() -%}
|
||||||
|
<link rel='prefetch' href='{{ panel.url }}'>
|
||||||
|
{% endfor -%}
|
||||||
<meta name='apple-mobile-web-app-capable' content='yes'>
|
<meta name='apple-mobile-web-app-capable' content='yes'>
|
||||||
<meta name="msapplication-square70x70logo" content="/static/icons/tile-win-70x70.png"/>
|
<meta name="msapplication-square70x70logo" content="/static/icons/tile-win-70x70.png"/>
|
||||||
<meta name="msapplication-square150x150logo" content="/static/icons/tile-win-150x150.png"/>
|
<meta name="msapplication-square150x150logo" content="/static/icons/tile-win-150x150.png"/>
|
||||||
@ -86,9 +89,9 @@
|
|||||||
{# <script src='/static/home-assistant-polymer/build/_demo_data_compiled.js'></script> #}
|
{# <script src='/static/home-assistant-polymer/build/_demo_data_compiled.js'></script> #}
|
||||||
<script src='{{ core_url }}'></script>
|
<script src='{{ core_url }}'></script>
|
||||||
<link rel='import' href='{{ ui_url }}' onerror='initError()'>
|
<link rel='import' href='{{ ui_url }}' onerror='initError()'>
|
||||||
{% if panel_url %}
|
{% if panel_url -%}
|
||||||
<link rel='import' href='{{ panel_url }}' onerror='initError()' async>
|
<link rel='import' href='{{ panel_url }}' onerror='initError()' async>
|
||||||
{% endif %}
|
{% endif -%}
|
||||||
<link rel='import' href='{{ icons_url }}' async>
|
<link rel='import' href='{{ icons_url }}' async>
|
||||||
<script>
|
<script>
|
||||||
var webComponentsSupported = (
|
var webComponentsSupported = (
|
||||||
|
@ -473,16 +473,16 @@ class HomeAssistantView(object):
|
|||||||
self.hass.wsgi.api_password):
|
self.hass.wsgi.api_password):
|
||||||
authenticated = True
|
authenticated = True
|
||||||
|
|
||||||
if authenticated:
|
if self.requires_auth and not authenticated:
|
||||||
_LOGGER.info('Successful login/request from %s',
|
|
||||||
request.remote_addr)
|
|
||||||
elif self.requires_auth and not authenticated:
|
|
||||||
_LOGGER.warning('Login attempt or request with an invalid'
|
_LOGGER.warning('Login attempt or request with an invalid'
|
||||||
'password from %s', request.remote_addr)
|
'password from %s', request.remote_addr)
|
||||||
raise Unauthorized()
|
raise Unauthorized()
|
||||||
|
|
||||||
request.authenticated = authenticated
|
request.authenticated = authenticated
|
||||||
|
|
||||||
|
_LOGGER.info('Serving %s to %s (auth: %s)',
|
||||||
|
request.path, request.remote_addr, authenticated)
|
||||||
|
|
||||||
result = handler(request, **values)
|
result = handler(request, **values)
|
||||||
|
|
||||||
if isinstance(result, self.Response):
|
if isinstance(result, self.Response):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user