This commit is contained in:
AndyGrant committed 2018-06-09 17:03:43 -04:00
1 parent c6d77ca894
commit 3551cd1feb
18 files changed
+194 -23

No files matched your search

+1
View File
@@ -0,0 +1 @@
*.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
from django.contrib import admin
from EtherBench.models import LogEvent, Engine, Machine, Results, Test
from OpenBench.models import LogEvent, Engine, Machine, Results, Test
admin.site.register(LogEvent)
admin.site.register(Engine)
+21
View File
@@ -0,0 +1,21 @@
FRAMEWORK_REPO_URL = "http://github.com/AndyGrant/OpenBench/"
FRAMEWORK_DEFAULTS = {
"config" : {
"source" : "http://github.com/AndyGrant/EtherealDev/",
"homepage" : "http://github.com/AndyGrant/Ethereal",
"framework" : "http://github.com/AndyGrant/OpenBench/",
"protocol" : "uci",
"engine" : "Ethereal",
"alpha" : .10,
"beta" : .10,
"elower" : 0,
"eupper" : 5,
"hashsize" : 8,
"threads" : 1,
"timecontrol" : "5.0+0.05"
}
}
+4 -4
View File
@@ -49,8 +49,8 @@ class Results(Model):
class Test(Model):
dev = ForeignKey('Engine', PROTECT, related_name='dev')
base = ForeignKey('Engine', PROTECT, related_name='base')
dev = ForeignKey('Engine', PROTECT, related_name='dev')
base = ForeignKey('Engine', PROTECT, related_name='base')
devoptions = CharField(max_length=256)
baseoptions = CharField(max_length=256)
@@ -83,8 +83,8 @@ class Test(Model):
deleted = BooleanField(default=False)
approved = BooleanField(default=False)
creation = DateTimeField(auto_now=True)
complted = DateTimeField(auto_now=True)
creation = DateTimeField(auto_now=True)
complted = DateTimeField(auto_now=True)
def __str__(self):
return '{0} vs {1} @ {2}'.format(self.dev.name, self.base.name, self.timecontrol)
+15 -15
View File
@@ -1,23 +1,23 @@
from django.conf.urls import url
from django.urls import path
import OpenBench.views
urlpatterns = [
path(r'register/$', OpenBench.views.register),
path(r'login/$', OpenBench.views.login),
path(r'logout/$', OpenBench.views.logout),
path(r'register/', OpenBench.views.register),
path(r'login/', OpenBench.views.login),
path(r'logout/', OpenBench.views.logout),
path(r'log/$', OpenBench.views.log),
path(r'index/([0-9]+)/$', OpenBench.views.index),
path(r'greens/([0-9]+)/$', OpenBench.views.greens),
path(r'eventLog/', OpenBench.views.eventLog),
path(r'index/', OpenBench.views.index),
path(r'index/<int:page>/', OpenBench.views.index),
path(r'newTest/$', OpenBench.views.newTest),
path(r'editTest/([0-9]+)/$', OpenBench.views.editTest),
path(r'viewTest/([0-9]+)/$', OpenBench.views.viewTest),
path(r'approveTest/([0-9]+)/$', OpenBench.views.approveTest),
path(r'newTest/', OpenBench.views.newTest),
path(r'editTest/<int:id>/', OpenBench.views.editTest),
path(r'viewTest/<int:id>/', OpenBench.views.viewTest),
path(r'approveTest/<int:id>/', OpenBench.views.approveTest),
path(r'getFiles/$', OpenBench.views.getFiles),
path(r'getWorkload/$', OpenBench.views.getFiles),
path(r'submitResults/$', OpenBench.views.submitResults),
path(r'invalidBench/$', OpenBench.views.invalidBench),
path(r'getFiles/', OpenBench.views.getFiles),
path(r'getWorkload/', OpenBench.views.getFiles),
path(r'submitResults/', OpenBench.views.submitResults),
path(r'invalidBench/', OpenBench.views.invalidBench),
]
+52 -2
View File
@@ -1,3 +1,53 @@
from django.shortcuts import render
from django.shortcuts import render as djangoRender
# Create your views here.
# Wrap django.shortcuts.render to add framework settings
def render(request, template, data):
data.update(FRAMEWORK_DEFAULTS)
return djangoRender(request, 'OpenBench/{0}'.format(template), data)
## ADMIN
def register(request):
pass
def login(request):
pass
def logout(request):
pass
## CONTENT VIEWING
def eventLog(request):
pass
def index(request, page=0):
pass
## TEST MANAGMENT
def newTest(request):
pass
def editTest(request, id):
pass
def viewTest(request, id):
pass
def approveTest(request, id):
pass
## CLIENT TARGETS
def getFiles(request):
pass
def getWorkload(request):
pass
def submitResults(request):
pass
def invalidBench(request):
pass
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -5,5 +5,5 @@ import OpenBench.urls
urlpatterns = [
path(r'admin/', admin.site.urls),
path(r'^', include(OpenBench.urls.urlpatterns)),
path(r'', include(OpenBench.urls.urlpatterns)),
]
+47
View File
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en">
{% load static %}
<head>
<link rel="stylesheet" href="{% static 'style.css' %}">
<title>
{% block title %}
OpenBench
{% endblock %}
</title>
</head>
<body>
<div id="sidebar">
{% block sidebar %}
<ul>
<li class="listheader">ADMIN</li>
{% if user.is_authenticated %}
<li><a href="/logout/">Logout</a></li>
{% else %}
<li><a href="/login">Login </a></li>
<li><a href="/register">Register</a></li>
{% endif %}
</ul>
<ul>
<li class="listheader"> CONTENT </li>
<li> <a href="/all"> All </a> </li>
<li> <a href="/index"> Index </a> </li>
<li> <a href="/greens"> Greens </a> </li>
<li> <a href="/newTest/"> New Test </a> </li>
</ul>
<ul>
<li class="listheader"> LINKS </li>
<li> <a href="{{config.homepage}}">{{config.engine}}</a> </li>
<li> <a href="{{config.framework}}"> OpenBench </a> </li>
</ul>
{% endblock %}
</div>
<div id="content">
{% block content %}
{% endblock %}
</div>
</body>
</html>
+52
View File
@@ -0,0 +1,52 @@
{% extends "OpenBench/base.html" %}
{% block title %}
Index
{% endblock %}
{% block content %}
<table>
<tr>
<th class="tabletitle"> TEST </th>
<th class="tabletitle"> DIFF </th>
<th class="tabletitle"> APPROVE </th>
</tr>
{% for test in pendingtests %}
<tr class={{test.status}}>
<td style="text-align:left;font-weight:bold">
<a href="/viewTest/{{test.id}}">{{test.dev.name}}</a>
</td>
<td style="text-align:left;font-weight:bold">
<a href="{{test|gitDiffLink}}">diff</a>
</td>
<td><a href="/approveTest/{{test.id}}">approve</a></td>
</tr>
</table>
<table>
<tr>
<th class="tabletitle"> TEST </th>
<th class="tabletitle"> DIFF </th>
<th class="tabletitle"> STATS </th>
<th class="tabletitle"> ELO </th>
</tr>
{% for test in activetests %}
<tr class={{test.status}}>
<td style="text-align:left;font-weight:bold">
<a href="/viewTest/{{test.id}}">{{test.dev.name}}</a>
</td>
<td style="text-align:left;font-weight:bold">
<a href="{{test|gitDiffLink}}">diff</a>
</td>
<td style="text-align:left;font-size:14px"><strong>
SPRT @ {{test.timecontrol}}s Threads={{test.threads}} Hash={{test.hashsize}}MB<br>
LLR: {{test.currentllr|twoDigitPrecision}} ({{test.lowerllr|twoDigitPrecision}},
{{test.upperllr|twoDigitPrecision}}) [{{test.elolower|twoDigitPrecision}},
{{test.eloupper|twoDigitPrecision}}] <br> Games: {{test.games}}
W: {{test.wins}} L: {{test.losses}} D: {{test.draws}}
</strong></td>
<td> {{enginetest.elo|twoDigitPrecision}} </td>
</tr>
</table>
{% endblock %}