L
+@attribute [Authorize(Roles = "UberAdmin, Admin")]
+@L["Instruction set details"]
+
+
+@if (!_loaded)
+{
+ @L["Loading..."]
+
+ return;
}
-Details
+
-
Instruction set
-
-
- -
- @Html.DisplayNameFor(model => model.Name)
-
- -
- @Html.DisplayFor(model => model.Name)
-
-
+
+ @L["Name"]
+
+
\ No newline at end of file
diff --git a/Marechai/Pages/Admin/Details/InstructionSet.razor.cs b/Marechai/Pages/Admin/Details/InstructionSet.razor.cs
new file mode 100644
index 00000000..35bf2149
--- /dev/null
+++ b/Marechai/Pages/Admin/Details/InstructionSet.razor.cs
@@ -0,0 +1,29 @@
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Components;
+
+namespace Marechai.Pages.Admin.Details
+{
+ public partial class InstructionSet
+ {
+ bool _editable;
+ bool _loaded;
+ Database.Models.InstructionSet _model;
+ [Parameter]
+ public int Id { get; set; }
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ if(_loaded)
+ return;
+
+ _loaded = true;
+
+ if(Id <= 0)
+ return;
+
+ _model = await Service.GetAsync(Id);
+
+ StateHasChanged();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Marechai/Pages/Admin/InstructionSets.razor b/Marechai/Pages/Admin/InstructionSets.razor
index ae0807df..97d1ae23 100644
--- a/Marechai/Pages/Admin/InstructionSets.razor
+++ b/Marechai/Pages/Admin/InstructionSets.razor
@@ -63,9 +63,7 @@
@item.Name
-
- @L["Details"]
-
+ @L["Details"]
@L["Edit"]
diff --git a/Marechai/Resources/Services/InstructionSetsService.es.resx b/Marechai/Resources/Services/InstructionSetsService.es.resx
index 18a25675..9e0285fd 100644
--- a/Marechai/Resources/Services/InstructionSetsService.es.resx
+++ b/Marechai/Resources/Services/InstructionSetsService.es.resx
@@ -158,4 +158,12 @@
Cancelar
Cancel
+
+ Detalles de arquitectura
+ Instruction set details
+
+
+ Volver a la lista
+ Back to list
+
\ No newline at end of file
diff --git a/Marechai/Services/InstructionSetsService.cs b/Marechai/Services/InstructionSetsService.cs
index 75988999..4b36ea1f 100644
--- a/Marechai/Services/InstructionSetsService.cs
+++ b/Marechai/Services/InstructionSetsService.cs
@@ -15,6 +15,8 @@ namespace Marechai.Services
public async Task> GetAsync() =>
await _context.InstructionSets.OrderBy(s => s.Name).ToListAsync();
+ public async Task GetAsync(int id) => await _context.InstructionSets.FindAsync(id);
+
public async Task DeleteAsync(int id)
{
InstructionSet item = await _context.InstructionSets.FindAsync(id);
|