AdminPanel
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
@page "/admin/recipes"
|
||||
@model VoidScavengers.Admin.Pages.Recipes.IndexModel
|
||||
@{
|
||||
ViewData["Title"] = "Recipes";
|
||||
}
|
||||
|
||||
<div class="space-y-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-white">Recipes</h1>
|
||||
<p class="text-gray-400 mt-1">Manage crafting recipes</p>
|
||||
</div>
|
||||
<a href="/admin/recipes/edit" class="btn btn-primary flex items-center gap-2">
|
||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
|
||||
</svg>
|
||||
Create Recipe
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card p-8 text-center">
|
||||
<p class="text-gray-400">@Model.RecipeCount recipes defined</p>
|
||||
<p class="text-gray-500 mt-2">Full recipe editor coming soon...</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Server.Data;
|
||||
|
||||
namespace VoidScavengers.Admin.Pages.Recipes;
|
||||
|
||||
public class IndexModel : AdminPageModel
|
||||
{
|
||||
private readonly GameDbContext _db;
|
||||
|
||||
public IndexModel(GameDbContext db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
public int RecipeCount { get; set; }
|
||||
|
||||
public async Task OnGetAsync()
|
||||
{
|
||||
RecipeCount = await _db.DungeonCraftingRecipes.CountAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user