|
34 | 34 | </div> |
35 | 35 | <div class="filter-group"> |
36 | 36 | <label class="form-label" for="resetFilters">Reset</label> |
37 | | - <button type="button" id="resetFilters" class="btn btn-outline-secondary btn-sm">Reset Filters</button> |
| 37 | + <button type="button" id="resetFilters" class="btn btn-outline-secondary btn-sm">Reset |
| 38 | + Filters</button> |
| 39 | + </div> |
38 | 40 | </div> |
39 | | - </div> |
40 | 41 |
|
41 | | - <div class="table-responsive"> |
42 | | - <table id="dataTable" class="table table-striped table-hover w-100"> |
43 | | - <thead> |
44 | | - <tr> |
45 | | - <th scope="col">Game</th> |
46 | | - <th scope="col">Username</th> |
47 | | - <th scope="col">Player Id</th> |
48 | | - <th scope="col">Profile Id</th> |
49 | | - <th scope="col">Method</th> |
50 | | - <th scope="col">Status</th> |
51 | | - <th scope="col" class="table-date-col">Linked At</th> |
52 | | - <th scope="col" class="table-date-col">Unlinked At</th> |
53 | | - <th scope="col" class="table-action-col">Actions</th> |
54 | | - </tr> |
55 | | - </thead> |
56 | | - <tbody> |
57 | | - @foreach (var item in Model.ConnectedPlayers) |
58 | | - { |
| 42 | + <div class="table-responsive"> |
| 43 | + <table id="dataTable" class="table table-striped table-hover w-100"> |
| 44 | + <thead> |
59 | 45 | <tr> |
60 | | - <td>@item.GameType</td> |
61 | | - <td>@item.Username</td> |
62 | | - <td><code>@item.PlayerId</code></td> |
63 | | - <td> |
64 | | - <a asp-controller="User" asp-action="ManageProfile" asp-route-id="@item.UserProfileId">@item.UserProfileId</a> |
65 | | - </td> |
66 | | - <td>@item.LinkMethod</td> |
67 | | - <td> |
68 | | - @if (item.IsActive) |
69 | | - { |
70 | | - <span class="badge bg-success">Active</span> |
71 | | - } |
72 | | - else |
73 | | - { |
74 | | - <span class="badge bg-secondary">Inactive</span> |
75 | | - } |
76 | | - </td> |
77 | | - <td><time user-time utc="@item.LinkedAtUtc"></time></td> |
78 | | - <td> |
79 | | - @if (item.UnlinkedAtUtc.HasValue) |
80 | | - { |
81 | | - <time user-time utc="@item.UnlinkedAtUtc.Value"></time> |
82 | | - } |
83 | | - </td> |
84 | | - <td> |
85 | | - @if (Model.IsSeniorAdmin && item.IsActive) |
86 | | - { |
87 | | - <form asp-action="ForceUnlink" method="post" class="d-inline"> |
88 | | - @Html.AntiForgeryToken() |
89 | | - <input type="hidden" name="connectedPlayerProfileId" value="@item.ConnectedPlayerProfileId" /> |
90 | | - <button type="submit" class="btn btn-outline-danger btn-sm" data-confirm="Are you sure you want to unlink this connected player?"> |
91 | | - <i class="fa-solid fa-fw fa-link-slash" aria-hidden="true"></i> |
92 | | - Unlink |
93 | | - </button> |
94 | | - </form> |
95 | | - } |
96 | | - </td> |
| 46 | + <th scope="col">Game</th> |
| 47 | + <th scope="col">Username</th> |
| 48 | + <th scope="col">Player Id</th> |
| 49 | + <th scope="col">Profile Id</th> |
| 50 | + <th scope="col">Method</th> |
| 51 | + <th scope="col">Status</th> |
| 52 | + <th scope="col" class="table-date-col">Linked At</th> |
| 53 | + <th scope="col" class="table-date-col">Unlinked At</th> |
| 54 | + <th scope="col" class="table-action-col">Actions</th> |
97 | 55 | </tr> |
98 | | - } |
99 | | - </tbody> |
100 | | - </table> |
| 56 | + </thead> |
| 57 | + <tbody> |
| 58 | + @foreach (var item in Model.ConnectedPlayers) |
| 59 | + { |
| 60 | + <tr> |
| 61 | + <td>@item.GameType</td> |
| 62 | + <td>@item.Username</td> |
| 63 | + <td><code>@item.PlayerId</code></td> |
| 64 | + <td> |
| 65 | + <a asp-controller="User" asp-action="ManageProfile" |
| 66 | + asp-route-id="@item.UserProfileId">@item.UserProfileId</a> |
| 67 | + </td> |
| 68 | + <td>@item.LinkMethod</td> |
| 69 | + <td> |
| 70 | + @if (item.IsActive) |
| 71 | + { |
| 72 | + <span class="badge bg-success">Active</span> |
| 73 | + } |
| 74 | + else |
| 75 | + { |
| 76 | + <span class="badge bg-secondary">Inactive</span> |
| 77 | + } |
| 78 | + </td> |
| 79 | + <td><time user-time utc="@item.LinkedAtUtc"></time></td> |
| 80 | + <td> |
| 81 | + @if (item.UnlinkedAtUtc.HasValue) |
| 82 | + { |
| 83 | + <time user-time utc="@item.UnlinkedAtUtc.Value"></time> |
| 84 | + } |
| 85 | + </td> |
| 86 | + <td> |
| 87 | + @if (Model.IsSeniorAdmin && item.IsActive) |
| 88 | + { |
| 89 | + <form asp-action="ForceUnlink" method="post" class="d-inline"> |
| 90 | + @Html.AntiForgeryToken() |
| 91 | + <input type="hidden" name="connectedPlayerProfileId" |
| 92 | + value="@item.ConnectedPlayerProfileId" /> |
| 93 | + <button type="submit" class="btn btn-outline-danger btn-sm" |
| 94 | + data-confirm="Are you sure you want to unlink this connected player?"> |
| 95 | + <i class="fa-solid fa-fw fa-link-slash" aria-hidden="true"></i> |
| 96 | + Unlink |
| 97 | + </button> |
| 98 | + </form> |
| 99 | + } |
| 100 | + </td> |
| 101 | + </tr> |
| 102 | + } |
| 103 | + </tbody> |
| 104 | + </table> |
| 105 | + </div> |
101 | 106 | </div> |
102 | 107 | </div> |
103 | 108 | </div> |
104 | 109 | </div> |
105 | | - </div> |
106 | 110 |
|
107 | | - @if (Model.IsSeniorAdmin) |
108 | | - { |
109 | | - <div class="row"> |
110 | | - <div class="col-lg-12"> |
111 | | - <div class="ibox"> |
112 | | - <div class="ibox-title"> |
113 | | - <h5>Manual Link (Senior Admin)</h5> |
114 | | - </div> |
115 | | - <div class="ibox-content"> |
116 | | - <form asp-action="CreateManualLink" method="post"> |
117 | | - @Html.AntiForgeryToken() |
118 | | - <div class="mb-3"> |
119 | | - <label class="form-label" for="PlayerId">Player Id</label> |
120 | | - <input class="form-control" id="PlayerId" name="PlayerId" placeholder="00000000-0000-0000-0000-000000000000" /> |
121 | | - </div> |
122 | | - <div class="mb-3"> |
123 | | - <label class="form-label" for="UserProfileId">User Profile Id</label> |
124 | | - <input class="form-control" id="UserProfileId" name="UserProfileId" placeholder="00000000-0000-0000-0000-000000000000" /> |
125 | | - </div> |
126 | | - <button type="submit" class="btn btn-primary"> |
127 | | - <i class="fa-solid fa-fw fa-link" aria-hidden="true"></i> |
128 | | - Create Manual Link |
129 | | - </button> |
130 | | - </form> |
| 111 | + @if (Model.IsSeniorAdmin) |
| 112 | + { |
| 113 | + <div class="row"> |
| 114 | + <div class="col-lg-12"> |
| 115 | + <div class="ibox"> |
| 116 | + <div class="ibox-title"> |
| 117 | + <h5>Manual Link (Senior Admin)</h5> |
| 118 | + </div> |
| 119 | + <div class="ibox-content"> |
| 120 | + <form asp-action="CreateManualLink" method="post"> |
| 121 | + @Html.AntiForgeryToken() |
| 122 | + <div class="mb-3"> |
| 123 | + <label class="form-label" for="PlayerId">Player Id</label> |
| 124 | + <input class="form-control" id="PlayerId" name="PlayerId" |
| 125 | + placeholder="00000000-0000-0000-0000-000000000000" /> |
| 126 | + </div> |
| 127 | + <div class="mb-3"> |
| 128 | + <label class="form-label" for="UserProfileId">User Profile Id</label> |
| 129 | + <input class="form-control" id="UserProfileId" name="UserProfileId" |
| 130 | + placeholder="00000000-0000-0000-0000-000000000000" /> |
| 131 | + </div> |
| 132 | + <button type="submit" class="btn btn-primary"> |
| 133 | + <i class="fa-solid fa-fw fa-link" aria-hidden="true"></i> |
| 134 | + Create Manual Link |
| 135 | + </button> |
| 136 | + </form> |
| 137 | + </div> |
131 | 138 | </div> |
132 | 139 | </div> |
133 | 140 | </div> |
134 | | - </div> |
135 | | - } |
136 | | -</div> |
| 141 | + } |
| 142 | + </div> |
137 | 143 |
|
138 | | -@section Scripts { |
139 | | - <script src="~/js/connected-players-index.js" asp-append-version="true"></script> |
140 | | -} |
| 144 | + @section Scripts { |
| 145 | + <script src="~/js/connected-players-index.js" asp-append-version="true"></script> |
| 146 | + } |
0 commit comments