Add registry element data view
This commit is contained in:
28
Hcs.WebApp/Components/Dialogs/ViewRegistryElement.razor
Normal file
28
Hcs.WebApp/Components/Dialogs/ViewRegistryElement.razor
Normal file
@ -0,0 +1,28 @@
|
||||
@using Hcs.WebApp.Services
|
||||
@using Newtonsoft.Json
|
||||
|
||||
@inject RegistryService RegistryService
|
||||
|
||||
<RadzenTextArea @bind-Value="@content" Style="width: 370px; height:500px; resize: none; display: block; margin-left: auto; margin-right: auto;" ReadOnly="true" />
|
||||
|
||||
@code {
|
||||
string? content;
|
||||
|
||||
[Parameter]
|
||||
public required RegistryElement RegistryElement { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
if (string.IsNullOrEmpty(RegistryElement.Json))
|
||||
{
|
||||
RegistryElement.Json = await RegistryService.GetRegistryElementJsonAsync(RegistryElement.Id);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(RegistryElement.Json))
|
||||
{
|
||||
content = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(RegistryElement.Json!), Formatting.Indented);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user