mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
Show error message frontend if can't find server (#1886)
This commit is contained in:
parent
ba696888c1
commit
cc42f2d8be
@ -28,20 +28,55 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
margin-bottom: 123px;
|
margin-bottom: 97px;
|
||||||
|
font-family: Roboto, sans-serif;
|
||||||
|
font-size: 0pt;
|
||||||
|
transition: font-size 2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ha-init-skeleton paper-spinner {
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ha-init-skeleton a {
|
||||||
|
color: #03A9F4;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ha-init-skeleton.error {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ha-init-skeleton.error img,
|
||||||
|
#ha-init-skeleton.error paper-spinner {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<link rel='import' href='/static/{{ app_url }}' async>
|
<script>
|
||||||
|
function initError() {
|
||||||
|
document
|
||||||
|
.getElementById('ha-init-skeleton')
|
||||||
|
.classList.add('error');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<link rel='import' href='/static/{{ app_url }}' onerror='initError()' async>
|
||||||
</head>
|
</head>
|
||||||
<body fullbleed>
|
<body fullbleed>
|
||||||
<div id='ha-init-skeleton'><img src='/static/favicon-192x192.png' height='192'></div>
|
<div id='ha-init-skeleton'>
|
||||||
|
<img src='/static/favicon-192x192.png' height='192'>
|
||||||
|
<paper-spinner active></paper-spinner>
|
||||||
|
Home Assistant had trouble<br>connecting to the server.<br><br><a href='/'>TRY AGAIN</a>
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
var webComponentsSupported = ('registerElement' in document &&
|
var webComponentsSupported = (
|
||||||
|
'registerElement' in document &&
|
||||||
'import' in document.createElement('link') &&
|
'import' in document.createElement('link') &&
|
||||||
'content' in document.createElement('template'))
|
'content' in document.createElement('template'));
|
||||||
if (!webComponentsSupported) {
|
if (!webComponentsSupported) {
|
||||||
var script = document.createElement('script')
|
var script = document.createElement('script')
|
||||||
script.async = true
|
script.async = true
|
||||||
|
script.onerror = initError;
|
||||||
script.src = '/static/webcomponents-lite.min.js'
|
script.src = '/static/webcomponents-lite.min.js'
|
||||||
document.head.appendChild(script)
|
document.head.appendChild(script)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user