connected/disconnected toasts
This commit is contained in:
parent
9955ddf08e
commit
277fe2ae02
@ -28,7 +28,11 @@ $(document).ready(function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
socket.on("connect", function(socket) {
|
socket.on("connect", function(socket) {
|
||||||
console.log("Connected");
|
$("#connectedtoast").toast("show")
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on("disconnect", function(socket) {
|
||||||
|
$("#disconnectedtoast").toast("show")
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("new_tick", function(data) {
|
socket.on("new_tick", function(data) {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<title>Hello world!</title>
|
<title>Hello world!</title>
|
||||||
|
|
||||||
<body class="h-100 d-flex flex-column">
|
<body class="h-100 d-flex flex-column">
|
||||||
<main class="container my-2 border h-100">
|
<main class="container my-2 border h-100">
|
||||||
|
|
||||||
<div class="row row-cols-auto justify-content-center my-2" id="statistics">
|
<div class="row row-cols-auto justify-content-center my-2" id="statistics">
|
||||||
<div class="card bg-light mx-auto" style="max-width: 25rem;">
|
<div class="card bg-light mx-auto" style="max-width: 25rem;">
|
||||||
@ -104,22 +104,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="toast">
|
<div class="toast-container hide">
|
||||||
|
<div class="toast mx-2 my-2 bg-success hide" id="connectedtoast" role="alert" aria-live="assertive" aria-atomic="true">
|
||||||
<div class="toast-header">
|
<div class="toast-header">
|
||||||
Toast Header
|
<strong class="me-auto">Connected!</strong>
|
||||||
</div>
|
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> </div>
|
||||||
<div class="toast-body">
|
<!-- <div class="toast-body bg-light">-->
|
||||||
Some text inside the toast body
|
<!-- You are connected to the server.-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="footer mt-auto py-3 bg-light border-top">
|
<div class="toast mx-2 my-2 bg-danger hide" id="disconnectedtoast" role="alert" aria-live="assertive" aria-atomic="true">
|
||||||
<div class="container text-center">
|
<div class="toast-header">
|
||||||
<span class="text-muted">Made with love by the Pepe</span>
|
<strong class="me-auto">Disconnected!</strong>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> </div>
|
||||||
|
<!-- <div class="toast-body bg-light">-->
|
||||||
|
<!-- You got disconnected from the server.-->
|
||||||
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</div>
|
||||||
|
|
||||||
|
<footer class="footer mt-auto py-3 bg-light border-top">
|
||||||
|
<div class="container text-center">
|
||||||
|
<span class="text-muted">Made with ❤️ by the Pepe</span>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user