Files
judas_server/src/judas_server/web/templates/panel.html

62 lines
1.6 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>judas panel</title>
<link
rel="stylesheet"
href="{{ url_for('static', filename='css/style.css') }}"
/>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.socket.io/4.8.1/socket.io.min.js"></script>
<script>
$(document).ready(function () {
const socket = io();
const dataElement = $("#data");
const showNotify = (message) => {
$("#notify").stop().fadeIn();
$("#notify").text(message);
setTimeout(() => {
$("#notify").fadeOut();
}, 3000);
};
$("#notify").hide();
socket.on("connect", () => {
console.log("Connected to server");
showNotify("Connected to server");
});
socket.on("disconnect", () => {
console.log("Disconnected from server");
showNotify("Disconnected from server");
});
socket.on("update_data", (data) => {
console.log("Received data:", data);
document.getElementById("data").innerHTML = JSON.stringify(
data,
null,
2,
);
});
});
</script>
</head>
<body>
<div id="wrapper">
<header>
<h1><a href="{{ url_for('index.index') }}">judas</a></h1>
<p><a class="button" href="{{ url_for('auth.logout') }}">Logout</a></p>
</header>
<div id="notify"></div>
<main>
<pre id="data"></pre>
</main>
</div>
</body>
</html>