Skip to content

Commit

Permalink
Add baby jail and IPIntel to connections table
Browse files Browse the repository at this point in the history
Better late than never
  • Loading branch information
PJB3005 committed Jan 19, 2025
1 parent c9c88ac commit 35422b8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
10 changes: 9 additions & 1 deletion SS14.Admin/Pages/Connections/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@
</div>
<div class="form-check col">
<input type="checkbox" class="form-check-input" id="showPanic" name="showPanic" @(Model.ShowPanic ? "checked" : "") value="true">
<label class="form-check-label" for="showPanic">Server Panic</label>
<label class="form-check-label" for="showPanic">Panic Bunker</label>
</div>
<div class="form-check col">
<input type="checkbox" class="form-check-input" id="showBabyJail" name="showBabyJail" @(Model.ShowBabyJail ? "checked" : "") value="true">
<label class="form-check-label" for="showBabyJail">Baby Jail</label>
</div>
<div class="form-check col">
<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>
</form>
Expand Down
14 changes: 13 additions & 1 deletion SS14.Admin/Pages/Connections/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class ConnectionsIndexModel : PageModel
public bool ShowWhitelist { get; set; }
public bool ShowFull { get; set; }
public bool ShowPanic { get; set; }
public bool ShowBabyJail { get; set; }
public bool ShowIPChecks { get; set; }

public ConnectionsIndexModel(PostgresServerDbContext dbContext)
{
Expand All @@ -36,7 +38,9 @@ public async Task OnGetAsync(
bool showBanned,
bool showWhitelist,
bool showFull,
bool showPanic)
bool showPanic,
bool showBabyJail,
bool showIPChecks)
{

Pagination.Init(pageIndex, perPage, AllRouteData);
Expand All @@ -55,6 +59,8 @@ public async Task OnGetAsync(
showWhitelist = true;
showFull = true;
showPanic = true;
showBabyJail = true;
showIPChecks = true;
}

CurrentFilter = search;
Expand All @@ -63,6 +69,8 @@ public async Task OnGetAsync(
ShowWhitelist = showWhitelist;
ShowFull = showFull;
ShowPanic = showPanic;
ShowBabyJail = showBabyJail;
ShowIPChecks = showIPChecks;

AllRouteData.Add("search", CurrentFilter);
AllRouteData.Add("showAccepted", showAccepted.ToString());
Expand All @@ -86,6 +94,10 @@ public async Task OnGetAsync(
acceptableDenies.Add(ConnectionDenyReason.Full);
if (showPanic)
acceptableDenies.Add(ConnectionDenyReason.Panic);
if (showBabyJail)
acceptableDenies.Add(ConnectionDenyReason.BabyJail);
if (showIPChecks)
acceptableDenies.Add(ConnectionDenyReason.IPChecks);

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

Expand Down
6 changes: 6 additions & 0 deletions SS14.Admin/Pages/Tables/ConnectionsTable.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
case ConnectionDenyReason.Panic:
<strong>Denied: Panic Bunker</strong>
break;
case ConnectionDenyReason.BabyJail:
<strong>Denied: Baby Jail</strong>
break;
case ConnectionDenyReason.IPChecks:
<strong>Denied: IP Checks</strong>
break;
case null:
<span>Accepted</span>
break;
Expand Down

0 comments on commit 35422b8

Please sign in to comment.