Clubstatus. Versuch 1.

This commit is contained in:
Bandie 2022-04-15 15:39:14 +02:00
parent a84dcabeeb
commit ecd8119880
Signed by: Bandie
GPG Key ID: F4E0AB327841A877

View File

@ -2,7 +2,7 @@
<hr id="status_bar">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="//chaospott.de">
<a class="navbar-brand" href="https://chaospott.de">
chaospott
</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
@ -36,23 +36,37 @@
</ul>
<ul class="nav navbar-nav navbar-right">
<script>
$.getJSON("https://status.chaospott.de/chaospott_mumble.json").done(function (data) {
if (data.connected_users > 0) {
$.getJSON("https://status.chaospott.de/status.json").done(function (data) {
if (data.state.open) {
$("#status_open").css("display", "block");
$("#status_bar").css("borderColor", "#29A900");
document.getElementById("mumble_users_online").textContent=data.connected_users;
} else {
$("#status_closed").css("display", "block");
$("#status_bar").css("borderColor", "#D9534F");
}
});
$.getJSON("https://status.chaospott.de/chaospott_mumble.json").done(function (data) {
if (data.connected_users > 0) {
$("#status_mumble_open").css("display", "block");
document.getElementById("mumble_users_online").textContent=data.connected_users;
} else {
$("#status_mumble_closed").css("display", "block");
}
});
</script>
<li id="status_open" style="background-color:#29A900;">
Club: Offen
</li>
<li id="status_closed" style="background-color:#D9534F;">
Club: Geschlossen
</li>
<li id="status_mumble_open" style="background-color:#29A900;">
<a href="mumble://mumble.chaospott.de" style="color:#ffffff !important;">
<i class="fa fa-microphone"></i> Nutzer im Mumble: <span id="mumble_users_online"></span>
</a>
</li>
<li id="status_closed" style="background-color:#D9534F;">
<li id="status_mumble_closed" style="background-color:#D9534F;">
<a href="mumble://mumble.chaospott.de" style="color:#ffffff !important;">
<i class="fa fa-microphone-slash"></i> Keine Nutzer im Mumble
</a>