From 448b5048d89c0d2a3bd352fe1ab54486c3e701b1 Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 26 Sep 2019 19:15:46 -0400 Subject: [PATCH] style and added table columns --- buckler.py | 2 +- static/buckler.css | 7 ++++--- templates/index.html | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/buckler.py b/buckler.py index 660bf57..0caf803 100644 --- a/buckler.py +++ b/buckler.py @@ -44,7 +44,7 @@ async def index(request): "SELECT * FROM user_credential WHERE user_id = $1", request['session']['id']) active_sessions = await conn.fetch( - "SELECT id, ip_address FROM user_session " + "SELECT id, ip_address, date_created, last_used FROM user_session " "WHERE user_id = $1", request['session']['id']) diff --git a/static/buckler.css b/static/buckler.css index 86f8ab5..0321854 100644 --- a/static/buckler.css +++ b/static/buckler.css @@ -41,15 +41,16 @@ h2 { list-style-type: none; } -#users { +table { border: 1px solid lightgray; border-collapse: collapse; + width: 100%; } -#users tr { +tr { border: 1px solid lightgray; } -#users td { +td { text-align: center; } diff --git a/templates/index.html b/templates/index.html index 264dbfe..5d7734f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -113,6 +113,8 @@ Session ID IP Address + Created + Last Used Delete @@ -121,6 +123,8 @@ {{ session['id'][:5] }}...{{ session['id'][-5:] }} {{ session['ip_address'] }} + {{ session['date_created'].strftime('%Y-%m-%d %H:%M') }} + {{ session['last_used'].strftime('%Y-%m-%d %H:%M') }} {% endfor %}