-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove the ugly sidebar that didn't work / flex properly
- Loading branch information
1 parent
70e744f
commit 78433b9
Showing
11 changed files
with
686 additions
and
682 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
{% extends "django_pev/base.html" %} | ||
{% block content %} | ||
<div class="row"> | ||
<div class="card mb-4 mt-4"> | ||
<div class="card-body"> | ||
<div class="d-flex justify-content-between"> | ||
<div> | ||
<h4 class="card-title mb-0">Live Connections</h4> | ||
<div class="row"> | ||
<div class="card mb-4 mt-4"> | ||
<div class="card-body"> | ||
<div class="d-flex justify-content-between"> | ||
<div> | ||
<h4 class="card-title mb-0">Live Connections</h4> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="d-flex justify-content-between mt-4"> | ||
<div> | ||
<ul> | ||
<li> | ||
<b> Total connections: </b> {{ connections| length}} | ||
</li> | ||
</ul> | ||
<div class="d-flex justify-content-between mt-4"> | ||
<div> | ||
<ul> | ||
<li> | ||
<b> Total connections: </b> {{ connections| length}} | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">PID</th> | ||
<th scope="col">User</th> | ||
<th scope="col">Source</th> | ||
<th scope="col">IP</th> | ||
<th scope="col">Open Since</th> | ||
<th scope="col">Query begin time</th> | ||
<th scope="col">Wait Event</th> | ||
<th scope="col">State</th> | ||
<th scope="col">Query</th> | ||
<th scope="col">SSL?</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for row in connections%} | ||
<tr id="#{{row.name}}"> | ||
<td>{{ row.pid }}</td> | ||
<td>{{ row.user }}</td> | ||
<td>{{ row.source }}</td> | ||
<td>{{ row.ip }}</td> | ||
<td>{{ row.backend_start | timesince }}</td> | ||
<td>{{ row.query_start | timesince }}</td> | ||
<td>{{ row.wait_event }}</td> | ||
<td>{{ row.start }}</td> | ||
<td>{{ row.query }}</td> | ||
<td> | ||
{% if row.ssl %} | ||
<i class="fa-solid fa-check"></i> | ||
{% endif%} | ||
</td> | ||
</tr> | ||
{% endfor%} | ||
</tbody> | ||
</table> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th scope="col">PID</th> | ||
<th scope="col">User</th> | ||
<th scope="col">Source</th> | ||
<th scope="col">IP</th> | ||
<th scope="col">Open Since</th> | ||
<th scope="col">Query begin time</th> | ||
<th scope="col">Wait Event</th> | ||
<th scope="col">State</th> | ||
<th scope="col">Query</th> | ||
<th scope="col">SSL?</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for row in connections%} | ||
<tr id="#{{row.name}}"> | ||
<td>{{ row.pid }}</td> | ||
<td>{{ row.user }}</td> | ||
<td>{{ row.source }}</td> | ||
<td>{{ row.ip }}</td> | ||
<td>{{ row.backend_start | timesince }}</td> | ||
<td>{{ row.query_start | timesince }}</td> | ||
<td>{{ row.wait_event }}</td> | ||
<td>{{ row.start }}</td> | ||
<td>{{ row.query }}</td> | ||
<td> | ||
{% if row.ssl %} | ||
<i class="fa-solid fa-check"></i> | ||
{% endif%} | ||
</td> | ||
</tr> | ||
{% endfor%} | ||
</tbody> | ||
</table> | ||
|
||
</div> | ||
<div class="card-footer"> | ||
</div> | ||
<div class="card-footer"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,93 @@ | ||
{% extends "django_pev/base.html" %} | ||
{% block content %} | ||
{% load humanize %} | ||
<div class="row"> | ||
<div class="card mb-4 mt-4"> | ||
<div class="card-body"> | ||
<div class="d-flex justify-content-between"> | ||
<div> | ||
<h4 class="card-title mb-0">Explain Query</h4> | ||
This page helps find the slowest queries of a page and explains it using an embedded version of <a href="https://explain.dalibo.com">Postgres Explain Visualizer 2 (by dalibo)</a> | ||
</div> | ||
</div> | ||
<div class="d-flex justify-content-between mt-4"> | ||
<form action="/django-pev/explain" method="post"> | ||
{% csrf_token %} | ||
<label for="id_url" class="form-label"> <b>Page url </b></label> | ||
<input type="text" class="form-control" name="url" value="{{url}}" required="true" id="id_url"> | ||
<div id="helpBlock" class="form-text"> | ||
The url should not include the protocol or the base url. For example (/dashboard/) . | ||
{% load humanize %} | ||
<div class="row"> | ||
<div class="card mb-4 mt-4"> | ||
<div class="card-body"> | ||
<div class="d-flex justify-content-between"> | ||
<div> | ||
<h4 class="card-title mb-0">Explain Query</h4> | ||
This page helps find the slowest queries of a page and explains it using an embedded version of <a href="https://explain.dalibo.com">Postgres Explain Visualizer 2 (by dalibo)</a> | ||
</div> | ||
<input class="btn btn-primary" type="submit" value="Submit" /> | ||
</form> | ||
</div> | ||
</div> | ||
<div class="d-flex justify-content-between mt-4"> | ||
<form action="/django-pev/explain" method="post"> | ||
{% csrf_token %} | ||
<label for="id_url" class="form-label"> <b>Page url </b></label> | ||
<input type="text" class="form-control" name="url" value="{{url}}" required="true" id="id_url"> | ||
<div id="helpBlock" class="form-text"> | ||
The url should not include the protocol or the base url. For example (/dashboard/) . | ||
</div> | ||
<input class="btn btn-primary" type="submit" value="Submit" /> | ||
</form> | ||
</div> | ||
|
||
{% if explain and explain.queries %} | ||
{% if explain and explain.queries %} | ||
|
||
<div class="card p-4 mt-1"> | ||
<h5> Slowest Query {{ slowest.duration|floatformat:4 }}s | ||
</h5> | ||
<form action="{% url 'django_pev:explain-visualize' %}" method="post"> | ||
{% csrf_token %} | ||
<input type="hidden" name="explainset_id" value="{{explain.id}}" /> | ||
<input type="hidden" name="query_index" value="{{slowest.index}}" /> | ||
<input class="btn btn-primary" type="submit" value="Analyze"> | ||
</input> | ||
</form> | ||
<div> | ||
<code> | ||
{{ slowest.sql }} | ||
</code> | ||
</div> | ||
</div> | ||
<div class="card p-4 mt-1"> | ||
<h5> Slowest Query {{ slowest.duration|floatformat:4 }}s | ||
</h5> | ||
<form action="{% url 'django_pev:explain-visualize' %}" method="post"> | ||
{% csrf_token %} | ||
<input type="hidden" name="explainset_id" value="{{explain.id}}" /> | ||
<input type="hidden" name="query_index" value="{{slowest.index}}" /> | ||
<input class="btn btn-primary" type="submit" value="Analyze"> | ||
</input> | ||
</form> | ||
<div> | ||
<code> | ||
{{ slowest.sql }} | ||
</code> | ||
</div> | ||
</div> | ||
|
||
<div class="mt-4"> | ||
<h5> All Queries {{explain.queries | length}}</h5> | ||
<ol> | ||
{% for query in explain.queries %} | ||
<div class="mt-4"> | ||
<h5> All Queries {{explain.queries | length}}</h5> | ||
<ol> | ||
{% for query in explain.queries %} | ||
|
||
<li> | ||
{{ query.duration | floatformat:4}}s | ||
<code>{{ query.sql | truncatechars:100 }}</code> | ||
<li> | ||
{{ query.duration | floatformat:4}}s | ||
<code>{{ query.sql | truncatechars:100 }}</code> | ||
|
||
<p class="d-inline-flex gap-1"> | ||
<p class="d-inline-flex gap-1"> | ||
|
||
<form action="{% url 'django_pev:explain-visualize' %}" method="post"> | ||
{% csrf_token %} | ||
<input type="hidden" name="explainset_id" value="{{explain.id}}" /> | ||
<input type="hidden" name="query_index" value="{{query.index}}" /> | ||
<input class="btn btn-primary" type="submit" value="Analyze" /> | ||
<button class="btn btn-secondary" type="button" data-coreui-toggle="collapse" data-coreui-target="#query{{query.index}}" aria-expanded="false" aria-controls="collapseExample"> | ||
Show Query | ||
</button> | ||
</form> | ||
<form action="{% url 'django_pev:explain-visualize' %}" method="post"> | ||
{% csrf_token %} | ||
<input type="hidden" name="explainset_id" value="{{explain.id}}" /> | ||
<input type="hidden" name="query_index" value="{{query.index}}" /> | ||
<input class="btn btn-primary" type="submit" value="Analyze" /> | ||
<button class="btn btn-secondary" type="button" data-coreui-toggle="collapse" data-coreui-target="#query{{query.index}}" aria-expanded="false" aria-controls="collapseExample"> | ||
Show Query | ||
</button> | ||
</form> | ||
|
||
</p> | ||
</p> | ||
|
||
<div class="collapse" id="query{{query.index}}"> | ||
<div class="card card-body"> | ||
<code> | ||
{{ query.sql }} | ||
</code> | ||
</div> | ||
</div> | ||
</li> | ||
<div class="collapse" id="query{{query.index}}"> | ||
<div class="card card-body"> | ||
<code> | ||
{{ query.sql }} | ||
</code> | ||
</div> | ||
</div> | ||
</li> | ||
|
||
{% endfor %} | ||
</ol> | ||
</div> | ||
{% elif explain %} | ||
<div class="mt-4"> | ||
<h5> No queries executed (probably a redirect.)</h5> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</ol> | ||
</div> | ||
{% elif explain %} | ||
<div class="mt-4"> | ||
<h5> No queries executed (probably a redirect.)</h5> | ||
</div> | ||
{% endif %} | ||
|
||
</div> | ||
</div> | ||
|
||
|
||
|
||
<div class="card-footer"> | ||
<div class="card-footer"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.