From ba04911acc9a9e1eee7a1df60ef6ba7e0512b8d6 Mon Sep 17 00:00:00 2001 From: dingo Date: Tue, 3 Mar 2026 17:05:27 -0500 Subject: [PATCH] CDN flag change --- .../Pages/Content/AiArtTracker.razor | 70 ++++++++++++++- .../Components/Pages/Content/CdnBrowser.razor | 85 ++++++++++++++++++- .../SOR.Database/Contexts/CatalogDbContext.cs | 13 +++ .../Entities/Catalog/CdnUploadRecord.cs | 29 +++++++ Server/src/SOR.Database/Enums/Affinity.cs | 14 +-- .../20260303221500_AddCdnUploadRecords.cs | 60 +++++++++++++ .../Catalog/CatalogDbContextModelSnapshot.cs | 39 +++++++++ Server/src/SOR.Game/Grid/AffinitySystem.cs | 4 +- 8 files changed, 303 insertions(+), 11 deletions(-) create mode 100644 Server/src/SOR.Database/Entities/Catalog/CdnUploadRecord.cs create mode 100644 Server/src/SOR.Database/Migrations/Catalog/20260303221500_AddCdnUploadRecords.cs diff --git a/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor b/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor index 6504d3c..27aadc1 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/AiArtTracker.razor @@ -15,7 +15,7 @@

- All assets and animations flagged as AI-generated across the card catalog. + All catalog assets, animation bindings, and generic CDN uploads flagged as AI-generated.

@if (_loading) @@ -24,6 +24,54 @@ } else { + +
+
+ + Generic CDN Uploads + @_cdnUploads.Count AI-generated + +
+
+ @if (_cdnUploads.Count == 0) + { +

No AI-generated generic CDN uploads.

+ } + else + { + + + + + + + + + + + + @foreach (var item in _cdnUploads) + { + + + + + + + + } + +
PrefixObject KeyMIMECDN URLUploaded
@(!string.IsNullOrWhiteSpace(item.Prefix) ? item.Prefix : "/")@item.ObjectKey@(!string.IsNullOrWhiteSpace(item.ContentType) ? item.ContentType : "—") + + @TruncateUrl(item.PublicUrl) + + + @item.UploadedAt.ToString("yyyy-MM-dd")
+ } +
+
+
@@ -166,8 +214,16 @@ else string? ActionName, string? CdnUrl); + private record CdnUploadRow( + string Prefix, + string ObjectKey, + string? ContentType, + string PublicUrl, + DateTimeOffset UploadedAt); + private List _assets = new(); private List _animations = new(); + private List _cdnUploads = new(); protected override async Task OnInitializedAsync() => await LoadAsync(); @@ -203,6 +259,18 @@ else a.AnimationCdnUrl)) .ToListAsync(); + _cdnUploads = await Db.CdnUploadRecords + .Where(r => r.IsAiGenerated) + .OrderBy(r => r.Prefix) + .ThenBy(r => r.ObjectKey) + .Select(r => new CdnUploadRow( + r.Prefix, + r.ObjectKey, + r.ContentType, + r.PublicUrl, + r.UploadedAt)) + .ToListAsync(); + _loading = false; } diff --git a/Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor b/Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor index 41bcb21..ba2263e 100644 --- a/Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor +++ b/Server/src/SOR.Admin/Components/Pages/Content/CdnBrowser.razor @@ -3,11 +3,14 @@ @using Amazon.S3 @using Amazon.S3.Model @using Microsoft.AspNetCore.Components.Forms +@using Microsoft.EntityFrameworkCore @using Microsoft.Extensions.Options @using SOR.Cdn +@using SOR.Database.Contexts @inject IAmazonS3 S3 @inject IOptions CdnOptionsAccessor @inject IJSRuntime Js +@inject CatalogDbContext Db CDN Browser - SOR Admin @@ -88,6 +91,10 @@ Upload destination: @(_activePrefixDisplay)
+
+ + +
+
+ + +