forked from leftypol/leftypol
New debug page: ?/debug/sql
This commit is contained in:
parent
764d718f84
commit
9a2c33736a
3 changed files with 53 additions and 0 deletions
26
templates/mod/debug/sql.html
Normal file
26
templates/mod/debug/sql.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
<form action="" method="post">
|
||||
<input type="hidden" name="token" value="{{ security_token }}">
|
||||
<textarea style="display:block;margin:5px auto;width:90%;max-width:600px" rows="3" name="query">{{ query | e }}</textarea>
|
||||
<input style="display:block;margin:5px auto" type="submit" value="Query">
|
||||
</form>
|
||||
|
||||
{% if result == 'empty' %}
|
||||
<p style="text-align:center">Query successful (no result).</p>
|
||||
{% elseif result %}
|
||||
<table class="modlog">
|
||||
<tr>
|
||||
{% for key in keys %}
|
||||
<th>{{ key }}</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% for row in result %}
|
||||
<tr>
|
||||
{% for col in row %}
|
||||
<td>{{ col }}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% elseif error %}
|
||||
<p style="text-align:center;color:#d00">{{ error }}</p>
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue