Skip to content

Commit

Permalink
Update devices listing to distinguish devices that have telemetry #1641
Browse files Browse the repository at this point in the history
  • Loading branch information
hocinehacherouf authored and kbeaugrand committed Dec 9, 2022
1 parent 343de2d commit 74a84cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
@if (Portal.IsLoRaSupported)
{
<MudTd DataLabel="Telemetry" Style="text-align: center">
@if (context.SupportLoRaFeatures)
@if (context.HasLoRaTelemetry)
{
<MudTooltip Text="See device telemetries">
<MudIconButton id="@($"show-device-telemetry-{@context.DeviceID}")" Icon="@Icons.Filled.ShowChart" Color="Color.Default" OnClick="@(() => ShowDeviceTelemetry(context))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public async Task<PaginatedResult<DeviceListItem>> GetDevices(string searchText
StatusUpdatedTime = device.StatusUpdatedTime,
DeviceModelId = device.DeviceModelId,
SupportLoRaFeatures = device is LorawanDevice,
HasLoRaTelemetry = device is LorawanDevice && ((LorawanDevice) device).Telemetry.Any(),
Labels = device.Labels
.Union(device.DeviceModel.Labels)
.Select(x => new LabelDto
Expand Down
5 changes: 5 additions & 0 deletions src/AzureIoTHub.Portal.Shared/Models/v1.0/DeviceListItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public class DeviceListItem
/// </summary>
public bool SupportLoRaFeatures { get; set; }

/// <summary>
/// A value indicating whether the device has telemetry.
/// </summary>
public bool HasLoRaTelemetry { get; set; }

/// <summary>
/// The device last status updated time.
/// </summary>
Expand Down

0 comments on commit 74a84cb

Please sign in to comment.