mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Add view for SCSI CD-ROM Capabilities details
This commit is contained in:
29
Aaru.Server/Components/Admin/Pages/Scsi/Cdrom/Details.razor
Normal file
29
Aaru.Server/Components/Admin/Pages/Scsi/Cdrom/Details.razor
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
@page "/admin/scsi/cdrom/{id:int}"
|
||||||
|
@using Aaru.Decoders.SCSI
|
||||||
|
@attribute [Authorize]
|
||||||
|
@layout AdminLayout
|
||||||
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
|
@inject Microsoft.EntityFrameworkCore.IDbContextFactory<DbContext> DbContextFactory
|
||||||
|
|
||||||
|
<PageTitle>SCSI CD-ROM Capabilities</PageTitle>
|
||||||
|
|
||||||
|
@if(!_initialized)
|
||||||
|
{
|
||||||
|
<div class="stats-section">
|
||||||
|
<h1 style="color: red; align-content: center; padding: 2rem">Loading...</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
<section class="stats-section">
|
||||||
|
<div>
|
||||||
|
<h4>SCSI CD-ROM Capabilities</h4>
|
||||||
|
<hr />
|
||||||
|
@((MarkupString)Modes.PrettifyModePage_2A(_model?.ModeSense2AData)?.Replace("\n", "<br />"))
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="/admin/scsi/cdrom" class="btn btn-secondary">Back to List</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using DbContext = Aaru.Server.Database.DbContext;
|
||||||
|
|
||||||
|
namespace Aaru.Server.Components.Admin.Pages.Scsi.Cdrom;
|
||||||
|
|
||||||
|
public partial class Details
|
||||||
|
{
|
||||||
|
bool _initialized;
|
||||||
|
CommonTypes.Metadata.Mmc? _model;
|
||||||
|
[Parameter]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
|
StateHasChanged();
|
||||||
|
|
||||||
|
await using DbContext ctx = await DbContextFactory.CreateDbContextAsync();
|
||||||
|
|
||||||
|
_model = await ctx.Mmc.FirstOrDefaultAsync(m => m.Id == Id);
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
|
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user