223 lines
19 KiB
Plaintext
223 lines
19 KiB
Plaintext
@using Microsoft.AspNetCore.Http
|
|
<!DOCTYPE html>
|
|
<html lang="en" class="h-full bg-gray-900">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>@ViewData["Title"] - Dungeon Divers Admin</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<script>
|
|
tailwind.config = {
|
|
darkMode: 'class',
|
|
theme: { extend: { colors: { primary: '#6366f1', secondary: '#8b5cf6' } } }
|
|
}
|
|
</script>
|
|
<style>
|
|
.sidebar-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; color: #d1d5db; border-radius: 0.5rem; transition: all 0.15s; white-space: nowrap; overflow: hidden; }
|
|
.sidebar-link:hover { background-color: #1f2937; color: white; }
|
|
.sidebar-link.active { background-color: #4f46e5; color: white; }
|
|
.sidebar-link svg { flex-shrink: 0; }
|
|
|
|
.btn { padding: 0.5rem 1rem; border-radius: 0.5rem; font-weight: 500; transition: all 0.15s; outline: none; }
|
|
.btn:focus { box-shadow: 0 0 0 2px #111827, 0 0 0 4px #6366f1; }
|
|
.btn-primary { background-color: #4f46e5; color: white; }
|
|
.btn-primary:hover { background-color: #4338ca; }
|
|
.btn-secondary { background-color: #374151; color: #e5e7eb; }
|
|
.btn-secondary:hover { background-color: #4b5563; }
|
|
.btn-danger { background-color: #dc2626; color: white; }
|
|
.btn-danger:hover { background-color: #b91c1c; }
|
|
.btn-success { background-color: #16a34a; color: white; }
|
|
.btn-success:hover { background-color: #15803d; }
|
|
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
|
|
.input { width: 100%; padding: 0.5rem 0.75rem; background-color: #1f2937; border: 1px solid #374151; border-radius: 0.5rem; color: #e5e7eb; }
|
|
.input::placeholder { color: #6b7280; }
|
|
.input:focus { outline: none; box-shadow: 0 0 0 2px #6366f1; border-color: transparent; }
|
|
.label { display: block; font-size: 0.875rem; font-weight: 500; color: #d1d5db; margin-bottom: 0.25rem; }
|
|
.card { background-color: #1f2937; border-radius: 0.75rem; border: 1px solid #374151; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
|
|
.table-header { padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 500; color: #9ca3af; text-transform: uppercase; }
|
|
.table-cell { padding: 0.75rem 1rem; font-size: 0.875rem; color: #d1d5db; }
|
|
.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
|
|
|
|
/* Collapsible sidebar */
|
|
.sidebar { width: 240px; transition: width 0.3s ease; }
|
|
.sidebar.collapsed { width: 56px; }
|
|
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 0.625rem 0.5rem; }
|
|
.sidebar.collapsed .sidebar-link span,
|
|
.sidebar.collapsed .section-title,
|
|
.sidebar.collapsed .logo-text,
|
|
.sidebar.collapsed .user-info { display: none; }
|
|
.sidebar.collapsed .collapse-btn svg { transform: rotate(180deg); }
|
|
|
|
/* Tooltip for collapsed */
|
|
.sidebar.collapsed .sidebar-link { position: relative; }
|
|
.sidebar.collapsed .sidebar-link::after {
|
|
content: attr(data-tooltip);
|
|
position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
|
|
background: #1f2937; color: white; padding: 4px 8px; border-radius: 4px;
|
|
font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden;
|
|
transition: opacity 0.2s; margin-left: 8px; z-index: 100; border: 1px solid #374151;
|
|
}
|
|
.sidebar.collapsed .sidebar-link:hover::after { opacity: 1; visibility: visible; }
|
|
|
|
/* Mobile drawer */
|
|
.drawer-overlay { opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
|
|
.drawer-overlay.open { opacity: 1; visibility: visible; }
|
|
.drawer-sidebar { transform: translateX(-100%); transition: transform 0.3s ease-in-out; }
|
|
.drawer-sidebar.open { transform: translateX(0); }
|
|
@@media (min-width: 1024px) {
|
|
.drawer-sidebar { transform: translateX(0) !important; }
|
|
.drawer-overlay { display: none !important; }
|
|
.mobile-menu-btn { display: none !important; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="h-full">
|
|
<div class="flex h-full">
|
|
<div id="drawer-overlay" class="drawer-overlay fixed inset-0 bg-black/50 z-40 lg:hidden" onclick="toggleDrawer()"></div>
|
|
|
|
<aside id="sidebar" class="sidebar drawer-sidebar fixed lg:static inset-y-0 left-0 z-50 bg-gray-800 border-r border-gray-700 flex flex-col">
|
|
<div class="p-3 border-b border-gray-700 flex items-center gap-2">
|
|
<svg class="w-7 h-7 text-indigo-500 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
|
|
</svg>
|
|
<div class="logo-text">
|
|
<h1 class="text-sm font-bold text-white">Dungeon Divers</h1>
|
|
<p class="text-xs text-gray-500">Admin</p>
|
|
</div>
|
|
<button class="lg:hidden ml-auto text-gray-400 hover:text-white" onclick="toggleDrawer()">✕</button>
|
|
</div>
|
|
|
|
<button onclick="toggleSidebar()" class="collapse-btn hidden lg:flex items-center justify-center p-2 mx-2 mt-2 text-gray-400 hover:text-white hover:bg-gray-700 rounded">
|
|
<svg class="w-4 h-4 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 19l-7-7 7-7m8 14l-7-7 7-7"/>
|
|
</svg>
|
|
</button>
|
|
|
|
<nav class="flex-1 p-2 space-y-0.5 overflow-y-auto">
|
|
<a href="/admin" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString() == "/Index" ? "active" : "")" data-tooltip="Dashboard">
|
|
<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="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/></svg>
|
|
<span>Dashboard</span>
|
|
</a>
|
|
|
|
<p class="section-title px-3 pt-3 pb-1 text-xs font-semibold text-gray-500 uppercase">Content</p>
|
|
|
|
<a href="/admin/items" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Items") == true ? "active" : "")" data-tooltip="Items">
|
|
<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="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"/></svg>
|
|
<span>Items</span>
|
|
</a>
|
|
<a href="/admin/recipes" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Recipes") == true ? "active" : "")" data-tooltip="Recipes">
|
|
<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="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"/></svg>
|
|
<span>Recipes</span>
|
|
</a>
|
|
<a href="/admin/mobs" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Mobs") == true ? "active" : "")" data-tooltip="Mobs">
|
|
<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 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/></svg>
|
|
<span>Mobs</span>
|
|
</a>
|
|
<a href="/admin/npcs" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Npcs") == true ? "active" : "")" data-tooltip="NPCs">
|
|
<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="M17 20h5V4H2v16h5m10 0v-2a4 4 0 00-4-4H11a4 4 0 00-4 4v2m10 0H7m8-10a3 3 0 11-6 0 3 3 0 016 0z"/></svg>
|
|
<span>NPCs</span>
|
|
</a>
|
|
<a href="/admin/npcs/shops" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Npcs/Shop") == true ? "active" : "")" data-tooltip="Shops">
|
|
<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="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-1.5 6h12M9 21a1 1 0 100-2 1 1 0 000 2zm8 0a1 1 0 100-2 1 1 0 000 2z"/></svg>
|
|
<span>Shops</span>
|
|
</a>
|
|
<a href="/admin/npcs/dialogtrees" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Npcs/Dialog") == true ? "active" : "")" data-tooltip="Dialog Trees">
|
|
<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="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-4l-4 4v-4z"/></svg>
|
|
<span>Dialog Trees</span>
|
|
</a>
|
|
<a href="/admin/spritesheets" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/SpriteSheets") == true ? "active" : "")" data-tooltip="SpriteSheets">
|
|
<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="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" /> </svg>
|
|
<span>Sprite Sheets</span>
|
|
</a>
|
|
<a href="/admin/tilemaps" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/TileMaps") == true ? "active" : "")" data-tooltip="TileMaps">
|
|
<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="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"/></svg>
|
|
<span>TileMaps</span>
|
|
</a>
|
|
<a href="/admin/dungeonbuilder" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.Contains("DungeonBuilder") == true ? "active" : "")" data-tooltip="Builder">
|
|
<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="M11 4a2 2 0 114 0v1a1 1 0 001 1h3a1 1 0 011 1v3a1 1 0 01-1 1h-1a2 2 0 100 4h1a1 1 0 011 1v3a1 1 0 01-1 1h-3a1 1 0 01-1-1v-1a2 2 0 10-4 0v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-3a1 1 0 00-1-1H4a2 2 0 110-4h1a1 1 0 001-1V7a1 1 0 011-1h3a1 1 0 001-1V4z"/></svg>
|
|
<span>Builder</span>
|
|
</a>
|
|
<a href="/admin/assets" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Assets") == true ? "active" : "")" data-tooltip="Assets">
|
|
<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="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>
|
|
<span>Assets</span>
|
|
</a>
|
|
<a href="/admin/loottables" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/LootTables") == true ? "active" : "")" data-tooltip="Loot">
|
|
<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 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
|
|
<span>Loot Tables</span>
|
|
</a>
|
|
<a href="/admin/resistances" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Resistances") == true ? "active" : "")" data-tooltip="Resistances">
|
|
<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="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>
|
|
<span>Resistances</span>
|
|
</a>
|
|
<a href="/admin/abilities" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Abilities") == true ? "active" : "")" data-tooltip="Abilities">
|
|
<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="M13 10V3L4 14h7v7l9-11h-7z"/></svg>
|
|
<span>Abilities</span>
|
|
</a>
|
|
|
|
<p class="section-title px-3 pt-3 pb-1 text-xs font-semibold text-gray-500 uppercase">Management</p>
|
|
|
|
<a href="/admin/dungeons" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Dungeons") == true ? "active" : "")" data-tooltip="Dungeons">
|
|
<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="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/></svg>
|
|
<span>Dungeons</span>
|
|
</a>
|
|
<a href="/admin/worldeditor" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/WorldEditor") == true ? "active" : "")" data-tooltip="World Editor">
|
|
<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="M17.657 16.657L13.414 20.9a2 2 0 01-2.828 0L6.343 16.657m11.314 0A8 8 0 005.03 7.343m12.627 9.314A8 8 0 1112 4a8 8 0 015.657 12.657z"/></svg>
|
|
<span>World Editor</span>
|
|
</a>
|
|
<a href="/admin/players" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Players") == true ? "active" : "")" data-tooltip="Players">
|
|
<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 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/></svg>
|
|
<span>Players</span>
|
|
</a>
|
|
<a href="/admin/server" class="sidebar-link @(ViewContext.RouteData.Values["page"]?.ToString()?.StartsWith("/Server") == true ? "active" : "")" data-tooltip="Server">
|
|
<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="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"/></svg>
|
|
<span>Server</span>
|
|
</a>
|
|
</nav>
|
|
|
|
<div class="p-2 border-t border-gray-700">
|
|
<div class="flex items-center gap-2 p-2">
|
|
<div class="w-8 h-8 rounded-full bg-indigo-600 flex items-center justify-center text-white text-sm font-bold flex-shrink-0">
|
|
@(ViewData["AdminUsername"]?.ToString()?.Substring(0, 1).ToUpper() ?? "A")
|
|
</div>
|
|
<div class="user-info flex-1 min-w-0">
|
|
<p class="text-sm font-medium text-white truncate">@ViewData["AdminUsername"]</p>
|
|
<p class="text-xs text-gray-400">@ViewData["AdminRole"]</p>
|
|
</div>
|
|
<a href="/admin/logout" class="text-gray-400 hover:text-white flex-shrink-0" title="Logout">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"/></svg>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
|
|
<main class="flex-1 overflow-auto min-w-0">
|
|
<div class="lg:hidden sticky top-0 z-30 bg-gray-800 border-b border-gray-700 p-3 flex items-center gap-3">
|
|
<button class="mobile-menu-btn text-gray-400 hover:text-white" onclick="toggleDrawer()">
|
|
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg>
|
|
</button>
|
|
<h1 class="text-lg font-semibold text-white truncate">@ViewData["Title"]</h1>
|
|
</div>
|
|
<div class="p-4 md:p-6">@RenderBody()</div>
|
|
</main>
|
|
</div>
|
|
|
|
<script>
|
|
const SIDEBAR_KEY = 'sidebar_collapsed';
|
|
function toggleSidebar() {
|
|
const s = document.getElementById('sidebar');
|
|
s.classList.toggle('collapsed');
|
|
localStorage.setItem(SIDEBAR_KEY, s.classList.contains('collapsed'));
|
|
}
|
|
function toggleDrawer() {
|
|
document.getElementById('sidebar').classList.toggle('open');
|
|
document.getElementById('drawer-overlay').classList.toggle('open');
|
|
}
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
if (localStorage.getItem(SIDEBAR_KEY) === 'true') document.getElementById('sidebar').classList.add('collapsed');
|
|
});
|
|
document.addEventListener('keydown', e => { if (e.key === 'Escape') { document.getElementById('sidebar').classList.remove('open'); document.getElementById('drawer-overlay').classList.remove('open'); } });
|
|
</script>
|
|
@await RenderSectionAsync("Scripts", required: false)
|
|
</body>
|
|
</html>
|