mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
fix issue with duplicate js function names for loader
hide flagged status of users on webfront unless logged in (will still show the level if they report someone because cba to update the view component w/out auth status) add terminal to the radar maps
This commit is contained in:
14
SharedLibraryCore/Dtos/IW4MAdminInfo.cs
Normal file
14
SharedLibraryCore/Dtos/IW4MAdminInfo.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SharedLibraryCore.Dtos
|
||||
{
|
||||
public class IW4MAdminInfo
|
||||
{
|
||||
public int TotalClientCount { get; set; }
|
||||
public int RecentClientCount { get; set; }
|
||||
public int TotalOccupiedClientSlots { get; set; }
|
||||
public int TotalAvailableClientSlots { get; set; }
|
||||
}
|
||||
}
|
@ -532,6 +532,23 @@ namespace SharedLibraryCore.Services
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of clients seen today
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<int> GetRecentClientCount()
|
||||
{
|
||||
using (var context = new DatabaseContext(true))
|
||||
{
|
||||
var startOfPeriod = DateTime.UtcNow.AddHours(-24);
|
||||
var iqQuery = context.Clients.Where(_client => _client.LastConnection >= startOfPeriod);
|
||||
#if DEBUG
|
||||
string sql = iqQuery.ToSql();
|
||||
#endif
|
||||
return await iqQuery.CountAsync();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// gets the 10 most recently added clients to IW4MAdmin
|
||||
/// </summary>
|
||||
|
@ -16,6 +16,7 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using static SharedLibraryCore.Database.Models.EFClient;
|
||||
using static SharedLibraryCore.Database.Models.EFPenalty;
|
||||
using static SharedLibraryCore.Server;
|
||||
|
||||
@ -834,6 +835,8 @@ namespace SharedLibraryCore
|
||||
return new[] { deltaX, deltaY };
|
||||
}
|
||||
|
||||
public static bool ShouldHideLevel(this Permission perm) => perm == Permission.Flagged;
|
||||
|
||||
#if DEBUG == true
|
||||
|
||||
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo();
|
||||
|
Reference in New Issue
Block a user