diff --git a/Expedience.Web/Dockerfile b/Expedience.Web/Dockerfile index eee2c9c..691b6c0 100644 --- a/Expedience.Web/Dockerfile +++ b/Expedience.Web/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM mcr.microsoft.com/dotnet/sdk:7.0.202-jammy-arm64v8 AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy-arm64v8 AS build # Set the working directory WORKDIR /src @@ -23,7 +23,7 @@ ARG TARGET_RUNTIME=linux-x64 RUN dotnet publish "Expedience.Web.csproj" -c Release -o /app/publish --no-self-contained --runtime $TARGET_RUNTIME # Set the base image for the final runtime -FROM mcr.microsoft.com/dotnet/aspnet:7.0.4-jammy-arm64v8 +FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy-arm64v8 # Set the working directory WORKDIR /app diff --git a/Expedience.Web/Pages/Index.cshtml.cs b/Expedience.Web/Pages/Index.cshtml.cs index 7be81da..64e3f02 100644 --- a/Expedience.Web/Pages/Index.cshtml.cs +++ b/Expedience.Web/Pages/Index.cshtml.cs @@ -19,7 +19,7 @@ namespace Expedience.Web.Pages public async Task OnGet(string? expac, CancellationToken cancellationToken) { - if (expac == null) expac = "EW"; + if (expac == null) expac = "DT"; if (expac == "DeepDungeons") { diff --git a/Expedience.Web/Pages/Records.cshtml b/Expedience.Web/Pages/Records.cshtml new file mode 100644 index 0000000..8f6af97 --- /dev/null +++ b/Expedience.Web/Pages/Records.cshtml @@ -0,0 +1,301 @@ +@page "/{recordType}/{territoryId}" + +@model Expedience.Web.Pages.RecordsModel +@{ + ViewData["Title"] = "Expedience"; + + var roleOrder = new Dictionary + { + {"Tank", 0}, + {"Healer", 1}, + {"DPS", 2} + }; + + var jobRoles = new Dictionary + { + {"MRD", "Tank"}, {"GLA", "Tank"}, {"PLD", "Tank"}, {"GNB", "Tank"}, {"DRK", "Tank"}, {"WAR", "Tank"}, + {"CNJ", "Healer"}, {"SCH", "Healer"}, {"SGE", "Healer"}, {"WHM", "Healer"}, {"AST", "Healer"} + }; + + Func getRole = job => jobRoles.ContainsKey(job) ? jobRoles[job] : "DPS"; + + + + var dutyName = Model.Results.FirstOrDefault()?.Territory?.ContentName ?? "Unknown Duty"; + +

@dutyName - @Model.Mode

+ + + + + + + + + + + + + + + + @for (int i = 0; i < Math.Min(Model.Results.Count, 10); i++) + { + var result = Model.Results[i]; + var playerMember = result.DutyMembers.FirstOrDefault(m => m.IsPlayer == true); + + + + + + + + + + + + + + + + } + +
RankPlayerJobDurationDateData Center
+ + @(i + 1)@result.User.UserName + @if (playerMember != null) + { + @playerMember.ClassJob + } + @($"{result.Hours:D2}:{result.Minutes:D2}:{result.Seconds:D2}.{result.Milliseconds:D3}")@result.EndTime.ToString("yyyy-MM-dd")@result.DataCenter
+ +
+ + Go Back + + +} \ No newline at end of file diff --git a/Expedience.Web/Pages/Records.cshtml.cs b/Expedience.Web/Pages/Records.cshtml.cs new file mode 100644 index 0000000..321a860 --- /dev/null +++ b/Expedience.Web/Pages/Records.cshtml.cs @@ -0,0 +1,45 @@ +using System; +using Expedience.Infrastructure.Models; +using Expedience.Web.Services; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Expedience.Web.Pages +{ + public class RecordsModel(IApiService apiService) : PageModel + { + public List Results { get; set; } + public string Mode { get; set; } + + public async Task OnGet(string recordType, int territoryId, CancellationToken cancellationToken) + { + var recordTypeNum = 0; + + if (recordType == "normal") + { + Mode = "Normal"; + recordTypeNum = 1; + } + else if (recordType == "solo") + { + Mode = "Solo"; + recordTypeNum = 2; + } + else if (recordType == "mine") + { + Mode = "MINE"; + recordTypeNum = 3; + } + else if (recordType == "npc") + { + Mode = "NPC Assisted"; + recordTypeNum = 4; + } + else + throw new Exception($"Record Type {recordType} not found"); + + Results = await apiService.GetTopXRecords(recordTypeNum, territoryId, 10, cancellationToken); + + + } + } +} diff --git a/Expedience.Web/Pages/Shared/_Layout.cshtml b/Expedience.Web/Pages/Shared/_Layout.cshtml index d16bb5f..691cc23 100644 --- a/Expedience.Web/Pages/Shared/_Layout.cshtml +++ b/Expedience.Web/Pages/Shared/_Layout.cshtml @@ -28,25 +28,25 @@ @@ -61,7 +61,7 @@
- © 2023 - Expedience - "LMAO ITS JUST PELOTON FOR RAIDS" + © 2024 - Expedience - "LMAO ITS JUST PELOTON FOR RAIDS"
diff --git a/Expedience.Web/Pages/_DutyTable.cshtml b/Expedience.Web/Pages/_DutyTable.cshtml index 16985d8..a11771c 100644 --- a/Expedience.Web/Pages/_DutyTable.cshtml +++ b/Expedience.Web/Pages/_DutyTable.cshtml @@ -11,7 +11,8 @@ Normal Solo - Min iLvl No Echo + MINE + NPC Level @@ -22,6 +23,8 @@ Avg Min Avg + Min + Avg @@ -29,13 +32,15 @@ { @record.Level - @record.ContentName - @record.MinNormal.Format() + @record.ContentName + @record.MinNormal.Format() @record.AvgNormal.Format() - @record.MinSolo.Format() + @record.MinSolo.Format() @record.AvgSolo.Format() - @record.MinMine.Format() + @record.MinMine.Format() @record.AvgMine.Format() + @record.MinNpc.Format() + @record.AvgNpc.Format() } diff --git a/Expedience.Web/Properties/launchSettings.json b/Expedience.Web/Properties/launchSettings.json index 2e5df9c..b9f5ac8 100644 --- a/Expedience.Web/Properties/launchSettings.json +++ b/Expedience.Web/Properties/launchSettings.json @@ -7,7 +7,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" }, "dotnetRunMessages": true, - "applicationUrl": "http://localhost:5108" + "applicationUrl": "http://localhost:5120" }, "https": { "commandName": "Project", @@ -16,7 +16,7 @@ "ASPNETCORE_ENVIRONMENT": "Development" }, "dotnetRunMessages": true, - "applicationUrl": "https://localhost:7079;http://localhost:5108" + "applicationUrl": "https://localhost:7079;http://localhost:5120" }, "IIS Express": { "commandName": "IISExpress", diff --git a/Expedience.Web/Services/ApiService.cs b/Expedience.Web/Services/ApiService.cs index 0d99124..44de81b 100644 --- a/Expedience.Web/Services/ApiService.cs +++ b/Expedience.Web/Services/ApiService.cs @@ -8,6 +8,7 @@ public interface IApiService { public ValueTask?> GetDutyCompletionRecordsAsync(string expac, CancellationToken cancellationToken); public ValueTask?> GetDeepDungeonRecordsAsync(CancellationToken cancellationToken); + public ValueTask?> GetTopXRecords(int recordType, int territoryId, int limit, CancellationToken cancellationToken); } public class ApiService : IApiService @@ -55,4 +56,24 @@ public class ApiService : IApiService return new List(); } + + public async ValueTask> GetTopXRecords(int recordType, int territoryId, int limit, CancellationToken cancellationToken) + { + var stopwatch = Stopwatch.StartNew(); + try + { + var records = await _httpClient.GetFromJsonAsync?>($"/api/TopX/{recordType}/{territoryId}/{limit}", cancellationToken); + _logger.LogInformation("Retrieved Top {limit} records for {territoryId} {recordType} in {duration}ms", + limit, territoryId, recordType, stopwatch.ElapsedMilliseconds); + + return records; + } + catch (Exception ex) + { + _logger.LogError(ex, "An error occurred trying to retrieve Top {limit} records for {territoryId} {recordType}: {errorMessage}", + limit, territoryId, recordType, ex.Message); + } + + return new List(); + } } diff --git a/Expedience.Web/wwwroot/images/ACN.png b/Expedience.Web/wwwroot/images/ACN.png new file mode 100644 index 0000000..79946a5 Binary files /dev/null and b/Expedience.Web/wwwroot/images/ACN.png differ diff --git a/Expedience.Web/wwwroot/images/ARC.png b/Expedience.Web/wwwroot/images/ARC.png new file mode 100644 index 0000000..4f0ff88 Binary files /dev/null and b/Expedience.Web/wwwroot/images/ARC.png differ diff --git a/Expedience.Web/wwwroot/images/AST.png b/Expedience.Web/wwwroot/images/AST.png new file mode 100644 index 0000000..7c25d6c Binary files /dev/null and b/Expedience.Web/wwwroot/images/AST.png differ diff --git a/Expedience.Web/wwwroot/images/BLM.png b/Expedience.Web/wwwroot/images/BLM.png new file mode 100644 index 0000000..13c89d7 Binary files /dev/null and b/Expedience.Web/wwwroot/images/BLM.png differ diff --git a/Expedience.Web/wwwroot/images/BLU.png b/Expedience.Web/wwwroot/images/BLU.png new file mode 100644 index 0000000..56ba5d1 Binary files /dev/null and b/Expedience.Web/wwwroot/images/BLU.png differ diff --git a/Expedience.Web/wwwroot/images/BRD.png b/Expedience.Web/wwwroot/images/BRD.png new file mode 100644 index 0000000..1d02e56 Binary files /dev/null and b/Expedience.Web/wwwroot/images/BRD.png differ diff --git a/Expedience.Web/wwwroot/images/CNJ.png b/Expedience.Web/wwwroot/images/CNJ.png new file mode 100644 index 0000000..6c3c534 Binary files /dev/null and b/Expedience.Web/wwwroot/images/CNJ.png differ diff --git a/Expedience.Web/wwwroot/images/DNC.png b/Expedience.Web/wwwroot/images/DNC.png new file mode 100644 index 0000000..6d6ccd8 Binary files /dev/null and b/Expedience.Web/wwwroot/images/DNC.png differ diff --git a/Expedience.Web/wwwroot/images/DRG.png b/Expedience.Web/wwwroot/images/DRG.png new file mode 100644 index 0000000..3fe8237 Binary files /dev/null and b/Expedience.Web/wwwroot/images/DRG.png differ diff --git a/Expedience.Web/wwwroot/images/DRK.png b/Expedience.Web/wwwroot/images/DRK.png new file mode 100644 index 0000000..c0c2189 Binary files /dev/null and b/Expedience.Web/wwwroot/images/DRK.png differ diff --git a/Expedience.Web/wwwroot/images/GLA.png b/Expedience.Web/wwwroot/images/GLA.png new file mode 100644 index 0000000..27b89ce Binary files /dev/null and b/Expedience.Web/wwwroot/images/GLA.png differ diff --git a/Expedience.Web/wwwroot/images/GNB.png b/Expedience.Web/wwwroot/images/GNB.png new file mode 100644 index 0000000..9b8b7fb Binary files /dev/null and b/Expedience.Web/wwwroot/images/GNB.png differ diff --git a/Expedience.Web/wwwroot/images/LNC.png b/Expedience.Web/wwwroot/images/LNC.png new file mode 100644 index 0000000..960a422 Binary files /dev/null and b/Expedience.Web/wwwroot/images/LNC.png differ diff --git a/Expedience.Web/wwwroot/images/MCH.png b/Expedience.Web/wwwroot/images/MCH.png new file mode 100644 index 0000000..cb2480b Binary files /dev/null and b/Expedience.Web/wwwroot/images/MCH.png differ diff --git a/Expedience.Web/wwwroot/images/MNK.png b/Expedience.Web/wwwroot/images/MNK.png new file mode 100644 index 0000000..aa960da Binary files /dev/null and b/Expedience.Web/wwwroot/images/MNK.png differ diff --git a/Expedience.Web/wwwroot/images/MRD.png b/Expedience.Web/wwwroot/images/MRD.png new file mode 100644 index 0000000..d62a5f4 Binary files /dev/null and b/Expedience.Web/wwwroot/images/MRD.png differ diff --git a/Expedience.Web/wwwroot/images/NIN.png b/Expedience.Web/wwwroot/images/NIN.png new file mode 100644 index 0000000..ef4e7d0 Binary files /dev/null and b/Expedience.Web/wwwroot/images/NIN.png differ diff --git a/Expedience.Web/wwwroot/images/PCT.png b/Expedience.Web/wwwroot/images/PCT.png new file mode 100644 index 0000000..257b04b Binary files /dev/null and b/Expedience.Web/wwwroot/images/PCT.png differ diff --git a/Expedience.Web/wwwroot/images/PGL.png b/Expedience.Web/wwwroot/images/PGL.png new file mode 100644 index 0000000..1ba8e21 Binary files /dev/null and b/Expedience.Web/wwwroot/images/PGL.png differ diff --git a/Expedience.Web/wwwroot/images/PLD.png b/Expedience.Web/wwwroot/images/PLD.png new file mode 100644 index 0000000..224b8bf Binary files /dev/null and b/Expedience.Web/wwwroot/images/PLD.png differ diff --git a/Expedience.Web/wwwroot/images/RDM.png b/Expedience.Web/wwwroot/images/RDM.png new file mode 100644 index 0000000..46b2028 Binary files /dev/null and b/Expedience.Web/wwwroot/images/RDM.png differ diff --git a/Expedience.Web/wwwroot/images/ROG.png b/Expedience.Web/wwwroot/images/ROG.png new file mode 100644 index 0000000..8731511 Binary files /dev/null and b/Expedience.Web/wwwroot/images/ROG.png differ diff --git a/Expedience.Web/wwwroot/images/RPR.png b/Expedience.Web/wwwroot/images/RPR.png new file mode 100644 index 0000000..6f574e6 Binary files /dev/null and b/Expedience.Web/wwwroot/images/RPR.png differ diff --git a/Expedience.Web/wwwroot/images/SAM.png b/Expedience.Web/wwwroot/images/SAM.png new file mode 100644 index 0000000..5201e35 Binary files /dev/null and b/Expedience.Web/wwwroot/images/SAM.png differ diff --git a/Expedience.Web/wwwroot/images/SCH.png b/Expedience.Web/wwwroot/images/SCH.png new file mode 100644 index 0000000..931ed4d Binary files /dev/null and b/Expedience.Web/wwwroot/images/SCH.png differ diff --git a/Expedience.Web/wwwroot/images/SGE.png b/Expedience.Web/wwwroot/images/SGE.png new file mode 100644 index 0000000..013ad83 Binary files /dev/null and b/Expedience.Web/wwwroot/images/SGE.png differ diff --git a/Expedience.Web/wwwroot/images/SMN.png b/Expedience.Web/wwwroot/images/SMN.png new file mode 100644 index 0000000..f4b6c6d Binary files /dev/null and b/Expedience.Web/wwwroot/images/SMN.png differ diff --git a/Expedience.Web/wwwroot/images/THM.png b/Expedience.Web/wwwroot/images/THM.png new file mode 100644 index 0000000..7fa2498 Binary files /dev/null and b/Expedience.Web/wwwroot/images/THM.png differ diff --git a/Expedience.Web/wwwroot/images/VPR.png b/Expedience.Web/wwwroot/images/VPR.png new file mode 100644 index 0000000..1c55bb0 Binary files /dev/null and b/Expedience.Web/wwwroot/images/VPR.png differ diff --git a/Expedience.Web/wwwroot/images/WAR.png b/Expedience.Web/wwwroot/images/WAR.png new file mode 100644 index 0000000..99643a0 Binary files /dev/null and b/Expedience.Web/wwwroot/images/WAR.png differ diff --git a/Expedience.Web/wwwroot/images/WHM.png b/Expedience.Web/wwwroot/images/WHM.png new file mode 100644 index 0000000..85be3b3 Binary files /dev/null and b/Expedience.Web/wwwroot/images/WHM.png differ