idee to look every 15s ...
This commit is contained in:
parent
348ea73a0e
commit
6b93c8ead4
@ -16,13 +16,23 @@
|
|||||||
<img id={{ $id }} src="{{ $img_off }}" alt="Off">
|
<img id={{ $id }} src="{{ $img_off }}" alt="Off">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
var imgping = new Image();
|
|
||||||
imgping.src = '{{ $opt1 }}';
|
function imgping(id,url){
|
||||||
if(imgping.height>0){
|
while (true) {
|
||||||
document.getElementById("{{ $id }}").outerHTML ='<img src="{{ $img_on }}" alt="On">';
|
function Sleep(milliseconds) {
|
||||||
} else {
|
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
||||||
document.getElementById("{{ $id }}").outerHTML ='<img src="{{ $img_off }}" alt="Off">';
|
|
||||||
}
|
}
|
||||||
|
var imgping = new Image();
|
||||||
|
imgping.src = url;
|
||||||
|
if(imgping.height>0){
|
||||||
|
document.getElementById(id).outerHTML ='<img src="{{ $img_on }}" alt="On">';
|
||||||
|
} else {
|
||||||
|
document.getElementById(id).outerHTML ='<img src="{{ $img_off }}" alt="Off">';
|
||||||
|
}
|
||||||
|
Sleep(15000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
imgping({{ $id }},{{ $opt1 }});
|
||||||
</script>
|
</script>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
imgping [URL to image] [default on/off]
|
imgping [URL to image] [default on/off]
|
||||||
|
Loading…
Reference in New Issue
Block a user