Merge pull request #214 from Moonlight-Panel/FixSessionView
Fixed session view
This commit is contained in:
@@ -11,6 +11,8 @@ public class SessionClientService
|
|||||||
public readonly Guid Uuid = Guid.NewGuid();
|
public readonly Guid Uuid = Guid.NewGuid();
|
||||||
public readonly DateTime CreateTimestamp = DateTime.UtcNow;
|
public readonly DateTime CreateTimestamp = DateTime.UtcNow;
|
||||||
public User? User { get; private set; }
|
public User? User { get; private set; }
|
||||||
|
public string Ip { get; private set; } = "N/A";
|
||||||
|
public string Device { get; private set; } = "N/A";
|
||||||
|
|
||||||
public readonly IdentityService IdentityService;
|
public readonly IdentityService IdentityService;
|
||||||
public readonly AlertService AlertService;
|
public readonly AlertService AlertService;
|
||||||
@@ -39,6 +41,8 @@ public class SessionClientService
|
|||||||
public async Task Start()
|
public async Task Start()
|
||||||
{
|
{
|
||||||
User = await IdentityService.Get();
|
User = await IdentityService.Get();
|
||||||
|
Ip = IdentityService.GetIp();
|
||||||
|
Device = IdentityService.GetDevice();
|
||||||
|
|
||||||
if (User != null) // Track users last visit
|
if (User != null) // Track users last visit
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,13 +60,13 @@
|
|||||||
</Column>
|
</Column>
|
||||||
<Column TableItem="SessionClientService" Title="@(SmartTranslateService.Translate("IP"))" Field="@(x => x.Uuid)" Sortable="false" Filterable="false" Width="10%">
|
<Column TableItem="SessionClientService" Title="@(SmartTranslateService.Translate("IP"))" Field="@(x => x.Uuid)" Sortable="false" Filterable="false" Width="10%">
|
||||||
<Template>
|
<Template>
|
||||||
@(context.IdentityService.GetIp())
|
@(context.Ip)
|
||||||
</Template>
|
</Template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column TableItem="SessionClientService" Title="@(SmartTranslateService.Translate("URL"))" Field="@(x => x.NavigationManager.Uri)" Sortable="true" Filterable="true" Width="10%"/>
|
<Column TableItem="SessionClientService" Title="@(SmartTranslateService.Translate("URL"))" Field="@(x => x.NavigationManager.Uri)" Sortable="true" Filterable="true" Width="10%"/>
|
||||||
<Column TableItem="SessionClientService" Title="@(SmartTranslateService.Translate("Device"))" Field="@(x => x.Uuid)" Sortable="false" Filterable="false" Width="10%">
|
<Column TableItem="SessionClientService" Title="@(SmartTranslateService.Translate("Device"))" Field="@(x => x.Uuid)" Sortable="false" Filterable="false" Width="10%">
|
||||||
<Template>
|
<Template>
|
||||||
@(context.IdentityService.GetDevice())
|
@(context.Device)
|
||||||
</Template>
|
</Template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column TableItem="SessionClientService" Title="@(SmartTranslateService.Translate("Time"))" Field="@(x => x.CreateTimestamp)" Sortable="true" Filterable="true" Width="10%">
|
<Column TableItem="SessionClientService" Title="@(SmartTranslateService.Translate("Time"))" Field="@(x => x.CreateTimestamp)" Sortable="true" Filterable="true" Width="10%">
|
||||||
|
|||||||
Reference in New Issue
Block a user