diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index 045d85c71e7..1cbb1f93067 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -76,11 +76,14 @@ class IndexView(HomeAssistantView): def get(self, request, entity_id=None): """Serve the index view.""" if self.hass.wsgi.development: - core_url = 'home-assistant-polymer/build/_core_compiled.js' - ui_url = 'home-assistant-polymer/src/home-assistant.html' + core_url = '/static/home-assistant-polymer/build/_core_compiled.js' + ui_url = '/static/home-assistant-polymer/src/home-assistant.html' + map_url = ('/static/home-assistant-polymer/src/layouts/' + 'partial-map.html') else: - core_url = 'core-{}.js'.format(version.CORE) - ui_url = 'frontend-{}.html'.format(version.UI) + core_url = '/static/core-{}.js'.format(version.CORE) + ui_url = '/static/frontend-{}.html'.format(version.UI) + map_url = '/static/partial-map-{}.html'.format(version.MAP) # auto login if no password was set if self.hass.config.api.api_password is None: @@ -88,14 +91,14 @@ class IndexView(HomeAssistantView): else: auth = 'false' - icons_url = 'mdi-{}.html'.format(mdi_version.VERSION) + icons_url = '/static/mdi-{}.html'.format(mdi_version.VERSION) template = self.templates.get_template('index.html') # pylint is wrong # pylint: disable=no-member resp = template.render( - core_url=core_url, ui_url=ui_url, auth=auth, + core_url=core_url, ui_url=ui_url, map_url=map_url, auth=auth, icons_url=icons_url, icons=mdi_version.VERSION) return self.Response(resp, mimetype='text/html') diff --git a/homeassistant/components/frontend/templates/index.html b/homeassistant/components/frontend/templates/index.html index 2c034058780..09e4d7e7f3a 100644 --- a/homeassistant/components/frontend/templates/index.html +++ b/homeassistant/components/frontend/templates/index.html @@ -64,8 +64,11 @@ document .getElementById('ha-init-skeleton') .classList.add('error'); - } - window.noAuth = {{ auth }} + }; + window.noAuth = {{ auth }}; + window.deferredLoading = { + map: '{{ map_url }}', + }; @@ -76,9 +79,9 @@ {# #} - - - + + + - \ No newline at end of file + clear: both;white-space:pre-wrap} \ No newline at end of file diff --git a/homeassistant/components/frontend/www_static/frontend.html.gz b/homeassistant/components/frontend/www_static/frontend.html.gz index ee1914f8dfe..6b23e77034b 100644 Binary files a/homeassistant/components/frontend/www_static/frontend.html.gz and b/homeassistant/components/frontend/www_static/frontend.html.gz differ diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index 6b226c02dab..78c8e680b2d 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit 6b226c02dab43e146b24cadd9e2668d4036e238b +Subproject commit 78c8e680b2deea335c2dc6f7e68e62df55c97a81 diff --git a/homeassistant/components/frontend/www_static/partial-map.html b/homeassistant/components/frontend/www_static/partial-map.html new file mode 100644 index 00000000000..a8037948657 --- /dev/null +++ b/homeassistant/components/frontend/www_static/partial-map.html @@ -0,0 +1,91 @@ + \ No newline at end of file diff --git a/homeassistant/components/frontend/www_static/partial-map.html.gz b/homeassistant/components/frontend/www_static/partial-map.html.gz new file mode 100644 index 00000000000..4407c1ecf2d Binary files /dev/null and b/homeassistant/components/frontend/www_static/partial-map.html.gz differ diff --git a/homeassistant/components/frontend/www_static/service_worker.js b/homeassistant/components/frontend/www_static/service_worker.js index 3e5b403998a..6191096f15e 100644 --- a/homeassistant/components/frontend/www_static/service_worker.js +++ b/homeassistant/components/frontend/www_static/service_worker.js @@ -29,7 +29,7 @@ /* eslint-disable quotes, comma-spacing */ -var PrecacheConfig = [["/","42f8a55847b7687eb5bf29637b5049c3"],["/devEvent","42f8a55847b7687eb5bf29637b5049c3"],["/devInfo","42f8a55847b7687eb5bf29637b5049c3"],["/devService","42f8a55847b7687eb5bf29637b5049c3"],["/devState","42f8a55847b7687eb5bf29637b5049c3"],["/devTemplate","42f8a55847b7687eb5bf29637b5049c3"],["/history","42f8a55847b7687eb5bf29637b5049c3"],["/logbook","42f8a55847b7687eb5bf29637b5049c3"],["/map","42f8a55847b7687eb5bf29637b5049c3"],["/states","42f8a55847b7687eb5bf29637b5049c3"],["/static/core-27fb37706dc723c31cc467edeabaae5e.js","863819dc100efdbbff2de424f9e9924c"],["/static/frontend-b0083f18b71bc0911d6e189e3b023dce.html","42f8a55847b7687eb5bf29637b5049c3"],["/static/mdi-758957b7ea989d6beca60e218ea7f7dd.html","4c32b01a3a5b194630963ff7ec4df36f"],["static/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["static/webcomponents-lite.min.js","b0f32ad3c7749c40d486603f31c9d8b1"]]; +var PrecacheConfig = [["/","c92b07b3335c166ffcc72a2da1d36909"],["/devEvent","c92b07b3335c166ffcc72a2da1d36909"],["/devInfo","c92b07b3335c166ffcc72a2da1d36909"],["/devService","c92b07b3335c166ffcc72a2da1d36909"],["/devState","c92b07b3335c166ffcc72a2da1d36909"],["/devTemplate","c92b07b3335c166ffcc72a2da1d36909"],["/history","c92b07b3335c166ffcc72a2da1d36909"],["/logbook","c92b07b3335c166ffcc72a2da1d36909"],["/map","c92b07b3335c166ffcc72a2da1d36909"],["/states","c92b07b3335c166ffcc72a2da1d36909"],["/static/core-190f3331fdbf7118e11c4ae1de3c197a.js","a881d94e39b965460813e25368fa8452"],["/static/frontend-a3bdf93df6b926a99bb427f8af684541.html","d00203ab83ec4b7c07b8d8c91b71b0d5"],["/static/mdi-758957b7ea989d6beca60e218ea7f7dd.html","4c32b01a3a5b194630963ff7ec4df36f"],["/static/partial-map-248e12589e3e3d10357adb46b1797ff3.html","cb27761f19029e2b26941d9e499696ca"],["static/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["static/webcomponents-lite.min.js","b0f32ad3c7749c40d486603f31c9d8b1"]]; /* eslint-enable quotes, comma-spacing */ var CacheNamePrefix = 'sw-precache-v1--' + (self.registration ? self.registration.scope : '') + '-'; diff --git a/homeassistant/components/frontend/www_static/service_worker.js.gz b/homeassistant/components/frontend/www_static/service_worker.js.gz index 20d247ec167..cbd92b181e2 100644 Binary files a/homeassistant/components/frontend/www_static/service_worker.js.gz and b/homeassistant/components/frontend/www_static/service_worker.js.gz differ diff --git a/script/build_frontend b/script/build_frontend index 4765e7f8b7b..d7207a51ac8 100755 --- a/script/build_frontend +++ b/script/build_frontend @@ -10,6 +10,8 @@ npm run frontend_prod cp bower_components/webcomponentsjs/webcomponents-lite.min.js .. cp build/frontend.html .. gzip build/frontend.html -c -k -9 > ../frontend.html.gz +cp build/partial-map.html .. +gzip build/partial-map.html -c -k -9 > ../partial-map.html.gz cp build/_core_compiled.js ../core.js gzip build/_core_compiled.js -c -k -9 > ../core.js.gz @@ -23,9 +25,11 @@ echo '"""DO NOT MODIFY. Auto-generated by build_frontend script."""' > version.p if [ $(command -v md5) ]; then echo 'CORE = "'`md5 -q www_static/core.js`'"' >> version.py echo 'UI = "'`md5 -q www_static/frontend.html`'"' >> version.py + echo 'MAP = "'`md5 -q www_static/partial-map.html`'"' >> version.py elif [ $(command -v md5sum) ]; then echo 'CORE = "'`md5sum www_static/core.js | cut -c-32`'"' >> version.py echo 'UI = "'`md5sum www_static/frontend.html | cut -c-32`'"' >> version.py + echo 'MAP = "'`md5sum www_static/partial-map.html | cut -c-32`'"' >> version.py else echo 'Could not find an MD5 utility' fi