migrated to ASP.Net Core
This commit is contained in:
21
WebfrontCore/Views/Client/Find/Index.cshtml
Normal file
21
WebfrontCore/Views/Client/Find/Index.cshtml
Normal file
@ -0,0 +1,21 @@
|
||||
@model List<SharedLibrary.Dtos.PlayerInfo>
|
||||
|
||||
<div class="mr-auto ml-auto col-12 col-lg-7 border-bottom">
|
||||
<h3 class="pb-2 text-center ">@ViewBag.Title</h3>
|
||||
<div class="row pt-2 pb-2 bg-primary">
|
||||
<div class="col-5 ">Name </div>
|
||||
<div class="col-4">Level</div>
|
||||
<div class="col-3 text-right">Last Seen</div>
|
||||
</div>
|
||||
|
||||
@{
|
||||
foreach (var client in Model)
|
||||
{
|
||||
<div class="row pt-2 pb-2 bg-dark">
|
||||
<div class="col-5">@Html.ActionLink(client.Name, "ProfileAsync", "Client", new { id = client.ClientId })</div>
|
||||
<div class="col-4 level-color-@client.Level.ToLower()">@client.Level</div>
|
||||
<div class="col-3 text-right">@client.LastSeen ago</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
20
WebfrontCore/Views/Client/Privileged/Index.cshtml
Normal file
20
WebfrontCore/Views/Client/Privileged/Index.cshtml
Normal file
@ -0,0 +1,20 @@
|
||||
@model Dictionary<SharedLibrary.Objects.Player.Permission, IList<SharedLibrary.Dtos.ClientInfo>>
|
||||
<h3 class="pb-2 text-center ">@ViewBag.Title</h3>
|
||||
|
||||
<div class="row border-bottom">
|
||||
@{
|
||||
foreach (var key in Model.Keys)
|
||||
{
|
||||
<div class="col-12 bg-primary pt-2 pb-2">
|
||||
@key.ToString()
|
||||
</div>
|
||||
|
||||
<div class="col-12 bg-dark pt-2 pb-2">
|
||||
@foreach (var client in Model[key])
|
||||
{
|
||||
<span>@Html.ActionLink(client.Name, "profileasync", "client", new { id = client.ClientId }, new { @class = "text-light" })</span><br />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
56
WebfrontCore/Views/Client/Profile/Index.cshtml
Normal file
56
WebfrontCore/Views/Client/Profile/Index.cshtml
Normal file
@ -0,0 +1,56 @@
|
||||
@model SharedLibrary.Dtos.PlayerInfo
|
||||
|
||||
<div id="profile_wrapper" class="row d-flex d-sm-inline-flex justify-content-center justify-content-left pb-4">
|
||||
<div class="mr-auto ml-auto ml-sm-0 mr-sm-0">
|
||||
<div id="profile_avatar" class="mb-4 mb-md-0 text-center level-bgcolor-@Model.Level.ToLower()">
|
||||
<span class="profile-shortcode">@Model.Name[0].ToString().ToUpper()</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="profile_info" class="text-center text-sm-left pr-4 pl-4">
|
||||
<div id="profile_name">
|
||||
<span class="client-name">@Model.Name<span id="profile_aliases_btn" class="oi oi-caret-bottom pl-2"></span></span>
|
||||
<div id="profile_aliases" class="pr-0 pr-sm-4 pb-2 mb-2 text-muted">
|
||||
@{
|
||||
foreach (string alias in Model.Aliases)
|
||||
{
|
||||
@alias <br />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div id="profile_level" class="text-muted">
|
||||
<span class="level-color-@Model.Level.ToLower()">@Model.Level</span>
|
||||
</div>
|
||||
<div id="profile_time_played" class="text-muted">
|
||||
Played <span class="text-primary">@Model.TimePlayed</span> hours
|
||||
</div>
|
||||
<div id="profile_first_seen" class="text-muted">
|
||||
First seen <span class="text-primary">@Model.FirstSeen</span> ago
|
||||
</div>
|
||||
<div id="profile_last_seen" class="text-muted">
|
||||
Last seen <span class="text-primary">@Model.LastSeen</span> ago
|
||||
</div>
|
||||
</div>
|
||||
<div id="profile_meta" class="text-center text-sm-right pt-2">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-md-flex pt-4">
|
||||
<div id="profile_events" class="text-muted text-left ml-sm-0">
|
||||
@{
|
||||
if (Model.Meta.Count == 0)
|
||||
{
|
||||
<span> No recent events</span>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section scripts {
|
||||
<script>
|
||||
const clientInfo = {};
|
||||
clientInfo.clientId = @Model.ClientId;
|
||||
clientInfo.Meta =@Html.Raw(Json.Serialize(@Model.Meta));
|
||||
</script>
|
||||
<script type="text/javascript" src="~/js/profile.js"></script>
|
||||
}
|
6
WebfrontCore/Views/Home/Index.cshtml
Normal file
6
WebfrontCore/Views/Home/Index.cshtml
Normal file
@ -0,0 +1,6 @@
|
||||
@await Component.InvokeAsync("ServerList")
|
||||
|
||||
@section scripts {
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/canvasjs.min.js"></script>
|
||||
<script type="text/javascript" src="~/js/server.js" defer="defer"></script>
|
||||
}
|
24
WebfrontCore/Views/Penalty/List.cshtml
Normal file
24
WebfrontCore/Views/Penalty/List.cshtml
Normal file
@ -0,0 +1,24 @@
|
||||
<h3 class="pb-2 text-center ">@ViewBag.Title</h3>
|
||||
<div class="row">
|
||||
<table class="table table-striped">
|
||||
<thead class="d-none d-md-table-header-group">
|
||||
<tr class="bg-primary pt-2 pb-2">
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Type</th>
|
||||
<th scope="col">Offense</th>
|
||||
<th scope="col">Admin</th>
|
||||
<th scope="col" class="text-right">Time/Left</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="penalty_table" class="border-bottom bg-dark">
|
||||
@await Component.InvokeAsync("PenaltyList", new { offset = 0 })
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table d-table d-md-none">
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@section scripts {
|
||||
<script type="text/javascript" src="~/js/penalty.js"></script>
|
||||
}
|
7
WebfrontCore/Views/Penalty/_List.cshtml
Normal file
7
WebfrontCore/Views/Penalty/_List.cshtml
Normal file
@ -0,0 +1,7 @@
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
@model int
|
||||
|
||||
@await Component.InvokeAsync("PenaltyList", new { offset = Model })
|
77
WebfrontCore/Views/Penalty/_Penalty.cshtml
Normal file
77
WebfrontCore/Views/Penalty/_Penalty.cshtml
Normal file
@ -0,0 +1,77 @@
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
@model SharedLibrary.Dtos.PenaltyInfo
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<th scope="row" class="bg-primary">Name</th>
|
||||
<td>
|
||||
@Html.ActionLink(Model.OffenderName, "ProfileAsync", "Client", new { id = Model.OffenderId }, new { @class = "link-inverse" })
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<th scope="row" class="bg-primary">Type</th>
|
||||
<td class="penalties-color-@Model.Type.ToLower()">
|
||||
@Model.Type
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<th scope="row" class="bg-primary">Offense</th>
|
||||
<td class="text-light">
|
||||
@Model.Offense
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<th scope="row" class="bg-primary">Admin</th>
|
||||
<td>
|
||||
@Html.ActionLink(Model.PunisherName, "ProfileAsync", "Client", new { id = Model.PunisherId }, new { @class = "link-inverse" })
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<th scope="row" class="w-25 bg-primary" style="border-bottom: 1px solid #222">Time/Left</th>
|
||||
<td class="text-light mb-2 border-bottom">
|
||||
@{
|
||||
if (Model.TimeRemaining == string.Empty)
|
||||
{
|
||||
<span>@Model.TimePunished ago</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span> @Model.TimeRemaining left</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr class="d-none d-md-table-row">
|
||||
<td>
|
||||
@Html.ActionLink(Model.OffenderName, "ProfileAsync", "Client", new { id = Model.OffenderId }, new { @class = "link-inverse" })
|
||||
</td>
|
||||
<td class="penalties-color-@Model.Type.ToLower()">
|
||||
@Model.Type
|
||||
</td>
|
||||
<td class="text-light">
|
||||
@Model.Offense
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink(Model.PunisherName, "ProfileAsync", "Client", new { id = Model.PunisherId }, new { @class = "link-inverse" })
|
||||
</td>
|
||||
<td class="text-right text-light">
|
||||
@{
|
||||
if (Model.TimeRemaining == string.Empty)
|
||||
{
|
||||
<span>@Model.TimePunished ago</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span> @Model.TimeRemaining left</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
39
WebfrontCore/Views/Server/_ClientActivity.cshtml
Normal file
39
WebfrontCore/Views/Server/_ClientActivity.cshtml
Normal file
@ -0,0 +1,39 @@
|
||||
@model SharedLibrary.Dtos.ServerInfo
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
int half = (int)Math.Ceiling(Model.ClientCount / 2.0);
|
||||
}
|
||||
<div class="col-12 col-md-8 d-none d-md-block">
|
||||
@{
|
||||
for (int i = 0; i < half && i < Model.ChatHistory.Count; i++)
|
||||
{
|
||||
string message = "– " + @Model.ChatHistory[i].Message;
|
||||
if (Model.ChatHistory[i].Message == "CONNECTED")
|
||||
message = "<span class='oi oi-account-login text-success'></span>";
|
||||
else if (Model.ChatHistory[i].Message == "DISCONNECTED")
|
||||
message = "<span class='oi oi-account-logout text-danger'></span>";
|
||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = "text-muted" }) @Html.Raw(@message)</span><br/>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row">
|
||||
<div class="col-6 text-left text-md-right">
|
||||
@{
|
||||
for (int i = 0; i < half; i++)
|
||||
{
|
||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId })</span><br />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
@{
|
||||
for (int i = half; i < Model.ClientCount; i++)
|
||||
{
|
||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId })</span><br />
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
20
WebfrontCore/Views/Server/_Server.cshtml
Normal file
20
WebfrontCore/Views/Server/_Server.cshtml
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
@model SharedLibrary.Dtos.ServerInfo
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<div class="row server-header">
|
||||
<div class="col-md-4 bg-primary text-center text-md-left">@Model.Name</div>
|
||||
<div class="text-center col-md-4 bg-primary">@Model.Map</div>
|
||||
<div class="text-center text-md-right col-md-4 bg-primary">@Model.ClientCount/@Model.MaxClients</div>
|
||||
</div>
|
||||
|
||||
<div id="server_clientactivity_@Model.ID" class="bg-dark row server-activity pt-2 pb-2">
|
||||
@Html.Partial("../Server/_ClientActivity", Model)
|
||||
</div>
|
||||
|
||||
<div class="row server-history mb-4">
|
||||
<div class="server-history-row col-md-12" id="server_history_@Model.ID" data-serverid="@Model.ID" data-clienthistory='@Html.Raw(Json.Serialize(Model.PlayerHistory))'></div>
|
||||
</div>
|
@ -0,0 +1,11 @@
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@model List<SharedLibrary.Dtos.PenaltyInfo>
|
||||
|
||||
@{
|
||||
foreach (var penalty in Model)
|
||||
{
|
||||
Html.RenderPartial("_Penalty", penalty);
|
||||
}
|
||||
}
|
11
WebfrontCore/Views/Shared/Components/ServerList/_List.cshtml
Normal file
11
WebfrontCore/Views/Shared/Components/ServerList/_List.cshtml
Normal file
@ -0,0 +1,11 @@
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@model IEnumerable<SharedLibrary.Dtos.ServerInfo>
|
||||
|
||||
@{
|
||||
foreach (var s in Model)
|
||||
{
|
||||
Html.RenderPartial("../Server/_Server", s);
|
||||
}
|
||||
}
|
22
WebfrontCore/Views/Shared/Error.cshtml
Normal file
22
WebfrontCore/Views/Shared/Error.cshtml
Normal file
@ -0,0 +1,22 @@
|
||||
@model ErrorViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application.
|
||||
</p>
|
44
WebfrontCore/Views/Shared/_Layout.cshtml
Normal file
44
WebfrontCore/Views/Shared/_Layout.cshtml
Normal file
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>IW4MAdmin::@ViewBag.Title</title>
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
|
||||
<environment names="Development">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
<link rel="stylesheet" href="~/lib/open-iconic/font/css/open-iconic-bootstrap.css" />
|
||||
</environment>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
||||
@Html.ActionLink("IW4MAdmin", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item text-center text-md-left">@Html.ActionLink("Home", "Index", "Home", new { area = "" }, new { @class = "nav-link" })</li>
|
||||
<li class="nav-item text-center text-md-left">@Html.ActionLink("Penalties", "List", "Penalty", new { area = "" }, new { @class = "nav-link" })</li>
|
||||
<li class="nav-item text-center text-md-left">@Html.ActionLink("Admins", "PrivilegedAsync", "Client", new { area = "" }, new { @class = "nav-link" })</li>
|
||||
</ul>
|
||||
<form class="form-inline text-primary pt-3 pb-3" method="get" action="/Client/FindAsync">
|
||||
<input id="client_search" name="clientName" class="form-control mr-auto ml-auto mr-md-2" type="text" placeholder="Find Player" />
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="container pt-0 pb-4 pl-4 pr-4">
|
||||
@RenderBody()
|
||||
<footer></footer>
|
||||
</div>
|
||||
<environment names="Development">
|
||||
<script type="text/javascript" src="~/lib/jQuery/dist/jquery.js"></script>
|
||||
<script type="text/javascript" src="~/lib/popper.js/dist/popper.js"></script>
|
||||
<script type="text/javascript" src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
|
||||
</environment>
|
||||
@RenderSection("scripts", required: false)
|
||||
</body>
|
||||
</html>
|
18
WebfrontCore/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
18
WebfrontCore/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
@ -0,0 +1,18 @@
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-Fnqn3nxp3506LP/7Y3j/25BlWeA3PXTyT1l78LjECcPaKCV12TsZP7yyMxOe/G/k">
|
||||
</script>
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-JrXK+k53HACyavUKOsL+NkmSesD2P+73eDMrbTtTk0h4RmOF8hF8apPlkp26JlyH">
|
||||
</script>
|
||||
</environment>
|
2
WebfrontCore/Views/_ViewImports.cshtml
Normal file
2
WebfrontCore/Views/_ViewImports.cshtml
Normal file
@ -0,0 +1,2 @@
|
||||
@using WebfrontCore
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
3
WebfrontCore/Views/_ViewStart.cshtml
Normal file
3
WebfrontCore/Views/_ViewStart.cshtml
Normal file
@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
Reference in New Issue
Block a user