mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
Made webfront optional for decreased ram usage
initialization should be better asynced clean up publish folder after publish added chevron hover icon for loading more penalties added T6M maps to config
This commit is contained in:
@ -22,7 +22,7 @@ namespace WebfrontCore.Controllers
|
||||
{
|
||||
Manager = Program.Manager;
|
||||
|
||||
User = new EFClient()
|
||||
User = User ?? new EFClient()
|
||||
{
|
||||
ClientId = -1
|
||||
};
|
||||
|
@ -4,7 +4,6 @@ using SharedLibraryCore.Dtos;
|
||||
using SharedLibraryCore.Objects;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebfrontCore.ViewComponents
|
||||
@ -13,7 +12,7 @@ namespace WebfrontCore.ViewComponents
|
||||
{
|
||||
public async Task<IViewComponentResult> InvokeAsync(int offset)
|
||||
{
|
||||
var penalties = await Program.Manager.GetPenaltyService().GetRecentPenalties(15, offset);
|
||||
var penalties = await Program.Manager.GetPenaltyService().GetRecentPenalties(12, offset);
|
||||
var penaltiesDto = penalties.Select(p => new PenaltyInfo()
|
||||
{
|
||||
OffenderId = p.OffenderId,
|
||||
@ -28,8 +27,7 @@ namespace WebfrontCore.ViewComponents
|
||||
Sensitive = p.Type == Penalty.PenaltyType.Flag
|
||||
});
|
||||
|
||||
bool authorized = User.Identity.IsAuthenticated;
|
||||
penaltiesDto = authorized ? penaltiesDto.ToList() : penaltiesDto.Where(p => !p.Sensitive).ToList();
|
||||
penaltiesDto = User.Identity.IsAuthenticated ? penaltiesDto.ToList() : penaltiesDto.Where(p => !p.Sensitive).ToList();
|
||||
|
||||
return View("_List", penaltiesDto);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
<table class="table d-table d-md-none">
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
<span id="load_penalties_button" class="oi oi-chevron-bottom text-center text-primary w-100 h3 pb-0 mb-0 d-none d-md-block"></span>
|
||||
</div>
|
||||
|
||||
@section scripts {
|
||||
|
@ -11,6 +11,8 @@
|
||||
<meta property="og:url" content="@ViewBag.Url">
|
||||
<meta name="description" content="@ViewBag.Description">
|
||||
<meta name="keywords" content="@ViewBag.Keywords">
|
||||
<link rel="icon" type="image/png" href="~/images/icon.png">
|
||||
|
||||
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
|
||||
<environment include="Development">
|
||||
<link rel="stylesheet" href="~/css/bootstrap-custom.css" />
|
||||
@ -136,10 +138,6 @@
|
||||
<script type="text/javascript" src="~/js/search.js"></script>
|
||||
</environment>
|
||||
<environment include="Production">
|
||||
<script type="text/javascript" src="~/lib/jQuery/dist/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="~/lib/moment/min/moment.min.js"></script>
|
||||
<script type="text/javascript" src="~/lib/moment-timezone/builds/moment-timezone.min.js"></script>
|
||||
<script type="text/javascript" src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<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/global.min.js"></script>
|
||||
</environment>
|
||||
|
@ -33,10 +33,20 @@
|
||||
<None Include="compilerconfig.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="wwwroot\**\*.*" CopyToPublishDirectory="Never" />
|
||||
<None Include="wwwroot\css\global.min.css" CopyToPublishDirectory="Always" />
|
||||
<None Include="wwwroot\js\global.min.js" CopyToPublishDirectory="Always" />
|
||||
<None Include="wwwroot\images\icon.png" CopyToPublishDirectory="Always" />
|
||||
<None Include="wwwroot\lib\open-iconic\font\fonts\open-iconic.ttf" CopyToPublishDirectory="Always" />
|
||||
<None Include="wwwroot\lib\open-iconic\font\fonts\open-iconic.woff" CopyToPublishDirectory="Always" />
|
||||
<None Include="wwwroot\lib\open-iconic\font\fonts\open-iconic.otf" CopyToPublishDirectory="Always" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bower" Version="1.3.11" />
|
||||
<PackageReference Include="BuildBundlerMinifier" Version="2.6.375" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -13,6 +13,10 @@
|
||||
{
|
||||
"outputFileName": "wwwroot/js/global.min.js",
|
||||
"inputFiles": [
|
||||
"wwwroot/lib/jQuery/dist/jquery.min.js",
|
||||
"wwwroot/lib/moment/min/moment.min.js",
|
||||
"wwwroot/lib/moment-timezone/builds/moment-timezone.min.js",
|
||||
"wwwroot/lib/bootstrap/dist/js/bootstrap.min.js",
|
||||
"wwwroot/js/action.js",
|
||||
"wwwroot/js/console.js",
|
||||
"wwwroot/js/penalty.js",
|
||||
|
@ -1,3 +0,0 @@
|
||||
/// <autosync enabled="true" />
|
||||
/// <reference path="lib/bootstrap/dist/js/bootstrap.js" />
|
||||
/// <reference path="lib/jquery/dist/jquery.js" />
|
Binary file not shown.
Before Width: | Height: | Size: 31 KiB |
@ -1,16 +1,24 @@
|
||||
let offset = 15;
|
||||
let offset = 12;
|
||||
let isLoading = false;
|
||||
|
||||
function loadMorePenalties() {
|
||||
if (isLoading) {
|
||||
return false;
|
||||
}
|
||||
|
||||
showLoader();
|
||||
isLoading = true;
|
||||
$.get('/Penalty/ListAsync', { offset: offset })
|
||||
.done(function (response) {
|
||||
$('#penalty_table').append(response);
|
||||
hideLoader();
|
||||
isLoading = false;
|
||||
})
|
||||
.fail(function (jqxhr, statis, error) {
|
||||
errorLoader();
|
||||
isLoading = false;
|
||||
});
|
||||
offset += 15;
|
||||
offset += 12;
|
||||
}
|
||||
|
||||
if ($('#penalty_table').length === 1) {
|
||||
@ -37,10 +45,13 @@ if ($('#penalty_table').length === 1) {
|
||||
var hasScrollBar = false;
|
||||
|
||||
$document.ready(function () {
|
||||
|
||||
$window
|
||||
.off('scroll', ScrollHandler)
|
||||
.on('scroll', ScrollHandler);
|
||||
|
||||
$('#load_penalties_button').hover(function () {
|
||||
loadMorePenalties();
|
||||
});
|
||||
});
|
||||
|
||||
function ScrollHandler(e) {
|
||||
|
Reference in New Issue
Block a user