Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions rnacentral/sequence_search/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,18 @@ <h1><i class="fa fa-tachometer"></i> Sequence Search Dashboard</h1>
<th scope="col">#</th>
<th scope="col" class="text-center">Number of searches</th>
<th scope="col" class="text-center">Average search time</th>
<th scope="col" class="text-center">Average search time (high priority)</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Last 24 hours</th>
<td class="text-center"><span class="badge">{{ context.searches_last_24_hours }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_last_24_hours }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_last_24_hours_high_priority }}</span></td>
</tr>
<tr>
<th scope="row">Last 7 days</th>
<td class="text-center"><span class="badge">{{ context.searches_last_week }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_last_week }}</span></td>
<td class="text-center"><span class="badge">{{ context.average_last_week_high_priority }}</span></td>
</tr>
</tbody>
</table>
Expand Down
17 changes: 2 additions & 15 deletions rnacentral/sequence_search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,8 @@ def show_searches(request):

def dashboard(request):
"""Info about searches in rnacentral-sequence-search."""
all_searches, searches_last_24_hours, searches_last_week = 0, 0, 0
average_all_searches, average_last_24_hours, average_last_week = 0, 0, 0
(
average_high_priority_searches,
average_last_24_hours_high_priority,
average_last_week_high_priority,
) = (0, 0, 0)
searches_last_24_hours, searches_last_week = 0, 0
average_last_24_hours, average_last_week = 0, 0
searches_per_month = None
expert_db_results = None
if "test" in request.build_absolute_uri():
Expand All @@ -143,14 +138,8 @@ def dashboard(request):
data = response_url.json()
searches_last_24_hours = data["last_24_hours_result"]["count"]
average_last_24_hours = data["last_24_hours_result"]["avg_time"]
average_last_24_hours_high_priority = data["high_priority_24_hours_result"][
"avg_time"
]
searches_last_week = data["last_week_result"]["count"]
average_last_week = data["last_week_result"]["avg_time"]
average_last_week_high_priority = data["high_priority_last_week_result"][
"avg_time"
]
searches_per_month = data["searches_per_month"]
expert_db_results = data["expert_db_results"]

Expand Down Expand Up @@ -200,8 +189,6 @@ def dashboard(request):
"searches_last_week": searches_last_week,
"average_last_24_hours": average_last_24_hours,
"average_last_week": average_last_week,
"average_last_24_hours_high_priority": average_last_24_hours_high_priority,
"average_last_week_high_priority": average_last_week_high_priority,
"searches_per_month": searches_per_month,
"expert_db_results": expert_db_results,
"current_month_pie_chart": current_month_pie_chart,
Expand Down