diff --git a/Marechai/Areas/Admin/Views/Processors/Details.cshtml b/Marechai/Areas/Admin/Views/Processors/Details.cshtml deleted file mode 100644 index 081f265c..00000000 --- a/Marechai/Areas/Admin/Views/Processors/Details.cshtml +++ /dev/null @@ -1,201 +0,0 @@ -@{ - /****************************************************************************** -// MARECHAI: Master repository of computing history artifacts information -// ---------------------------------------------------------------------------- -// -// Filename : Details.cshtml -// Author(s) : Natalia Portillo -// -// --[ Description ] ---------------------------------------------------------- -// -// Admin view details -// -// --[ License ] -------------------------------------------------------------- -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// ---------------------------------------------------------------------------- -// Copyright © 2003-2020 Natalia Portillo -*******************************************************************************/ -} -@model Marechai.Database.Models.Processor - -@{ - ViewData["Title"] = "Details"; -} -

Details

-
-

Processor

-
-
-
- @Html.DisplayNameFor(model => model.Company) -
-
- @Html.DisplayFor(model => model.Company.Name) -
-
- @Html.DisplayNameFor(model => model.Name) -
-
- @Html.DisplayFor(model => model.Name) -
-
- @Html.DisplayNameFor(model => model.ModelCode) -
-
- @Html.DisplayFor(model => model.ModelCode) -
-
- @Html.DisplayNameFor(model => model.Introduced) -
-
- @Html.DisplayFor(model => model.Introduced) -
-
- @Html.DisplayNameFor(model => model.InstructionSet) -
-
- @Html.DisplayFor(model => model.InstructionSet.Name) -
-
- @Html.DisplayNameFor(model => model.Speed) -
-
- @Html.DisplayFor(model => model.Speed) -
-
- @Html.DisplayNameFor(model => model.Package) -
-
- @Html.DisplayFor(model => model.Package) -
-
- @Html.DisplayNameFor(model => model.Cores) -
-
- @Html.DisplayFor(model => model.Cores) -
-
- @Html.DisplayNameFor(model => model.ThreadsPerCore) -
-
- @Html.DisplayFor(model => model.ThreadsPerCore) -
-
- @Html.DisplayNameFor(model => model.Process) -
-
- @Html.DisplayFor(model => model.Process) -
-
- @Html.DisplayNameFor(model => model.ProcessNm) -
-
- @Html.DisplayFor(model => model.ProcessNm) -
-
- @Html.DisplayNameFor(model => model.DieSize) -
-
- @Html.DisplayFor(model => model.DieSize) -
-
- @Html.DisplayNameFor(model => model.Transistors) -
-
- @Html.DisplayFor(model => model.Transistors) -
-
- @Html.DisplayNameFor(model => model.DataBus) -
-
- @Html.DisplayFor(model => model.DataBus) -
-
- @Html.DisplayNameFor(model => model.AddrBus) -
-
- @Html.DisplayFor(model => model.AddrBus) -
-
- @Html.DisplayNameFor(model => model.Gprs) -
-
- @Html.DisplayFor(model => model.Gprs) -
-
- @Html.DisplayNameFor(model => model.GprSize) -
-
- @Html.DisplayFor(model => model.GprSize) -
-
- @Html.DisplayNameFor(model => model.Fprs) -
-
- @Html.DisplayFor(model => model.Fprs) -
-
- @Html.DisplayNameFor(model => model.FprSize) -
-
- @Html.DisplayFor(model => model.FprSize) -
-
- @Html.DisplayNameFor(model => model.SimdRegisters) -
-
- @Html.DisplayFor(model => model.SimdRegisters) -
-
- @Html.DisplayNameFor(model => model.SimdSize) -
-
- @Html.DisplayFor(model => model.SimdSize) -
-
- @Html.DisplayNameFor(model => model.L1Instruction) -
-
- @Html.DisplayFor(model => model.L1Instruction) -
-
- @Html.DisplayNameFor(model => model.L1Data) -
-
- @Html.DisplayFor(model => model.L1Data) -
-
- @Html.DisplayNameFor(model => model.L2) -
-
- @Html.DisplayFor(model => model.L2) -
-
- @Html.DisplayNameFor(model => model.L3) -
-
- @Html.DisplayFor(model => model.L3) -
-
-
-
- - Edit - - - Back to List - -
\ No newline at end of file diff --git a/Marechai/Marechai.csproj b/Marechai/Marechai.csproj index 481bd320..50eb2304 100644 --- a/Marechai/Marechai.csproj +++ b/Marechai/Marechai.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 3.0.99.1188 + 3.0.99.1192 Canary Islands Computer Museum Copyright © 2003-2020 Natalia Portillo Canary Islands Computer Museum Website @@ -112,6 +112,9 @@ true + + true + <_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Delete.cshtml" /> diff --git a/Marechai/Pages/Admin/Details/Gpu.razor b/Marechai/Pages/Admin/Details/Gpu.razor index 8e062c99..cc0727a4 100644 --- a/Marechai/Pages/Admin/Details/Gpu.razor +++ b/Marechai/Pages/Admin/Details/Gpu.razor @@ -96,14 +96,14 @@ @if (_editable || _model.ProcessNm != null) { - @L["Process size in nm"] + @L["Process (nm)"] } @if (_editable || _model.DieSize != null) { - @L["Die size"] + @L["Die size (mm²)"] } diff --git a/Marechai/Pages/Admin/Details/Person.razor b/Marechai/Pages/Admin/Details/Person.razor index 43e4edf7..137b73c8 100644 --- a/Marechai/Pages/Admin/Details/Person.razor +++ b/Marechai/Pages/Admin/Details/Person.razor @@ -88,13 +88,13 @@ } @L["Birth date"] - + @if (_editable || _model.DeathDate != null) { @L["Date of death"] - + } @if (_editable || _model.Webpage != null) diff --git a/Marechai/Pages/Admin/Details/Processor.razor b/Marechai/Pages/Admin/Details/Processor.razor new file mode 100644 index 00000000..4e0bf779 --- /dev/null +++ b/Marechai/Pages/Admin/Details/Processor.razor @@ -0,0 +1,243 @@ +@{ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Filename : Details.cshtml +// Author(s) : Natalia Portillo +// +// --[ Description ] ---------------------------------------------------------- +// +// Admin view details +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ +} + +@page "/admin/processors/details/{Id:int}" +@inherits OwningComponentBase +@inject IStringLocalizer L +@inject CompaniesService CompaniesService +@inject InstructionSetsService InstructionSetsService +@attribute [Authorize(Roles = "UberAdmin, Admin")] +

@L["Processor details"]

+
+ +@if (!_loaded) +{ +

@L["Loading..."]

+ + return; +} + +
+ + @L["Name"] + + + @if (_editable || _model.CompanyId != null) + { + + @L["Company"] + + + } + @if (_editable || _model.ModelCode != null) + { + + @L["Model code"] + + + } + @if(_editable || _model.Introduced.HasValue) + { + + @L["Introduced"] + @if(_model.Introduced?.Year == 1000) + { + @L["PROTOTYPE"] + } + else + { + + } + + } + @if (_editable || _model.InstructionSetId.HasValue) + { + + @L["Instruction set"] + + + } + @if (_editable || _model.Speed.HasValue) + { + + @L["Nominal speed (MHz)"] + + + } + @if (_editable || _model.Package != null) + { + + @L["Package"] + + + } + @if (_editable || _model.Gprs.HasValue) + { + + @L["General Purpose Registers"] + + + } + @if (_editable || _model.GprSize.HasValue) + { + + @L["General Purpose Register size"] + + + } + @if (_editable || _model.Fprs.HasValue) + { + + @L["Floating Point Registers"] + + + } + @if (_editable || _model.FprSize.HasValue) + { + + @L["Floating Point Register size"] + + + } + @if (_editable || _model.SimdRegisters.HasValue) + { + + @L["SIMD Registers"] + + + } + @if (_editable || _model.SimdSize.HasValue) + { + + @L["SIMD Register size"] + + + } + @if (_editable || _model.Cores.HasValue) + { + + @L["Cores"] + + + } + @if (_editable || _model.ThreadsPerCore.HasValue) + { + + @L["Threads per core"] + + + } + @if (_editable || _model.Process != null) + { + + @L["Process"] + + + } + @if (_editable || _model.ProcessNm.HasValue) + { + + @L["Process (nm)"] + + + } + @if (_editable || _model.DieSize.HasValue) + { + + @L["Die size (mm²)"] + + + } + @if (_editable || _model.Transistors.HasValue) + { + + @L["Transistors"] + + + } + @if (_editable || _model.DataBus.HasValue) + { + + @L["Data bus size"] + + + } + @if (_editable || _model.AddrBus.HasValue) + { + + @L["Address bus size"] + + + } + @if (_editable || _model.L1Instruction.HasValue) + { + + @L["L1 instruction cache (KiB)"] + + + } + @if (_editable || _model.L1Data.HasValue) + { + + @L["L1 data cache (KiB)"] + + + } + @if (_editable || _model.L2.HasValue) + { + + @L["L2 cache (KiB)"] + + + } + @if (_editable || _model.L3.HasValue) + { + + @L["L3 cache (KiB)"] + + + } +
+
+ @L["Edit"] + @L["Back to list"] +
\ No newline at end of file diff --git a/Marechai/Pages/Admin/Details/Processor.razor.cs b/Marechai/Pages/Admin/Details/Processor.razor.cs new file mode 100644 index 00000000..1f667e4d --- /dev/null +++ b/Marechai/Pages/Admin/Details/Processor.razor.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Marechai.ViewModels; +using Microsoft.AspNetCore.Components; + +namespace Marechai.Pages.Admin.Details +{ + public partial class Processor + { + List _companies; + bool _editable; + List _instructionSets; + bool _loaded; + Database.Models.Processor _model; + [Parameter] + public int Id { get; set; } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if(_loaded) + return; + + _loaded = true; + + if(Id <= 0) + return; + + _companies = await CompaniesService.GetAsync(); + _instructionSets = await InstructionSetsService.GetAsync(); + _model = await Service.GetAsync(Id); + + StateHasChanged(); + } + } +} \ No newline at end of file diff --git a/Marechai/Pages/Admin/Processors.razor b/Marechai/Pages/Admin/Processors.razor index 5c077846..6383234b 100644 --- a/Marechai/Pages/Admin/Processors.razor +++ b/Marechai/Pages/Admin/Processors.razor @@ -87,9 +87,7 @@ @item.InstructionSet - - @L["Details"] - + @L["Details"] @L["Edit"] diff --git a/Marechai/Resources/Services/GpusService.es.resx b/Marechai/Resources/Services/GpusService.es.resx index c35b39df..3489ef45 100644 --- a/Marechai/Resources/Services/GpusService.es.resx +++ b/Marechai/Resources/Services/GpusService.es.resx @@ -186,13 +186,13 @@ Proceso Process - + Tamaño en nm del proceso Process size in nm - - Área del chip - Die size + + Área del chip (mm²) + Die size (mm²) Transistores diff --git a/Marechai/Resources/Services/ProcessorsService.es.resx b/Marechai/Resources/Services/ProcessorsService.es.resx index 9476d3f4..7cf40264 100644 --- a/Marechai/Resources/Services/ProcessorsService.es.resx +++ b/Marechai/Resources/Services/ProcessorsService.es.resx @@ -174,4 +174,96 @@ Cancelar Cancel + + Detalles de procesador + Processor details + + + Volver a la lista + Back to list + + + PROTOTIPO + PROTOTYPE + + + Velocidad nominal (MHz) + Nominal speed (MHz) + + + Empaquetado + Package + + + Registros de propósito general + General Purpose Registers + + + Tamaño de los registros de propósito general + General Purpose Register size + + + Registros de coma flotante + Floating Point Registers + + + Tamaño de los registros de coma flotante + Floating Point Register size + + + Registros SIMD + SIMD Registers + + + Tamaño de los registros SIMD + SIMD Register size + + + Núcleos + Cores + + + Hilos por núcleo + Threads per core + + + Proceso + Process + + + Tamaño del proceso en nm + Process (nm) + + + Area del chip (mm²) + Die size (mm²) + + + Transistores + Transistors + + + Tamaño del bus de datos + Data bus size + + + Tamaño del bus de direcciones + Address bus size + + + Caché L1 de instrucciones (KiB) + L1 instruction cache (KiB) + + + Caché L1 de datos (KiB) + L1 data cache (KiB) + + + Caché L2 (KiB) + L2 cache (KiB) + + + Caché L3 (KiB) + L3 cache (KiB) + \ No newline at end of file diff --git a/Marechai/Services/ProcessorsService.cs b/Marechai/Services/ProcessorsService.cs index b44ff4ca..1c8409e2 100644 --- a/Marechai/Services/ProcessorsService.cs +++ b/Marechai/Services/ProcessorsService.cs @@ -42,6 +42,8 @@ namespace Marechai.Services p.Processor.InstructionSetExtensions.Select(e => e.Extension.Extension).ToList() }).ToListAsync(); + public async Task GetAsync(int id) => await _context.Processors.FindAsync(id); + public async Task DeleteAsync(int id) { Processor item = await _context.Processors.FindAsync(id);