fix: navegar al detalle del tenant tras crearlo, fila clickeable en la lista

El único link a /tenants/:id era el nombre del tenant en texto plano sin
ningún indicio visual de que fuera clickeable — después de crear un tenant
no había forma obvia de llegar a configurarlo (base de conocimiento, tools,
canales). Ahora crear un tenant navega directo a su detalle, y toda la fila
de la lista es clickeable con un "Configurar →" explícito.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-08-11 22:28:21 -05:00
co-authored by Claude Sonnet 5
parent 98c68b0385
commit b2f6b518b6
5 changed files with 46 additions and 42 deletions
+17 -13
View File
@@ -1,7 +1,10 @@
<script setup> <script setup>
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { api } from '../lib/api.js' import { api } from '../lib/api.js'
const router = useRouter()
const tenants = ref([]) const tenants = ref([])
const aiConfigs = ref([]) const aiConfigs = ref([])
const loading = ref(true) const loading = ref(true)
@@ -69,11 +72,15 @@ async function guardar() {
try { try {
if (editing.value) { if (editing.value) {
await api.put(`/app/umind/tenants/${editing.value.ID}`, payload) await api.put(`/app/umind/tenants/${editing.value.ID}`, payload)
showForm.value = false
await cargar()
} else { } else {
await api.post('/app/umind/tenants', payload) const r = await api.post('/app/umind/tenants', payload)
showForm.value = false
// Ir directo a configurar el tenant recién creado en vez de dejarlo
// perdido en la lista — es lo primero que hay que hacer con él.
router.push(`/tenants/${r.id}`)
} }
showForm.value = false
await cargar()
} catch (e) { } catch (e) {
error.value = e.message error.value = e.message
} }
@@ -114,15 +121,11 @@ onMounted(cargar)
<div <div
v-for="t in tenants" v-for="t in tenants"
:key="t.ID" :key="t.ID"
class="p-4 flex items-center justify-between hover:bg-gray-50" class="p-4 flex items-center justify-between hover:bg-gray-50 cursor-pointer"
@click="router.push(`/tenants/${t.ID}`)"
> >
<div> <div>
<router-link <span class="font-medium text-gray-800">{{ t.nombre }}</span>
:to="`/tenants/${t.ID}`"
class="font-medium text-gray-800 hover:text-brand"
>
{{ t.nombre }}
</router-link>
<div class="text-xs text-gray-500 mt-0.5"> <div class="text-xs text-gray-500 mt-0.5">
{{ t.dominios_permitidos || 'sin dominios configurados' }} {{ t.dominios_permitidos || 'sin dominios configurados' }}
<span <span
@@ -133,9 +136,10 @@ onMounted(cargar)
</span> </span>
</div> </div>
</div> </div>
<div class="flex gap-3 text-sm"> <div class="flex items-center gap-3 text-sm">
<button class="text-gray-500 hover:text-gray-800" @click="editarTenant(t)">Editar</button> <span class="text-brand font-medium">Configurar &rarr;</span>
<button class="text-red-500 hover:text-red-700" @click="eliminar(t)">Eliminar</button> <button class="text-gray-500 hover:text-gray-800" @click.stop="editarTenant(t)">Editar</button>
<button class="text-red-500 hover:text-red-700" @click.stop="eliminar(t)">Eliminar</button>
</div> </div>
</div> </div>
</div> </div>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -4,8 +4,8 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>uMind — Orquestador</title> <title>uMind — Orquestador</title>
<script type="module" crossorigin src="/orchestrator/assets/index-1EuRm07B.js"></script> <script type="module" crossorigin src="/orchestrator/assets/index-DopCJrBT.js"></script>
<link rel="stylesheet" crossorigin href="/orchestrator/assets/index-CamCOnxy.css"> <link rel="stylesheet" crossorigin href="/orchestrator/assets/index-DniozBCm.css">
</head> </head>
<body class="bg-gray-50"> <body class="bg-gray-50">
<div id="app"></div> <div id="app"></div>