refine webfront pages

finish refactor of penalty information/profile
optimize pull penalty query
start impl of quick message mapping
This commit is contained in:
RaidMax
2019-03-31 19:56:31 -05:00
parent 9393b35c39
commit 6f80f1edbb
23 changed files with 253 additions and 283 deletions

View File

@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static SharedLibraryCore.Database.Models.EFClient;
using static SharedLibraryCore.Objects.Penalty;
namespace SharedLibraryCore.Dtos
{
@ -16,13 +14,19 @@ namespace SharedLibraryCore.Dtos
public int PunisherId { get; set; }
public ulong PunisherNetworkId { get; set; }
public string PunisherIPAddress { get; set; }
public string PunisherLevel { get; set; }
public int PunisherLevelId { get; set; }
public Permission PunisherLevel { get; set; }
public string PunisherLevelText => PunisherLevel.ToLocalizedLevelName();
public string Offense { get; set; }
public string AutomatedOffense { get; set; }
public string PenaltyType { get; set; }
public string TimePunished { get; set; }
public string TimeRemaining { get; set; }
public bool Expired { get; set; }
public PenaltyType PenaltyType { get; set; }
public string PenaltyTypeText => PenaltyType.ToString();
public DateTime TimePunished { get; set; }
public string TimePunishedString => Utilities.GetTimePassed(TimePunished, true);
public string TimeRemaining => DateTime.UtcNow > Expires ? "" : $"{((Expires ?? DateTime.MaxValue).Year == DateTime.MaxValue.Year ? Utilities.GetTimePassed(TimePunished, true) : Utilities.TimeSpanText((Expires ?? DateTime.MaxValue) - DateTime.UtcNow))}";
public bool Expired => Expires.HasValue && Expires <= DateTime.UtcNow;
public DateTime? Expires { get; set; }
public override bool Sensitive => PenaltyType == PenaltyType.Flag;
public bool IsEvade { get; set; }
public string AdditionalPenaltyInformation => $"{(!string.IsNullOrEmpty(AutomatedOffense) ? $" ({AutomatedOffense})" : "")}{(IsEvade ? $" ({Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PENALTY_EVADE"]})" : "")}";
}
}

View File

@ -22,6 +22,8 @@ namespace SharedLibraryCore.Dtos
public List<ProfileMeta> Meta { get; set; }
public bool Online { get; set; }
public string TimeOnline { get; set; }
public DateTime LastConnection { get; set; }
public string LastConnectionText => Utilities.GetTimePassed(LastConnection, true);
public IDictionary<int, long> LinkedAccounts { get; set; }
}
}

View File

@ -3,8 +3,8 @@ namespace SharedLibraryCore.Dtos
{
public class SharedInfo
{
public bool Sensitive { get; set; }
public virtual bool Sensitive { get; set; }
public bool Show { get; set; } = true;
public int Id {get;set;}
}
public int Id { get; set; }
}
}