Split LogEvents into events, and errors
This commit is contained in:
1 parent
ec1b1c852b
commit
36470ff7ef
5 files changed
+49
-17
No files matched your search
+4
-2
@@ -40,8 +40,10 @@ urlpatterns = [
|
|||||||
|
|
||||||
# Links for viewing general information tables
|
# Links for viewing general information tables
|
||||||
django.urls.path(r'users/', OpenBench.views.users),
|
django.urls.path(r'users/', OpenBench.views.users),
|
||||||
django.urls.path(r'events/', OpenBench.views.events),
|
django.urls.path(r'events/', OpenBench.views.events_actions),
|
||||||
django.urls.path(r'events/<int:page>/', OpenBench.views.events),
|
django.urls.path(r'events/<int:page>/', OpenBench.views.events_actions),
|
||||||
|
django.urls.path(r'errors/', OpenBench.views.events_errors),
|
||||||
|
django.urls.path(r'errors/<int:page>/', OpenBench.views.events_errors),
|
||||||
django.urls.path(r'machines/', OpenBench.views.machines),
|
django.urls.path(r'machines/', OpenBench.views.machines),
|
||||||
django.urls.path(r'machines/<int:machineid>/', OpenBench.views.machines),
|
django.urls.path(r'machines/<int:machineid>/', OpenBench.views.machines),
|
||||||
|
|
||||||
|
|||||||
+10
-9
@@ -343,21 +343,22 @@ def users(request):
|
|||||||
data = {'profiles' : Profile.objects.order_by('-games', '-tests')}
|
data = {'profiles' : Profile.objects.order_by('-games', '-tests')}
|
||||||
return render(request, 'users.html', data)
|
return render(request, 'users.html', data)
|
||||||
|
|
||||||
def events(request, page=1):
|
def events_actions(request, page=1):
|
||||||
|
|
||||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
events = LogEvent.objects.all().filter(machine_id=0).order_by('-id')
|
||||||
# #
|
|
||||||
# GET : Return information about the events taken on the Framework. #
|
|
||||||
# Only show those events for the requested page. #
|
|
||||||
# #
|
|
||||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
|
||||||
|
|
||||||
events = LogEvent.objects.all().order_by('-id')
|
|
||||||
start, end, paging = OpenBench.utils.getPaging(events, page, 'events')
|
start, end, paging = OpenBench.utils.getPaging(events, page, 'events')
|
||||||
|
|
||||||
data = {'events' : events[start:end], 'paging' : paging};
|
data = {'events' : events[start:end], 'paging' : paging};
|
||||||
return render(request, 'events.html', data)
|
return render(request, 'events.html', data)
|
||||||
|
|
||||||
|
def events_errors(request, page=1):
|
||||||
|
|
||||||
|
events = LogEvent.objects.all().exclude(machine_id=0).order_by('-id')
|
||||||
|
start, end, paging = OpenBench.utils.getPaging(events, page, 'errors')
|
||||||
|
|
||||||
|
data = {'events' : events[start:end], 'paging' : paging};
|
||||||
|
return render(request, 'errors.html', data)
|
||||||
|
|
||||||
def machines(request, machineid=None):
|
def machines(request, machineid=None):
|
||||||
|
|
||||||
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
||||||
|
|||||||
@@ -87,6 +87,7 @@
|
|||||||
<li class="header">Info</li>
|
<li class="header">Info</li>
|
||||||
<li><a href="/users"><i class="fa-solid fa-users fa-fw"></i> Users</a></li>
|
<li><a href="/users"><i class="fa-solid fa-users fa-fw"></i> Users</a></li>
|
||||||
<li><a href="/events"><i class="fa-solid fa-circle-exclamation fa-fw"></i> Events</a></li>
|
<li><a href="/events"><i class="fa-solid fa-circle-exclamation fa-fw"></i> Events</a></li>
|
||||||
|
<li><a href="/errors"><i class="fa-solid fa-exclamation-triangle fa-fw"></i> Errors</a></li>
|
||||||
<li><a href="/machines"><i class="fa-solid fa-microchip fa-fw"></i> Machines</a></li>
|
<li><a href="/machines"><i class="fa-solid fa-microchip fa-fw"></i> Machines</a></li>
|
||||||
<li><a href="/networks"><i class="fa-solid fa-circle-nodes fa-fw"></i> Networks</a></li>
|
<li><a href="/networks"><i class="fa-solid fa-circle-nodes fa-fw"></i> Networks</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -119,7 +120,5 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{% extends "OpenBench/base.html" %}
|
||||||
|
|
||||||
|
{% load mytags %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<table class="hoverable">
|
||||||
|
|
||||||
|
<tr class="table-header">
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Worker</th>
|
||||||
|
<th>User</th>
|
||||||
|
<th>Test</th>
|
||||||
|
<th>Summary</th>
|
||||||
|
<th>Logs</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% for event in events %}
|
||||||
|
<tr>
|
||||||
|
<td class="timestamp">{{event.created|date:'U'}}</td>
|
||||||
|
<td><a href="/machines/{{event.machine_id}}">{{event.machine_id}}</a></td>
|
||||||
|
<td>{{event.author|capfirst}}</td>
|
||||||
|
<td><a href="/test/{{event.test_id}}">{{event.test_id|testIdToPrettyName}}</a></td>
|
||||||
|
|
||||||
|
<td>{{event.summary}}</td>
|
||||||
|
<td>{% if event.log_file %}<a href='/event/{{event.id}}'>View</a>{% endif %}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<table>
|
||||||
|
|
||||||
|
{% include "OpenBench/Blocks/pagebrowser.html" %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -10,10 +10,8 @@
|
|||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>User</th>
|
<th>User</th>
|
||||||
<th>Test</th>
|
<th>Test</th>
|
||||||
<th>Worker</th>
|
|
||||||
<th>TC</th>
|
<th>TC</th>
|
||||||
<th>Summary</th>
|
<th>Summary</th>
|
||||||
<th>Logs</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% for event in events %}
|
{% for event in events %}
|
||||||
@@ -21,10 +19,8 @@
|
|||||||
<td class="timestamp">{{event.created|date:'U'}}</td>
|
<td class="timestamp">{{event.created|date:'U'}}</td>
|
||||||
<td>{{event.author|capfirst}}</td>
|
<td>{{event.author|capfirst}}</td>
|
||||||
<td><a href="/test/{{event.test_id}}">{{event.test_id|testIdToPrettyName}}</a></td>
|
<td><a href="/test/{{event.test_id}}">{{event.test_id|testIdToPrettyName}}</a></td>
|
||||||
<td>{% if event.machine_id %} {{event.machine_id}} {% endif %}</td>
|
|
||||||
<td>{{event.test_id|testIdToTimeControl}}</td>
|
<td>{{event.test_id|testIdToTimeControl}}</td>
|
||||||
<td>{{event.summary}}</td>
|
<td>{{event.summary}}</td>
|
||||||
<td>{% if event.log_file %}<a href='/event/{{event.id}}'>View</a>{% endif %}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user