AdminPanel
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Server.Data;
|
||||
|
||||
namespace VoidScavengers.Admin.Pages;
|
||||
|
||||
public class IndexModel : AdminPageModel
|
||||
{
|
||||
private readonly GameDbContext _db;
|
||||
|
||||
public IndexModel(GameDbContext db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
public int ItemCount { get; set; }
|
||||
public int MobCount { get; set; }
|
||||
public int RecipeCount { get; set; }
|
||||
public int PlayerCount { get; set; }
|
||||
public int AssetCount { get; set; }
|
||||
public string CdnBaseUrl { get; set; } = "https://assets.aeternalisgames.com";
|
||||
|
||||
public async Task OnGetAsync()
|
||||
{
|
||||
ItemCount = await _db.DungeonItemDefinitions.CountAsync();
|
||||
MobCount = await _db.DungeonMobDefinitions.CountAsync();
|
||||
RecipeCount = await _db.DungeonCraftingRecipes.CountAsync();
|
||||
PlayerCount = await _db.Accounts.CountAsync();
|
||||
AssetCount = await _db.ClientAssets.CountAsync();
|
||||
|
||||
// Get CDN URL from environment if set
|
||||
var cdnUrl = Environment.GetEnvironmentVariable("CDN_BASE_URL");
|
||||
if (!string.IsNullOrEmpty(cdnUrl))
|
||||
{
|
||||
CdnBaseUrl = cdnUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user