Added benchmark and hardware models; added routes and views for hardware

This commit is contained in:
2023-11-26 12:54:09 -05:00
parent e5602e660d
commit 2f016d3062
10 changed files with 181 additions and 2 deletions

35
views/hardware/add.twig Normal file
View File

@ -0,0 +1,35 @@
{% extends 'layouts/default.twig' %}
{% block title %}Add Hardware{% endblock %}
{% block content %}
<div class="row">
<h2>Add hardware</h2>
<form class="twelve columns" action="/hardware/add" method="POST">
<div class="row">
<div class="nine columns">
<label for="hardware_name">
Hardware name:
<input id="hardware_name" class="u-full-width" type="text" name="hardware_name" placeholder="EVGA RTX 3080 Ti">
</label>
</div>
<div class="three columns">
<label for="hardware_type">
Hardware type:
<select id="hardware_type" class="u-full-width" name="hardware_type">
<option value="cpu">Processor</option>
<option value="mem">Memory</option>
<option value="gpu">Graphics card</option>
<option value="ssd">SSD</option>
<option value="hdd">HDD</option>
</select>
</label>
</div>
</div>
<input class="button-primary u-full-width" type="submit" value="Submit">
</form>
</div>
{% endblock %}

31
views/hardware/list.twig Normal file
View File

@ -0,0 +1,31 @@
{% extends 'layouts/default.twig' %}
{% block title %}List of Hardware{% endblock %}
{% block content %}
<div class="row">
<h2>Hardware</h2>
<a href="/hardware/add">Add new hardware</a>
<table class="twelve columns">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Created at</td>
<td>Last updated</td>
</tr>
</thead>
<tbody>
{% for h in hardware %}
<tr>
<td><a href="/hardware/{{ h.id }}">{{ h.name }}</a></td>
<td>{{ h.type }}</td>
<td>{{ p.createdAt | date('m/d/Y g:ia') }}</td>
<td>{{ p.updatedAt | date('m/d/Y g:ia') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

15
views/hardware/view.twig Normal file
View File

@ -0,0 +1,15 @@
{% extends 'layouts/default.twig' %}
{% block title %}{{ hardware.name }}{% endblock %}
{% block content %}
<div class="row">
<h2>{{ hardware.name }}</h2>
<p>Hardware type: {{ hardware.type }}</p>
<hr>
<p><a href="/hardware">Back</a></p>
</div>
{% endblock %}