IW4M-Admin/WebfrontCore/Views/Server/_ClientActivity.cshtml

74 lines
3.1 KiB
Plaintext
Raw Normal View History

2018-04-08 02:44:42 -04:00
@model SharedLibraryCore.Dtos.ServerInfo
2018-02-21 20:29:23 -05:00
@{
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 < Model.ChatHistory.Length; i++)
2018-02-21 20:29:23 -05:00
{
string message = @Model.ChatHistory[i].Message;
2018-02-21 20:29:23 -05:00
if (Model.ChatHistory[i].Message == "CONNECTED")
{
<span class="text-light"><span class="oi oi-account-login mr-2 text-success"> </span>@Model.ChatHistory[i].Name</span><br />
}
if (Model.ChatHistory[i].Message == "DISCONNECTED")
{
<span class="text-light"><span class="oi oi-account-logout mr-2 text-danger"> </span>@Model.ChatHistory[i].Name</span><br />
}
if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED")
{
<span class="text-light">@Model.ChatHistory[i].Name</span><span> &mdash; @message.Substring(0, Math.Min(65, message.Length)) </span><br />
}
2018-02-21 20:29:23 -05:00
}
}
</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++)
{
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].Level.ToLower()}";
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })</span><br />
2018-02-21 20:29:23 -05:00
}
}
</div>
<div class="col-6 text-right">
@{
for (int i = half; i < Model.ClientCount; i++)
{
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].Level.ToLower()}";
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })</span><br />
2018-02-21 20:29:23 -05:00
}
}
</div>
</div>
</div>
@if (Model.ChatHistory.Length > 0)
{
<div class="w-100 border-bottom d-md-none d-block mt-1 mb-1"></div>
}
<div class="col-12 col-md-8 d-md-none d-block text-left">
@{
for (int i = 0; i < Model.ChatHistory.Length; i++)
{
string message = @Model.ChatHistory[i].Message;
if (Model.ChatHistory[i].Message == "CONNECTED")
{
<span class="text-light"><span class="oi oi-account-login mr-2 text-success"> </span>@Model.ChatHistory[i].Name</span><br />
}
if (Model.ChatHistory[i].Message == "DISCONNECTED")
{
<span class="text-light"><span class="oi oi-account-logout mr-2 text-danger"> </span>@Model.ChatHistory[i].Name</span><br />
}
if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED")
{
<span class="text-light">@Model.ChatHistory[i].Name</span><span> &mdash; @message.Substring(0, Math.Min(65, message.Length)) </span><br />
}
}
}
2018-02-21 20:29:23 -05:00
</div>