From ace9f8ee50fcae392c6fbe9cfb3cc2e392880271 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Fri, 15 Aug 2025 22:56:07 -0600 Subject: [PATCH] feat: mejoras al dashboard y selector de UUID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dashboard: agregar opciones de 50 pestañas deterministas (lotes 1-4) - Dashboard: botón para cerrar salas individuales y expulsar jugadores - Dashboard: selector de variante G por sala individual en tabla - Nuevo selector moderno de UUID en página principal - Mostrar nombres de jugadores en selector de UUID - Búsqueda por UUID o nombre de jugador - Redireccionar /missing-uuid a selector principal - Endpoints para obtener UUIDs con nombres y cerrar/cambiar variante de salas --- client/src/components/RoomsTable.vue | 64 +++++ client/src/router/index.ts | 10 +- client/src/views/Dashboard.vue | 74 +++++- client/src/views/UuidSelector.vue | 381 +++++++++++++++++++++++++++ server/src/adminApi.ts | 64 +++++ 5 files changed, 581 insertions(+), 12 deletions(-) create mode 100644 client/src/views/UuidSelector.vue diff --git a/client/src/components/RoomsTable.vue b/client/src/components/RoomsTable.vue index dc6d296..61d4aad 100644 --- a/client/src/components/RoomsTable.vue +++ b/client/src/components/RoomsTable.vue @@ -96,6 +96,27 @@ > 📊 Details +
+ +
+ @@ -145,6 +166,8 @@ const props = defineProps<{ defineEmits<{ refresh: []; viewRoomModal: [roomId: string]; + closeRoom: [roomId: string]; + changeVariant: [roomId: string, variant: string]; }>(); function getRoomDetails(roomId: string) { @@ -243,6 +266,47 @@ function getReadableTextColor(hex?: string): string { transform: translateY(-1px); } +.btn-close { + background: #f44336; + color: white; + padding: 6px 12px; + font-size: 12px; + margin-left: 4px; +} + +.btn-close:hover { + background: #d32f2f; + transform: translateY(-1px); +} + +.variant-selector-container { + display: inline-block; + margin: 0 4px; +} + +.variant-select { + padding: 4px 8px; + border: 1px solid #ddd; + border-radius: 4px; + background: white; + font-size: 12px; + font-weight: 600; + color: #333; + cursor: pointer; + transition: all 0.2s; +} + +.variant-select:hover { + border-color: #9c27b0; + background: #f8f9fa; +} + +.variant-select:focus { + outline: none; + border-color: #9c27b0; + box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.2); +} + .no-rooms { text-align: center; padding: 40px; diff --git a/client/src/router/index.ts b/client/src/router/index.ts index a2c3646..d141b37 100644 --- a/client/src/router/index.ts +++ b/client/src/router/index.ts @@ -3,6 +3,7 @@ import Lobby from '../views/Lobby.vue'; import Game from '../views/Game.vue'; import Dashboard from '../views/Dashboard.vue'; import DemoGame from '../views/DemoGame.vue'; +import UuidSelector from '../views/UuidSelector.vue'; const router = createRouter({ history: createWebHistory(), @@ -29,14 +30,13 @@ const router = createRouter({ }, { path: '/', - redirect: '/missing-uuid' + name: 'UuidSelector', + component: UuidSelector }, { - // simple fallback for users hitting root without UUID + // Redirect old missing-uuid path to the new selector path: '/missing-uuid', - component: { - template: `

Falta UUID

Abre el juego escaneando tu código QR: snatchgame.nucleoriofrio.com/{uuid}

` - } + redirect: '/' } ] }); diff --git a/client/src/views/Dashboard.vue b/client/src/views/Dashboard.vue index cd003ef..9980b81 100644 --- a/client/src/views/Dashboard.vue +++ b/client/src/views/Dashboard.vue @@ -37,6 +37,10 @@ + + + +