PythonFastServer/templates/user.html

70 lines
2.3 KiB
HTML
Raw Normal View History

2025-12-17 19:41:44 +05:30
<!DOCTYPE html>
<head>
<title>
Server Manager
</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link href="{{ url_for('static', path='/basic.css')}}" rel="stylesheet">
</head>
<body style="background-color:#d3e6e0">
<script src="{{ url_for('static', path='/jquery.js') }}">
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
2025-12-28 18:11:32 +05:30
<script>
function logout() {
fetch("/api/users/logout", {
method: "POST",
body: JSON.stringify({
username: getCookie("username"),
session_key: getCookie("session_key"),
redirect: "/server",
password: ""
}),
headers: {
"Content-type": "application/json; charset=UTF-8"
},
redirect: "follow"
})
}
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
}
</script>
2025-12-17 19:41:44 +05:30
<div align="center">
<h3>Server Manager, Welcome {{ username }} </h3>
2025-12-28 18:11:32 +05:30
<a href="/api/users/logout" onclick="location.href=this.href+'?username='+getCookie('username')+'&session_key='+getCookie('session_key')+'&redirect=/server';return false;">Logout</a>
2025-12-17 19:41:44 +05:30
</div>
<br>
<br>
<br>
<span class="border border-primary">
<div align="center">
<table id="active_users" class="table table-sm">
<thead>
<tr>
<th scope="col">
Username
</th>
<th scope="col">
Session Status
</th>
</tr>
</thead>
<tbody>
{% for user in active_users %}
<tr class="mytr">
{% for item in user %}
<td>
{{ item }}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</span>
</body>