All the GPU stuff

This commit is contained in:
Timothy Warren 2022-10-07 22:00:14 -04:00
parent f6792de6c5
commit 5188f80567
18 changed files with 740 additions and 210 deletions

View File

@ -27,7 +27,17 @@ class GpuController extends AbstractController
#[Route('/', name: 'gpu_index', methods: ['GET'])] #[Route('/', name: 'gpu_index', methods: ['GET'])]
public function index(): Response public function index(): Response
{ {
return $this->itemListView('gpus'); $acquiredItems = $this->entityManager->getRepository(self::ENTITY)->findBy([
'acquired' => TRUE,
], []);
$newItems = $this->entityManager->getRepository(self::ENTITY)->findBy([
'acquired' => FALSE,
], []);
return $this->render('gpu/index.html.twig', [
'not_acquired' => $newItems,
'acquired' => $acquiredItems,
]);
} }
#[Route('/new', name: 'gpu_new', methods: ['GET', 'POST'])] #[Route('/new', name: 'gpu_new', methods: ['GET', 'POST'])]

View File

@ -2,6 +2,8 @@
namespace App\Entity; namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'brand', schema: 'collection')] #[ORM\Table(name: 'brand', schema: 'collection')]
@ -16,9 +18,21 @@ class Brand
#[ORM\SequenceGenerator(sequenceName: 'brand_id_seq', allocationSize: 1, initialValue: 1)] #[ORM\SequenceGenerator(sequenceName: 'brand_id_seq', allocationSize: 1, initialValue: 1)]
private int $id; private int $id;
#[ORM\ManyToMany(targetEntity: BrandCategory::class)]
#[ORM\JoinTable(name: 'collection.brand_category_link')]
#[ORM\JoinColumn(name: 'brand_id', referencedColumnName: 'id')]
#[ORM\InverseJoinColumn(name: 'brand_category', referencedColumnName: 'category_name')]
#[ORM\OrderBy(['name' => 'asc'])]
private $categories;
#[ORM\Column(name: 'name', unique: TRUE, nullable: FALSE)] #[ORM\Column(name: 'name', unique: TRUE, nullable: FALSE)]
private string $name; private string $name;
public function __construct()
{
$this->categories = new ArrayCollection();
}
public function __toString(): string public function __toString(): string
{ {
return $this->name; return $this->name;
@ -40,4 +54,28 @@ class Brand
return $this; return $this;
} }
/**
* @return Collection<int, BrandCategory>
*/
public function getCategories(): Collection
{
return $this->categories;
}
public function addCategory(BrandCategory $category): self
{
if (!$this->categories->contains($category)) {
$this->categories->add($category);
}
return $this;
}
public function removeCategory(BrandCategory $category): self
{
$this->categories->removeElement($category);
return $this;
}
} }

View File

@ -0,0 +1,31 @@
<?php declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'brand_category', schema: 'collection')]
#[ORM\Entity]
class BrandCategory {
#[ORM\Id]
#[ORM\Column(name: 'category_name')]
#[ORM\OrderBy(['name' => 'asc'])]
private string $name;
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function __toString(): string
{
return $this->name;
}
}

View File

@ -2,6 +2,7 @@
namespace App\Entity; namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Stringable; use Stringable;

View File

@ -2,6 +2,7 @@
namespace App\Entity; namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**

View File

@ -2,6 +2,7 @@
namespace App\Entity; namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'gpu', schema: 'collection')] #[ORM\Table(name: 'gpu', schema: 'collection')]
@ -18,15 +19,15 @@ class Gpu
#[ORM\ManyToOne(targetEntity: 'Brand')] #[ORM\ManyToOne(targetEntity: 'Brand')]
#[ORM\OrderBy(['name' => 'asc'])] #[ORM\OrderBy(['name' => 'asc'])]
#[ORM\JoinColumn(name: 'gpu_brand_id', referencedColumnName: 'id', nullable: FALSE)] #[ORM\JoinColumn(name: 'gpu_brand_id', referencedColumnName: 'id', nullable: FALSE)]
private readonly Brand $gpuBrand; private Brand $gpuBrand;
#[ORM\ManyToOne(targetEntity: 'GpuCore')] #[ORM\ManyToOne(targetEntity: 'GpuCore')]
#[ORM\OrderBy(['brand' => 'asc', 'name' => 'asc'])] #[ORM\OrderBy(['brand' => 'asc', 'name' => 'asc'])]
#[ORM\JoinColumn(name: 'gpu_core_id', referencedColumnName: 'id', nullable: TRUE)] #[ORM\JoinColumn(name: 'gpu_core_id', referencedColumnName: 'id', nullable: TRUE)]
private readonly GpuCore $gpuCore; private GpuCore $gpuCore;
#[ORM\Column(name: 'reference_model_name', nullable: FALSE)] #[ORM\Column(name: 'reference_model_name', nullable: FALSE)]
private readonly string $modelName; private string $modelName;
#[ORM\ManyToOne(targetEntity: 'Brand')] #[ORM\ManyToOne(targetEntity: 'Brand')]
#[ORM\OrderBy(['name' => 'asc'])] #[ORM\OrderBy(['name' => 'asc'])]
@ -37,10 +38,10 @@ class Gpu
private ?string $alternateModelName = ''; private ?string $alternateModelName = '';
#[ORM\Column(name: 'card_key', nullable: TRUE)] #[ORM\Column(name: 'card_key', nullable: TRUE)]
private readonly ?string $cardKey; private ?string $cardKey;
#[ORM\Column(name: 'bus_interface')] #[ORM\Column(name: 'bus_interface', nullable: TRUE)]
private readonly ?string $busInterface; private ?string $busInterface;
#[ORM\Column(name: 'slot_width')] #[ORM\Column(name: 'slot_width')]
private int $slotWidth = 1; private int $slotWidth = 1;
@ -57,56 +58,56 @@ class Gpu
#[ORM\Column(name: 'tdp', nullable: TRUE)] #[ORM\Column(name: 'tdp', nullable: TRUE)]
private readonly ?int $tdp; private readonly ?int $tdp;
#[ORM\Column(name: 'base_clock')] #[ORM\Column(name: 'base_clock', nullable: TRUE)]
private readonly ?int $baseClock; private ?int $baseClock;
#[ORM\Column(name: 'boost_clock')] #[ORM\Column(name: 'boost_clock', nullable: TRUE)]
private readonly ?int $boostClock; private ?int $boostClock;
#[ORM\Column(name: 'memory_clock')] #[ORM\Column(name: 'memory_clock', nullable: TRUE)]
private readonly ?int $memoryClock; private ?int $memoryClock;
#[ORM\Column(name: 'memory_size')] #[ORM\Column(name: 'memory_size', nullable: TRUE)]
private readonly ?int $memorySize; private ?int $memorySize;
#[ORM\Column(name: 'memory_bus')] #[ORM\Column(name: 'memory_bus', nullable: TRUE)]
private readonly ?int $memoryBus; private ?int $memoryBus;
#[ORM\Column(name: 'memory_type')] #[ORM\Column(name: 'memory_type', nullable: TRUE)]
private readonly ?string $memoryType; private ?string $memoryType;
#[ORM\Column(name: 'shading_units')] #[ORM\Column(name: 'shading_units', nullable: TRUE)]
private readonly ?int $shadingUnits; private ?int $shadingUnits;
#[ORM\Column(name: 'tmus')] #[ORM\Column(name: 'tmus', nullable: TRUE)]
private readonly ?int $tmus; private ?int $tmus;
#[ORM\Column(name: 'rops')] #[ORM\Column(name: 'rops', nullable: TRUE)]
private readonly ?int $rops; private ?int $rops;
#[ORM\Column(name: 'compute_units')] #[ORM\Column(name: 'compute_units', nullable: TRUE)]
private readonly ?int $computeUnits; private ?int $computeUnits;
#[ORM\Column(name: 'l1_cache')] #[ORM\Column(name: 'l1_cache', nullable: TRUE)]
private readonly ?string $l1cache; private ?string $l1cache;
#[ORM\Column(name: 'l2_cache')] #[ORM\Column(name: 'l2_cache', nullable: TRUE)]
private readonly ?string $l2cache; private ?string $l2cache;
#[ORM\Column(name: 'direct_x_support')] #[ORM\Column(name: 'direct_x_support', nullable: TRUE)]
private readonly ?string $directXSupport; private ?string $directXSupport;
#[ORM\Column(name: 'opengl_support')] #[ORM\Column(name: 'opengl_support', nullable: TRUE)]
private readonly ?string $openGLSupport; private ?string $openGLSupport;
#[ORM\Column(name: 'opencl_support')] #[ORM\Column(name: 'opencl_support', nullable: TRUE)]
private readonly ?string $openCLSupport; private ?string $openCLSupport;
#[ORM\Column(name: 'vulkan_support')] #[ORM\Column(name: 'vulkan_support', nullable: TRUE)]
private readonly ?string $vulkanSupport; private ?string $vulkanSupport;
#[ORM\Column(name: 'shader_model')] #[ORM\Column(name: 'shader_model', nullable: TRUE)]
private readonly ?string $shaderModel; private ?string $shaderModel;
#[ORM\Column(name: 'link')] #[ORM\Column(name: 'link')]
private readonly string $link; private readonly string $link;

View File

@ -44,7 +44,11 @@ class GpuCore implements Stringable
public function __toString(): string public function __toString(): string
{ {
return "{$this->brand} {$this->name} ({$this->variant}/{$this->generationName})"; $name = ( ! empty($this->variant))
? "{$this->name} ({$this->variant})"
: $this->name;
return "{$name} - [{$this->brand}] $this->generationName";
} }
public function getId(): ?int public function getId(): ?int

View File

@ -4,6 +4,9 @@ namespace App\Form;
use App\Entity\Brand; use App\Entity\Brand;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface}; use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use App\Entity\BrandCategory;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
class BrandType extends AbstractType class BrandType extends AbstractType
@ -11,7 +14,8 @@ class BrandType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options): void public function buildForm(FormBuilderInterface $builder, array $options): void
{ {
$builder $builder
->add('name'); ->add('name')
->add('categories');
} }
public function configureOptions(OptionsResolver $resolver): void public function configureOptions(OptionsResolver $resolver): void

View File

@ -28,30 +28,32 @@ class GpuType extends AbstractType
'class' => Brand::class, 'class' => Brand::class,
'query_builder' => $brandQueryBuilder, 'query_builder' => $brandQueryBuilder,
'empty_data' => NULL, 'empty_data' => NULL,
'placeholder' => 'Unknown',
'required' => false,
]) ])
->add('alternateModelName') ->add('alternateModelName')
->add('cardKey') ->add('cardKey')
->add('busInterface') ->add('busInterface')
->add('slotWidth') ->add('slotWidth')
->add('molexPower') ->add('molexPower', null, ['label' => 'Molex Power Connectors'])
->add('pcie6power') ->add('pcie6power', null, ['label' => 'PCIe 6-pin Power Connectors'])
->add('pcie8power') ->add('pcie8power', null, ['label' => 'PCIe 8-pin Power Connectors'])
->add('tdp') ->add('tdp', null, ['label' => 'TDP (Watts)'])
->add('baseClock') ->add('baseClock', null, ['label' => 'GPU Base Clock (MHz)'])
->add('boostClock') ->add('boostClock', null, ['label' => 'GPU Boost Clock (MHz)'])
->add('memoryClock') ->add('memoryClock', null, ['label' => 'Memory Speed (MHz)'])
->add('memorySize') ->add('memorySize', null, ['label' => 'Memory Size (MB)'])
->add('memoryBus') ->add('memoryBus', null, ['label' => 'Memory Bus Size (bits)'])
->add('memoryType') ->add('memoryType')
->add('shadingUnits') ->add('shadingUnits')
->add('tmus') ->add('tmus', null, ['label' => 'TMUs'])
->add('rops') ->add('rops', null, ['label' => 'ROPs'])
->add('computeUnits') ->add('computeUnits')
->add('l1cache') ->add('l1cache', null, ['label' => 'L1 Cache'])
->add('l2cache') ->add('l2cache', null, ['label' => 'L2 Cache'])
->add('directXSupport') ->add('directXSupport', null, ['label' => 'DirectX Support'])
->add('openGLSupport') ->add('openGLSupport', null, ['label' => 'OpenGL Support'])
->add('openCLSupport') ->add('openCLSupport', null, ['label' => 'OpenCL Support'])
->add('vulkanSupport') ->add('vulkanSupport')
->add('shaderModel') ->add('shaderModel')
->add('link') ->add('link')

View File

@ -0,0 +1,28 @@
<?php declare(strict_types=1);
namespace App\Repository;
use App\Entity\Brand;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\Query;
use Doctrine\Persistence\ManagerRegistry;
class BrandRepository extends ServiceEntityRepository {
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Brand::class);
}
public function filterByCategory(string $category): Query
{
$em = $this->getEntityManager();
$query = $em->createQuery("
SELECT b FROM App\Entity\Brand b
INNER JOIN b.categories c WHERE c.name = ?1
ORDER BY b.name ASC
");
$query->setParameter(1, $category);
return $query->execute();
}
}

View File

@ -16,9 +16,10 @@
<table class="hover scroll sortable stack"> <table class="hover scroll sortable stack">
<thead> <thead>
<tr> <tr>
<th>Actions</th> <th>&nbsp;</th>
<th>Id</th> <th>Id</th>
<th>Name</th> <th>Name</th>
<th>Categories</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -36,6 +37,13 @@
</td> </td>
<td>{{ brand.id }}</td> <td>{{ brand.id }}</td>
<td>{{ brand.name }}</td> <td>{{ brand.name }}</td>
<td>
<ul>
{% for category in brand.categories %}
<li>{{ category }}</li>
{% endfor %}
</ul>
</td>
</tr> </tr>
{% else %} {% else %}
<tr> <tr>

View File

@ -3,7 +3,7 @@
{% block title %}Brand{% endblock %} {% block title %}Brand{% endblock %}
{% block form %} {% block form %}
<h2>Brand</h2> <h2>Brand</h2>
<div class="callout"> <div class="callout">
<ul> <ul>
@ -16,27 +16,38 @@
</ul> </ul>
<hr /> <hr/>
<form method="post" action="{{ path('brand_delete', {'id': brand.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');"> <form method="post" action="{{ path('brand_delete', {'id': brand.id}) }}"
onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ brand.id) }}"> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ brand.id) }}">
<button type="submit" class="alert button expanded">Delete</button> <button type="submit" class="alert button expanded">Delete</button>
</form> </form>
</div> </div>
<div class="large primary callout"> <div class="large primary callout">
<table class="table"> <table class="table">
<tbody> <tbody>
<tr> <tr>
<th>Id</th> <th>Id</th>
<td>{{ brand.id }}</td> <td>{{ brand.id }}</td>
</tr> </tr>
<tr> <tr>
<th>Name</th> <th>Name</th>
<td>{{ brand.name }}</td> <td>{{ brand.name }}</td>
</tr> </tr>
</tbody> <tr>
</table> <th>Categories</th>
<td>
<ul>
{% for category in brand.categories %}
<li>{{ category }}</li>
{% endfor %}
</ul>
</td>
</tr>
</tbody>
</table>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,4 +0,0 @@
<form method="post" action="{{ path('gpu_delete', {'id': gpu.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ gpu.id) }}">
<button class="btn">Delete</button>
</form>

View File

@ -1,4 +0,0 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View File

@ -3,7 +3,7 @@
{% block title %}Edit Gpu{% endblock %} {% block title %}Edit Gpu{% endblock %}
{% block form %} {% block form %}
<h2>Edit Graphics Card</h2> <h2>Edit Graphics Card</h2>
<div class="small callout"> <div class="small callout">
<ul> <ul>
@ -13,8 +13,83 @@
</ul> </ul>
</div> </div>
<div class="large primary callout"> <div>
{{ form_start(edit_form) }} {{ form_start(edit_form) }}
<fieldset class="large primary callout">
<legend>Names / Brands</legend>
{{ form_row(edit_form.gpuBrand) }}
{{ form_row(edit_form.modelName) }}
{{ form_row(edit_form.gpuCore) }}
<hr />
{{ form_row(edit_form.boardBrand) }}
{{ form_row(edit_form.alternateModelName) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Bus / Size</legend>
{{ form_row(edit_form.cardKey) }}
{{ form_row(edit_form.busInterface) }}
{{ form_row(edit_form.slotWidth) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Power</legend>
{{ form_row(edit_form.molexPower) }}
{{ form_row(edit_form.pcie6power) }}
{{ form_row(edit_form.pcie8power) }}
{{ form_row(edit_form.tdp) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Clock Speeds</legend>
{{ form_row(edit_form.baseClock) }}
{{ form_row(edit_form.boostClock) }}
{{ form_row(edit_form.memoryClock) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Memory</legend>
{{ form_row(edit_form.memorySize) }}
{{ form_row(edit_form.memoryBus) }}
{{ form_row(edit_form.memoryType) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Rendering Hardware</legend>
{{ form_row(edit_form.shadingUnits) }}
{{ form_row(edit_form.tmus) }}
{{ form_row(edit_form.rops) }}
{{ form_row(edit_form.computeUnits) }}
{{ form_row(edit_form.l1cache) }}
{{ form_row(edit_form.l2cache) }}
</fieldset>
<fieldset class="large primary callout">
<legend>API Support</legend>
{{ form_row(edit_form.directXSupport) }}
{{ form_row(edit_form.openGLSupport) }}
{{ form_row(edit_form.openCLSupport) }}
{{ form_row(edit_form.vulkanSupport) }}
{{ form_row(edit_form.shaderModel) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Misc.</legend>
{{ form_row(edit_form.link) }}
{{ form_row(edit_form.count) }}
{{ form_row(edit_form.acquired) }}
{{ form_row(edit_form.notes) }}
</fieldset>
{{ form_widget(edit_form) }} {{ form_widget(edit_form) }}
<button <button
type="submit" type="submit"

View File

@ -3,7 +3,7 @@
{% block title %}Gpu index{% endblock %} {% block title %}Gpu index{% endblock %}
{% block body %} {% block body %}
<h2>Graphics Cards</h2> <h2>Graphics Cards</h2>
<div class="small callout primary"> <div class="small callout primary">
<ul> <ul>
@ -13,72 +13,237 @@
</ul> </ul>
</div> </div>
<table class="hover scroll sortable stack"> <ul
<thead> class="tabs"
<tr> data-deep-link="true"
<th>actions</th> data-update-history="true"
<th>Id</th> data-deep-link-smudge="true"
<th>Model Name</th> data-deep-link-smudge-delay="500"
<th>GPU</th> data-tabs
<th>Card Brand</th> id="classifications"
<th>Alternate Model Name</th> >
<th>Power</th> <li class="tabs-title is-active" aria-selected="true">
<th>Card Keying</th> <a href="#in_collection">In Collection</a>
<th>TDP</th> </li>
<th>Link</th> <li class="tabs-title">
<th>Count</th> <a href="#on_the_way">On the Way</a>
<th>Notes</th> </li>
</tr> </ul>
</thead>
<tbody> <div class="tabs-content" data-tabs-content="classifications">
{% for gpu in gpus %} <div class="tabs-panel is-active" id="in_collection">
<tr> <table class="hover scroll sortable stack">
<td> <thead>
<ul> <tr>
<li> <th>&nbsp;</th>
<a href="{{ path('gpu_show', {'id': gpu.id}) }}">View 👁</a> <th>Id</th>
</li> <th>Model Name</th>
<li> <th>GPU</th>
<a href="{{ path('gpu_edit', {'id': gpu.id}) }}">Edit <span class="edit-icon">&#9998;</span></a> <th>Card Brand</th>
</li> <th>Alternate Model Name</th>
</ul> <th>Card Keying</th>
</td> <th>Bus Interface</th>
<td>{{ gpu.id }}</td> <th>Slot Width</th>
<td>{{ gpu.gpuBrand.name }} {{ gpu.modelName }}</td> <th>Power</th>
<td> <th>Tdp</th>
{% if gpu.gpuCore.variant %} <th>GPU Clock</th>
{{ gpu.gpuCore.name }} ({{ gpu.gpuCore.variant }}) <th>Memory</th>
{% else %} <th>Shading Units</th>
{{ gpu.gpuCore.name }} <th>TMUs</th>
{% endif %} <th>ROPs</th>
</td> <th>Compute Units</th>
<td>{{ gpu.boardBrand.name }}</td> <th>L1 cache</th>
<td>{{ gpu.alternateModelName }}</td> <th>L2 cache</th>
<td> <th>DirectX Support</th>
{% if gpu.pcie6power > 0 or gpu.pcie8power > 0 %} <th>OpenGL</th>
{% if gpu.pcie6power > 0 %} <th>OpenCL</th>
{{ gpu.pcie6power }} PCIe 6-pin <th>Vulkan</th>
{% endif %} <th>Shader Model</th>
{% if gpu.pcie8power > 0 %} <th>Link</th>
{{ gpu.pcie8power }} PCIe 8-pin <th>Count</th>
{% endif %} <th>Acquired</th>
{% elseif gpu.molexPower > 0 %} <th>Notes</th>
{{ gpu.molexPower }} Molex </tr>
{% else %} </thead>
Slot <tbody>
{% endif %} {% for gpu in acquired %}
</td> <tr>
<td>{{ gpu.cardKey }}</td> <td>
<td>{{ gpu.tdp }} W</td> <ul>
<td>{{ gpu.link }}</td> <li>
<td>{{ gpu.count }}</td> <a href="{{ path('gpu_show', {'id': gpu.id}) }}">View 👁</a>
<td>{{ gpu.notes }}</td> </li>
</tr> <li>
{% else %} <a href="{{ path('gpu_edit', {'id': gpu.id}) }}">Edit <span class="edit-icon">&#9998;</span></a>
<tr> </li>
<td colspan="12">no records found</td> </ul>
</tr> </td>
{% endfor %} <td>{{ gpu.id }}</td>
</tbody> <td>{{ gpu.gpuBrand.name }} {{ gpu.modelName }}</td>
</table> <td>
{% if gpu.gpuCore.variant %}
{{ gpu.gpuCore.name }} ({{ gpu.gpuCore.variant }})
{% else %}
{{ gpu.gpuCore.name }}
{% endif %}
</td>
<td>{% if gpu.boardBrand %}{{ gpu.boardBrand.name }}{% else %}Unknown{% endif %}</td>
<td>{{ gpu.alternateModelName }}</td>
<td>{{ gpu.cardKey }}</td>
<td>{{ gpu.busInterface }}</td>
<td>{{ gpu.slotWidth }}</td>
<td>
{% if gpu.pcie6power > 0 or gpu.pcie8power > 0 %}
{% if gpu.pcie6power > 0 %}
{{ gpu.pcie6power }} PCIe 6-pin
{% endif %}
{% if gpu.pcie8power > 0 %}
{{ gpu.pcie8power }} PCIe 8-pin
{% endif %}
{% elseif gpu.molexPower > 0 %}
{{ gpu.molexPower }} Molex
{% else %}
Slot
{% endif %}
</td>
<td>{{ gpu.tdp }}</td>
<td>
{% if gpu.boostClock %}
{{ gpu.baseClock }} -> {{ gpu.boostClock }}
{% else %}
{{ gpu.baseClock }}
{% endif %}
</td>
<td>{{ gpu.memorySize }}MiB {{ gpu.memoryClock }}MHz {{ gpu.memoryBus }}bit {{ gpu.memoryType }}</td>
<td>{{ gpu.shadingUnits }}</td>
<td>{{ gpu.tmus }}</td>
<td>{{ gpu.rops }}</td>
<td>{{ gpu.computeUnits }}</td>
<td>{{ gpu.l1cache }}</td>
<td>{{ gpu.l2cache }}</td>
<td>{{ gpu.directXSupport }}</td>
<td>{{ gpu.openGLSupport }}</td>
<td>{{ gpu.openCLSupport }}</td>
<td>{{ gpu.vulkanSupport }}</td>
<td>{{ gpu.shaderModel }}</td>
<td>{{ gpu.link }}</td>
<td>{{ gpu.count }}</td>
<td>{{ gpu.acquired ? 'Yes' : 'No' }}</td>
<td>{{ gpu.notes }}</td>
</tr>
{% else %}
<tr>
<td colspan="32">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="tabs-panel" id="on_the_way">
<table class="hover scroll sortable stack">
<thead>
<tr>
<th>&nbsp;</th>
<th>Id</th>
<th>Model Name</th>
<th>GPU</th>
<th>Card Brand</th>
<th>Alternate Model Name</th>
<th>Card Keying</th>
<th>Bus Interface</th>
<th>Slot Width</th>
<th>Power</th>
<th>Tdp</th>
<th>GPU Clock</th>
<th>Memory</th>
<th>Shading Units</th>
<th>TMUs</th>
<th>ROPs</th>
<th>Compute Units</th>
<th>L1 cache</th>
<th>L2 cache</th>
<th>DirectX Support</th>
<th>OpenGL</th>
<th>OpenCL</th>
<th>Vulkan</th>
<th>Shader Model</th>
<th>Link</th>
<th>Count</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
{% for gpu in not_acquired %}
<tr>
<td>
<ul>
<li>
<a href="{{ path('gpu_show', {'id': gpu.id}) }}">View 👁</a>
</li>
<li>
<a href="{{ path('gpu_edit', {'id': gpu.id}) }}">Edit <span class="edit-icon">&#9998;</span></a>
</li>
</ul>
</td>
<td>{{ gpu.id }}</td>
<td>{{ gpu.gpuBrand.name }} {{ gpu.modelName }}</td>
<td>
{% if gpu.gpuCore.variant %}
{{ gpu.gpuCore.name }} ({{ gpu.gpuCore.variant }})
{% else %}
{{ gpu.gpuCore.name }}
{% endif %}
</td>
<td>{% if gpu.boardBrand %}{{ gpu.boardBrand.name }}{% else %}Unknown{% endif %}</td>
<td>{{ gpu.alternateModelName }}</td>
<td>{{ gpu.cardKey }}</td>
<td>{{ gpu.busInterface }}</td>
<td>{{ gpu.slotWidth }}</td>
<td>
{% if gpu.pcie6power > 0 or gpu.pcie8power > 0 %}
{% if gpu.pcie6power > 0 %}
{{ gpu.pcie6power }} PCIe 6-pin
{% endif %}
{% if gpu.pcie8power > 0 %}
{{ gpu.pcie8power }} PCIe 8-pin
{% endif %}
{% elseif gpu.molexPower > 0 %}
{{ gpu.molexPower }} Molex
{% else %}
Slot
{% endif %}
</td>
<td>{{ gpu.tdp }}</td>
<td>
{% if gpu.boostClock %}
{{ gpu.baseClock }} -> {{ gpu.boostClock }}
{% else %}
{{ gpu.baseClock }}
{% endif %}
</td>
<td>{{ gpu.memorySize }}MiB {{ gpu.memoryClock }}MHz {{ gpu.memoryBus }}bit {{ gpu.memoryType }}</td>
<td>{{ gpu.shadingUnits }}</td>
<td>{{ gpu.tmus }}</td>
<td>{{ gpu.rops }}</td>
<td>{{ gpu.computeUnits }}</td>
<td>{{ gpu.l1cache }}</td>
<td>{{ gpu.l2cache }}</td>
<td>{{ gpu.directXSupport }}</td>
<td>{{ gpu.openGLSupport }}</td>
<td>{{ gpu.openCLSupport }}</td>
<td>{{ gpu.vulkanSupport }}</td>
<td>{{ gpu.shaderModel }}</td>
<td>{{ gpu.link }}</td>
<td>{{ gpu.count }}</td>
<td>{{ gpu.notes }}</td>
</tr>
{% else %}
<tr>
<td colspan="32">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %} {% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}New Gpu{% endblock %} {% block title %}New Gpu{% endblock %}
{% block form %} {% block form %}
<h2>Add Graphics Card</h2> <h2>Add Graphics Card</h2>
<div class="small callout"> <div class="small callout">
<ul> <ul>
@ -13,10 +13,86 @@
</ul> </ul>
</div> </div>
<div class="large primary callout"> {{ form_start(form) }}
{{ form_start(form) }} <fieldset class="large primary callout">
{{ form_widget(form) }} <legend>Names / Brands</legend>
<button type="submit" class="success button expanded">Add</button>
{{ form_end(form) }} {{ form_row(form.gpuBrand) }}
</div> {{ form_row(form.modelName) }}
{{ form_row(form.gpuCore) }}
<hr />
{{ form_row(form.boardBrand) }}
{{ form_row(form.alternateModelName) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Bus / Size</legend>
{{ form_row(form.cardKey) }}
{{ form_row(form.busInterface) }}
{{ form_row(form.slotWidth) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Power</legend>
{{ form_row(form.molexPower) }}
{{ form_row(form.pcie6power) }}
{{ form_row(form.pcie8power) }}
{{ form_row(form.tdp) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Clock Speeds</legend>
{{ form_row(form.baseClock) }}
{{ form_row(form.boostClock) }}
{{ form_row(form.memoryClock) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Memory</legend>
{{ form_row(form.memorySize) }}
{{ form_row(form.memoryBus) }}
{{ form_row(form.memoryType) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Rendering Hardware</legend>
{{ form_row(form.shadingUnits) }}
{{ form_row(form.tmus) }}
{{ form_row(form.rops) }}
{{ form_row(form.computeUnits) }}
{{ form_row(form.l1cache) }}
{{ form_row(form.l2cache) }}
</fieldset>
<fieldset class="large primary callout">
<legend>API Support</legend>
{{ form_row(form.directXSupport) }}
{{ form_row(form.openGLSupport) }}
{{ form_row(form.openCLSupport) }}
{{ form_row(form.vulkanSupport) }}
{{ form_row(form.shaderModel) }}
</fieldset>
<fieldset class="large primary callout">
<legend>Misc.</legend>
{{ form_row(form.link) }}
{{ form_row(form.count) }}
{{ form_row(form.acquired) }}
{{ form_row(form.notes) }}
</fieldset>
{{ form_widget(form) }}
<button
type="submit"
class="success button expanded"
>Add</button>
{{ form_end(form) }}
{% endblock %} {% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}Gpu{% endblock %} {% block title %}Gpu{% endblock %}
{% block form %} {% block form %}
<h2>Graphics Card</h2> <h2>Graphics Card</h2>
<div class="callout"> <div class="callout">
<ul> <ul>
@ -15,8 +15,10 @@
</li> </li>
</ul> </ul>
<hr /> <hr />
<form method="post" action="{{ path('gpu_delete', {'id': gpu.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');"> <form method="post" action="{{ path('gpu_delete', {'id': gpu.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ gpu.id) }}"> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ gpu.id) }}">
<button type="submit" class="alert button expanded">Delete</button> <button type="submit" class="alert button expanded">Delete</button>
@ -24,53 +26,134 @@
</div> </div>
<div class="large primary callout"> <div class="large primary callout">
<table class="table"> <table class="table">
<tbody> <tbody>
<tr> <tr>
<th>Id</th> <th>Id</th>
<td>{{ gpu.id }}</td> <td>{{ gpu.id }}</td>
</tr> </tr>
<tr> <tr>
<th>ModelName</th> <th>ModelName</th>
<td>{{ gpu.modelName }}</td> <td>{{ gpu.modelName }}</td>
</tr> </tr>
<tr> <tr>
<th>AlternateModelName</th> <th>AlternateModelName</th>
<td>{{ gpu.alternateModelName }}</td> <td>{{ gpu.alternateModelName }}</td>
</tr> </tr>
<tr> <tr>
<th>MolexPower</th> <th>CardKey</th>
<td>{{ gpu.molexPower }}</td> <td>{{ gpu.cardKey }}</td>
</tr> </tr>
<tr> <tr>
<th>Pcie6power</th> <th>BusInterface</th>
<td>{{ gpu.pcie6power }}</td> <td>{{ gpu.busInterface }}</td>
</tr> </tr>
<tr> <tr>
<th>Pcie8power</th> <th>SlotWidth</th>
<td>{{ gpu.pcie8power }}</td> <td>{{ gpu.slotWidth }}</td>
</tr> </tr>
<tr> <tr>
<th>CardKey</th> <th>MolexPower</th>
<td>{{ gpu.cardKey }}</td> <td>{{ gpu.molexPower }}</td>
</tr> </tr>
<tr> <tr>
<th>Tdp</th> <th>Pcie6power</th>
<td>{{ gpu.tdp }}</td> <td>{{ gpu.pcie6power }}</td>
</tr> </tr>
<tr> <tr>
<th>Link</th> <th>Pcie8power</th>
<td>{{ gpu.link }}</td> <td>{{ gpu.pcie8power }}</td>
</tr> </tr>
<tr> <tr>
<th>Count</th> <th>Tdp</th>
<td>{{ gpu.count }}</td> <td>{{ gpu.tdp }}</td>
</tr> </tr>
<tr> <tr>
<th>Notes</th> <th>BaseClock</th>
<td>{{ gpu.notes }}</td> <td>{{ gpu.baseClock }}</td>
</tr> </tr>
</tbody> <tr>
</table> <th>BoostClock</th>
<td>{{ gpu.boostClock }}</td>
</tr>
<tr>
<th>MemoryClock</th>
<td>{{ gpu.memoryClock }}</td>
</tr>
<tr>
<th>MemorySize</th>
<td>{{ gpu.memorySize }}</td>
</tr>
<tr>
<th>MemoryBus</th>
<td>{{ gpu.memoryBus }}</td>
</tr>
<tr>
<th>MemoryType</th>
<td>{{ gpu.memoryType }}</td>
</tr>
<tr>
<th>ShadingUnits</th>
<td>{{ gpu.shadingUnits }}</td>
</tr>
<tr>
<th>Tmus</th>
<td>{{ gpu.tmus }}</td>
</tr>
<tr>
<th>Rops</th>
<td>{{ gpu.rops }}</td>
</tr>
<tr>
<th>ComputeUnits</th>
<td>{{ gpu.computeUnits }}</td>
</tr>
<tr>
<th>L1cache</th>
<td>{{ gpu.l1cache }}</td>
</tr>
<tr>
<th>L2cache</th>
<td>{{ gpu.l2cache }}</td>
</tr>
<tr>
<th>DirectXSupport</th>
<td>{{ gpu.directXSupport }}</td>
</tr>
<tr>
<th>OpenGLSupport</th>
<td>{{ gpu.openGLSupport }}</td>
</tr>
<tr>
<th>OpenCLSupport</th>
<td>{{ gpu.openCLSupport }}</td>
</tr>
<tr>
<th>VulkanSupport</th>
<td>{{ gpu.vulkanSupport }}</td>
</tr>
<tr>
<th>ShaderModel</th>
<td>{{ gpu.shaderModel }}</td>
</tr>
<tr>
<th>Link</th>
<td>{{ gpu.link }}</td>
</tr>
<tr>
<th>Count</th>
<td>{{ gpu.count }}</td>
</tr>
<tr>
<th>Acquired</th>
<td>{{ gpu.acquired ? 'Yes' : 'No' }}</td>
</tr>
<tr>
<th>Notes</th>
<td>{{ gpu.notes }}</td>
</tr>
</tbody>
</table>
</div> </div>
{% endblock %} {% endblock %}