Upgrade NPC admin editor selectors and add dialog tree admin UI
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
@page "/admin/npcs/dialogtrees"
|
||||
@model Npcs.DialogTreesModel
|
||||
@{
|
||||
ViewData["Title"] = "Dialog Trees";
|
||||
}
|
||||
|
||||
<div class="space-y-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-white">Dialog Trees</h1>
|
||||
<p class="text-gray-400 mt-1">Manage NPC conversation trees, nodes, and options</p>
|
||||
</div>
|
||||
<a href="/admin/npcs/dialogtrees/edit" class="btn btn-primary">Create Dialog Tree</a>
|
||||
</div>
|
||||
|
||||
<div class="card p-4">
|
||||
<form method="get" class="flex items-end gap-4">
|
||||
<div class="flex-1">
|
||||
<label class="label">Search</label>
|
||||
<input type="text" name="search" value="@Model.Search" class="input" placeholder="Search by name/description..." />
|
||||
</div>
|
||||
<button class="btn btn-secondary" type="submit">Filter</button>
|
||||
<a class="btn btn-secondary" href="/admin/npcs/dialogtrees">Clear</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card overflow-hidden">
|
||||
<table class="w-full">
|
||||
<thead class="bg-gray-900/50">
|
||||
<tr>
|
||||
<th class="table-header w-16">ID</th>
|
||||
<th class="table-header">Name</th>
|
||||
<th class="table-header w-20">Nodes</th>
|
||||
<th class="table-header w-20">Enabled</th>
|
||||
<th class="table-header w-24">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-700">
|
||||
@foreach (var t in Model.Trees)
|
||||
{
|
||||
<tr class="hover:bg-gray-700/30">
|
||||
<td class="table-cell font-mono text-gray-500">@t.Id</td>
|
||||
<td class="table-cell">
|
||||
<div class="text-white font-medium">@t.Name</div>
|
||||
<div class="text-xs text-gray-500">@t.Description</div>
|
||||
</td>
|
||||
<td class="table-cell text-gray-300">@Model.NodeCountByTreeId.GetValueOrDefault(t.Id)</td>
|
||||
<td class="table-cell text-gray-300">@(t.IsEnabled ? "Yes" : "No")</td>
|
||||
<td class="table-cell">
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="/admin/npcs/dialogtrees/edit?id=@t.Id" class="btn btn-secondary btn-sm">Edit</a>
|
||||
<form method="post" asp-page-handler="Delete" class="inline" onsubmit="return confirm('Delete this dialog tree?');">
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="id" value="@t.Id" />
|
||||
<button class="btn btn-danger btn-sm" type="submit">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@if (!Model.Trees.Any())
|
||||
{
|
||||
<tr>
|
||||
<td colspan="5" class="table-cell text-center text-gray-500 py-10">No dialog trees found.</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user