New changes.

main
nataly 1 year ago
parent 158d0eacf2
commit 7255126f08

@ -25,13 +25,30 @@
<p class="text-secondosiblue text-[18px]">You are Currently Offline</p>
</div>
<a href="{% url 'go_online' %}">
<button class="text-white bg-green-700 py-3 px-3 rounded-b-md hover:bg-opacity-60 duration-300 cursor-pointer">Go Online</button>
</a>
<button id="go-online-btn" class="w-full text-white bg-green-700 py-3 px-3 rounded-b-md hover:bg-opacity-60 duration-300 cursor-pointer">Go Online</button>
</div>
</div>
{% endif %}
<script>
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('go-online-btn').addEventListener('click', function () {
// Send an AJAX request to the server
var xhr = new XMLHttpRequest();
xhr.open('GET', "{% url 'go_online' %}", true);
xhr.onload = function () {
if (xhr.status === 200) {
// If the request is successful, reload the top window
window.top.location.reload();
} else {
console.log('You are still offline.')
}
};
xhr.send();
});
});
</script>
<div class="w-full flex">
<!-- FIXED SIDE NAVBAR -->

Loading…
Cancel
Save