Commit da3ff9a6 authored by HERBERT Ryan's avatar HERBERT Ryan
Browse files

Added basic controller for viewing logs stored in db

parent d787d50d
import gluon.contrib.simplejson
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
def index():
query = db(db.user_log).select()
return dict(query=query)
......@@ -10,6 +10,7 @@
<a class="button" onclick="db.call('config/index');">analysis configs</a>
<a class="button" onclick="db.call('group/index');">groups</a>
<a class="button" onclick="db.call('user/index');">users</a>
<a class="button" onclick="db.call('log/index');">log</a>
<a class="button" onclick="db.call('admin/index');">admin</a>
- - -
{{pass}}
......
{{extend 'db_layout.html'}}
{{import vidjil_utils}}
<h3></h3>
<div id="db_table_container">
<table class="db_table" id="table">
<thead>
<tr>
<td class='column_100 pointer'>user</td>
<td class='column_100 pointer'>table</td>
<td class='column_100 pointer'>message</td>
<td class='column_100 pointer'>record</td>
<td class='column_100 pointer'>created</td>
</tr>
</thead>
{{ for row in query: }}
<tr>
<td>{{=row.user_id}}</td>
<td>{{=row.table_name}}</td>
<td>{{=row.msg}}</td>
<td>{{=row.record_id}}</td>
<td>{{=row.created}}</td>
</tr>
{{ pass }}
</table>
<table class="db_table" id="db_fixed_header"></table>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment