This commit is contained in:
Ccjcarkbla
2026-03-09 12:53:15 -04:00
parent 072b892fb7
commit dd287987e0
24 changed files with 550 additions and 97 deletions
+61 -21
View File
@@ -5,12 +5,28 @@
}
<h1>Admin Groups</h1>
<p>Manage group claim values that grant admin access.</p>
<p>
@if (Model.IsAdSource)
{
<text>Source: AD lookup + AuthorizationGroup records.</text>
}
else
{
<text>Source: MAX app database records.</text>
}
</p>
<form method="get" class="mb-4">
<div class="row g-2">
<div class="col-md-8">
<input asp-for="GroupSearch" class="form-control" placeholder="Search available groups by name" />
@if (Model.IsAdSource)
{
<input asp-for="GroupSearch" class="form-control" placeholder="Search AD lookup groups by name" />
}
else
{
<input asp-for="GroupSearch" class="form-control" placeholder="Search added groups (case-insensitive)" />
}
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-outline-primary">Search</button>
@@ -18,7 +34,7 @@
</div>
</form>
@if (Model.LookupResults.Count > 0)
@if (Model.IsAdSource && Model.LookupResults.Count > 0)
{
<div class="mb-4">
<h5>Lookup Results</h5>
@@ -63,29 +79,53 @@
<thead>
<tr>
<th>Group Claim Value</th>
<th>Role</th>
<th>Active</th>
@if (Model.IsAdSource)
{
<th>Role</th>
<th>Active</th>
}
<th></th>
</tr>
</thead>
<tbody>
@foreach (var g in Model.Groups)
@if (Model.IsAdSource)
{
<tr>
<td>@g.GroupClaimValue</td>
<td>@g.Role</td>
<td>@g.Active</td>
<td>
<form method="post" asp-page-handler="Toggle" style="display:inline">
<input type="hidden" name="id" value="@g.Id" />
<button type="submit" class="btn btn-sm btn-outline-secondary">Toggle</button>
</form>
<form method="post" asp-page-handler="Delete" style="display:inline">
<input type="hidden" name="id" value="@g.Id" />
<button type="submit" class="btn btn-sm btn-outline-danger">Remove</button>
</form>
</td>
</tr>
@foreach (var g in Model.AdGroups)
{
<tr>
<td>@g.GroupClaimValue</td>
<td>@g.Role</td>
<td>@g.Active</td>
<td>
<form method="post" asp-page-handler="Toggle" style="display:inline">
<input type="hidden" name="id" value="@g.Id" />
<input type="hidden" asp-for="GroupSearch" />
<button type="submit" class="btn btn-sm btn-outline-secondary">Toggle</button>
</form>
<form method="post" asp-page-handler="Delete" style="display:inline">
<input type="hidden" name="id" value="@g.Id" />
<input type="hidden" asp-for="GroupSearch" />
<button type="submit" class="btn btn-sm btn-outline-danger">Remove</button>
</form>
</td>
</tr>
}
}
else
{
@foreach (var g in Model.Groups)
{
<tr>
<td>@g.GroupClaimValue</td>
<td>
<form method="post" asp-page-handler="Delete" style="display:inline">
<input type="hidden" name="id" value="@g.Id" />
<input type="hidden" asp-for="GroupSearch" />
<button type="submit" class="btn btn-sm btn-outline-danger">Remove</button>
</form>
</td>
</tr>
}
}
</tbody>
</table>