after some tests remove useles stuff
This commit is contained in:
parent
6b93c8ead4
commit
0e4a1a46a0
@ -16,23 +16,16 @@
|
|||||||
<img id={{ $id }} src="{{ $img_off }}" alt="Off">
|
<img id={{ $id }} src="{{ $img_off }}" alt="Off">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<script language="JavaScript">
|
<script language="JavaScript">
|
||||||
|
function exec(){
|
||||||
function imgping(id,url){
|
|
||||||
while (true) {
|
|
||||||
function Sleep(milliseconds) {
|
|
||||||
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
|
||||||
}
|
|
||||||
var imgping = new Image();
|
var imgping = new Image();
|
||||||
imgping.src = url;
|
imgping.src = {{ $opt1 }};
|
||||||
if(imgping.height>0){
|
if(imgping.height>0){
|
||||||
document.getElementById(id).outerHTML ='<img src="{{ $img_on }}" alt="On">';
|
document.getElementById({{ $id }}).outerHTML ='<img src="{{ $img_on }}" alt="On">';
|
||||||
} else {
|
} else {
|
||||||
document.getElementById(id).outerHTML ='<img src="{{ $img_off }}" alt="Off">';
|
document.getElementById({{ $id }}).outerHTML ='<img src="{{ $img_off }}" alt="Off">';
|
||||||
}
|
}
|
||||||
Sleep(15000);
|
|
||||||
}
|
}
|
||||||
}
|
exec();
|
||||||
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