Skip to content

Commit

Permalink
Fix #2219 (#2220)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand authored Jun 15, 2023
1 parent 7ba4749 commit 2ef1470
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/IoTHub.Portal.Application/Mappers/EdgeDeviceProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public EdgeDeviceProfile()
.ForMember(dest => dest.DeviceName, opts => opts.MapFrom(src => src.Name))
.ForMember(dest => dest.NbDevices, opts => opts.MapFrom(src => src.NbDevices))
.ForMember(dest => dest.ImageUrl, opts => opts.MapFrom((src, _, _, context) => context.Items["imageUrl"]))
.ForMember(dest => dest.Status, opts => opts.MapFrom(src => src.IsEnabled ? DeviceStatus.Enabled.ToString() : DeviceStatus.Disabled.ToString()))
.ForMember(dest => dest.Status, opts => opts.MapFrom(src => src.ConnectionState))
.ForMember(dest => dest.Labels, opts => opts.MapFrom(src => src.Labels.Union(src.DeviceModel.Labels)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
<MudText>Status</MudText>
<MudRadioGroup @bind-SelectedOption="@searchModel.Status" Style="display:flex;align-items:baseline">
<MudItem md="4" sm="12">
<MudRadio Option=@("true") Color="Color.Primary">Enabled</MudRadio>
<MudRadio Option=@("true") Color="Color.Primary">Connected</MudRadio>
</MudItem>
<MudItem md="4" sm="12">
<MudRadio Option=@("false") Color="Color.Primary">Disabled</MudRadio>
<MudRadio Option=@("false") Color="Color.Primary">Disconnected</MudRadio>
</MudItem>
<MudItem md="4" sm="12">
<MudRadio Option=@("true") Color="Color.Secondary">All</MudRadio>
Expand Down Expand Up @@ -102,8 +102,8 @@
<HeaderContent>
<MudTh></MudTh>
<MudTh><MudTableSortLabel SortLabel="Id" T="IoTEdgeListItem" id="sortDeviceId">Device ID</MudTableSortLabel></MudTh>
<MudTh Style="text-align: center"><MudTableSortLabel SortLabel="IsEnabled" T="IoTEdgeListItem">Allowed</MudTableSortLabel></MudTh>
<MudTh Style="text-align: center"><MudTableSortLabel SortLabel="NbDevices" T="IoTEdgeListItem">Nb devices</MudTableSortLabel></MudTh>
<MudTh Style="text-align: center"><MudTableSortLabel SortLabel="IsEnabled" T="IoTEdgeListItem">Connected</MudTableSortLabel></MudTh>
<MudTh Style="text-align: center"><MudTableSortLabel SortLabel="NbDevices" T="IoTEdgeListItem">Connected leaf devices</MudTableSortLabel></MudTh>
<MudTh Style="text-align: center">See details</MudTh>
<MudTh Style="text-align: center">Delete</MudTh>
</HeaderContent>
Expand All @@ -123,13 +123,13 @@
<MudTd DataLabel="Status" Style="text-align: center">
@if (context.Status == "Enabled")
{
<MudTooltip Text="Device can connect">
<MudTooltip Text="Device is connected">
<MudIcon Icon="@Icons.Material.Filled.CheckCircle" Color="Color.Success" />
</MudTooltip>
}
else
{
<MudTooltip Text="Device cannot connect">
<MudTooltip Text="Device is disconnected">
<MudIcon Icon="@Icons.Material.Filled.Error" Color="Color.Default" />
</MudTooltip>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task<PaginatedResult<IoTEdgeListItem>> GetEdgeDevicesPage(

if (deviceListFilter.IsEnabled != null)
{
devicePredicate = devicePredicate.And(device => device.IsEnabled.Equals(deviceListFilter.IsEnabled));
devicePredicate = devicePredicate.And(device => device.ConnectionState.Equals(deviceListFilter.IsEnabled.Value ? "Connected" : "Disconnected"));
}

if (!string.IsNullOrWhiteSpace(deviceListFilter.ModelId))
Expand Down

0 comments on commit 2ef1470

Please sign in to comment.