Skip to content

Commit

Permalink
Fix #459
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand committed Mar 14, 2022
1 parent 6604e17 commit 20f1e09
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions src/AzureIoTHub.Portal/Client/Pages/Devices/DeviceDetailPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -107,42 +107,38 @@
break;
case DevicePropertyType.Double:
<MudItem xs="12" md="4">
<MudTextField
@bind-Value="item.Value"
Label="@item.DisplayName"
Variant="Variant.Outlined"
Validation=@((string c) => string.IsNullOrEmpty(c) || double.TryParse(c, out var result))
Clearable="true" />
<MudTextField @bind-Value="item.Value"
Label="@item.DisplayName"
Variant="Variant.Outlined"
Validation=@((string c) => string.IsNullOrEmpty(c) || double.TryParse(c, out var result))
Clearable="true" />
</MudItem>
break;
case DevicePropertyType.Float:
<MudItem xs="12" md="4">
<MudTextField
@bind-Value="item.Value"
Label="@item.DisplayName"
Variant="Variant.Outlined"
Validation=@((string c) => string.IsNullOrEmpty(c) || float.TryParse(c, out var result))
Clearable="true" />
<MudTextField @bind-Value="item.Value"
Label="@item.DisplayName"
Variant="Variant.Outlined"
Validation=@((string c) => string.IsNullOrEmpty(c) || float.TryParse(c, out var result))
Clearable="true" />
</MudItem>
break;
case DevicePropertyType.Integer:
<MudItem xs="12" md="4">
<MudTextField
@bind-Value="item.Value"
Label="@item.DisplayName"
Variant="Variant.Outlined"
Validation=@((string c) => string.IsNullOrEmpty(c) || int.TryParse(c, out var result))
Clearable="true" />
<MudTextField @bind-Value="item.Value"
Label="@item.DisplayName"
Variant="Variant.Outlined"
Validation=@((string c) => string.IsNullOrEmpty(c) || int.TryParse(c, out var result))
Clearable="true" />
</MudItem>
break;
case DevicePropertyType.Long:
<MudItem xs="12" md="4">
<MudTextField
@bind-Value="item.Value"
Label="@item.DisplayName"
Variant="Variant.Outlined"
Validation=@((string c) => string.IsNullOrEmpty(c) || long.TryParse(c, out var result))
Clearable="true" />
<MudTextField @bind-Value="item.Value"
Label="@item.DisplayName"
Variant="Variant.Outlined"
Validation=@((string c) => string.IsNullOrEmpty(c) || long.TryParse(c, out var result))
Clearable="true" />
</MudItem>
break;
case DevicePropertyType.String:
Expand Down Expand Up @@ -214,10 +210,10 @@
else
{
Device = await Http.GetFromJsonAsync<DeviceDetails>($"{ApiUrlBase}/{DeviceID}");
Properties = await Http.GetFromJsonAsync<List<DevicePropertyValue>>($"{ApiUrlBase}/{DeviceID}/properties");
}

TagList = await Http.GetFromJsonAsync<List<DeviceTag>>($"/api/settings/device-tags");
Properties = await Http.GetFromJsonAsync<List<DevicePropertyValue>>($"{ApiUrlBase}/{DeviceID}/properties");

isLoaded = true;
}
Expand Down

0 comments on commit 20f1e09

Please sign in to comment.