Move instruction set extensions admin index to Blazor.

This commit is contained in:
2020-05-24 05:55:12 +01:00
parent acf9a36024
commit c8b692f877
38 changed files with 250 additions and 68 deletions

View File

@@ -37,7 +37,7 @@
<h1>Company description</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Company logos</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>GPUs by machine</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>GPUs by machine</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -42,8 +42,6 @@
<br />
<a asp-controller="InstructionSets">Instruction sets</a>
<br />
<a asp-controller="InstructionSetExtensions">Instruction set extensions</a>
<br />
<a asp-controller="InstructionSetExtensionsByProcessor">Instruction set extensions by processor</a>
<br />
<a asp-controller="Licenses">Licenses</a>
@@ -81,13 +79,6 @@
<a asp-controller="StorageByMachines">Storage by machines</a>
<br />
</div>
<div class="content">
<h3>Administrative pages for documents</h3>
<a asp-controller="DocumentCompanies">Document companies</a>
<br />
<a asp-controller="DocumentPeople">Document people</a>
<br />
</div>
<div class="content">
<h3>Administrative pages for owned machines</h3>
<a asp-controller="OwnedMachine">Owned machines</a>
@@ -102,8 +93,4 @@
<br />
<a asp-controller="StorageByOwnedMachines">Storage by owned machine</a>
<br />
</div>
<div class="content">
<h3>User administrative pages</h3>
@* TODO *@ To be implemented
</div>

View File

@@ -6,7 +6,7 @@
<h1>Instruction set extensions by processor</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Instruction sets</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Licenses</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Machine families</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Machine photos</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Machines</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Memory by machines</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Memory by machines</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -5,7 +5,7 @@
}
<h1>Owned machines</h1>
<p>
<a asp-action="Create" class="btn btn-primary">Create New</a>
<a asp-action="Create" class="btn btn-primary">Create new</a>
</p>
<table class="table">
<thead>

View File

@@ -5,7 +5,7 @@
}
<h1>People</h1>
<p>
<a asp-action="Create" class="btn btn-primary">Create New</a>
<a asp-action="Create" class="btn btn-primary">Create new</a>
</p>
<table class="table">
<thead>

View File

@@ -37,7 +37,7 @@
<h2>Processors</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Processors by machine</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Processors by machine</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Resolutions</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Resolutions by GPU</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Resolutions by screen</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Screens</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Screens by machine</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Sound synthesizers by machine</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -6,7 +6,7 @@
<h1>Sound synthesizers by machine</h1>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Sound synthesizers</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Storage by machines</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -37,7 +37,7 @@
<h2>Storage by machines</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
Create new
</a>
</p>
<table class="table">

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.0.99.1053</Version>
<Version>3.0.99.1055</Version>
<Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product>
@@ -52,6 +52,9 @@
<Content Update="Pages\Admin\Gpus.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
<Content Update="Pages\Admin\InstructionSetExtensions.razor">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Delete.cshtml" />

View File

@@ -43,7 +43,7 @@
}
<p>
<span class="btn btn-primary">
@L["Create New"]
@L["Create new"]
</span>
</p>
<table class="table">

View File

@@ -43,7 +43,7 @@
}
<p>
<span class="btn btn-primary">
@L["Create New"]
@L["Create new"]
</span>
</p>
<table class="table">

View File

@@ -43,7 +43,7 @@
}
<p>
<span class="btn btn-primary">
@L["Create New"]
@L["Create new"]
</span>
</p>
<table class="table">

View File

@@ -50,6 +50,9 @@
<li>
<a href="/admin/gpus">@L["Graphics Processing Units"]</a>
</li>
<li>
<a href="/admin/instruction_set_extensions">@L["Instruction set extensions"]</a>
</li>
</ul>
</div>
<div class="content">

View File

@@ -1,14 +1,14 @@
@{
/******************************************************************************
@{
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Filename : Index.cshtml
// Filename : InstructionSetExtensions.razor
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin view index
// List of instruction set extensions
//
// --[ License ] --------------------------------------------------------------
//
@@ -29,45 +29,62 @@
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
}
@model IEnumerable<Marechai.Database.Models.InstructionSetExtension>
@{
ViewData["Title"] = "Instruction set extensions (Admin)";
@page "/admin/instruction_set_extensions"
@using Marechai.Database.Models
@inherits OwningComponentBase<InstructionSetExtensionsService>
@inject IStringLocalizer<InstructionSetExtensionsService> L
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Instruction set extensions"]</h3>
@if (_extensions is null)
{
<p>@L["Loading..."]</p>
return;
}
<h2>Instruction set extensions</h2>
<p>
<a asp-action="Create" class="btn btn-primary">
Create New
</a>
<span class="btn btn-primary">
@L["Create new"]
</span>
</p>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Extension)
@L["Extensions"]
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
@foreach (var item in _extensions)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Extension)
@item.Extension
</td>
<td>
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-primary">
Details
</a>
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-secondary">
Edit
</a>
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">
Delete
</a>
<span class="btn btn-primary">
@L["Details"]
</span>
<span class="btn btn-secondary">
@L["Edit"]
</span>
<span class="btn btn-danger">
@L["Delete"]
</span>
</td>
</tr>
}
</tbody>
</table>
</table>
@code
{
List<InstructionSetExtension> _extensions;
protected override async Task OnInitializedAsync()
{
_extensions = await Service.GetAsync();
}
}

View File

@@ -166,4 +166,8 @@
<value>Páginas de administración de usuarios</value>
<comment>User administrative pages.</comment>
</data>
<data name="Instruction set extensions" xml:space="preserve">
<value>Extensiones de arquitectura</value>
<comment>Instruction set extensions.</comment>
</data>
</root>

View File

@@ -0,0 +1,149 @@
<?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="Instruction set extensions" xml:space="preserve">
<value>Extensiones de arquitectura</value>
<comment>Instruction set extensions</comment>
</data>
<data name="Loading..." xml:space="preserve">
<value>Cargando...</value>
<comment>Message that appears while data is being loaded from database</comment>
</data>
<data name="Extension" xml:space="preserve">
<value>Extensión</value>
<comment>Extension</comment>
</data>
<data name="Create new" xml:space="preserve">
<value>Crear nueva</value>
<comment>Create new</comment>
</data>
<data name="Details" xml:space="preserve">
<value>Detalles</value>
<comment>Details</comment>
</data>
<data name="Edit" xml:space="preserve">
<value>Editar</value>
<comment>Edit</comment>
</data>
<data name="Delete" xml:space="preserve">
<value>Eliminar</value>
<comment>Delete</comment>
</data>
</root>

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Marechai.Database.Models;
using Microsoft.EntityFrameworkCore;
namespace Marechai.Services
{
public class InstructionSetExtensionsService
{
readonly MarechaiContext _context;
public InstructionSetExtensionsService(MarechaiContext context) => _context = context;
public async Task<List<InstructionSetExtension>> GetAsync() =>
await _context.InstructionSetExtensions.OrderBy(e => e.Extension).ToListAsync();
}
}

View File

@@ -51,6 +51,7 @@ namespace Marechai.Services
services.AddScoped<DocumentCompaniesService>();
services.AddScoped<DocumentPeopleService>();
services.AddScoped<GpusService>();
services.AddScoped<InstructionSetExtensionsService>();
}
}
}