Changed the stats that are sent back to stat server from installed server.
This commit is contained in:
parent
4921b9d26b
commit
644cb6d1f6
7 changed files with 46 additions and 208 deletions
15
API/DTOs/Stats/InstallationStatsDto.cs
Normal file
15
API/DTOs/Stats/InstallationStatsDto.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace API.DTOs.Stats
|
||||
{
|
||||
public class InstallationStatsDto
|
||||
{
|
||||
public string InstallId { get; set; }
|
||||
public string Os { get; set; }
|
||||
public bool IsDocker { get; set; }
|
||||
public string DotnetVersion { get; set; }
|
||||
public string KavitaVersion { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,14 +1,11 @@
|
|||
namespace API.DTOs.Stats
|
||||
namespace API.DTOs.Stats
|
||||
{
|
||||
public class ServerInfoDto
|
||||
{
|
||||
public string InstallId { get; set; }
|
||||
public string Os { get; set; }
|
||||
public string DotNetVersion { get; set; }
|
||||
public string RunTimeVersion { get; set; }
|
||||
public string KavitaVersion { get; set; }
|
||||
public string BuildBranch { get; set; }
|
||||
public string Culture { get; set; }
|
||||
public bool IsDocker { get; set; }
|
||||
public int NumOfCores { get; set; }
|
||||
public string DotnetVersion { get; set; }
|
||||
public string KavitaVersion { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace API.DTOs.Stats
|
||||
{
|
||||
public class UsageStatisticsDto
|
||||
{
|
||||
public UsageStatisticsDto()
|
||||
{
|
||||
MarkAsUpdatedNow();
|
||||
ClientsInfo = new List<ClientInfoDto>();
|
||||
}
|
||||
|
||||
public string InstallId { get; set; }
|
||||
public DateTime LastUpdate { get; set; }
|
||||
public UsageInfoDto UsageInfo { get; set; }
|
||||
public ServerInfoDto ServerInfo { get; set; }
|
||||
public List<ClientInfoDto> ClientsInfo { get; set; }
|
||||
|
||||
public void MarkAsUpdatedNow()
|
||||
{
|
||||
LastUpdate = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public void AddClientInfo(ClientInfoDto clientInfoDto)
|
||||
{
|
||||
if (ClientsInfo.Any(x => x.IsTheSameDevice(clientInfoDto))) return;
|
||||
|
||||
ClientsInfo.Add(clientInfoDto);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue