feat: Mejorar la selección de servidores y mostrar el nombre del servidor seleccionado en la navegación del dashboard

This commit is contained in:
Shni
2025-10-14 23:38:46 -05:00
parent edf2c995fa
commit 07c1aa7298
4 changed files with 28 additions and 59 deletions

View File

@@ -31,50 +31,7 @@
<%- body %>
</div>
<footer class="pixel-box mt-16 mx-4 mb-8">
<div class="max-w-6xl mx-auto">
<div class="text-center mb-8">
<h3 class="mb-4">Amayo Bot</h3>
<p class="text-sm pixel-text-dim">Sistema completo de juego, economía y gestión para Discord</p>
</div>
<div class="flex flex-wrap justify-center gap-4 mb-6 text-sm items-center">
<span class="pixel-leaf" style="width: 16px; height: 10px;"></span>
<a href="#primeros-pasos">Primeros Pasos</a>
<span>✦</span>
<a href="#comandos-basicos">Comandos</a>
<span>✦</span>
<a href="#minijuegos">Minijuegos</a>
<span>✦</span>
<a href="#faq">FAQ</a>
<span class="pixel-leaf" style="width: 16px; height: 10px; transform: rotate(20deg);"></span>
</div>
<div class="pixel-border p-4 mb-6" style="background: linear-gradient(135deg, var(--pixel-bg-dark) 0%, var(--pixel-bg-medium) 100%);">
<div class="flex items-center justify-center gap-4 text-sm" style="color: var(--text-secondary);">
<span class="pixel-pumpkin" style="width: 16px; height: 16px;"></span>
<span>VER <%= version %></span>
<span>•</span>
<span>DJS <%= djsVersion %></span>
<span>•</span>
<span><%= currentDateHuman %></span>
<span class="pixel-ghost" style="width: 16px; height: 20px;"></span>
</div>
</div>
<p class="text-center text-sm mb-6 flex items-center justify-center gap-3" style="color: var(--text-muted);">
<span class="pixel-star-halloween">✦</span>
<span>Amayo © <%= new Date().getFullYear() %> — Documentación para usuarios finales de Discord</span>
<span class="pixel-star-halloween">✦</span>
</p>
<div class="text-center">
<a class="pixel-btn-secondary pixel-btn inline-block" href="#primeros-pasos">
↑ Volver arriba
</a>
</div>
</div>
</footer>
<script src="/assets/js/main.js" type="module"></script>
<script src="/assets/js/code.js" defer></script>

View File

@@ -6,8 +6,9 @@
<div class="mt-4">
<label class="block text-xs text-slate-300 mb-2">Servidor</label>
<select id="guildSelector" class="w-full rounded-md p-3 bg-white/6 text-white focus:outline-none">
<option value="">Selecciona un servidor...</option>
<% if (guilds && guilds.length) { %>
<% guilds.forEach(g => { %>
<% guilds.sort((a,b)=> a.name.localeCompare(b.name)).forEach(g => { %>
<option value="<%= g.id %>"><%= g.name %> (<%= g.id %>)</option>
<% }) %>
<% } else { %>
@@ -15,18 +16,13 @@
<% } %>
</select>
</div>
<div class="mt-4 text-right">
<button id="goBtn" class="pixel-btn">Ir al servidor</button>
</div>
</div>
</div>
<script>
const sel = document.getElementById('guildSelector');
const btn = document.getElementById('goBtn');
btn?.addEventListener('click', () => {
const v = sel.value;
sel?.addEventListener('change', (e)=>{
const v = e.target.value;
if (v) window.location.href = `/dashboard/${v}/overview`;
});
</script>

View File

@@ -13,6 +13,10 @@
<img src="<%= user.avatar || '/assets/images/snap1.svg' %>" class="w-8 h-8 rounded-full" alt="avatar">
<span class="text-white"><%= user.username %></span>
</div>
<span class="text-sm text-white/70 px-3">|</span>
<% if (typeof selectedGuildName !== 'undefined' && selectedGuildName) { %>
<span class="text-white/80"> <%= selectedGuildName %> </span>
<% } %>
<a href="/auth/logout" class="text-sm text-white/70 px-3 py-2 rounded-md hover:bg-white/5">Salir</a>
<% } else { %>
<a href="/auth/discord" class="text-sm text-white/70 px-3 py-2 rounded-md hover:bg-white/5">Entrar</a>