Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NoHwID denies to connection table #78

Merged
merged 4 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions SS14.Admin/Pages/Connections/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<input type="checkbox" class="form-check-input" id="showIPChecks" name="showIPChecks" @(Model.ShowIPChecks ? "checked" : "") value="true">
<label class="form-check-label" for="showIPChecks">IP Checks</label>
</div>
<div class="form-check col">
<input type="checkbox" class="form-check-input" id="showNoHwId" name="showNoHwId" @(Model.ShowNoHwid ? "checked" : "") value="true">
<label class="form-check-label" for="showNoHwId">No HWID</label>
</div>
</div>
</form>

Expand Down
8 changes: 7 additions & 1 deletion SS14.Admin/Pages/Connections/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ConnectionsIndexModel : PageModel
public bool ShowPanic { get; set; }
public bool ShowBabyJail { get; set; }
public bool ShowIPChecks { get; set; }
public bool ShowNoHwid { get; set; }

public ConnectionsIndexModel(PostgresServerDbContext dbContext)
{
Expand All @@ -40,7 +41,8 @@ public async Task OnGetAsync(
bool showFull,
bool showPanic,
bool showBabyJail,
bool showIPChecks)
bool showIPChecks,
bool showNoHwid)
{

Pagination.Init(pageIndex, perPage, AllRouteData);
Expand All @@ -61,6 +63,7 @@ public async Task OnGetAsync(
showPanic = true;
showBabyJail = true;
showIPChecks = true;
showNoHwid = true;
}

CurrentFilter = search;
Expand All @@ -71,6 +74,7 @@ public async Task OnGetAsync(
ShowPanic = showPanic;
ShowBabyJail = showBabyJail;
ShowIPChecks = showIPChecks;
ShowNoHwid = showNoHwid;

AllRouteData.Add("search", CurrentFilter);
AllRouteData.Add("showAccepted", showAccepted.ToString());
Expand Down Expand Up @@ -98,6 +102,8 @@ public async Task OnGetAsync(
acceptableDenies.Add(ConnectionDenyReason.BabyJail);
if (showIPChecks)
acceptableDenies.Add(ConnectionDenyReason.IPChecks);
if (showNoHwid)
acceptableDenies.Add(ConnectionDenyReason.NoHwid);

logQuery = logQuery.Where(c => acceptableDenies.Contains(c.Denied));

Expand Down
Loading