mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add processor editing in admin view.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=claunia/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=kibibytes/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Marechai/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Portillo/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=SIMD/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
@@ -1,231 +0,0 @@
|
||||
@{
|
||||
/******************************************************************************
|
||||
// MARECHAI: Master repository of computing history artifacts information
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Edit.cshtml
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Admin view edit
|
||||
//
|
||||
// --[ 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 <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2003-2020 Natalia Portillo
|
||||
*******************************************************************************/
|
||||
}
|
||||
@model Marechai.Database.Models.Processor
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
<h2>Edit</h2>
|
||||
<h4>Processor</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Edit">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger">
|
||||
</div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="Company" class="control-label">
|
||||
</label>
|
||||
<select asp-for="CompanyId" class="form-control" asp-items="ViewBag.CompanyId">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Name" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Name" class="form-control" />
|
||||
<span asp-validation-for="Name" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ModelCode" class="control-label">
|
||||
</label>
|
||||
<input asp-for="ModelCode" class="form-control" />
|
||||
<span asp-validation-for="ModelCode" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Introduced" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Introduced" class="form-control" />
|
||||
<span asp-validation-for="Introduced" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="InstructionSetId" class="control-label">
|
||||
</label>
|
||||
<select asp-for="InstructionSetId" class="form-control" asp-items="ViewBag.InstructionSetId">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Speed" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Speed" class="form-control" />
|
||||
<span asp-validation-for="Speed" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Package" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Package" class="form-control" />
|
||||
<span asp-validation-for="Package" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Cores" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Cores" class="form-control" />
|
||||
<span asp-validation-for="Cores" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ThreadsPerCore" class="control-label">
|
||||
</label>
|
||||
<input asp-for="ThreadsPerCore" class="form-control" />
|
||||
<span asp-validation-for="ThreadsPerCore" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Process" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Process" class="form-control" />
|
||||
<span asp-validation-for="Process" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ProcessNm" class="control-label">
|
||||
</label>
|
||||
<input asp-for="ProcessNm" class="form-control" />
|
||||
<span asp-validation-for="ProcessNm" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="DieSize" class="control-label">
|
||||
</label>
|
||||
<input asp-for="DieSize" class="form-control" />
|
||||
<span asp-validation-for="DieSize" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Transistors" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Transistors" class="form-control" />
|
||||
<span asp-validation-for="Transistors" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="DataBus" class="control-label">
|
||||
</label>
|
||||
<input asp-for="DataBus" class="form-control" />
|
||||
<span asp-validation-for="DataBus" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="AddrBus" class="control-label">
|
||||
</label>
|
||||
<input asp-for="AddrBus" class="form-control" />
|
||||
<span asp-validation-for="AddrBus" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Gprs" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Gprs" class="form-control" />
|
||||
<span asp-validation-for="Gprs" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="GprSize" class="control-label">
|
||||
</label>
|
||||
<input asp-for="GprSize" class="form-control" />
|
||||
<span asp-validation-for="GprSize" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Fprs" class="control-label">
|
||||
</label>
|
||||
<input asp-for="Fprs" class="form-control" />
|
||||
<span asp-validation-for="Fprs" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="FprSize" class="control-label">
|
||||
</label>
|
||||
<input asp-for="FprSize" class="form-control" />
|
||||
<span asp-validation-for="FprSize" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="SimdRegisters" class="control-label">
|
||||
</label>
|
||||
<input asp-for="SimdRegisters" class="form-control" />
|
||||
<span asp-validation-for="SimdRegisters" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="SimdSize" class="control-label">
|
||||
</label>
|
||||
<input asp-for="SimdSize" class="form-control" />
|
||||
<span asp-validation-for="SimdSize" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="L1Instruction" class="control-label">
|
||||
</label>
|
||||
<input asp-for="L1Instruction" class="form-control" />
|
||||
<span asp-validation-for="L1Instruction" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="L1Data" class="control-label">
|
||||
</label>
|
||||
<input asp-for="L1Data" class="form-control" />
|
||||
<span asp-validation-for="L1Data" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="L2" class="control-label">
|
||||
</label>
|
||||
<input asp-for="L2" class="form-control" />
|
||||
<span asp-validation-for="L2" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="L3" class="control-label">
|
||||
</label>
|
||||
<input asp-for="L3" class="form-control" />
|
||||
<span asp-validation-for="L3" class="text-danger">
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input class="btn btn-primary" type="submit" value="Create" />
|
||||
<a asp-action="Index" class="btn btn-secondary">
|
||||
Back to List
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<Version>3.0.99.1219</Version>
|
||||
<Version>3.0.99.1223</Version>
|
||||
<Company>Canary Islands Computer Museum</Company>
|
||||
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
|
||||
<Product>Canary Islands Computer Museum Website</Product>
|
||||
|
||||
@@ -31,10 +31,12 @@
|
||||
}
|
||||
|
||||
@page "/admin/processors/details/{Id:int}"
|
||||
@page "/admin/processors/edit/{Id:int}"
|
||||
@inherits OwningComponentBase<ProcessorsService>
|
||||
@inject IStringLocalizer<ProcessorsService> L
|
||||
@inject CompaniesService CompaniesService
|
||||
@inject InstructionSetsService InstructionSetsService
|
||||
@inject NavigationManager NavigationManager
|
||||
@attribute [Authorize(Roles = "UberAdmin, Admin")]
|
||||
<h3>@L["Processor details"]</h3>
|
||||
<hr />
|
||||
@@ -47,197 +49,537 @@
|
||||
}
|
||||
|
||||
<div>
|
||||
<Field>
|
||||
<FieldLabel>@L["Name"]</FieldLabel>
|
||||
<TextEdit ReadOnly="!_editable" @bind-Text="@_model.Name"/>
|
||||
</Field>
|
||||
@if (_editable || _model.CompanyId != null)
|
||||
@if (_editing || _model.CompanyId != null)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Company"]</FieldLabel>
|
||||
<Select Disabled="!_editable" TValue="int?" @bind-SelectedValue="@_model.CompanyId">
|
||||
@foreach (var company in _companies)
|
||||
{
|
||||
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
|
||||
}
|
||||
</Select>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownCompany">@L["Unknown (company)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownCompany)
|
||||
{
|
||||
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.CompanyId">
|
||||
@foreach (var company in _companies)
|
||||
{
|
||||
<SelectItem TValue="int?" Value="@company.Id">@company.Name</SelectItem>
|
||||
}
|
||||
</Select>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.ModelCode != null)
|
||||
<Field>
|
||||
<FieldLabel>@L["Name"]</FieldLabel>
|
||||
<Validation Validator="@ValidateName">
|
||||
<TextEdit Disabled="!_editing" @bind-Text="@_model.Name">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid name."]</ValidationError>
|
||||
</Feedback>
|
||||
</TextEdit>
|
||||
</Validation>
|
||||
</Field>
|
||||
@if (_editing || _model.ModelCode != null)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Model code"]</FieldLabel>
|
||||
<TextEdit ReadOnly="!_editable" @bind-Text="@_model.ModelCode"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownModelCode">@L["Unknown (model code)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownModelCode)
|
||||
{
|
||||
<Validation Validator="@ValidateModelCode">
|
||||
<TextEdit Disabled="!_editing" @bind-Text="@_model.ModelCode">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid model code."]</ValidationError>
|
||||
</Feedback>
|
||||
</TextEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if(_editable || _model.Introduced.HasValue)
|
||||
@if (_editing || _model.Introduced.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Introduced"]</FieldLabel>
|
||||
@if(_model.Introduced?.Year == 1000)
|
||||
@if (_editing)
|
||||
{
|
||||
<TextEdit ReadOnly="true">@L["PROTOTYPE"]</TextEdit>
|
||||
<Check TValue="bool" Disabled="_prototype" @bind-Checked="@_unknownIntroduced">@L["Unknown (introduction date)"]</Check>
|
||||
<Check TValue="bool" Disabled="_unknownIntroduced" @bind-Checked="@_prototype">@L["Prototype"]</Check>
|
||||
}
|
||||
else
|
||||
@if (!_editing ||
|
||||
(!_prototype && !_unknownIntroduced))
|
||||
{
|
||||
<DateEdit ReadOnly="!_editable" TValue="DateTime?" @bind-Date="@_model.Introduced"/>
|
||||
<Validation Validator="@ValidateIntroduced">
|
||||
<DateEdit Disabled="!_editing" TValue="DateTime?" @bind-Date="@_model.Introduced">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter an introduction date."]</ValidationError>
|
||||
</Feedback>
|
||||
</DateEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.InstructionSetId.HasValue)
|
||||
@if (_editing || _model.InstructionSetId != null)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Instruction set"]</FieldLabel>
|
||||
<Select Disabled="!_editable" TValue="int?" @bind-SelectedValue="@_model.InstructionSetId">
|
||||
@foreach (var instructionSet in _instructionSets)
|
||||
{
|
||||
<SelectItem TValue="int?" Value="@instructionSet.Id">@instructionSet.Name</SelectItem>
|
||||
}
|
||||
</Select>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownInstructionSet">@L["Unknown (instruction set)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownInstructionSet)
|
||||
{
|
||||
<Select Disabled="!_editing" TValue="int?" @bind-SelectedValue="@_model.InstructionSetId">
|
||||
@foreach (var instructionSet in _instructionSets)
|
||||
{
|
||||
<SelectItem TValue="int?" Value="@instructionSet.Id">@instructionSet.Name</SelectItem>
|
||||
}
|
||||
</Select>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.Speed.HasValue)
|
||||
@if (_editing || _model.Speed.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Nominal speed (MHz)"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="double?" Decimals="3" @bind-Value="@_model.Speed"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownSpeed">@L["Unknown (nominal speed)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownSpeed)
|
||||
{
|
||||
<Validation Validator="@ValidateDoubleBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="double?" Decimals="3" @bind-Value="@_model.Speed">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid nominal speed."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.Package != null)
|
||||
@if (_editing || _model.Package != null)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Package"]</FieldLabel>
|
||||
<TextEdit ReadOnly="!_editable" @bind-Text="@_model.Package"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownPackage">@L["Unknown (package)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownPackage)
|
||||
{
|
||||
<Validation Validator="@ValidatePackage">
|
||||
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Package">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid package."]</ValidationError>
|
||||
</Feedback>
|
||||
</TextEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.Gprs.HasValue)
|
||||
@if (_editing || _model.Gprs.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["General Purpose Registers"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.Gprs"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownGprs">@L["Unknown (general purpose registers)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownGprs)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Gprs">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid number of general purpose registers."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.GprSize.HasValue)
|
||||
@if (_editing || _model.GprSize.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["General Purpose Register size"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.GprSize"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownGprSize">@L["Unknown (general purpose register size)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownGprSize)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.GprSize">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid general purpose register size."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.Fprs.HasValue)
|
||||
@if (_editing || _model.Fprs.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Floating Point Registers"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.Fprs"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownFprs">@L["Unknown (floating point registers)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownFprs)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Fprs">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid number of floating point registers."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
@if (_editing)
|
||||
{
|
||||
<FieldHelp>@L["If set to zero, but with a size, indicates floating point instructions use the general purpose registers."]</FieldHelp>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.FprSize.HasValue)
|
||||
@if (_editing || _model.FprSize.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Floating Point Register size"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.FprSize"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownFprSize">@L["Unknown (floating point register size)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownFprSize)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.FprSize">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid floating point register size."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.SimdRegisters.HasValue)
|
||||
@if (_editing || _model.SimdRegisters.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["SIMD Registers"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.SimdRegisters"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownSimdRegisters">@L["Unknown (simd registers)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownSimdRegisters)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.SimdRegisters">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid number of SIMD registers."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
@if (_editing)
|
||||
{
|
||||
<FieldHelp>@L["If set to zero, but with a size, indicates SIMD instructions use the floating point registers. If they are also set to zero with a size, it means SIMD instructions use the general purpose registers."]</FieldHelp>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.SimdSize.HasValue)
|
||||
@if (_editing || _model.SimdSize.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["SIMD Register size"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.SimdSize"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownSimdSize">@L["Unknown (simd register size)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownSimdSize)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.SimdSize">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid SIMD register size."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.Cores.HasValue)
|
||||
@if (_editing || _model.Cores.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Cores"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.Cores"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownCores">@L["Unknown (cores)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownCores)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanOne">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.Cores">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid number of cores."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.ThreadsPerCore.HasValue)
|
||||
@if (_editing || _model.ThreadsPerCore.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Threads per core"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.ThreadsPerCore"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownThreadsPerCore">@L["Unknown (threads per core)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownThreadsPerCore)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanOne">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.ThreadsPerCore">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid number of threads per core."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.Process != null)
|
||||
@if (_editing || _model.Process != null)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Process"]</FieldLabel>
|
||||
<TextEdit ReadOnly="!_editable" @bind-Text="@_model.Process"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownProcess">@L["Unknown (process)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownProcess)
|
||||
{
|
||||
<Validation Validator="@ValidateProcess">
|
||||
<TextEdit ReadOnly="!_editing" @bind-Text="@_model.Process">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid process."]</ValidationError>
|
||||
</Feedback>
|
||||
</TextEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.ProcessNm.HasValue)
|
||||
@if (_editing || _model.ProcessNm.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Process (nm)"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="float?" Decimals="2" @bind-Value="@_model.ProcessNm"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownProcessNm">@L["Unknown (process size)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownProcessNm)
|
||||
{
|
||||
<Validation Validator="@ValidateFloatBiggerThanOne">
|
||||
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="2" @bind-Value="@_model.ProcessNm">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid process size in nanometers."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.DieSize.HasValue)
|
||||
@if (_editing || _model.DieSize.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Die size (mm²)"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="float?" Decimals="2" @bind-Value="@_model.DieSize"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownDieSize">@L["Unknown (die size)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownDieSize)
|
||||
{
|
||||
<Validation Validator="@ValidateFloatBiggerThanOne">
|
||||
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="2" @bind-Value="@_model.DieSize">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid die size in square millimeters."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.Transistors.HasValue)
|
||||
@if (_editing || _model.Transistors.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Transistors"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="long?" Decimals="0" @bind-Value="@_model.Transistors"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownTransistors">@L["Unknown (transistors)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownTransistors)
|
||||
{
|
||||
<Validation Validator="@ValidateLongBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="long?" Decimals="0" @bind-Value="@_model.Transistors">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid number of transistors."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.DataBus.HasValue)
|
||||
@if (_editing || _model.DataBus.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Data bus size"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.DataBus"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownDataBus">@L["Unknown (data bus size)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownDataBus)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanOne">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.DataBus">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid data bus size in bits."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.AddrBus.HasValue)
|
||||
@if (_editing || _model.AddrBus.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["Address bus size"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="int?" Decimals="0" @bind-Value="@_model.AddrBus"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownAddressBus">@L["Unknown (address bus size)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownAddressBus)
|
||||
{
|
||||
<Validation Validator="@ValidateIntegerBiggerThanOne">
|
||||
<NumericEdit Disabled="!_editing" TValue="int?" Decimals="0" @bind-Value="@_model.AddrBus">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid address bus size in bits."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.L1Instruction.HasValue)
|
||||
@if (_editing || _model.L1Instruction.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["L1 instruction cache (KiB)"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="float?" Decimals="3" @bind-Value="@_model.L1Instruction"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownL1Instruction">@L["Unknown (L1 instruction cache)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownL1Instruction)
|
||||
{
|
||||
<Validation Validator="@ValidateFloatBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="3" @bind-Value="@_model.L1Instruction">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid L1 instruction cache size in kibibytes."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.L1Data.HasValue)
|
||||
@if (_editing || _model.L1Data.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["L1 data cache (KiB)"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="float?" Decimals="3" @bind-Value="@_model.L1Data"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownL1Data">@L["Unknown (L1 data cache)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownL1Data)
|
||||
{
|
||||
<Validation Validator="@ValidateFloatBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="3" @bind-Value="@_model.L1Data">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid L1 data cache size in kibibytes."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.L2.HasValue)
|
||||
@if (_editing || _model.L2.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["L2 cache (KiB)"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="float?" Decimals="3" @bind-Value="@_model.L2"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownL2">@L["Unknown (L2 cache)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownL2)
|
||||
{
|
||||
<Validation Validator="@ValidateFloatBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="3" @bind-Value="@_model.L2">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid L2 cache size in kibibytes."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
@if (_editable || _model.L3.HasValue)
|
||||
@if (_editing || _model.L3.HasValue)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@L["L3 cache (KiB)"]</FieldLabel>
|
||||
<NumericEdit Disabled="!_editable" TValue="float?" Decimals="3" @bind-Value="@_model.L3"/>
|
||||
@if (_editing)
|
||||
{
|
||||
<Check TValue="bool" @bind-Checked="@_unknownL3">@L["Unknown (L3 cache)"]</Check>
|
||||
}
|
||||
@if (!_editing ||
|
||||
!_unknownL3)
|
||||
{
|
||||
<Validation Validator="@ValidateFloatBiggerThanZero">
|
||||
<NumericEdit Disabled="!_editing" TValue="float?" Decimals="3" @bind-Value="@_model.L3">
|
||||
<Feedback>
|
||||
<ValidationError>@L["Please enter a valid L3 cache size in kibibytes."]</ValidationError>
|
||||
</Feedback>
|
||||
</NumericEdit>
|
||||
</Validation>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
<span class="btn btn-primary">@L["Edit"]</span>
|
||||
@if (!_editing)
|
||||
{
|
||||
<Button Color="Color.Primary" Clicked="@OnEditClicked">@L["Edit"]</Button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Button Color="Color.Success" Clicked="@OnSaveClicked">@L["Save"]</Button>
|
||||
<Button Color="Color.Danger" Clicked="@OnCancelClicked">@L["Cancel"]</Button>
|
||||
}
|
||||
<a href="/admin/processors" class="btn btn-secondary">@L["Back to list"]</a>
|
||||
</div>
|
||||
@@ -1,5 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Blazorise;
|
||||
using Marechai.Shared;
|
||||
using Marechai.ViewModels;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
@@ -8,10 +11,35 @@ namespace Marechai.Pages.Admin.Details
|
||||
public partial class Processor
|
||||
{
|
||||
List<CompanyViewModel> _companies;
|
||||
bool _editable;
|
||||
bool _editing;
|
||||
List<Database.Models.InstructionSet> _instructionSets;
|
||||
bool _loaded;
|
||||
Database.Models.Processor _model;
|
||||
ProcessorViewModel _model;
|
||||
bool _prototype;
|
||||
bool _unknownAddressBus;
|
||||
bool _unknownCompany;
|
||||
bool _unknownCores;
|
||||
bool _unknownDataBus;
|
||||
bool _unknownDieSize;
|
||||
bool _unknownFprs;
|
||||
bool _unknownFprSize;
|
||||
bool _unknownGprs;
|
||||
bool _unknownGprSize;
|
||||
bool _unknownInstructionSet;
|
||||
bool _unknownIntroduced;
|
||||
bool _unknownL1Data;
|
||||
bool _unknownL1Instruction;
|
||||
bool _unknownL2;
|
||||
bool _unknownL3;
|
||||
bool _unknownModelCode;
|
||||
bool _unknownPackage;
|
||||
bool _unknownProcess;
|
||||
bool _unknownProcessNm;
|
||||
bool _unknownSimdRegisters;
|
||||
bool _unknownSimdSize;
|
||||
bool _unknownSpeed;
|
||||
bool _unknownThreadsPerCore;
|
||||
bool _unknownTransistors;
|
||||
[Parameter]
|
||||
public int Id { get; set; }
|
||||
|
||||
@@ -29,7 +57,213 @@ namespace Marechai.Pages.Admin.Details
|
||||
_instructionSets = await InstructionSetsService.GetAsync();
|
||||
_model = await Service.GetAsync(Id);
|
||||
|
||||
_editing = NavigationManager.ToBaseRelativePath(NavigationManager.Uri).ToLowerInvariant().
|
||||
StartsWith("admin/processors/edit/", StringComparison.InvariantCulture);
|
||||
|
||||
if(_editing)
|
||||
SetCheckboxes();
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
void SetCheckboxes()
|
||||
{
|
||||
_unknownAddressBus = !_model.AddrBus.HasValue;
|
||||
_unknownCompany = !_model.CompanyId.HasValue;
|
||||
_unknownCores = !_model.Cores.HasValue;
|
||||
_unknownDataBus = !_model.DataBus.HasValue;
|
||||
_unknownDieSize = !_model.DieSize.HasValue;
|
||||
_unknownFprs = !_model.Fprs.HasValue;
|
||||
_unknownFprSize = !_model.FprSize.HasValue;
|
||||
_unknownGprs = !_model.Gprs.HasValue;
|
||||
_unknownGprSize = !_model.GprSize.HasValue;
|
||||
_unknownInstructionSet = !_model.InstructionSetId.HasValue;
|
||||
_unknownIntroduced = !_model.Introduced.HasValue;
|
||||
_unknownL1Data = !_model.L1Data.HasValue;
|
||||
_unknownL1Instruction = !_model.L1Instruction.HasValue;
|
||||
_unknownL2 = !_model.L2.HasValue;
|
||||
_unknownL3 = !_model.L3.HasValue;
|
||||
_unknownModelCode = string.IsNullOrWhiteSpace(_model.ModelCode);
|
||||
_unknownPackage = string.IsNullOrWhiteSpace(_model.Package);
|
||||
_unknownProcess = string.IsNullOrWhiteSpace(_model.Process);
|
||||
_unknownProcessNm = !_model.ProcessNm.HasValue;
|
||||
_unknownSimdRegisters = !_model.SimdRegisters.HasValue;
|
||||
_unknownSimdSize = !_model.SimdSize.HasValue;
|
||||
_unknownSpeed = !_model.Speed.HasValue;
|
||||
_unknownThreadsPerCore = !_model.ThreadsPerCore.HasValue;
|
||||
_unknownTransistors = !_model.Transistors.HasValue;
|
||||
}
|
||||
|
||||
void OnEditClicked()
|
||||
{
|
||||
_editing = true;
|
||||
SetCheckboxes();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
async void OnCancelClicked()
|
||||
{
|
||||
_editing = false;
|
||||
_model = await Service.GetAsync(Id);
|
||||
SetCheckboxes();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
async void OnSaveClicked()
|
||||
{
|
||||
if(_unknownCompany)
|
||||
_model.CompanyId = null;
|
||||
else if(_model.CompanyId < 0)
|
||||
return;
|
||||
|
||||
if(_unknownModelCode)
|
||||
_model.ModelCode = null;
|
||||
else if(string.IsNullOrWhiteSpace(_model.ModelCode))
|
||||
return;
|
||||
|
||||
if(_unknownIntroduced)
|
||||
_model.Introduced = null;
|
||||
else if(_prototype)
|
||||
_model.Introduced = new DateTime(1000, 1, 1);
|
||||
else if(_model.Introduced >= DateTime.UtcNow.Date)
|
||||
return;
|
||||
|
||||
if(_unknownInstructionSet)
|
||||
_model.InstructionSetId = null;
|
||||
else if(_model.InstructionSetId < 0)
|
||||
return;
|
||||
|
||||
if(_unknownSpeed)
|
||||
_model.Speed = null;
|
||||
else if(_model.Speed < 0)
|
||||
return;
|
||||
|
||||
if(_unknownPackage)
|
||||
_model.Package = null;
|
||||
else if(string.IsNullOrWhiteSpace(_model.Package))
|
||||
return;
|
||||
|
||||
if(_unknownGprs)
|
||||
_model.Gprs = null;
|
||||
else if(_model.Gprs < 0)
|
||||
return;
|
||||
|
||||
if(_unknownGprSize)
|
||||
_model.GprSize = null;
|
||||
else if(_model.GprSize < 0)
|
||||
return;
|
||||
|
||||
if(_unknownFprs)
|
||||
_model.Fprs = null;
|
||||
else if(_model.Fprs < 0)
|
||||
return;
|
||||
|
||||
if(_unknownFprSize)
|
||||
_model.FprSize = null;
|
||||
else if(_model.FprSize < 0)
|
||||
return;
|
||||
|
||||
if(_unknownSimdRegisters)
|
||||
_model.SimdRegisters = null;
|
||||
else if(_model.SimdRegisters < 0)
|
||||
return;
|
||||
|
||||
if(_unknownSimdSize)
|
||||
_model.SimdSize = null;
|
||||
else if(_model.SimdSize < 0)
|
||||
return;
|
||||
|
||||
if(_unknownCores)
|
||||
_model.Cores = null;
|
||||
else if(_model.Cores < 1)
|
||||
return;
|
||||
|
||||
if(_unknownThreadsPerCore)
|
||||
_model.ThreadsPerCore = null;
|
||||
else if(_model.ThreadsPerCore < 1)
|
||||
return;
|
||||
|
||||
if(_unknownProcess)
|
||||
_model.Process = null;
|
||||
else if(string.IsNullOrWhiteSpace(_model.Process))
|
||||
return;
|
||||
|
||||
if(_unknownProcessNm)
|
||||
_model.ProcessNm = null;
|
||||
else if(_model.ProcessNm < 1)
|
||||
return;
|
||||
|
||||
if(_unknownDieSize)
|
||||
_model.DieSize = null;
|
||||
else if(_model.DieSize < 1)
|
||||
return;
|
||||
|
||||
if(_unknownTransistors)
|
||||
_model.Transistors = null;
|
||||
else if(_model.Transistors < 0)
|
||||
return;
|
||||
|
||||
if(_unknownDataBus)
|
||||
_model.DataBus = null;
|
||||
else if(_model.DataBus < 1)
|
||||
return;
|
||||
|
||||
if(_unknownAddressBus)
|
||||
_model.AddrBus = null;
|
||||
else if(_model.AddrBus < 1)
|
||||
return;
|
||||
|
||||
if(_unknownL1Instruction)
|
||||
_model.L1Instruction = null;
|
||||
else if(_model.L1Instruction < 0)
|
||||
return;
|
||||
|
||||
if(_unknownL1Data)
|
||||
_model.L1Data = null;
|
||||
else if(_model.L1Data < 0)
|
||||
return;
|
||||
|
||||
if(_unknownL2)
|
||||
_model.L2 = null;
|
||||
else if(_model.L2 < 0)
|
||||
return;
|
||||
|
||||
if(_unknownL3)
|
||||
_model.FprSize = null;
|
||||
else if(_model.L3 < 0)
|
||||
return;
|
||||
|
||||
_editing = false;
|
||||
await Service.UpdateAsync(_model);
|
||||
_model = await Service.GetAsync(Id);
|
||||
SetCheckboxes();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
void ValidateName(ValidatorEventArgs e) =>
|
||||
Validators.ValidateString(e, L["Name must be 50 characters or less."], 50);
|
||||
|
||||
void ValidateModelCode(ValidatorEventArgs e) =>
|
||||
Validators.ValidateString(e, L["Model code must be 45 characters or less."], 45);
|
||||
|
||||
void ValidateIntroduced(ValidatorEventArgs e) => Validators.ValidateIntroducedDate(e);
|
||||
|
||||
void ValidateDoubleBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateDouble(e);
|
||||
|
||||
void ValidateIntegerBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateInteger(e);
|
||||
|
||||
void ValidatePackage(ValidatorEventArgs e) =>
|
||||
Validators.ValidateString(e, L["Package must be 45 characters or less."], 45);
|
||||
|
||||
void ValidateFloatBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateFloat(e);
|
||||
|
||||
void ValidateIntegerBiggerThanOne(ValidatorEventArgs e) => Validators.ValidateInteger(e, 1);
|
||||
|
||||
void ValidateLongBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateLong(e);
|
||||
|
||||
void ValidateFloatBiggerThanOne(ValidatorEventArgs e) => Validators.ValidateFloat(e, 1);
|
||||
|
||||
void ValidateProcess(ValidatorEventArgs e) =>
|
||||
Validators.ValidateString(e, L["Process must be 45 characters or less."], 45);
|
||||
}
|
||||
}
|
||||
@@ -95,12 +95,11 @@ namespace Marechai.Pages.Admin.Details
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
void ValidateDoubleBiggerThanZero(ValidatorEventArgs e) =>
|
||||
Validators.ValidateDoubleBiggerThanZero(e, 1, 131072);
|
||||
void ValidateDoubleBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateDouble(e, 1, 131072);
|
||||
|
||||
void ValidateLongBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateLongBiggerThanZero(e, 2);
|
||||
void ValidateLongBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateLong(e, 2);
|
||||
|
||||
void ValidateType(ValidatorEventArgs e) =>
|
||||
Validators.ValidateStringWithMaxLength(e, L["Screen type cannot be bigger than 256 characters."], 256);
|
||||
Validators.ValidateString(e, L["Screen type cannot be bigger than 256 characters."], 256);
|
||||
}
|
||||
}
|
||||
@@ -135,15 +135,15 @@ namespace Marechai.Pages.Admin.Details
|
||||
}
|
||||
|
||||
void ValidateModelCode(ValidatorEventArgs e) =>
|
||||
Validators.ValidateStringWithMaxLength(e, L["Model code must be 45 characters or less."], 45);
|
||||
Validators.ValidateString(e, L["Model code must be 45 characters or less."], 45);
|
||||
|
||||
void ValidateIntroduced(ValidatorEventArgs e) => Validators.ValidateIntroducedDate(e);
|
||||
|
||||
void ValidateIntegerBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateIntegerBiggerThanZero(e);
|
||||
void ValidateIntegerBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateInteger(e);
|
||||
|
||||
void ValidateDoubleBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateDoubleBiggerThanZero(e);
|
||||
void ValidateDoubleBiggerThanZero(ValidatorEventArgs e) => Validators.ValidateDouble(e);
|
||||
|
||||
void ValidateName(ValidatorEventArgs e) =>
|
||||
Validators.ValidateStringWithMaxLength(e, L["Name must be 50 characters or less."], 50);
|
||||
Validators.ValidateString(e, L["Name must be 50 characters or less."], 50);
|
||||
}
|
||||
}
|
||||
@@ -88,9 +88,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-primary" href="/admin/processors/details/@item.Id">@L["Details"]</a>
|
||||
<span class="btn btn-secondary">
|
||||
@L["Edit"]
|
||||
</span>
|
||||
<a class="btn btn-primary" href="/admin/processors/edit/@item.Id">@L["Edit"]</a>
|
||||
<Button Color="Color.Danger" Clicked="() => {ShowModal(item.Id);}">@L["Delete"]</Button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
217
Marechai/Resources/Services/ProcessorsService.en.resx
Normal file
217
Marechai/Resources/Services/ProcessorsService.en.resx
Normal file
@@ -0,0 +1,217 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ReSharper disable MarkupTextTypo -->
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Unknown (company)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to a company</comment>
|
||||
</data>
|
||||
<data name="Unknown (model code)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to a model code</comment>
|
||||
</data>
|
||||
<data name="Unknown (introduction date)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to an introduction date</comment>
|
||||
</data>
|
||||
<data name="Unknown (instruction set)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to an instruction set</comment>
|
||||
</data>
|
||||
<data name="Unknown (nominal speed)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to a nominal speed</comment>
|
||||
</data>
|
||||
<data name="Unknown (package)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to a chip package</comment>
|
||||
</data>
|
||||
<data name="Unknown (general purpose registers)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the number of general purpose registers</comment>
|
||||
</data>
|
||||
<data name="Unknown (general purpose register size)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of a general purpose register</comment>
|
||||
</data>
|
||||
<data name="Unknown (floating point registers)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the number of floating point registers</comment>
|
||||
</data>
|
||||
<data name="Unknown (floating point register size)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of a floating point register</comment>
|
||||
</data>
|
||||
<data name="Unknown (simd registers)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the number of SIMD registers</comment>
|
||||
</data>
|
||||
<data name="Unknown (simd register size)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of a SIMD register</comment>
|
||||
</data>
|
||||
<data name="Unknown (cores)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the number of cores</comment>
|
||||
</data>
|
||||
<data name="Unknown (threads per core)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the number of threads per core</comment>
|
||||
</data>
|
||||
<data name="Unknown (process)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the chip process</comment>
|
||||
</data>
|
||||
<data name="Unknown (process size)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the chip process size in nanometers</comment>
|
||||
</data>
|
||||
<data name="Unknown (die size)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the die size in square millimeters</comment>
|
||||
</data>
|
||||
<data name="Unknown (transistors)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the number of transistors</comment>
|
||||
</data>
|
||||
<data name="Unknown (data bus size)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of the data bus</comment>
|
||||
</data>
|
||||
<data name="Unknown (address bus size)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of the address bus</comment>
|
||||
</data>
|
||||
<data name="Unknown (L1 instruction cache)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of the L1 instruction cache</comment>
|
||||
</data>
|
||||
<data name="Unknown (L1 data cache)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of the L1 data cache</comment>
|
||||
</data>
|
||||
<data name="Unknown (L2 cache)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of the L2 data cache</comment>
|
||||
</data>
|
||||
<data name="Unknown (L3)" xml:space="preserve">
|
||||
<value>Unknown</value>
|
||||
<comment>Unknown, referring to the size of the L3 data cache</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -266,4 +266,208 @@
|
||||
<value>Caché L3 (KiB)</value>
|
||||
<comment>L3 cache (KiB)</comment>
|
||||
</data>
|
||||
<data name="Save" xml:space="preserve">
|
||||
<value>Guardar</value>
|
||||
<comment>Save</comment>
|
||||
</data>
|
||||
<data name="Unknown (company)" xml:space="preserve">
|
||||
<value>Desconocida</value>
|
||||
<comment>Unknown, referring to a company</comment>
|
||||
</data>
|
||||
<data name="Unknown (model code)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to a model code</comment>
|
||||
</data>
|
||||
<data name="Unknown (introduction date)" xml:space="preserve">
|
||||
<value>Desconocida</value>
|
||||
<comment>Unknown, referring to an introduction date</comment>
|
||||
</data>
|
||||
<data name="Unknown (instruction set)" xml:space="preserve">
|
||||
<value>Desconocida</value>
|
||||
<comment>Unknown, referring to an instruction set</comment>
|
||||
</data>
|
||||
<data name="Unknown (nominal speed)" xml:space="preserve">
|
||||
<value>Desconocida</value>
|
||||
<comment>Unknown, referring to a nominal speed</comment>
|
||||
</data>
|
||||
<data name="Unknown (package)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to a chip package</comment>
|
||||
</data>
|
||||
<data name="Unknown (general purpose registers)" xml:space="preserve">
|
||||
<value>Desconocidos</value>
|
||||
<comment>Unknown, referring to the number of general purpose registers</comment>
|
||||
</data>
|
||||
<data name="Unknown (general purpose register size)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of a general purpose register</comment>
|
||||
</data>
|
||||
<data name="Unknown (floating point registers)" xml:space="preserve">
|
||||
<value>Desconocidos</value>
|
||||
<comment>Unknown, referring to the number of floating point registers</comment>
|
||||
</data>
|
||||
<data name="Unknown (floating point register size)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of a floating point register</comment>
|
||||
</data>
|
||||
<data name="Unknown (simd registers)" xml:space="preserve">
|
||||
<value>Desconocidos</value>
|
||||
<comment>Unknown, referring to the number of SIMD registers</comment>
|
||||
</data>
|
||||
<data name="Unknown (simd register size)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of a SIMD register</comment>
|
||||
</data>
|
||||
<data name="Unknown (cores)" xml:space="preserve">
|
||||
<value>Desconocidos</value>
|
||||
<comment>Unknown, referring to the number of cores</comment>
|
||||
</data>
|
||||
<data name="Unknown (threads per core)" xml:space="preserve">
|
||||
<value>Desconocidos</value>
|
||||
<comment>Unknown, referring to the number of threads per core</comment>
|
||||
</data>
|
||||
<data name="Unknown (process)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the chip process</comment>
|
||||
</data>
|
||||
<data name="Unknown (process size)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the chip process size in nanometers</comment>
|
||||
</data>
|
||||
<data name="Unknown (die size)" xml:space="preserve">
|
||||
<value>Desconocida</value>
|
||||
<comment>Unknown, referring to the die size in square millimeters</comment>
|
||||
</data>
|
||||
<data name="Unknown (transistors)" xml:space="preserve">
|
||||
<value>Desconocidos</value>
|
||||
<comment>Unknown, referring to the number of transistors</comment>
|
||||
</data>
|
||||
<data name="Unknown (data bus size)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of the data bus</comment>
|
||||
</data>
|
||||
<data name="Unknown (address bus size)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of the address bus</comment>
|
||||
</data>
|
||||
<data name="Unknown (L1 instruction cache)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of the L1 instruction cache</comment>
|
||||
</data>
|
||||
<data name="Unknown (L1 data cache)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of the L1 data cache</comment>
|
||||
</data>
|
||||
<data name="Unknown (L2 cache)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of the L2 data cache</comment>
|
||||
</data>
|
||||
<data name="Unknown (L3)" xml:space="preserve">
|
||||
<value>Desconocido</value>
|
||||
<comment>Unknown, referring to the size of the L3 data cache</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid name." xml:space="preserve">
|
||||
<value>Por favor introduce un nombre válido.</value>
|
||||
<comment>Please enter a valid name.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid model code." xml:space="preserve">
|
||||
<value>Por favor introduce un modelo válido.</value>
|
||||
<comment>Please enter a valid model code.</comment>
|
||||
</data>
|
||||
<data name="Prototype" xml:space="preserve">
|
||||
<value>Prototipo</value>
|
||||
<comment>Prototype</comment>
|
||||
</data>
|
||||
<data name="Please enter an introduction date." xml:space="preserve">
|
||||
<value>Por favor elige una fecha válida.</value>
|
||||
<comment>Please enter an introduction date.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid nominal speed." xml:space="preserve">
|
||||
<value>Por favor introduce una velocidad nominal válida.</value>
|
||||
<comment>Please enter a valid nominal speed.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid package." xml:space="preserve">
|
||||
<value>Por favor introduce un empaquetado válido.</value>
|
||||
<comment>Please enter a valid package.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid number of general purpose registers." xml:space="preserve">
|
||||
<value>Por favor introduce un número válido de registros de propósito general.</value>
|
||||
<comment>Please enter a valid number of general purpose registers.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid general purpose register size." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño de registro de propósito general válido.</value>
|
||||
<comment>Please enter a valid general purpose register size.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid number of floating point registers." xml:space="preserve">
|
||||
<value>Por favor introduce un número válido de registros de coma flotante.</value>
|
||||
<comment>Please enter a valid number of floating point registers.</comment>
|
||||
</data>
|
||||
<data name="If set to zero, but with a size, indicates floating point instructions use the general purpose registers." xml:space="preserve">
|
||||
<value>Si introduces cero, con un tamaño válido, indica que las instrucciones de coma flotante utilizan los registros de propósito general.</value>
|
||||
<comment>If set to zero, but with a size, indicates floating point instructions use the general purpose registers.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid floating point register size." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño de registro de coma flotante válido.</value>
|
||||
<comment>Please enter a valid floating point register size.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid number of SIMD registers." xml:space="preserve">
|
||||
<value>Por favor introduce un número válido de registros SIMD.</value>
|
||||
<comment>Please enter a valid number of SIMD registers.</comment>
|
||||
</data>
|
||||
<data name="If set to zero, but with a size, indicates SIMD instructions use the floating point registers. If they are also set to zero with a size, it means SIMD instructions use the general purpose registers." xml:space="preserve">
|
||||
<value>Si introduces cero, con un tamaño válido, indica que las instrucciones SIMD utilizan los registros de coma flotante. Si su número también es cero, indica que las instrucciones SIMD utilizan los registros de propósito general.</value>
|
||||
<comment>If set to zero, but with a size, indicates SIMD instructions use the floating point registers. If they are also set to zero with a size, it means SIMD instructions use the general purpose registers.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid SIMD register size." xml:space="preserve">
|
||||
<value>Por favor intrudoce un tamaño de registro SIMD válido.</value>
|
||||
<comment>Please enter a valid SIMD register size.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid number of cores." xml:space="preserve">
|
||||
<value>Por favor introduce un número válido de núcleos.</value>
|
||||
<comment>Please enter a valid number of cores.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid number of threads per core." xml:space="preserve">
|
||||
<value>Por favor introduce un número válido de hilos por núcleo.</value>
|
||||
<comment>Please enter a valid number of threads per core.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid process." xml:space="preserve">
|
||||
<value>Por favor introduce un proceso válido.</value>
|
||||
<comment>Please enter a valid process.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid process size in nanometers." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño de proceso en nanómetros válido.</value>
|
||||
<comment>Please enter a valid process size in nanometers.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid die size in square millimeters." xml:space="preserve">
|
||||
<value>Por favor introduce un área del chip en milímetros cuadrados válida.</value>
|
||||
<comment>Please enter a valid die size in square millimeters.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid number of transistors." xml:space="preserve">
|
||||
<value>Por favor introduce un número válido de transistores.</value>
|
||||
<comment>Please enter a valid number of transistors.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid data bus size in bits." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño válido del bus de datos en bits.</value>
|
||||
<comment>Please enter a valid data bus size in bits.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid address bus size in bits." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño válido del bus de direcciones en bits.</value>
|
||||
<comment>Please enter a valid address bus size in bits.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid L1 instruction cache size in kibibytes." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño válido de la caché L1 de instrucciones en kibibytes.</value>
|
||||
<comment>Please enter a valid L1 instruction cache size in kibibytes.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid L1 data cache size in kibibytes." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño válido de la caché L1 de datos en kibibytes.</value>
|
||||
<comment>Please enter a valid L1 data cache size in kibibytes.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid L2 cache size in kibibytes." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño válido de la caché L2 en kibibytes.</value>
|
||||
<comment>Please enter a valid L2 cache size in kibibytes.</comment>
|
||||
</data>
|
||||
<data name="Please enter a valid L3 cache size in kibibytes." xml:space="preserve">
|
||||
<value>Por favor introduce un tamaño válido de la caché L3 en kibibytes.</value>
|
||||
<comment>Please enter a valid L3 cache size in kibibytes.</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -42,7 +42,53 @@ namespace Marechai.Services
|
||||
p.Processor.InstructionSetExtensions.Select(e => e.Extension.Extension).ToList()
|
||||
}).ToListAsync();
|
||||
|
||||
public async Task<Processor> GetAsync(int id) => await _context.Processors.FindAsync(id);
|
||||
public async Task<ProcessorViewModel> GetAsync(int id) =>
|
||||
await _context.Processors.Where(p => p.Id == id).Select(p => new ProcessorViewModel
|
||||
{
|
||||
Name = p.Name, CompanyName = p.Company.Name, CompanyId = p.Company.Id, ModelCode = p.ModelCode,
|
||||
Introduced = p.Introduced, Speed = p.Speed, Package = p.Package, Gprs = p.Gprs,
|
||||
GprSize = p.GprSize, Fprs = p.Fprs, FprSize = p.FprSize, Cores = p.Cores,
|
||||
ThreadsPerCore = p.ThreadsPerCore, Process = p.Process, ProcessNm = p.ProcessNm, DieSize = p.DieSize,
|
||||
Transistors = p.Transistors, DataBus = p.DataBus, AddrBus = p.AddrBus, SimdRegisters = p.SimdRegisters,
|
||||
SimdSize = p.SimdSize, L1Instruction = p.L1Instruction, L1Data = p.L1Data, L2 = p.L2,
|
||||
L3 = p.L3, InstructionSet = p.InstructionSet.Name, InstructionSetId = p.InstructionSetId
|
||||
}).FirstOrDefaultAsync();
|
||||
|
||||
public async Task UpdateAsync(ProcessorViewModel viewModel)
|
||||
{
|
||||
Processor model = await _context.Processors.FindAsync(viewModel.Id);
|
||||
|
||||
if(model is null)
|
||||
return;
|
||||
|
||||
model.AddrBus = viewModel.AddrBus;
|
||||
model.CompanyId = viewModel.CompanyId;
|
||||
model.Cores = viewModel.Cores;
|
||||
model.DataBus = viewModel.DataBus;
|
||||
model.DieSize = viewModel.DieSize;
|
||||
model.Fprs = viewModel.Fprs;
|
||||
model.FprSize = viewModel.FprSize;
|
||||
model.Gprs = viewModel.Gprs;
|
||||
model.GprSize = viewModel.GprSize;
|
||||
model.InstructionSetId = viewModel.InstructionSetId;
|
||||
model.Introduced = viewModel.Introduced;
|
||||
model.L1Data = viewModel.L1Data;
|
||||
model.L1Instruction = viewModel.L1Instruction;
|
||||
model.L2 = viewModel.L2;
|
||||
model.L3 = viewModel.L3;
|
||||
model.ModelCode = viewModel.ModelCode;
|
||||
model.Name = viewModel.Name;
|
||||
model.Package = viewModel.Package;
|
||||
model.Process = viewModel.Process;
|
||||
model.ProcessNm = viewModel.ProcessNm;
|
||||
model.SimdRegisters = viewModel.SimdRegisters;
|
||||
model.SimdSize = viewModel.SimdSize;
|
||||
model.Speed = viewModel.Speed;
|
||||
model.ThreadsPerCore = viewModel.ThreadsPerCore;
|
||||
model.Transistors = viewModel.Transistors;
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task DeleteAsync(int id)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Marechai.Shared
|
||||
{
|
||||
public static class Validators
|
||||
{
|
||||
public static void ValidateStringWithMaxLength(ValidatorEventArgs e, string message, int maxLength)
|
||||
public static void ValidateString(ValidatorEventArgs e, string message, int maxLength)
|
||||
{
|
||||
string item = e.Value as string;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Marechai.Shared
|
||||
e.Status = ValidationStatus.Success;
|
||||
}
|
||||
|
||||
public static void ValidateDoubleBiggerThanZero(ValidatorEventArgs e, double minValue = 0, double maxValue = double.MaxValue)
|
||||
public static void ValidateDouble(ValidatorEventArgs e, double minValue = 0, double maxValue = double.MaxValue)
|
||||
{
|
||||
if(!(e.Value is double item) ||
|
||||
item < minValue || item > maxValue)
|
||||
@@ -37,7 +37,7 @@ namespace Marechai.Shared
|
||||
e.Status = ValidationStatus.Success;
|
||||
}
|
||||
|
||||
public static void ValidateIntegerBiggerThanZero(ValidatorEventArgs e, int minValue = 0, int maxValue = int.MaxValue)
|
||||
public static void ValidateInteger(ValidatorEventArgs e, int minValue = 0, int maxValue = int.MaxValue)
|
||||
{
|
||||
if(!(e.Value is int item) ||
|
||||
item < minValue || item > maxValue)
|
||||
@@ -46,7 +46,7 @@ namespace Marechai.Shared
|
||||
e.Status = ValidationStatus.Success;
|
||||
}
|
||||
|
||||
public static void ValidateLongBiggerThanZero(ValidatorEventArgs e, long minValue = 0, long maxValue = long.MaxValue)
|
||||
public static void ValidateLong(ValidatorEventArgs e, long minValue = 0, long maxValue = long.MaxValue)
|
||||
{
|
||||
if(!(e.Value is long item) ||
|
||||
item < minValue || item > maxValue)
|
||||
@@ -54,5 +54,14 @@ namespace Marechai.Shared
|
||||
else
|
||||
e.Status = ValidationStatus.Success;
|
||||
}
|
||||
|
||||
public static void ValidateFloat(ValidatorEventArgs e, float minValue = 0, float maxValue = float.MaxValue)
|
||||
{
|
||||
if(!(e.Value is float item) ||
|
||||
item < minValue || item > maxValue)
|
||||
e.Status = ValidationStatus.Error;
|
||||
else
|
||||
e.Status = ValidationStatus.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ namespace Marechai.ViewModels
|
||||
public string InstructionSet { get; set; }
|
||||
public List<string> InstructionSetExtensions { get; set; }
|
||||
public int? CompanyId { get; set; }
|
||||
public int? InstructionSetId { get; set; }
|
||||
|
||||
public string IntroducedView => Introduced?.ToShortDateString() ?? "Unknown";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user