Merge branch ‘develop’ #10

Merged
6543 merged 19 commits from develop into master 2019-07-14 01:29:25 +00:00
Showing only changes of commit 6b93c8ead4 - Show all commits

View File

@ -16,13 +16,23 @@
<img id={{ $id }} src="{{ $img_off }}" alt="Off">
{{ end }}
<script language="JavaScript">
var imgping = new Image();
imgping.src = '{{ $opt1 }}';
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">';

function imgping(id,url){
while (true) {
function Sleep(milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
}
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>
{{ else }}
imgping [URL to image] [default on/off]