Move list of browser tests to Blazor.

This commit is contained in:
2020-05-24 04:11:58 +01:00
parent be87adddc4
commit a3015ce0aa
12 changed files with 397 additions and 761 deletions

View File

@@ -1,138 +0,0 @@
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Filename : BrowserTestsController.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Browser test admin controller
//
// --[ 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
*******************************************************************************/
using System.Linq;
using System.Threading.Tasks;
using Marechai.Database.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace Marechai.Areas.Admin.Controllers
{
[Area("Admin"), Authorize]
public class BrowserTestsController : Controller
{
readonly MarechaiContext _context;
public BrowserTestsController(MarechaiContext context) => _context = context;
// GET: Admin/BrowserTests
public async Task<IActionResult> Index() =>
View(await _context.BrowserTests.OrderBy(b => b.Browser).ThenBy(b => b.Version).ThenBy(b => b.Os).
ThenBy(b => b.Platform).ThenBy(b => b.UserAgent).ToListAsync());
// GET: Admin/BrowserTests/Details/5
public async Task<IActionResult> Details(int? id)
{
if(id == null)
return NotFound();
BrowserTest browserTest = await _context.BrowserTests.FirstOrDefaultAsync(m => m.Id == id);
if(browserTest == null)
return NotFound();
return View(browserTest);
}
// GET: Admin/BrowserTests/Edit/5
public async Task<IActionResult> Edit(int? id)
{
if(id == null)
return NotFound();
BrowserTest browserTest = await _context.BrowserTests.FindAsync(id);
if(browserTest == null)
return NotFound();
return View(browserTest);
}
// POST: Admin/BrowserTests/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost, ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(
int id,
[Bind("Id,UserAgent,Browser,Version,Os,Platform,Gif87,Gif89,Jpeg,Png,Pngt,Agif,Table,Colors,Js,Frames,Flash")]
BrowserTest browserTest)
{
if(id != browserTest.Id)
return NotFound();
if(!ModelState.IsValid)
return View(browserTest);
try
{
_context.Update(browserTest);
await _context.SaveChangesAsync();
}
catch(DbUpdateConcurrencyException)
{
if(!BrowserTestExists(browserTest.Id))
return NotFound();
throw;
}
return RedirectToAction(nameof(Index));
}
// GET: Admin/BrowserTests/Delete/5
public async Task<IActionResult> Delete(int? id)
{
if(id == null)
return NotFound();
BrowserTest browserTest = await _context.BrowserTests.FirstOrDefaultAsync(m => m.Id == id);
if(browserTest == null)
return NotFound();
return View(browserTest);
}
// POST: Admin/BrowserTests/Delete/5
[HttpPost, ActionName("Delete"), ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(int id)
{
BrowserTest browserTest = await _context.BrowserTests.FindAsync(id);
_context.BrowserTests.Remove(browserTest);
await _context.SaveChangesAsync();
return RedirectToAction(nameof(Index));
}
bool BrowserTestExists(int id) => _context.BrowserTests.Any(e => e.Id == id);
}
}

View File

@@ -1,147 +0,0 @@
@{
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Filename : Delete.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin view delete
//
// --[ 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.BrowserTest
@{
ViewData["Title"] = "Delete";
}
<h2>Delete</h2>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>Browser test</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.UserAgent)
</dt>
<dd>
@Html.DisplayFor(model => model.UserAgent)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Browser)
</dt>
<dd>
@Html.DisplayFor(model => model.Browser)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Version)
</dt>
<dd>
@Html.DisplayFor(model => model.Version)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Os)
</dt>
<dd>
@Html.DisplayFor(model => model.Os)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Platform)
</dt>
<dd>
@Html.DisplayFor(model => model.Platform)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Gif87)
</dt>
<dd>
@Html.DisplayFor(model => model.Gif87)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Gif89)
</dt>
<dd>
@Html.DisplayFor(model => model.Gif89)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Jpeg)
</dt>
<dd>
@Html.DisplayFor(model => model.Jpeg)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Png)
</dt>
<dd>
@Html.DisplayFor(model => model.Png)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Pngt)
</dt>
<dd>
@Html.DisplayFor(model => model.Pngt)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Agif)
</dt>
<dd>
@Html.DisplayFor(model => model.Agif)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Table)
</dt>
<dd>
@Html.DisplayFor(model => model.Table)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Colors)
</dt>
<dd>
@Html.DisplayFor(model => model.Colors)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Js)
</dt>
<dd>
@Html.DisplayFor(model => model.Js)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Frames)
</dt>
<dd>
@Html.DisplayFor(model => model.Frames)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Flash)
</dt>
<dd>
@Html.DisplayFor(model => model.Flash)
</dd>
</dl>
<form asp-action="Delete">
<input type="hidden" asp-for="Id" />
<input class="btn btn-danger" type="submit" value="Delete" />
<a asp-action="Index" class="btn btn-secondary">
Back to List
</a>
</form>
</div>

View File

@@ -1,143 +0,0 @@
@{
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Filename : Details.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2020 Natalia Portillo
*******************************************************************************/
}
@model Marechai.Database.Models.BrowserTest
@{
ViewData["Title"] = "Details";
}
<h2>Details</h2>
<div>
<h4>Browser test</h4>
<hr />
<dl class="dl-horizontal">
<dt>
@Html.DisplayNameFor(model => model.UserAgent)
</dt>
<dd>
@Html.DisplayFor(model => model.UserAgent)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Browser)
</dt>
<dd>
@Html.DisplayFor(model => model.Browser)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Version)
</dt>
<dd>
@Html.DisplayFor(model => model.Version)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Os)
</dt>
<dd>
@Html.DisplayFor(model => model.Os)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Platform)
</dt>
<dd>
@Html.DisplayFor(model => model.Platform)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Gif87)
</dt>
<dd>
@Html.DisplayFor(model => model.Gif87)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Gif89)
</dt>
<dd>
@Html.DisplayFor(model => model.Gif89)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Jpeg)
</dt>
<dd>
@Html.DisplayFor(model => model.Jpeg)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Png)
</dt>
<dd>
@Html.DisplayFor(model => model.Png)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Pngt)
</dt>
<dd>
@Html.DisplayFor(model => model.Pngt)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Agif)
</dt>
<dd>
@Html.DisplayFor(model => model.Agif)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Table)
</dt>
<dd>
@Html.DisplayFor(model => model.Table)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Colors)
</dt>
<dd>
@Html.DisplayFor(model => model.Colors)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Js)
</dt>
<dd>
@Html.DisplayFor(model => model.Js)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Frames)
</dt>
<dd>
@Html.DisplayFor(model => model.Frames)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Flash)
</dt>
<dd>
@Html.DisplayFor(model => model.Flash)
</dd>
</dl>
</div>
<div>
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary">Edit</a>
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
</div>

View File

@@ -1,170 +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.BrowserTest
@{
ViewData["Title"] = "Edit";
}
<h2>Edit</h2>
<h4>Browser test</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="UserAgent" class="control-label">
</label>
<input asp-for="UserAgent" class="form-control" />
<span asp-validation-for="UserAgent" class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Browser" class="control-label">
</label>
<input asp-for="Browser" class="form-control" />
<span asp-validation-for="Browser" class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Version" class="control-label">
</label>
<input asp-for="Version" class="form-control" />
<span asp-validation-for="Version" class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Os" class="control-label">
</label>
<input asp-for="Os" class="form-control" />
<span asp-validation-for="Os" class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Platform" class="control-label">
</label>
<input asp-for="Platform" class="form-control" />
<span asp-validation-for="Platform" class="text-danger">
</span>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Gif87" /> @Html.DisplayNameFor(model => model.Gif87)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Gif89" /> @Html.DisplayNameFor(model => model.Gif89)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Jpeg" /> @Html.DisplayNameFor(model => model.Jpeg)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Png" /> @Html.DisplayNameFor(model => model.Png)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Pngt" /> @Html.DisplayNameFor(model => model.Pngt)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Agif" /> @Html.DisplayNameFor(model => model.Agif)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Table" /> @Html.DisplayNameFor(model => model.Table)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Colors" /> @Html.DisplayNameFor(model => model.Colors)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Js" /> @Html.DisplayNameFor(model => model.Js)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Frames" /> @Html.DisplayNameFor(model => model.Frames)
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
<input asp-for="Flash" /> @Html.DisplayNameFor(model => model.Flash)
</label>
</div>
</div>
<div class="form-group">
<input class="btn btn-primary" type="submit" value="Save" />
<a asp-action="Index" class="btn btn-secondary">
Back to List
</a>
</div>
</form>
</div>
</div>
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}

View File

@@ -1,158 +0,0 @@
@{
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Filename : Index.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// Admin view index
//
// --[ 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 IEnumerable<Marechai.Database.Models.BrowserTest>
@{
ViewData["Title"] = "Browser tests (Admin)";
}
<h2>Browser tests</h2>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Browser)
</th>
<th>
@Html.DisplayNameFor(model => model.Version)
</th>
<th>
@Html.DisplayNameFor(model => model.Os)
</th>
<th>
@Html.DisplayNameFor(model => model.Platform)
</th>
<th>
@Html.DisplayNameFor(model => model.UserAgent)
</th>
<th>
@Html.DisplayNameFor(model => model.Gif87)
</th>
<th>
@Html.DisplayNameFor(model => model.Gif89)
</th>
<th>
@Html.DisplayNameFor(model => model.Jpeg)
</th>
<th>
@Html.DisplayNameFor(model => model.Png)
</th>
<th>
@Html.DisplayNameFor(model => model.Pngt)
</th>
<th>
@Html.DisplayNameFor(model => model.Agif)
</th>
<th>
@Html.DisplayNameFor(model => model.Table)
</th>
<th>
@Html.DisplayNameFor(model => model.Colors)
</th>
<th>
@Html.DisplayNameFor(model => model.Js)
</th>
<th>
@Html.DisplayNameFor(model => model.Frames)
</th>
<th>
@Html.DisplayNameFor(model => model.Flash)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Browser)
</td>
<td>
@Html.DisplayFor(modelItem => item.Version)
</td>
<td>
@Html.DisplayFor(modelItem => item.Os)
</td>
<td>
@Html.DisplayFor(modelItem => item.Platform)
</td>
<td>
@Html.DisplayFor(modelItem => item.UserAgent)
</td>
<td>
@Html.DisplayFor(modelItem => item.Gif87)
</td>
<td>
@Html.DisplayFor(modelItem => item.Gif89)
</td>
<td>
@Html.DisplayFor(modelItem => item.Jpeg)
</td>
<td>
@Html.DisplayFor(modelItem => item.Png)
</td>
<td>
@Html.DisplayFor(modelItem => item.Pngt)
</td>
<td>
@Html.DisplayFor(modelItem => item.Agif)
</td>
<td>
@Html.DisplayFor(modelItem => item.Table)
</td>
<td>
@Html.DisplayFor(modelItem => item.Colors)
</td>
<td>
@Html.DisplayFor(modelItem => item.Js)
</td>
<td>
@Html.DisplayFor(modelItem => item.Frames)
</td>
<td>
@Html.DisplayFor(modelItem => item.Flash)
</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>
</td>
</tr>
}
</tbody>
</table>

View File

@@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Version>3.0.99.1041</Version>
<Version>3.0.99.1045</Version>
<Company>Canary Islands Computer Museum</Company>
<Copyright>Copyright © 2003-2020 Natalia Portillo</Copyright>
<Product>Canary Islands Computer Museum Website</Product>
@@ -44,4 +44,10 @@
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</Content>
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Delete.cshtml" />
<_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Details.cshtml" />
<_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Edit.cshtml" />
<_ContentIncludedByDefault Remove="Areas\Admin\Views\BrowserTests\Index.cshtml" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,163 @@
@{
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Filename : BrowserTests.razor
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ Description ] ----------------------------------------------------------
//
// List of browser tests
//
// --[ 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
*******************************************************************************/
}
@page "/admin/browser_tests"
@using Marechai.Database.Models
@inherits OwningComponentBase<BrowserTestsService>
@inject IStringLocalizer<BrowserTestsService> L
@attribute [Authorize(Roles = "UberAdmin")]
<h3>@L["Browser tests"]</h3>
@if (_tests is null)
{
<p>@L["Loading..."]</p>
return;
}
<table class="table">
<thead>
<tr>
<th>
@L["Browser"]
</th>
<th>
@L["Version"]
</th>
<th>
@L["Operating system"]
</th>
<th>
@L["Platform"]
</th>
<th>
@L["User agent"]
</th>
<th>
@L["GIF87"]
</th>
<th>
@L["GIF89"]
</th>
<th>
@L["JPEG"]
</th>
<th>
@L["PNG"]
</th>
<th>
@L["Transparent PNG"]
</th>
<th>
@L["Animated GIF"]
</th>
<th>
@L["Table"]
</th>
<th>
@L["Colors"]
</th>
<th>
@L["JavaScript"]
</th>
<th>
@L["Frames"]
</th>
<th>
@L["Flash"]
</th>
</tr>
</thead>
<tbody>
@foreach (var item in _tests)
{
<tr>
<td>
@item.Browser
</td>
<td>
@item.Version
</td>
<td>
@item.Os
</td>
<td>
@item.Platform
</td>
<td>
@item.UserAgent
</td>
<td>
@item.Gif87
</td>
<td>
@item.Gif89
</td>
<td>
@item.Jpeg
</td>
<td>
@item.Png
</td>
<td>
@item.Pngt
</td>
<td>
@item.Agif
</td>
<td>
@item.Table
</td>
<td>
@item.Colors
</td>
<td>
@item.Js
</td>
<td>
@item.Frames
</td>
<td>
@item.Flash
</td>
</tr>
}
</tbody>
</table>
@code
{
List<BrowserTest> _tests;
protected override async Task OnInitializedAsync()
{
_tests = await Service.GetAsync();
}
}

View File

@@ -1,5 +1,5 @@
@{
/******************************************************************************
/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
@@ -34,7 +34,12 @@
@inherits OwningComponentBase<AdminService>
@inject IStringLocalizer<AdminService> L
@attribute [Authorize(Roles = "UberAdmin, Admin")]
<h3>@L["Administration area"]</h3>
<p>@L["Welcome to the administration area. Act with care!"]</p>
<ul>
<authorizeview Roles="UberAdmin">
<li>
<a href="/admin/browser_tests">@L["Browser tests"]</a>
</li>
</authorizeview>
</ul>

View File

@@ -130,4 +130,8 @@
<value>Bienvenido/a al área de administración. ¡Actúa con cuidado!</value>
<comment>Welcome message.</comment>
</data>
<data name="Browser tests" xml:space="preserve">
<value>Pruebas de navegadores</value>
<comment>Browser tests.</comment>
</data>
</root>

View File

@@ -0,0 +1,193 @@
<?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="Loading..." xml:space="preserve">
<value>Cargando...</value>
<comment>Loading message</comment>
</data>
<data name="Browser tests" xml:space="preserve">
<value>Pruebas de navegadores</value>
<comment>Browser tests.</comment>
</data>
<data name="Browser" xml:space="preserve">
<value>Navegador</value>
<comment>Browser.</comment>
</data>
<data name="Version" xml:space="preserve">
<value>Versión</value>
<comment>Version.</comment>
</data>
<data name="Operating system" xml:space="preserve">
<value>Sistema operativo</value>
<comment>Operating system.</comment>
</data>
<data name="Platform" xml:space="preserve">
<value>Plataforma</value>
<comment>Platform.</comment>
</data>
<data name="User agent" xml:space="preserve">
<value>Identificator</value>
<comment>User agent.</comment>
</data>
<data name="GIF87" xml:space="preserve">
<value>GIF87</value>
<comment>GIF87.</comment>
</data>
<data name="GIF89" xml:space="preserve">
<value>GIF89</value>
<comment>GIF89.</comment>
</data>
<data name="JPEG" xml:space="preserve">
<value>JPEG</value>
<comment>JPEG.</comment>
</data>
<data name="PNG" xml:space="preserve">
<value>PNG</value>
<comment>PNG.</comment>
</data>
<data name="Transparent PNG" xml:space="preserve">
<value>PNG transparente</value>
<comment>Transparent PNG.</comment>
</data>
<data name="Animated GIF" xml:space="preserve">
<value>GIF animado</value>
<comment>Animated GIF.</comment>
</data>
<data name="Table" xml:space="preserve">
<value>Tabla</value>
<comment>Table.</comment>
</data>
<data name="Colors" xml:space="preserve">
<value>Colores</value>
<comment>Colors.</comment>
</data>
<data name="JavaScript" xml:space="preserve">
<value>JavaScript</value>
<comment>JavaScript.</comment>
</data>
<data name="Frames" xml:space="preserve">
<value>Marcos</value>
<comment>Frames.</comment>
</data>
<data name="Flash" xml:space="preserve">
<value>Flash</value>
<comment>Flash.</comment>
</data>
</root>

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Marechai.Database.Models;
using Microsoft.EntityFrameworkCore;
namespace Marechai.Services
{
public class BrowserTestsService
{
readonly MarechaiContext _context;
public BrowserTestsService(MarechaiContext context) => _context = context;
public Task<List<BrowserTest>> GetAsync() => _context.
BrowserTests.OrderBy(b => b.Browser).ThenBy(b => b.Version).
ThenBy(b => b.Os).ThenBy(b => b.Platform).ThenBy(b => b.UserAgent).
ToListAsync();
}
}

View File

@@ -47,6 +47,7 @@ namespace Marechai.Services
services.AddScoped<ConsolesService>();
services.AddScoped<MachinesService>();
services.AddScoped<AdminService>();
services.AddScoped<BrowserTestsService>();
}
}
}