Skip to content

Commit

Permalink
AppEUI field set as ReadOnly on DeviceDetailPage (#108)
Browse files Browse the repository at this point in the history
* fix #102 - Check if device model is present before requesting the current device model (#105)

* AppEUI field set as ReadOnly on DeviceDetailPage

Co-authored-by: Kevin BEAUGRAND <9513635+kbeaugrand@users.noreply.github.com>
  • Loading branch information
audserraCGI and kbeaugrand authored Jan 26, 2022
1 parent 8dcaf4c commit f55bed6
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<MudText>OTAA AppEUI : </MudText>
</MudItem>
<MudItem md="9" sm="12">
<MudTextField @bind-Value="@Device.AppEUI" Class="" Margin="Margin.Dense" ReadOnly="false" Variant="Variant.Outlined"></MudTextField>
<MudTextField @bind-Value="@Device.AppEUI" Class="custom-disabled" Margin="Margin.Dense" ReadOnly="true" Variant="Variant.Outlined"></MudTextField>
</MudItem>
</MudItem>
<MudItem xs="12" Class="custom-form">
Expand Down Expand Up @@ -184,8 +184,11 @@
Device = await Http.GetFromJsonAsync<DeviceDetails>($"api/Devices/{DeviceID}");

// Gets the DeviceModel Name from the DeviceModel ID
DeviceModel model = await Http.GetFromJsonAsync<DeviceModel>($"api/DeviceModels/{Device.ModelId}");
Device.ModelName = model.Name;
if (!string.IsNullOrEmpty(Device.ModelId))
{
DeviceModel model = await Http.GetFromJsonAsync<DeviceModel>($"api/DeviceModels/{Device.ModelId}");
Device.ModelName = model?.Name;
}

// StatusUpdatedTime set to string to have a more human-readable format
StatusUpdatedTimeString = Device.StatusUpdatedTime.ToString();
Expand Down

0 comments on commit f55bed6

Please sign in to comment.