add active sessions section
This commit is contained in:
parent
e3c33a7492
commit
a93a178b57
|
@ -44,6 +44,10 @@ async def index(request):
|
|||
fido2_keys = await conn.fetch(
|
||||
"SELECT * FROM user_credential WHERE user_id = $1",
|
||||
request['session']['id'])
|
||||
active_sessions = await conn.fetch(
|
||||
"SELECT ip_address FROM user_session "
|
||||
"WHERE user_id = $1",
|
||||
request['session']['id'])
|
||||
|
||||
if request['session']['admin']:
|
||||
apps = [app['name'] for app in apps]
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
{% if request['session']['admin'] %}
|
||||
<section>
|
||||
<h2>User Permissions</h2>
|
||||
<article>
|
||||
<article style="display: none;">
|
||||
<hr>
|
||||
<table id="users">
|
||||
<thead>
|
||||
|
@ -58,7 +58,7 @@
|
|||
{% endif %}
|
||||
<section>
|
||||
<h2>Change Password</h2>
|
||||
<article>
|
||||
<article style="display: none;">
|
||||
<hr>
|
||||
<form action="{{ request.app.router['change_password'].url_for() }}" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<label for="current_password">Current password</label>
|
||||
|
@ -73,7 +73,7 @@
|
|||
</section>
|
||||
<section>
|
||||
<h2>Security Keys</h2>
|
||||
<article>
|
||||
<article style="display: none;">
|
||||
<hr>
|
||||
{% if fido2_keys %}
|
||||
<table id="security_keys">
|
||||
|
@ -98,6 +98,28 @@
|
|||
<br><a href="./add_key">Add key</a>
|
||||
</article>
|
||||
</section>
|
||||
<section>
|
||||
<h2>Active Sessions</h2>
|
||||
<article style="display: none;">
|
||||
<hr>
|
||||
<table id="active_sessions">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP Address</th>
|
||||
<th>Delete</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for session in active_sessions %}
|
||||
<tr>
|
||||
<td>{{ session['ip_address'] }}</td>
|
||||
<td><input type="checkbox"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue
Block a user