Merge branch 'services-status-button-auto' into develop

This commit is contained in:
6543 2019-07-14 03:20:41 +02:00
commit adf72ccf12
Signed by: 6543
GPG Key ID: A1CA74D27FD13271
3 changed files with 55 additions and 15 deletions

View File

@ -10,17 +10,17 @@ draft = false
+++


Software | Address | Status | Comments
-----------------------------------------------|----------------------------|:-------:|:--------
[Diaspora](https://diasporafoundation.org/) | Diaspora.AltinSystems.DE | {{<on-off off>}} | switch domain
[NextCloud](https://nextcloud.com) | [Cloud.Obermui.de](https://cloud.obermui.de/login) | {{<on-off on>}} |
[PeerTube](https://joinpeertube.org) | [Video.Obermui.de](https://Video.Obermui.de) | {{<on-off on>}} |
[TeamSpeak](https://www.teamspeak.com/)| [Obermui.de](ts3server://80.241.216.82?port=9987) | {{<on-off on>}} |
[MineCraft](https://minecraft.net/) | [Obermui.DE](minecraft://Obermui.DE:25565) | {{<on-off off>}} | migrate server
[CJDNS](https://github.com/cjdelisle/cjdns/) | [Obermui.de:51935]({{<siteurl>}}post/connect-2-cjdns/) | {{<on-off on>}} |
[OpenTracker](https://erdgeist.org/arts/software/opentracker/)| [CJDNS Address](fc15:368e:2797:79d1:71d4:f698:c081:d4a2) | {{<on-off off>}} | migrate server
[Gitea](https://gitea.io) | [Code.Obermui.DE](https://Code.Obermui.DE/explore/repos) | {{<on-off on>}} |
[IPFS](https://ipfs.io/) | Internal | {{<on-off on>}} |
Software | Address | Status | Comments
---------------------------------------------|------------------------------------------------------|:------------------------:|:--------------
[Diaspora](https://diasporafoundation.org/) | Diaspora.AltinSystems.DE | {{<on-off off>}} | switch domain
[NextCloud](https://nextcloud.com) | [Cloud.Obermui.de](https://cloud.obermui.de/login) | {{<on-off on>}} |
[PeerTube](https://joinpeertube.org) | [Video.Obermui.de](https://Video.Obermui.de) | {{<on-off on>}} |
[TeamSpeak](https://www.teamspeak.com/) | [Obermui.de](ts3server://80.241.216.82?port=9987) | {{<on-off on>}} |
[MineCraft](https://minecraft.net/) | [Obermui.DE](minecraft://Obermui.DE:25565) | {{<on-off off>}} | migrate server
[CJDNS](https://github.com/cjdelisle/cjdns/) | [Obermui.de:51935]({{<siteurl>}}post/connect-2-cjdns/) | {{<on-off on>}}
[OpenTracker](https://erdgeist.org/arts/software/opentracker/)| [CJDNS Address](fc15:368e:2797:79d1:71d4:f698:c081:d4a2) | {{<on-off off>}} | migrate server
[Gitea](https://gitea.io) | [Code.Obermui.DE](https://Code.Obermui.DE/explore) | {{<on-off on>}} |
[IPFS](https://ipfs.io/) | Internal | {{<on-off on>}} |




View File

@ -1,8 +1,35 @@
{{ $mode := .Get 0 }}
{{ $mode := .Get 0 }}{{ $opt1 := .Get 1 }}{{ $opt2 := .Get 2 }}

{{ $img_on := ( printf "%s%s" $.Page.Site.BaseURL "img/on-off/switch-on-icon_smal.png" )}}
{{ $img_off := ( printf "%s%s" $.Page.Site.BaseURL "img/on-off/switch-off-icon_smal.png" )}}

{{ if eq $mode "on" }}
<img src="{{ .Page.Site.BaseURL }}img/on-off/switch-on-icon_smal.png" alt="On">
<img src="{{ $img_on }}" alt="On">
{{ else if eq $mode "off"}}
<img src="{{ .Page.Site.BaseURL }}img/on-off/switch-off-icon_smal.png" alt="Off">
<img src="{{ $img_off }}" alt="Off">
{{ else if eq $mode "imgping" }}
{{ with $opt1 }}
{{ $id := md5 $opt1 }}
{{ if eq $opt2 "on" }}
<img id={{ $id }} src="{{ $img_on }}" alt="On">
{{ else }}
<img id={{ $id }} src="{{ $img_off }}" alt="Off">
{{ end }}
<script language="JavaScript">
function exec(){
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">';
}
}
exec();
</script>
{{ else }}
imgping [URL to image] [default on/off]
{{ end }}
{{ else }}
???
{{end}}
{{ end }}

View File

@ -0,0 +1,13 @@
{{ $seconds := .Get 0 }}
{{ $ms := ( printf "%s%s" $seconds "000" )}}
<script>
function Sleep(milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
}

async function reload(){
await Sleep({{ $ms }});
location.reload();
}
reload();
</script>