Merge: integrar cambios del trabajo con chat en tiempo real

This commit is contained in:
2026-04-28 16:30:01 -06:00
parent 47d29b7f13
commit b469b884f5
10 changed files with 402 additions and 384 deletions
@@ -1,98 +1,99 @@
<x-action-section>
<x-slot name="title">
{{ __('Browser Sessions') }}
</x-slot>
<div x-data="{
init() {
Livewire.on('confirming-logout-other-browser-sessions', () => {
$('#sesionesModal').modal('show');
});
}
}">
<x-action-section>
<x-slot name="title"></x-slot>
<x-slot name="description"></x-slot>
<x-slot name="description">
{{ __('Manage and log out your active sessions on other browsers and devices.') }}
</x-slot>
<x-slot name="content">
<x-slot name="content">
<div class="max-w-xl text-sm text-gray-600">
{{ __('If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.') }}
</div>
<p class="text-muted small mb-4">
Si es necesario, puedes cerrar sesión en todos los demás dispositivos. Si crees que tu cuenta fue comprometida, también deberías actualizar tu contraseña.
</p>
@if (count($this->sessions) > 0)
<div class="mt-5 space-y-6">
<!-- Other Browser Sessions -->
@foreach ($this->sessions as $session)
<div class="flex items-center">
<div>
@if ($session->agent->isDesktop())
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-8 text-gray-500">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25" />
</svg>
@else
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-8 text-gray-500">
<path stroke-linecap="round" stroke-linejoin="round" d="M10.5 1.5H8.25A2.25 2.25 0 006 3.75v16.5a2.25 2.25 0 002.25 2.25h7.5A2.25 2.25 0 0018 20.25V3.75a2.25 2.25 0 00-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3" />
</svg>
@endif
</div>
<div class="ms-3">
<div class="text-sm text-gray-600">
{{ $session->agent->platform() ? $session->agent->platform() : __('Unknown') }} - {{ $session->agent->browser() ? $session->agent->browser() : __('Unknown') }}
@if (count($this->sessions) > 0)
<div class="mb-4">
@foreach ($this->sessions as $session)
<div class="d-flex align-items-center mb-3">
<div class="mr-3 text-secondary">
@if ($session->agent->isDesktop())
<i class="fas fa-desktop fa-2x"></i>
@else
<i class="fas fa-mobile-alt fa-2x"></i>
@endif
</div>
<div>
<div class="text-xs text-gray-500">
<div class="font-weight-bold small">
{{ $session->agent->platform() ?: 'Desconocido' }}
{{ $session->agent->browser() ?: 'Desconocido' }}
</div>
<div class="text-muted small">
{{ $session->ip_address }},
@if ($session->is_current_device)
<span class="text-green-500 font-semibold">{{ __('This device') }}</span>
<span class="text-success font-weight-bold">Este dispositivo</span>
@else
{{ __('Last active') }} {{ $session->last_active }}
Última actividad: {{ $session->last_active }}
@endif
</div>
</div>
</div>
</div>
@endforeach
</div>
@endif
@endforeach
</div>
@endif
<div class="flex items-center mt-5">
<x-button wire:click="confirmLogout" wire:loading.attr="disabled">
{{ __('Log Out Other Browser Sessions') }}
</x-button>
<button class="btn btn-danger"
wire:click="confirmLogout"
wire:loading.attr="disabled">
<span wire:loading class="spinner-border spinner-border-sm mr-1" role="status"></span>
<i class="fas fa-sign-out-alt mr-1"></i>
Cerrar otras sesiones
</button>
<x-action-message class="ms-3" on="loggedOut">
{{ __('Done.') }}
</x-action-message>
</div>
<!-- Log Out Other Devices Confirmation Modal -->
<x-dialog-modal wire:model.live="confirmingLogout">
<x-slot name="title">
{{ __('Log Out Other Browser Sessions') }}
</x-slot>
<x-slot name="content">
{{ __('Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices.') }}
<div class="mt-4" x-data="{}" x-on:confirming-logout-other-browser-sessions.window="setTimeout(() => $refs.password.focus(), 250)">
<x-input type="password" class="mt-1 block w-3/4"
autocomplete="current-password"
placeholder="{{ __('Password') }}"
x-ref="password"
wire:model="password"
wire:keydown.enter="logoutOtherBrowserSessions" />
</x-slot>
</x-action-section>
<!-- Modal Bootstrap -->
<div class="modal fade" id="sesionesModal" tabindex="-1" role="dialog"
wire:ignore>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Cerrar otras sesiones</h5>
<button type="button" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<p class="text-muted small mb-3">
Ingresa tu contraseña para confirmar que deseas cerrar sesión en los demás dispositivos.
</p>
<input type="password"
class="form-control"
placeholder="Contraseña"
autocomplete="current-password"
wire:model="password"
wire:keydown.enter="logoutOtherBrowserSessions" />
<x-input-error for="password" class="mt-2" />
</div>
</x-slot>
<x-slot name="footer">
<x-secondary-button wire:click="$toggle('confirmingLogout')" wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-secondary-button>
<x-button class="ms-3"
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-dismiss="modal">
Cancelar
</button>
<button type="button" class="btn btn-danger"
wire:click="logoutOtherBrowserSessions"
wire:loading.attr="disabled">
{{ __('Log Out Other Browser Sessions') }}
</x-button>
</x-slot>
</x-dialog-modal>
</x-slot>
</x-action-section>
<span wire:loading class="spinner-border spinner-border-sm mr-1" role="status"></span>
Confirmar
</button>
</div>
</div>
</div>
</div>
</div>