/llr-history/', OpenBench.views.test_llr_history),
+ django.urls.path(r'api/quick-search/', OpenBench.views.api_quick_search),
# Redirect anything else to the Index
django.urls.path(r'', OpenBench.views.index),
diff --git a/OpenBench/views.py b/OpenBench/views.py
index 5299493..949ba49 100644
--- a/OpenBench/views.py
+++ b/OpenBench/views.py
@@ -585,6 +585,41 @@ def test_llr_history(request, id):
return HttpResponse(str(llr_history_graph(test)), content_type='text/plain; charset=utf-8')
+def api_quick_search(request):
+
+ ## Feeds the Ctrl+K palette: up to eight workloads that match a branch name,
+ ## an author, an engine, or a workload id, newest first.
+
+ if OPENBENCH_CONFIG['require_login_to_view'] and not request.user.is_authenticated:
+ return JsonResponse({ 'tests' : [] }, status=403)
+
+ from OpenBench.templatetags.mytags import prettyName
+ from OpenBench.templatetags.uitags import test_status
+
+ query = request.GET.get('q', '').strip().lstrip('#')[:64]
+ if not query:
+ return JsonResponse({ 'tests' : [] })
+
+ match = Q(dev__name__icontains=query) | Q(author__icontains=query) | Q(dev_engine__icontains=query)
+ if query.isdigit() and len(query) <= 9:
+ match |= Q(id=int(query))
+
+ found = list(Test.objects.select_related('dev').filter(match).exclude(deleted=True).order_by('-id')[:8])
+
+ # An exact workload id is always the first hit
+ if query.isdigit():
+ found.sort(key=lambda test: str(test.id) != query)
+
+ return JsonResponse({ 'tests' : [{
+ 'id' : test.id,
+ 'name' : prettyName(test.dev.name),
+ 'author' : test.author.capitalize(),
+ 'engine' : test.dev_engine,
+ 'tc' : test.dev_time_control,
+ 'status' : test_status(test),
+ 'url' : '/%s/%d/' % ('tune' if test.test_mode == 'SPSA' else 'test', test.id),
+ } for test in found] })
+
def create_test(request):
return create_workload(request, 'TEST')
diff --git a/Templates/OpenBench/Blocks/palette.html b/Templates/OpenBench/Blocks/palette.html
new file mode 100644
index 0000000..2a0bf95
--- /dev/null
+++ b/Templates/OpenBench/Blocks/palette.html
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Index
+ - Greens
+ - Advanced search
+ - Machines
+ - Users
+ - Events
+ - Errors
+ - Networks
+
+ - Create test
+ - Create tune
+ - Create datagen
+ - Upload net
+
+ {% if user.is_authenticated %}
+ - Profile
+ - Log out
+ {% else %}
+ - Log in
+ - Register
+ {% endif %}
+
+ - OpenBench on GitHub
+ {% for engine, data in config.engines.items %}
+ - {{engine}} source
+ {% endfor %}
+
+
+
+
+
+
+
diff --git a/Templates/OpenBench/Blocks/testsummary.html b/Templates/OpenBench/Blocks/testsummary.html
index 4da61c4..f0c1c03 100644
--- a/Templates/OpenBench/Blocks/testsummary.html
+++ b/Templates/OpenBench/Blocks/testsummary.html
@@ -1,12 +1,18 @@
{% load mytags uitags %}
-{{test.author|capfirst|slice:":6"}} |
+{{test.author|capfirst}} |
{{test.dev_engine}} |
{{test|prettyDevName}}
{% if test.error %}crash{% endif %}
{% if test|test_is_fischer %}frc{% endif %}
{% with progress=test|progress_info %}
- {% if progress %}
+ {% if progress.gauge %}
+
+
+
+
+ {{ progress.lower }}{{ progress.llr }}{{ progress.upper }}
+ {% elif progress %}
{% endif %}
{% endwith %}
@@ -17,4 +23,4 @@
{% if test|test_is_time_odds %}time odds{% endif %}
{% if test|test_is_smp_odds %}thread odds{% endif %}
|
-{{test|shortStatBlock|linebreaksbr}} |
+{{test|shortStatBlock|linebreaksbr}} |
diff --git a/Templates/OpenBench/base.html b/Templates/OpenBench/base.html
index 17aca09..7f4f2be 100644
--- a/Templates/OpenBench/base.html
+++ b/Templates/OpenBench/base.html
@@ -7,7 +7,7 @@
-
+
@@ -17,12 +17,15 @@
+
+
+
-
+
RektBench
@@ -31,6 +34,8 @@
+
+