Prepare modules

This commit is contained in:
2025-03-22 12:44:30 -06:00
parent 099267ee07
commit 7d8566350d
137 changed files with 3723 additions and 4325 deletions

View File

@ -2,10 +2,7 @@
namespace Koneko\VuexyAdmin\Services;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\{Auth,Cache,Route,Gate};
use Koneko\VuexyAdmin\Models\Setting;
class VuexyAdminService
@ -26,12 +23,8 @@ class VuexyAdminService
{
$this->user = Auth::user();
$this->vuexySearch = Auth::user() !== null;
$this->orientation = config('vuexy.custom.myLayout');
}
/**
* Obtiene el menú según el estado del usuario (autenticado o no).
*/
public function getMenu()
{
// Obtener el menú desde la caché
@ -45,9 +38,6 @@ class VuexyAdminService
return $this->markActive($menu, $currentRoute);
}
/**
* Menú para usuarios no autenticados.dump
*/
private function getGuestMenu()
{
return Cache::remember('vuexy_menu_guest', now()->addDays(7), function () {
@ -55,12 +45,9 @@ class VuexyAdminService
});
}
/**
* Menú para usuarios autenticados.
*/
private function getUserMenu()
{
Cache::forget("vuexy_menu_user_{$this->user->id}"); // Borrar la caché anterior para actualizarla
//Cache::forget("vuexy_menu_user_{$this->user->id}"); // Borrar la caché anterior para actualizarla
return Cache::remember("vuexy_menu_user_{$this->user->id}", now()->addHours(24), function () {
return $this->getMenuArray();
@ -89,9 +76,6 @@ class VuexyAdminService
return $menu;
}
/**
* Invalida el cache del menú de un usuario.
*/
public static function clearUserMenuCache()
{
$user = Auth::user();
@ -100,9 +84,6 @@ class VuexyAdminService
Cache::forget("vuexy_menu_user_{$user->id}");
}
/**
* Invalida el cache del menú de invitados.
*/
public static function clearGuestMenuCache()
{
Cache::forget('vuexy_menu_guest');
@ -224,7 +205,7 @@ class VuexyAdminService
return $quickLinksData;
}
private function collectQuickLinksFromMenu(array $menu, array &$quickLinks, string $parentTitle = null)
private function collectQuickLinksFromMenu(array $menu, array &$quickLinks, mixed $parentTitle = null)
{
foreach ($menu as $title => $item) {
// Verificar si el elemento está en la lista de quicklinksRouteNames
@ -249,9 +230,6 @@ class VuexyAdminService
}
}
/**
* Verifica si la ruta actual existe en la lista de enlaces.
*/
private function isCurrentPageInList(array $quickLinks, string $currentRoute): bool
{
foreach ($quickLinks['rows'] as $row) {
@ -291,193 +269,8 @@ class VuexyAdminService
<a class='nav-link btn btn-text-secondary btn-icon rounded-pill dropdown-toggle hide-arrow' href='javascript:void(0);' data-bs-toggle='dropdown' data-bs-auto-close='outside' aria-expanded='false'>
<span class='position-relative'>
<i class='ti ti-bell ti-md'></i>
<span class='badge rounded-pill bg-danger badge-dot badge-notifications border'></span>
</span>
</a>
<ul class='dropdown-menu dropdown-menu-end p-0'>
<li class='dropdown-menu-header border-bottom'>
<div class='dropdown-header d-flex align-items-center py-3'>
<h6 class='mb-0 me-auto'>Notification</h6>
<div class='d-flex align-items-center h6 mb-0'>
<span class='badge bg-label-primary me-2'>8 New</span>
<a href='javascript:void(0)' class='btn btn-text-secondary rounded-pill btn-icon dropdown-notifications-all' data-bs-toggle='tooltip' data-bs-placement='top' title='Mark all as read'><i class='ti ti-mail-opened text-heading'></i></a>
</div>
</div>
</li>
<li class='dropdown-notifications-list scrollable-container'>
<ul class='list-group list-group-flush'>
<li class='list-group-item list-group-item-action dropdown-notifications-item'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<img src='' . asset('assets/admin/img/avatars/1.png') . '' alt class='rounded-circle'>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='small mb-1'>Congratulation Lettie 🎉</h6>
<small class='mb-1 d-block text-body'>Won the monthly best seller gold badge</small>
<small class='text-muted'>1h ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
<li class='list-group-item list-group-item-action dropdown-notifications-item'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<span class='avatar-initial rounded-circle bg-label-danger'>CF</span>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='mb-1 small'>Charles Franklin</h6>
<small class='mb-1 d-block text-body'>Accepted your connection</small>
<small class='text-muted'>12hr ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
<li class='list-group-item list-group-item-action dropdown-notifications-item marked-as-read'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<img src='' . asset('assets/admin/img/avatars/2.png') . '' alt class='rounded-circle'>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='mb-1 small'>New Message ✉️</h6>
<small class='mb-1 d-block text-body'>You have new message from Natalie</small>
<small class='text-muted'>1h ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
<li class='list-group-item list-group-item-action dropdown-notifications-item'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<span class='avatar-initial rounded-circle bg-label-success'><i class='ti ti-shopping-cart'></i></span>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='mb-1 small'>Whoo! You have new order 🛒 </h6>
<small class='mb-1 d-block text-body'>ACME Inc. made new order $1,154</small>
<small class='text-muted'>1 day ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
<li class='list-group-item list-group-item-action dropdown-notifications-item marked-as-read'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<img src='' . asset('assets/admin/img/avatars/9.png') . '' alt class='rounded-circle'>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='mb-1 small'>Application has been approved 🚀 </h6>
<small class='mb-1 d-block text-body'>Your ABC project application has been approved.</small>
<small class='text-muted'>2 days ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
<li class='list-group-item list-group-item-action dropdown-notifications-item marked-as-read'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<span class='avatar-initial rounded-circle bg-label-success'><i class='ti ti-chart-pie'></i></span>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='mb-1 small'>Monthly report is generated</h6>
<small class='mb-1 d-block text-body'>July monthly financial report is generated </small>
<small class='text-muted'>3 days ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
<li class='list-group-item list-group-item-action dropdown-notifications-item marked-as-read'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<img src='' . asset('assets/admin/img/avatars/5.png') . '' alt class='rounded-circle'>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='mb-1 small'>Send connection request</h6>
<small class='mb-1 d-block text-body'>Peter sent you connection request</small>
<small class='text-muted'>4 days ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
<li class='list-group-item list-group-item-action dropdown-notifications-item'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<img src='' . asset('assets/admin/img/avatars/6.png') . '' alt class='rounded-circle'>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='mb-1 small'>New message from Jane</h6>
<small class='mb-1 d-block text-body'>Your have new message from Jane</small>
<small class='text-muted'>5 days ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
<li class='list-group-item list-group-item-action dropdown-notifications-item marked-as-read'>
<div class='d-flex'>
<div class='flex-shrink-0 me-3'>
<div class='avatar'>
<span class='avatar-initial rounded-circle bg-label-warning'><i class='ti ti-alert-triangle'></i></span>
</div>
</div>
<div class='flex-grow-1'>
<h6 class='mb-1 small'>CPU is running high</h6>
<small class='mb-1 d-block text-body'>CPU Utilization Percent is currently at 88.63%,</small>
<small class='text-muted'>5 days ago</small>
</div>
<div class='flex-shrink-0 dropdown-notifications-actions'>
<a href='javascript:void(0)' class='dropdown-notifications-read'><span class='badge badge-dot'></span></a>
<a href='javascript:void(0)' class='dropdown-notifications-archive'><span class='ti ti-x'></span></a>
</div>
</div>
</li>
</ul>
</li>
<li class='border-top'>
<div class='d-grid p-4'>
<a class='btn btn-primary btn-sm d-flex' href='javascript:void(0);'>
<small class='align-middle'>View all notifications</small>
</a>
</div>
</li>
</ul>
</li>";
}