Allow uploading Network files to the server. No way to download yet.

This commit is contained in:
Andrew Grant committed 2020-12-20 19:03:57 -05:00
1 parent a59a797a9f
commit 93cc8119eb
7 files changed
+124 -3

No files matched your search

+11 -1
View File
@@ -42,7 +42,12 @@
<li><a href="/index">Index</a></li>
<li><a href="/greens">Greens</a></li>
<li><a href="/search">Search</a></li>
<li><a href="/newTest">New Test</a></li>
</ul>
<ul>
<li class="header">ACTIONS</li>
<li><a href="/newTest">Create Test</a></li>
<li><a href="/newNetwork">Upload Net</a></li>
</ul>
<ul>
@@ -50,6 +55,11 @@
<li><a href="/users">Users</a></li>
<li><a href="/events">Events</a></li>
<li><a href="/machines">Machines</a></li>
<li><a href="/networks">Networks</a></li>
</ul>
<ul>
<li class="header">SUPPORT</li>
<li><a href="{{config.framework}}">OpenBench</a></li>
<li><a href="https://discord.gg/HNXsgfS">Discord</a></li>
</ul>
+27
View File
@@ -0,0 +1,27 @@
{% extends "OpenBench/base.html" %}
{% block content %}
<table>
<tr>
<th>Engine</th>
<th>Uploader</th>
<th>Name</th>
<th>Hash</th>
<th>Downloads</th>
</tr>
{% for network in networks %}
<tr>
<td>{{network.engine}}</td>
<td><a href="/user/{{network.author}}">{{network.author}}</a></td>
<td>{{network.name}}</td>
<td>{{network.sha256}}</td>
<td style="text-align: right">{{network.downloads}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}
+21
View File
@@ -0,0 +1,21 @@
{% extends "OpenBench/base.html" %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
<label>Name</label><input name="name"><br>
<label>Weights</label><input name="netfile" type="file"><br>
<label>Engine</label> <select id="engine" name="engine">
{% for engine in config.engines %}
<option value="{{engine}}">{{engine}}</option>
{% endfor %}
<option selected value=""></option>
</select><br>
<input type="submit" value="Upload">
<form>
{% endblock %}