Skip to content

Commit

Permalink
LastActivityTime changed to StatusUpdatedTime (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
audserraCGI authored Jan 25, 2022
1 parent 719db65 commit ad54754
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@
</MudItem>
<MudItem xs="12" Class="custom-form">
<MudItem md="3" sm="12">
<MudText>Last activity time : </MudText>
<MudText>Last status update : </MudText>
</MudItem>
<MudItem md="9" sm="12">
<MudTextField @bind-Value="@LastActivityDateString" Margin="Margin.Dense" Class="custom-disabled" ReadOnly="true" Variant="Variant.Outlined"></MudTextField>
<MudTextField @bind-Value="@StatusUpdatedTimeString" Margin="Margin.Dense" Class="custom-disabled" ReadOnly="true" Variant="Variant.Outlined"></MudTextField>
</MudItem>
</MudItem>
</MudItem>
Expand Down Expand Up @@ -174,7 +174,7 @@
private DeviceDetails Device { get; set; } = new DeviceDetails();

private bool success = true;
private string LastActivityDateString { get; set; }
private string StatusUpdatedTimeString { get; set; }

protected override async Task OnInitializedAsync()
{
Expand All @@ -187,8 +187,8 @@
DeviceModel model = await Http.GetFromJsonAsync<DeviceModel>($"api/DeviceModels/{Device.ModelId}");
Device.ModelName = model.Name;

// LastActivityDate set to string to have a more human-readable format
LastActivityDateString = Device.LastActivityDate.ToString();
// StatusUpdatedTime set to string to have a more human-readable format
StatusUpdatedTimeString = Device.StatusUpdatedTime.ToString();
}
catch (AccessTokenNotAvailableException exception)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<MudTh>Device</MudTh>
<MudTh Style="text-align: center">Status</MudTh>
<MudTh Style="text-align: center">Connection state</MudTh>
<MudTh Style="text-align: center">Last activity time</MudTh>
<MudTh Style="text-align: center">Last status update</MudTh>
<MudTh Style="text-align: center">See details</MudTh>
<MudTh Style="text-align: center">Delete</MudTh>
</HeaderContent>
Expand Down Expand Up @@ -136,7 +136,7 @@
<MudIcon Icon="@Icons.Filled.WifiOff" Color="Color.Error" />
}
</MudTd>
<MudTd DataLabel="LAT" Style="text-align: center">@context.LastActivityDate</MudTd>
<MudTd DataLabel="LSU" Style="text-align: center">@context.StatusUpdatedTime</MudTd>
<MudTd DataLabel="Details" Style="text-align: center">
<a href="devices/@context.DeviceID"><MudIconButton Icon="@Icons.Filled.Visibility" Color="Color.Default" /></a>
</MudTd>
Expand Down
4 changes: 2 additions & 2 deletions src/AzureIoTHub.Portal/Server/Mappers/DeviceTwinMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public DeviceDetails CreateDeviceDetails(Twin twin)
ImageUrl = this.deviceModelImageManager.ComputeImageUri(modelId),
IsConnected = twin.ConnectionState == DeviceConnectionState.Connected,
IsEnabled = twin.Status == DeviceStatus.Enabled,
LastActivityDate = twin.LastActivityTime.GetValueOrDefault(DateTime.MinValue),
StatusUpdatedTime = twin.StatusUpdatedTime.GetValueOrDefault(DateTime.MinValue),
AppEUI = Helpers.DeviceHelper.RetrievePropertyValue(twin, nameof(DeviceDetails.AppEUI)),
AppKey = Helpers.DeviceHelper.RetrievePropertyValue(twin, nameof(DeviceDetails.AppKey)),
LocationCode = Helpers.DeviceHelper.RetrieveTagValue(twin, nameof(DeviceDetails.LocationCode)),
Expand All @@ -57,7 +57,7 @@ public DeviceListItem CreateDeviceListItem(Twin twin)
IsConnected = twin.ConnectionState == DeviceConnectionState.Connected,
IsEnabled = twin.Status == DeviceStatus.Enabled,
LocationCode = Helpers.DeviceHelper.RetrieveTagValue(twin, nameof(DeviceDetails.LocationCode)),
LastActivityDate = twin.LastActivityTime.GetValueOrDefault(DateTime.MinValue)
StatusUpdatedTime = twin.StatusUpdatedTime.GetValueOrDefault(DateTime.MinValue)
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class DeviceDetails

public bool IsEnabled { get; set; }

public DateTime LastActivityDate { get; set; }
public DateTime StatusUpdatedTime { get; set; }

public string AppEUI { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class DeviceListItem

public bool IsEnabled { get; set; }

public DateTime LastActivityDate { get; set; }
public DateTime StatusUpdatedTime { get; set; }

public string AppEUI { get; set; }

Expand Down

0 comments on commit ad54754

Please sign in to comment.