From 82b38845f7c0422d3169bc8cc3c0a78910ee0028 Mon Sep 17 00:00:00 2001 From: bobbahbrown Date: Sat, 14 Nov 2020 06:29:01 -0400 Subject: [PATCH] version 1.2.5 --- CentCom.API/CentCom.API.csproj | 6 +++--- CentCom.API/Models/BanData.cs | 1 + CentCom.API/Services/Implemented/BanService.cs | 1 - CentCom.API/Views/Viewer/viewbans.cshtml | 13 ++++++++++--- CentCom.Common/CentCom.Common.csproj | 6 +++--- CentCom.Server/CentCom.Server.csproj | 6 +++--- publish-script.bat | 7 +++++++ 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/CentCom.API/CentCom.API.csproj b/CentCom.API/CentCom.API.csproj index 4e8b98e..24f5f6f 100644 --- a/CentCom.API/CentCom.API.csproj +++ b/CentCom.API/CentCom.API.csproj @@ -2,9 +2,9 @@ netcoreapp3.1 - 1.2.4 - 1.2.4.0 - 1.2.4.0 + 1.2.5 + 1.2.5.0 + 1.2.5.0 diff --git a/CentCom.API/Models/BanData.cs b/CentCom.API/Models/BanData.cs index 8921b5c..0c82c3e 100644 --- a/CentCom.API/Models/BanData.cs +++ b/CentCom.API/Models/BanData.cs @@ -22,6 +22,7 @@ public class BanData public string BanID { get; set; } public List Jobs { get; set; } public List BanAttributes { get; set; } + public bool Active => (!Expires.HasValue || Expires.Value > DateTime.UtcNow) && UnbannedBy == null; public static BanData FromBan(Ban ban) { diff --git a/CentCom.API/Services/Implemented/BanService.cs b/CentCom.API/Services/Implemented/BanService.cs index 1aaea95..aa8558c 100644 --- a/CentCom.API/Services/Implemented/BanService.cs +++ b/CentCom.API/Services/Implemented/BanService.cs @@ -6,7 +6,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text.RegularExpressions; using System.Threading.Tasks; namespace CentCom.API.Services.Implemented diff --git a/CentCom.API/Views/Viewer/viewbans.cshtml b/CentCom.API/Views/Viewer/viewbans.cshtml index 09c8852..a82244e 100644 --- a/CentCom.API/Views/Viewer/viewbans.cshtml +++ b/CentCom.API/Views/Viewer/viewbans.cshtml @@ -23,6 +23,10 @@ { thisBan.Insert(0, ("Jobs", string.Join(", ", b.Jobs))); } + if (b.UnbannedBy != null) + { + thisBan.Add(("Unbanned By", b.UnbannedBy)); + } banTraits.Add(b.ID, thisBan); } } @@ -47,9 +51,9 @@ @foreach (var b in Model.Bans.OrderByDescending(x => x.BannedOn)) { -
+
- @(b.Type) Ban / @b.SourceName / @(b.Expires.HasValue && b.Expires.Value < DateTime.UtcNow ? "Expired" : "Active") + @(b.Type) Ban / @b.SourceName / @(b.Active ? "Active" : "Expired")
@b.Reason
@@ -58,11 +62,14 @@ { @kvp.title: @kvp.value } + @if (b.BanAttributes?.Count() > 0) + { + CentCom Attributes: @(string.Join(", ", b.BanAttributes)) + }
} - } } \ No newline at end of file diff --git a/CentCom.Common/CentCom.Common.csproj b/CentCom.Common/CentCom.Common.csproj index 02aeb9b..33f5e17 100644 --- a/CentCom.Common/CentCom.Common.csproj +++ b/CentCom.Common/CentCom.Common.csproj @@ -2,9 +2,9 @@ netstandard2.0 - 1.2.4 - 1.2.4.0 - 1.2.4.0 + 1.2.5 + 1.2.5.0 + 1.2.5.0 diff --git a/CentCom.Server/CentCom.Server.csproj b/CentCom.Server/CentCom.Server.csproj index c7e5735..a2fe89b 100644 --- a/CentCom.Server/CentCom.Server.csproj +++ b/CentCom.Server/CentCom.Server.csproj @@ -3,9 +3,9 @@ Exe netcoreapp3.1 - 1.2.4.0 - 1.2.4.0 - 1.2.4 + 1.2.5.0 + 1.2.5.0 + 1.2.5 diff --git a/publish-script.bat b/publish-script.bat index eaca983..791f7f9 100644 --- a/publish-script.bat +++ b/publish-script.bat @@ -1,3 +1,10 @@ +rmdir /Q /S publish +rmdir /Q /S CentCom.API\bin +rmdir /Q /S CentCom.API\obj +rmdir /Q /S CentCom.Common\bin +rmdir /Q /S CentCom.Common\obj +rmdir /Q /S CentCom.Server\bin +rmdir /Q /S CentCom.Server\obj dotnet publish CentCom.API -o publish/linux-x64/CentCom.API/ -r "linux-x64" --self-contained false 7z a publish/CentCom.API-linux-x64.zip -r ./publish/linux-x64/CentCom.API/* dotnet publish CentCom.Server -o publish/linux-x64/CentCom.Server -r "linux-x64" --self-contained false