A bunch of fixes and tweaks

This commit is contained in:
Timothy Warren 2022-10-28 08:46:35 -04:00
parent a64ec3f913
commit 21604e5e3e
29 changed files with 840 additions and 458 deletions

View File

@ -24,31 +24,31 @@ class CpuController extends AbstractController {
{
}
#[Route('/', name: 'app_cpu_index', methods: ['GET'])]
#[Route('/', name: 'cpu_index', methods: ['GET'])]
public function index(): Response
{
return $this->itemListView('cpus', []);
}
#[Route('/new', name: 'app_cpu_new', methods: ['GET', 'POST'])]
#[Route('/new', name: 'cpu_new', methods: ['GET', 'POST'])]
public function new(Request $request): Response
{
return $this->itemCreate($request, 'cpu');
}
#[Route('/{id}', name: 'app_cpu_show', methods: ['GET'])]
#[Route('/{id}', name: 'cpu_show', methods: ['GET'])]
public function show(Cpu $cpu): Response
{
return $this->itemView($cpu, 'cpu');
}
#[Route('/{id}/edit', name: 'app_cpu_edit', methods: ['GET', 'POST'])]
#[Route('/{id}/edit', name: 'cpu_edit', methods: ['GET', 'POST'])]
public function edit(Request $request, Cpu $cpu): Response
{
return $this->itemUpdate($request, $cpu, 'cpu');
}
#[Route('/{id}', name: 'app_cpu_delete', methods: ['POST'])]
#[Route('/{id}', name: 'cpu_delete', methods: ['POST'])]
public function delete(Request $request, Cpu $cpu): Response
{
return $this->deleteCSRF($request, $cpu);

View File

@ -9,7 +9,7 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Table('cpu', schema: 'collection')]
#[ORM\Entity]
class Cpu {
use CpuCache;
use CpuCacheTrait;
use GetSetTrait;
#[ORM\Column('id', type: 'integer', nullable: FALSE)]
@ -23,7 +23,7 @@ class Cpu {
private Brand $brand;
#[ORM\Column('architecture', type: 'string', enumType: CpuArchitectureEnum::class)]
private string $architecture;
private CpuArchitectureEnum $architecture;
/**
* @var Collection<int, Socket>
@ -49,11 +49,11 @@ class Cpu {
))]
private ?string $lotNumber;
#[ORM\Column('micro_architecture', type: 'string')]
private string $microArchitecture = '';
#[ORM\Column('micro_architecture', type: 'string', nullable: TRUE)]
private ?string $microArchitecture = '';
#[ORM\Column('codename', type: 'string')]
private string $codeName = '';
#[ORM\Column('codename', type: 'string', nullable: TRUE)]
private ?string $codeName = '';
#[ORM\Column('base_speed', type: 'integer', options: array(
'comment' => 'The stock speed of the cpu in MHz'
@ -79,7 +79,7 @@ class Cpu {
#[ORM\Column('voltage', type: 'float', nullable: true)]
private ?float $voltage;
#[ORM\Column('tdp', type: 'integer')]
#[ORM\Column('tdp', type: 'integer', nullable: true)]
private ?int $tdp;
#[ORM\Column('process_node', type: 'integer', nullable: TRUE)]
@ -101,8 +101,8 @@ class Cpu {
#[ORM\Column('link', type: 'string')]
private string $link;
#[ORM\Column('notes', type: 'string')]
private string $notes = '';
#[ORM\Column('notes', type: 'text', nullable: true)]
private ?string $notes = '';
public function __construct()
{

View File

@ -4,29 +4,45 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
trait CpuCache {
#[ORM\Column('l1_count', type:'integer', options: array(
'comment' => 'The number of L1 caches on the package, usually the same as the number of cores'
trait CpuCacheTrait {
#[ORM\Column('l1_data_count', type:'integer', nullable: true, options: array(
'comment' => 'The number of L1 data caches on the package, usually the same as the number of cores'
))]
private int $L1Count = 1;
private ?int $L1dCount = null;
#[ORM\Column('l1_data_size', type: 'integer', nullable: true, options: array(
'comment' => 'The size of each Level 1 data cache in KB'
))]
private ?int $L1dSize;
private ?int $L1dSize = null;
#[ORM\Column('l1_data_way', type: 'integer', nullable: true)]
private ?int $L1dWay = null;
#[ORM\Column('l1_code_count', type:'integer', nullable: true, options: array(
'comment' => 'The number of L1 instruction caches on the package, usually the same as the number of cores'
))]
private ?int $L1cCount = null;
#[ORM\Column('l1_code_size', type: 'integer', nullable: true, options: array(
'comment' => 'The size of each Level 1 instruction cache in KB'
))]
private ?int $L1cSize;
private ?int $L1cSize = null;
#[ORM\Column('l1_code_way', type: 'integer', nullable: true)]
private ?int $L1cWay = null;
#[ORM\Column('l1_unified_count', type:'integer', nullable: true, options: array(
'comment' => 'The number of L1 caches on the package, usually the same as the number of cores'
))]
private ?int $L1uCount = null;
#[ORM\Column('l1_unified_size', type: 'integer', nullable: true, options: array(
'comment' => 'The size of each Level 1 unified cache in KB'
))]
private ?int $L1uSize;
private ?int $L1uSize = null;
#[ORM\Column('l1_way', type: 'integer', nullable: true)]
private ?int $L1Way;
#[ORM\Column('l1_unified_way', type: 'integer', nullable: true)]
private ?int $L1uWay = null;
#[ORM\Column('l2_count', type: 'integer', options: array(
'comment' => 'The number of L2 caches on the package, usually the same as the number of cores'

View File

@ -3,17 +3,42 @@
namespace App\Enum;
enum CpuArchitectureEnum: string {
case X86 = 'x86';
case X86_64 = 'x86_64';
case ARM = 'arm';
case ARM64 = 'arm64';
case POWER_PC = 'PowerPC';
case POWER = 'IBM POWER';
case SIXTY_EIGHT_K = 'Motorola 68k';
case RISC_V = 'RISC V';
case MIPS = 'MIPS';
case SIX_FIVE_OH_TWO = 'MOS 6502';
case Z80 = 'Z80';
case EIGHT_OH_ONE_EIGHT_SIX = 'Intel 80186';
case EIGHT_OH_EIGHT_EIGHT = 'Intel 8088';
case EIGHT_OH_186 = 'Intel 80186';
case MIPS = 'MIPS';
case POWER = 'IBM POWER';
case POWER_PC = 'PowerPC';
case RISC_V = 'RISC V';
case SIX_FIVE_OH_TWO = 'MOS 6502';
case SIXTY_EIGHT_K = 'Motorola 68k';
case X86 = 'x86';
case X86_64 = 'x86_64';
case Z80 = 'Z80';
public static function getGroups(): array
{
return [
'Common' => [
self::X86,
self::X86_64,
self::ARM,
self::ARM64,
],
'Historical' => [
self::EIGHT_OH_EIGHT_EIGHT,
self::EIGHT_OH_ONE_EIGHT_SIX,
self::SIX_FIVE_OH_TWO,
self::SIXTY_EIGHT_K,
self::POWER_PC,
self::Z80,
],
'Others' => [
self::MIPS,
self::POWER,
self::RISC_V,
],
];
}
}

View File

@ -2,23 +2,88 @@
namespace App\Form;
use App\Entity\Brand;
use App\Entity\Cpu;
use App\Enum\CpuArchitectureEnum;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EnumType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use UnitEnum;
class CpuType extends AbstractType {
use BrandCategoryTrait;
class CpuType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('architecture')
->add('architecture', EnumType::class, [
'class' => CpuArchitectureEnum::class,
'choice_label' => fn(UnitEnum $choice): string => $choice->value,
'choices' => CpuArchitectureEnum::getGroups(),
'preferred_choices' => [CpuArchitectureEnum::X86, CpuArchitectureEnum::X86_64]
])
->add('brand', EntityType::class, [
'class' => Brand::class,
'query_builder' => self::filterBrands('cpu'),
])
->add('sockets')
->add('productLine')
->add('model')
->add('partNumber')
->add('lotNumber')
->add('microArchitecture')
->add('codeName')
// Cache Stuff
->add('L1dCount', null, [
'label' => 'L1 Data Cache(s)',
])
->add('L1dSize', null, [
'label' => 'L1 Data Size KB'
])
->add('L1dWay', null, [
'label' => 'L1 Data (x-way)'
])
->add('L1cCount', null, [
'label' => 'L1 Instruction Cache(s)',
])
->add('L1cSize', null, [
'label' => 'L1 Instruction Size KB'
])
->add('L1cWay', null, [
'label' => 'L1 Instruction (x-way)'
])
->add('L1uCount', null, [
'label' => 'L1 Unified Cache(s)',
])
->add('L1uSize', null, [
'label' => 'L1 Unified Cache Size: KB'
])
->add('L1uWay', null, [
'label' => 'L1 Unified (x-way)'
])
->add('L2Count', null, [
'label' => 'L2 Cache(s)'
])
->add('L2Size', null, [
'label' => 'L2 Cache Size KB (per unit)'
])
->add('L2Way', null, [
'label' => 'L2 Cache (x-way)'
])
->add('L3Count', null, [
'label' => 'L3 Cache(s)'
])
->add('L3Size', null, [
'label' => 'L3 Cache Size KB (per unit)'
])
->add('L3Way', null, [
'label' => 'L3 Cache (x-way)'
])
->add('baseSpeed')
->add('boostSpeed')
->add('cores')
@ -30,21 +95,8 @@ class CpuType extends AbstractType
->add('count')
->add('usable')
->add('received')
->add('link')
->add('link', UrlType::class)
->add('notes')
->add('L1Count')
->add('L1dSize')
->add('L1cSize')
->add('L1uSize')
->add('L1Way')
->add('L2Count')
->add('L2Size')
->add('L2Way')
->add('L3Count')
->add('L3Size')
->add('L3Way')
->add('brand')
->add('sockets')
;
}

View File

@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027192946 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE collection.cpu ADD l1_data_way INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_code_way INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu DROP l1_data_way');
$this->addSql('ALTER TABLE collection.cpu DROP l1_code_way');
}
}

View File

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027200731 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE collection.cpu ALTER notes TYPE TEXT');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu ALTER notes TYPE VARCHAR(255)');
}
}

View File

@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027211813 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE collection.cpu ADD l1_data_count INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_code_count INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_unified_count INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu DROP l1_count');
$this->addSql('ALTER TABLE collection.cpu RENAME COLUMN l1_way TO l1_unified_way');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_data_count IS \'The number of L1 data caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_code_count IS \'The number of L1 instruction caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_unified_count IS \'The number of L1 caches on the package, usually the same as the number of cores\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu ADD l1_count INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu DROP l1_data_count');
$this->addSql('ALTER TABLE collection.cpu DROP l1_code_count');
$this->addSql('ALTER TABLE collection.cpu DROP l1_unified_count');
$this->addSql('ALTER TABLE collection.cpu RENAME COLUMN l1_unified_way TO l1_way');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_count IS \'The number of L1 caches on the package, usually the same as the number of cores\'');
}
}

View File

@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027214731 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE collection.cpu ALTER micro_architecture DROP NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER codename DROP NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER tdp DROP NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER notes DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu ALTER micro_architecture SET NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER codename SET NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER tdp SET NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER notes SET NOT NULL');
}
}

View File

@ -14,13 +14,13 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button
type="submit"
class="success button expanded"
>Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<form method="post" action="{{ path('<?= $route_name ?>_delete', {'<?= $entity_identifier ?>': <?= $entity_twig_var_singular ?>.<?= $entity_identifier ?>}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ <?= $entity_twig_var_singular ?>.<?= $entity_identifier ?>) }}">

View File

@ -3,7 +3,7 @@
{% block title %}<?= $entity_class_name ?>{% endblock %}
{% block form %}
<h2>Brand</h2>
<h2><?= $entity_class_name ?></h2>
<div class="callout">
<ul>

View File

@ -109,7 +109,7 @@ trait FormControllerTrait
// If showing the edit form
$templateData = [
$templateKey => $item,
'edit_form' => $editForm->createView(),
'form' => $editForm->createView(),
];
if (method_exists($this, 'createDeleteForm')) {

View File

@ -14,17 +14,17 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button
type="submit"
class="success button expanded"
>Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<form method="post" action="{{ path('<?= $route_name ?>_delete', {'<?= $entity_identifier ?>': <?= $entity_twig_var_singular ?>.<?= $entity_identifier ?>}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ <?= $entity_twig_var_singular ?>.<?= $entity_identifier ?>) }}">
<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) }}">
<button type="submit" class="alert button expanded">Delete</button>
</form>
</div>

View File

@ -16,11 +16,11 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_errors(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<div class="grid-x grid-margin-x">
<div class="cell large-6 small-12">

View File

@ -16,10 +16,10 @@
</div>
<div class="large callout primary">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Save</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<hr />

View File

@ -8,23 +8,105 @@
<div class="small callout">
<ul>
<li>
<a href="{{ path('app_cpu_index') }}">Back to the list</a>
<a href="{{ path('cpu_index') }}">Back to the list</a>
</li>
</ul>
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
<fieldset class="large primary callout">
<legend>Brand, Model, Family</legend>
<div class="grid-x grid-margin-x">
<div class="cell">{{ form_row(form.architecture) }}</div>
<div class="cell">{{ form_row(form.sockets) }}</div>
<div class="cell medium-4">{{ form_row(form.brand) }}</div>
<div class="cell medium-4">{{ form_row(form.productLine) }}</div>
<div class="cell medium-4">{{ form_row(form.model) }}</div>
<div class="cell medium-6">{{ form_row(form.partNumber) }}</div>
<div class="cell medium-6">{{ form_row(form.lotNumber) }}</div>
<div class="cell medium-6">{{ form_row(form.microArchitecture) }}</div>
<div class="cell medium-6">{{ form_row(form.codeName) }}</div>
</div>
</fieldset>
<fieldset class="large primary callout">
<legend>Cache</legend>
<details {% if cpu.L1uSize %}open{% endif %}>
<summary>Unified Cache</summary>
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.L1uCount) }}</div>
<div class="cell medium-4">{{ form_row(form.L1uSize) }}</div>
<div class="cell medium-4">{{ form_row(form.L1uWay) }}</div>
</div>
</details>
<details {% if cpu.L1cSize %}open{% endif %}>
<summary>Split cache</summary>
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.L1cCount) }}</div>
<div class="cell medium-4">{{ form_row(form.L1cSize) }}</div>
<div class="cell medium-4">{{ form_row(form.L1cWay) }}</div>
<div class="cell medium-4">{{ form_row(form.L1dCount) }}</div>
<div class="cell medium-4">{{ form_row(form.L1dSize) }}</div>
<div class="cell medium-4">{{ form_row(form.L1dWay) }}</div>
</div>
</details>
<hr />
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.L2Count) }}</div>
<div class="cell medium-4">{{ form_row(form.L2Size) }}</div>
<div class="cell medium-4">{{ form_row(form.L2Way) }}</div>
</div>
<hr />
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.L3Count) }}</div>
<div class="cell medium-4">{{ form_row(form.L3Size) }}</div>
<div class="cell medium-4">{{ form_row(form.L3Way) }}</div>
</div>
</fieldset>
<fieldset class="large primary callout">
<legend>Speed and Power</legend>
<div class="grid-x grid-margin-x">
<div class="cell medium-6">{{ form_row(form.baseSpeed) }}</div>
<div class="cell medium-6">{{ form_row(form.boostSpeed) }}</div>
<div class="cell medium-6">{{ form_row(form.cores) }}</div>
<div class="cell medium-6">{{ form_row(form.threads) }}</div>
<div class="cell">{{ form_row(form.igp) }}</div>
<div class="cell">{{ form_row(form.voltage) }}</div>
<div class="cell medium-6">{{ form_row(form.tdp) }}</div>
<div class="cell medium-6">{{ form_row(form.processNode) }}</div>
</div>
</fieldset>
<fieldset class="large primary callout">
<legend>Misc</legend>
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.count) }}</div>
<div class="cell medium-8">&nbsp;</div>
<div class="cell medium-6">{{ form_row(form.usable) }}</div>
<div class="cell medium-6">{{ form_row(form.received) }}</div>
<div class="cell">{{ form_row(form.link) }}</div>
<div class="cell">{{ form_row(form.notes) }}</div>
</div>
</fieldset>
{{ form_widget(form) }}
<button
type="submit"
class="success button expanded"
>Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<form method="post" action="{{ path('app_cpu_delete', {'id': cpu.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<form method="post" action="{{ path('cpu_delete', {'id': cpu.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ cpu.id) }}">
<button type="submit" class="alert button expanded">Delete</button>
</form>
</div>
{% endblock %}

View File

@ -3,32 +3,33 @@
{% block title %}Cpu{% endblock %}
{% block body %}
<h2>Cpu</h2>
<h2>CPUs</h2>
<div class="small callout primary">
<ul>
<li>
<a href="{{ path('app_cpu_new') }}">Add Cpu</a>
<a href="{{ path('cpu_new') }}">Add Cpu</a>
</li>
</ul>
</div>
<table class="table">
<table class="hover scroll sortable stack">
<thead>
<tr>
<th>&nbsp;</th>
<th>Id</th>
<th>Architecture</th>
<th>ProductLine</th>
<th>Arch</th>
<th>Model</th>
<th>Socket(s)</th>
<th>Part Number</th>
<th>Lot Number</th>
<th>MicroArchitecture</th>
<th>uArch</th>
<th>Code Name</th>
<th>BaseSpeed</th>
<th>BoostSpeed</th>
<th>Cores</th>
<th>Threads</th>
<th>Speed</th>
<th>C/T</th>
<th>L1 Cache</th>
<th>L2 Cache</th>
<th>L3 Cache</th>
<th>Igp</th>
<th>Voltage</th>
<th>Tdp</th>
@ -38,17 +39,6 @@
<th>Received</th>
<th>Link</th>
<th>Notes</th>
<th>L1Count</th>
<th>L1dSize</th>
<th>L1cSize</th>
<th>L1uSize</th>
<th>L1Way</th>
<th>L2Count</th>
<th>L2Size</th>
<th>L2Way</th>
<th>L3Count</th>
<th>L3Size</th>
<th>L3Way</th>
</tr>
</thead>
<tbody>
@ -57,29 +47,57 @@
<td>
<ul>
<li>
<a href="{{ path('app_cpu_show', {'id': cpu.id}) }}">
<a href="{{ path('cpu_show', {'id': cpu.id}) }}">
View 👁
</a>
</li>
<li>
<a href="{{ path('app_cpu_edit', {'id': cpu.id}) }}">
<a href="{{ path('cpu_edit', {'id': cpu.id}) }}">
Edit <span class="edit-icon">&#9998;</span>
</a>
</li>
</ul>
</td>
<td>{{ cpu.id }}</td>
<td>{{ cpu.architecture }}</td>
<td>{{ cpu.productLine }}</td>
<td>{{ cpu.model }}</td>
<td>{{ cpu.architecture.value }}</td>
<td>{{ cpu.brand.name }} {{ cpu.productLine }} {{ cpu.model }}</td>
<td>
<ul>
{% for socket in cpu.sockets %}
<li>{{ socket.name }}</li>
{% endfor %}
</ul>
</td>
<td>{{ cpu.partNumber }}</td>
<td>{{ cpu.lotNumber }}</td>
<td>{{ cpu.microArchitecture }}</td>
<td>{{ cpu.codeName }}</td>
<td>{{ cpu.baseSpeed }}</td>
<td>{{ cpu.boostSpeed }}</td>
<td>{{ cpu.cores }}</td>
<td>{{ cpu.threads }}</td>
<td>
{{ cpu.baseSpeed }}
{% if cpu.boostSpeed > 0 %}
-{{ cpu.boostSpeed }}
{% endif %}
</td>
<td>{{ cpu.cores }} / {{ cpu.threads }}</td>
<td>
{% if cpu.L1uCount > 0 %}
{{ cpu.L1uCount }}x {{ cpu.L1uSize }}KB {{ cpu.L1uWay }}-way
{% endif %}
{% if cpu.L1cCount > 0 %}
{{ cpu.L1cCount }}x {{ cpu.L1dSize }}KB {{ cpu.L1dWay }}-way data,
{{ cpu.L1dCount }}x {{ cpu.L1cSize }}KB {{ cpu.L1cWay }}-way instruction
{% endif %}
</td>
<td>
{% if cpu.L2Count > 0 %}
{{ cpu.L2Count }}x {{ cpu.L2Size }}KB {{ cpu.L2Way }}-way
{% endif %}
</td>
<td>
{% if cpu.L3Count > 0 %}
{{ cpu.L3Count }}x {{ cpu.L3Size }}KB {{ cpu.L3Way }}-way
{% endif %}
</td>
<td>{{ cpu.igp }}</td>
<td>{{ cpu.voltage }}</td>
<td>{{ cpu.tdp }}</td>
@ -89,17 +107,6 @@
<td>{{ cpu.received ? 'Yes' : 'No' }}</td>
<td>{{ cpu.link }}</td>
<td>{{ cpu.notes }}</td>
<td>{{ cpu.L1Count }}</td>
<td>{{ cpu.L1dSize }}</td>
<td>{{ cpu.L1cSize }}</td>
<td>{{ cpu.L1uSize }}</td>
<td>{{ cpu.L1Way }}</td>
<td>{{ cpu.L2Count }}</td>
<td>{{ cpu.L2Size }}</td>
<td>{{ cpu.L2Way }}</td>
<td>{{ cpu.L3Count }}</td>
<td>{{ cpu.L3Size }}</td>
<td>{{ cpu.L3Way }}</td>
</tr>
{% else %}
<tr>

View File

@ -8,16 +8,98 @@
<div class="small callout">
<ul>
<li>
<a href="{{ path('app_cpu_index') }}">Back to the list</a>
<a href="{{ path('cpu_index') }}">Back to the list</a>
</li>
</ul>
</div>
<div class="large primary callout">
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Add</button>
{{ form_end(form) }}
<fieldset class="large primary callout">
<legend>Brand, Model, Family</legend>
<div class="grid-x grid-margin-x">
<div class="cell">{{ form_row(form.architecture) }}</div>
<div class="cell">{{ form_row(form.sockets) }}</div>
<div class="cell medium-4">{{ form_row(form.brand) }}</div>
<div class="cell medium-4">{{ form_row(form.productLine) }}</div>
<div class="cell medium-4">{{ form_row(form.model) }}</div>
<div class="cell medium-6">{{ form_row(form.partNumber) }}</div>
<div class="cell medium-6">{{ form_row(form.lotNumber) }}</div>
<div class="cell medium-6">{{ form_row(form.microArchitecture) }}</div>
<div class="cell medium-6">{{ form_row(form.codeName) }}</div>
</div>
</fieldset>
<fieldset class="large primary callout">
<legend>Cache</legend>
<details {% if cpu.L1uSize %}open{% endif %}>
<summary>Unified Cache</summary>
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.L1uCount) }}</div>
<div class="cell medium-4">{{ form_row(form.L1uSize) }}</div>
<div class="cell medium-4">{{ form_row(form.L1uWay) }}</div>
</div>
</details>
<details {% if cpu.L1cSize %}open{% endif %}>
<summary>Split cache</summary>
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.L1cCount) }}</div>
<div class="cell medium-4">{{ form_row(form.L1cSize) }}</div>
<div class="cell medium-4">{{ form_row(form.L1cWay) }}</div>
<div class="cell medium-4">{{ form_row(form.L1dCount) }}</div>
<div class="cell medium-4">{{ form_row(form.L1dSize) }}</div>
<div class="cell medium-4">{{ form_row(form.L1dWay) }}</div>
</div>
</details>
<hr />
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.L2Count) }}</div>
<div class="cell medium-4">{{ form_row(form.L2Size) }}</div>
<div class="cell medium-4">{{ form_row(form.L2Way) }}</div>
</div>
<hr />
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.L3Count) }}</div>
<div class="cell medium-4">{{ form_row(form.L3Size) }}</div>
<div class="cell medium-4">{{ form_row(form.L3Way) }}</div>
</div>
</fieldset>
<fieldset class="large primary callout">
<legend>Speed and Power</legend>
<div class="grid-x grid-margin-x">
<div class="cell medium-6">{{ form_row(form.baseSpeed) }}</div>
<div class="cell medium-6">{{ form_row(form.boostSpeed) }}</div>
<div class="cell medium-6">{{ form_row(form.cores) }}</div>
<div class="cell medium-6">{{ form_row(form.threads) }}</div>
<div class="cell">{{ form_row(form.igp) }}</div>
<div class="cell">{{ form_row(form.voltage) }}</div>
<div class="cell medium-6">{{ form_row(form.tdp) }}</div>
<div class="cell medium-6">{{ form_row(form.processNode) }}</div>
</div>
</fieldset>
<fieldset class="large primary callout">
<legend>Misc</legend>
<div class="grid-x grid-margin-x">
<div class="cell medium-4">{{ form_row(form.count) }}</div>
<div class="cell medium-8">&nbsp;</div>
<div class="cell medium-6">{{ form_row(form.usable) }}</div>
<div class="cell medium-6">{{ form_row(form.received) }}</div>
<div class="cell">{{ form_row(form.link) }}</div>
<div class="cell">{{ form_row(form.notes) }}</div>
</div>
</fieldset>
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Add</button>
{{ form_end(form) }}
{% endblock %}

View File

@ -3,15 +3,15 @@
{% block title %}Cpu{% endblock %}
{% block form %}
<h2>Brand</h2>
<h2>CPU</h2>
<div class="callout">
<ul>
<li>
<a href="{{ path('app_cpu_index') }}">Back to the list</a>
<a href="{{ path('cpu_index') }}">Back to the list</a>
</li>
<li>
<a href="{{ path('app_cpu_edit', {'id': cpu.id}) }}">Edit</a>
<a href="{{ path('cpu_edit', {'id': cpu.id}) }}">Edit</a>
</li>
</ul>
@ -19,7 +19,8 @@
<hr/>
<form method="post" action="{{ path('app_cpu_delete', {'id': cpu.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<form method="post" action="{{ path('cpu_delete', {'id': cpu.id}) }}"
onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ cpu.id) }}">
<button type="submit" class="alert button expanded">Delete</button>
</form>
@ -34,15 +35,11 @@
</tr>
<tr>
<th>Architecture</th>
<td>{{ cpu.architecture }}</td>
</tr>
<tr>
<th>ProductLine</th>
<td>{{ cpu.productLine }}</td>
<td>{{ cpu.architecture.value }}</td>
</tr>
<tr>
<th>Model</th>
<td>{{ cpu.model }}</td>
<td>{{ cpu.brand.name }} {{ cpu.productLine }} {{ cpu.model }}</td>
</tr>
<tr>
<th>PartNumber</th>
@ -69,12 +66,8 @@
<td>{{ cpu.boostSpeed }}</td>
</tr>
<tr>
<th>Cores</th>
<td>{{ cpu.cores }}</td>
</tr>
<tr>
<th>Threads</th>
<td>{{ cpu.threads }}</td>
<th>Cores / Threads</th>
<td>{{ cpu.cores }} / {{ cpu.threads }}</td>
</tr>
<tr>
<th>Igp</th>
@ -113,49 +106,33 @@
<td>{{ cpu.notes }}</td>
</tr>
<tr>
<th>L1Count</th>
<td>{{ cpu.L1Count }}</td>
<th>L1</th>
{% if cpu.L1uCount > 0 %}
<td>
{{ cpu.L1uCount }}x {{ cpu.L1uSize }}KB {{ cpu.L1uWay }}-way
</td>
{% endif %}
{% if cpu.L1cCount > 0 %}
<td>
{{ cpu.L1cCount }}x {{ cpu.L1dSize }}KB {{ cpu.L1dWay }}-way data,
{{ cpu.L1dCount }}x {{ cpu.L1cSize }}KB {{ cpu.L1cWay }}-way instruction
</td>
{% endif %}
</tr>
<tr>
<th>L1dSize</th>
<td>{{ cpu.L1dSize }}</td>
<th>L2</th>
<td>
{% if cpu.L2Count > 0 %}
{{ cpu.L2Count }}x {{ cpu.L2Size }}KB {{ cpu.L2Way }}-way
{% endif %}
</td>
</tr>
{% if cpu.L3Count > 0 %}
<tr>
<th>L1cSize</th>
<td>{{ cpu.L1cSize }}</td>
</tr>
<tr>
<th>L1uSize</th>
<td>{{ cpu.L1uSize }}</td>
</tr>
<tr>
<th>L1Way</th>
<td>{{ cpu.L1Way }}</td>
</tr>
<tr>
<th>L2Count</th>
<td>{{ cpu.L2Count }}</td>
</tr>
<tr>
<th>L2Size</th>
<td>{{ cpu.L2Size }}</td>
</tr>
<tr>
<th>L2Way</th>
<td>{{ cpu.L2Way }}</td>
</tr>
<tr>
<th>L3Count</th>
<td>{{ cpu.L3Count }}</td>
</tr>
<tr>
<th>L3Size</th>
<td>{{ cpu.L3Size }}</td>
</tr>
<tr>
<th>L3Way</th>
<td>{{ cpu.L3Way }}</td>
<th>L3</th>
<td>{{ cpu.L3Count }}x {{ cpu.L3Size }}KB {{ cpu.L3Way }}-way</td>
</tr>
{% endif %}
</tbody>
</table>
</div>

View File

@ -16,10 +16,10 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<hr />

View File

@ -16,10 +16,10 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<hr />

View File

@ -14,13 +14,13 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button
type="submit"
class="success button expanded"
>Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<form method="post" action="{{ path('fpu_delete', {'id': fpu.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">

View File

@ -14,88 +14,88 @@
</div>
<div>
{{ form_start(edit_form) }}
{{ form_start(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) }}
{{ form_row(form.gpuBrand) }}
{{ form_row(form.modelName) }}
{{ form_row(form.gpuCore) }}
<hr />
{{ form_row(edit_form.boardBrand) }}
{{ form_row(edit_form.alternateModelName) }}
{{ form_row(form.boardBrand) }}
{{ form_row(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.slotSpan) }}
{{ form_row(form.cardKey) }}
{{ form_row(form.busInterface) }}
{{ form_row(form.slotSpan) }}
</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) }}
{{ 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(edit_form.baseClock) }}
{{ form_row(edit_form.boostClock) }}
{{ form_row(edit_form.memoryClock) }}
{{ form_row(form.baseClock) }}
{{ form_row(form.boostClock) }}
{{ form_row(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) }}
{{ form_row(form.memorySize) }}
{{ form_row(form.memoryBus) }}
{{ form_row(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) }}
{{ 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(edit_form.directXSupport) }}
{{ form_row(edit_form.openGLSupport) }}
{{ form_row(edit_form.openCLSupport) }}
{{ form_row(edit_form.vulkanSupport) }}
{{ form_row(edit_form.shaderModel) }}
{{ 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(edit_form.link) }}
{{ form_row(edit_form.count) }}
{{ form_row(edit_form.acquired) }}
{{ form_row(edit_form.notes) }}
{{ form_row(form.link) }}
{{ form_row(form.count) }}
{{ form_row(form.acquired) }}
{{ form_row(form.notes) }}
</fieldset>
{{ form_widget(edit_form) }}
{{ form_widget(form) }}
<button
type="submit"
class="success button expanded"
>Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<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) }}">

View File

@ -14,10 +14,10 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<form method="post" action="{{ path('gpu-core_delete', {'id': gpu_core.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ gpu_core.id) }}">

View File

@ -3,13 +3,29 @@
<ul class=" dropdown menu" data-dropdown-menu>
<li class="menu-text">Collection CRUD</li>
<li class="mega-menu">
<a data-toggle="meta-menu" href="#">Meta</a>
<a data-toggle="computer-menu" href="#">Computer Related</a>
<div class="dropdown-pane bottom" id="meta-menu" data-dropdown data-options="closeOnClick:true; hover: true; hoverPane: true; vOffset:11">
<div class="dropdown-pane bottom" id="computer-menu" data-dropdown data-options="closeOnClick:true; hover: true; hoverPane: true; vOffset:11">
<div class="row expanded">
<div class="column">
<ul class="menu">
<li class="menu-text">Computer Related</li>
<li class="{{ route starts with 'gpu_' ? 'is-active' }}">
<a href="{{ path('gpu_index') }}">🎮 Graphics Cards</a>
</li>
<li class="{{ route starts with 'cpu_' ? 'is-active' }}">
<a href="{{ path('cpu_index') }}">🧠 CPUs</a>
</li>
<li class="{{ route starts with 'fpu_' ? 'is-active' }}">
<a href="{{ path('fpu_index') }}">🧮 FPUs</a>
</li>
<li class="not-implemented {{ route starts with 'motherboard_' ? 'is-active' }}">
<a href="#">🤰 Motherboards</a>
</li>
<li class="not-implemented">
<a href="#">🖥️ Systems</a>
</li>
</ul>
<ul class="menu">
<li class="menu-text">Meta</li>
<li class="{{ route starts with 'brand_' ? 'is-active' }}">
<a href="{{ path('brand_index') }}">🕺 Brands</a>
</li>
@ -27,18 +43,6 @@
</li>
</ul>
</div>
<div class="column">
<ul class="menu">
<li class="menu-text">Photography Related</li>
<li class="{{ route starts with 'film_' ? 'is-active' }}">
<a href="{{ path('film_index') }}">🎞️ Film</a>
</li>
<li class="{{ route starts with 'camera-type_' ? 'is-active' }}">
<a href="{{ path('camera-type_index') }}">🎥 Camera Types</a>
</li>
</ul>
</div>
</div>
</div>
</li>
<li class="mega-menu">
@ -74,30 +78,19 @@
</li>
</ul>
</div>
</div>
</div>
</li>
<li class="mega-menu">
<a data-toggle="computer-menu" href="#">Computer Related</a>
<div class="dropdown-pane bottom" id="computer-menu" data-dropdown data-options="closeOnClick:true; hover: true; hoverPane: true; vOffset:11">
<div class="row expanded">
<div class="column">
<ul class="menu">
<li class="{{ route starts with 'gpu_' ? 'is-active' }}">
<a href="{{ path('gpu_index') }}">🎮 Graphics Cards</a>
<li class="menu-text">Meta</li>
<li class="{{ route starts with 'film_' ? 'is-active' }}">
<a href="{{ path('film_index') }}">🎞️ Film</a>
</li>
<li class="{{ route starts with 'app_cpu_' ? 'is-active' }}">
<a href="{{ path('app_cpu_index') }}">🧠 CPUs</a>
</li>
<li class="{{ route starts with 'fpu_' ? 'is-active' }}">
<a href="{{ path('fpu_index') }}">🧮 FPUs</a>
</li>
<li class="not-implemented {{ route starts with 'motherboard_' ? 'is-active' }}">
<a href="#">🤰 Motherboards</a>
<li class="{{ route starts with 'camera-type_' ? 'is-active' }}">
<a href="{{ path('camera-type_index') }}">🎥 Camera Types</a>
</li>
</ul>
</div>
</div>
</div>
</li>
</ul>
</div>

View File

@ -16,10 +16,10 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
<div class="grid-x grid-margin-x">
<div class="cell large-6 small-12">

View File

@ -17,10 +17,10 @@
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
{{ form_start(reacquire_form) }}
{{ form_widget(reacquire_form) }}

View File

@ -16,10 +16,10 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Edit</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
</div>

View File

@ -16,9 +16,9 @@
</div>
<div class="large primary callout">
{{ form_start(edit_form) }}
{{ form_widget(edit_form) }}
{{ form_start(form) }}
{{ form_widget(form) }}
<button type="submit" class="success button expanded">Update</button>
{{ form_end(edit_form) }}
{{ form_end(form) }}
</div>
{% endblock %}