feat: improve tab label retrieval in Proxmox layout for better navigation consistency across mobile and desktop views
This commit is contained in:
@@ -754,9 +754,27 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="flex gap-3">
|
<div class="flex gap-3">
|
||||||
|
@php
|
||||||
|
// Find the current tab label, checking both regular tabs and dropdown items
|
||||||
|
$currentLabel = 'Menu';
|
||||||
|
foreach ($tabs as $tab) {
|
||||||
|
if (isset($tab['view']) && $tab['view'] === $view) {
|
||||||
|
$currentLabel = $tab['label'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (isset($tab['dropdown']) && $tab['dropdown'] && isset($tab['items'])) {
|
||||||
|
foreach ($tab['items'] as $item) {
|
||||||
|
if ($item['view'] === $view) {
|
||||||
|
$currentLabel = $item['label'];
|
||||||
|
break 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
<button @click="open = !open"
|
<button @click="open = !open"
|
||||||
class="mobile-nav-button flex items-center gap-3 flex-1 justify-between font-semibold">
|
class="mobile-nav-button flex items-center gap-3 flex-1 justify-between font-semibold">
|
||||||
<span class="text-sm">{{ $tabs[array_search($view, array_column($tabs, 'view'))]['label'] ?? __('Menu') }}</span>
|
<span class="text-sm">{{ $currentLabel }}</span>
|
||||||
<x-ri-menu-line class="size-5" />
|
<x-ri-menu-line class="size-5" />
|
||||||
</button>
|
</button>
|
||||||
<div class="mobile-toggle-compact flex-shrink-0"
|
<div class="mobile-toggle-compact flex-shrink-0"
|
||||||
|
|||||||
Reference in New Issue
Block a user