mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Use different way of showing MMC FEATURES.
This commit is contained in:
Submodule DiscImageChef.CommonTypes updated: 374c145562...e95d90a932
@@ -16,7 +16,18 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
public MmcController(DicServerContext context) => _context = context;
|
||||
|
||||
// GET: Admin/Mmc
|
||||
public async Task<IActionResult> Index() => View(await _context.Mmc.ToListAsync());
|
||||
public IActionResult Index() => View(_context.Mmc.Where(m => m.ModeSense2AData != null).
|
||||
Select(m => new MmcModelForView
|
||||
{
|
||||
Id = m.Id, FeaturesId = m.FeaturesId,
|
||||
DataLength = m.ModeSense2AData.Length
|
||||
}).ToList().
|
||||
Concat(_context.Mmc.Where(m => m.ModeSense2AData == null).
|
||||
Select(m => new MmcModelForView
|
||||
{
|
||||
Id = m.Id, FeaturesId = m.FeaturesId,
|
||||
DataLength = 0
|
||||
}).ToList()).OrderBy(m => m.Id));
|
||||
|
||||
// GET: Admin/Mmc/Details/5
|
||||
public async Task<IActionResult> Details(int? id)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@model IEnumerable<DiscImageChef.CommonTypes.Metadata.Mmc>
|
||||
@model IEnumerable<MmcModelForView>
|
||||
|
||||
@{
|
||||
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
|
||||
@@ -37,7 +37,13 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.ModeSense2AData)
|
||||
@Html.DisplayNameFor(model => model.Id)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FeaturesId)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.DataLength)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@@ -47,7 +53,20 @@
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ModeSense2AData)
|
||||
@Html.DisplayFor(modelItem => item.Id)
|
||||
</td>
|
||||
<td>
|
||||
@if (item.FeaturesId != null)
|
||||
{
|
||||
<a asp-action="details" asp-controller="MmcFeatures" asp-route-id="@item.FeaturesId" target="_blank">@Html.DisplayFor(modelItem => item.FeaturesId)</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.DisplayFor(modelItem => item.FeaturesId)
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.DataLength)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-primary">Details</a>
|
||||
|
||||
14
DiscImageChef.Server/Models/MmcModelForView.cs
Normal file
14
DiscImageChef.Server/Models/MmcModelForView.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiscImageChef.Server.Models
|
||||
{
|
||||
public class MmcModelForView
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayFormat(NullDisplayText = "none"), DisplayName("MMC FEATURES ID")]
|
||||
public int? FeaturesId { get; set; }
|
||||
[DisplayName("Response length (bytes)")]
|
||||
public int DataLength { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user