|
1 | 1 | @using XtremeIdiots.Portal.Web.Extensions |
2 | 2 | @using XtremeIdiots.Portal.Web.ViewModels |
| 3 | +@using XtremeIdiots.Portal.Repository.Abstractions.Constants.V1 |
3 | 4 | @model ManageMapsViewModel |
4 | 5 |
|
5 | 6 | @{ |
|
78 | 79 | <partial name="PushMapToRemotePartial" |
79 | 80 | model="@(new PushMapToRemoteViewModel(Model.GameServer.GameServerId))"></partial> |
80 | 81 |
|
| 82 | + <div class="ibox"> |
| 83 | + <div class="ibox-title"> |
| 84 | + <h5>Map Rotations (@Model.RotationAssignments.Count)</h5> |
| 85 | + <div class="ibox-tools"> |
| 86 | + <a asp-controller="MapRotations" asp-action="Index" asp-route-gameType="@Model.GameServer.GameType" class="btn btn-outline-secondary btn-sm me-1"> |
| 87 | + <i class="fa-solid fa-fw fa-list"></i> All Rotations |
| 88 | + </a> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + |
| 92 | + <div class="ibox-content"> |
| 93 | + @if (Model.RotationAssignments.Count == 0) |
| 94 | + { |
| 95 | + <div class="text-center text-muted py-3"> |
| 96 | + <i class="fa-solid fa-rotate fa-2x mb-2 d-block"></i> |
| 97 | + <p>No map rotations assigned to this server.</p> |
| 98 | + <a asp-controller="MapRotations" asp-action="Index" asp-route-gameType="@Model.GameServer.GameType" class="btn btn-outline-primary btn-sm"> |
| 99 | + <i class="fa-solid fa-fw fa-plus"></i> Manage Rotations |
| 100 | + </a> |
| 101 | + </div> |
| 102 | + } |
| 103 | + else |
| 104 | + { |
| 105 | + <div class="table-responsive"> |
| 106 | + <table class="table table-striped table-hover mb-0"> |
| 107 | + <thead> |
| 108 | + <tr> |
| 109 | + <th>Rotation</th> |
| 110 | + <th style="width: 80px;">Mode</th> |
| 111 | + <th style="width: 90px;">Deploy</th> |
| 112 | + <th style="width: 90px;">Active</th> |
| 113 | + <th style="width: 80px;"></th> |
| 114 | + </tr> |
| 115 | + </thead> |
| 116 | + <tbody> |
| 117 | + @foreach (var assignment in Model.RotationAssignments) |
| 118 | + { |
| 119 | + Model.Rotations.TryGetValue(assignment.MapRotationId, out var rotation); |
| 120 | + <tr> |
| 121 | + <td> |
| 122 | + <a asp-controller="MapRotations" asp-action="Details" asp-route-id="@assignment.MapRotationId"> |
| 123 | + <strong>@(rotation?.Title ?? "Unknown")</strong> |
| 124 | + </a> |
| 125 | + <br /> |
| 126 | + <small class="text-muted"> |
| 127 | + <code>@assignment.ConfigVariableName</code> |
| 128 | + @if (rotation?.MapRotationMaps != null) |
| 129 | + { |
| 130 | + <span>· @rotation.MapRotationMaps.Count maps</span> |
| 131 | + } |
| 132 | + </small> |
| 133 | + </td> |
| 134 | + <td><span class="badge bg-info">@(rotation?.GameMode ?? "—")</span></td> |
| 135 | + <td> |
| 136 | + @switch (assignment.DeploymentState) |
| 137 | + { |
| 138 | + case DeploymentState.Pending: |
| 139 | + <span class="badge bg-warning text-dark">Pending</span> |
| 140 | + break; |
| 141 | + case DeploymentState.Syncing: |
| 142 | + <span class="badge bg-info">Syncing</span> |
| 143 | + break; |
| 144 | + case DeploymentState.Synced: |
| 145 | + <span class="badge bg-success">Synced</span> |
| 146 | + break; |
| 147 | + case DeploymentState.Failed: |
| 148 | + <span class="badge bg-danger">Failed</span> |
| 149 | + break; |
| 150 | + default: |
| 151 | + <span class="badge bg-secondary">@assignment.DeploymentState</span> |
| 152 | + break; |
| 153 | + } |
| 154 | + </td> |
| 155 | + <td> |
| 156 | + @switch (assignment.ActivationState) |
| 157 | + { |
| 158 | + case ActivationState.Active: |
| 159 | + <span class="badge bg-success">Active</span> |
| 160 | + break; |
| 161 | + case ActivationState.Activating: |
| 162 | + <span class="badge bg-info">Activating</span> |
| 163 | + break; |
| 164 | + case ActivationState.Inactive: |
| 165 | + <span class="badge bg-secondary">Inactive</span> |
| 166 | + break; |
| 167 | + case ActivationState.Failed: |
| 168 | + <span class="badge bg-danger">Failed</span> |
| 169 | + break; |
| 170 | + default: |
| 171 | + <span class="badge bg-secondary">@assignment.ActivationState</span> |
| 172 | + break; |
| 173 | + } |
| 174 | + </td> |
| 175 | + <td> |
| 176 | + <a asp-controller="MapRotations" asp-action="AssignmentStatus" asp-route-id="@assignment.MapRotationServerAssignmentId" |
| 177 | + class="btn btn-outline-secondary btn-xs" title="View Status"> |
| 178 | + <i class="fa-solid fa-fw fa-eye"></i> |
| 179 | + </a> |
| 180 | + </td> |
| 181 | + </tr> |
| 182 | + } |
| 183 | + </tbody> |
| 184 | + </table> |
| 185 | + </div> |
| 186 | + } |
| 187 | + </div> |
| 188 | + </div> |
| 189 | + |
81 | 190 | </div> |
82 | 191 |
|
83 | 192 | <div class="col-sm-6"> |
|
0 commit comments