use muni-item-active for submenus for services and database

This commit is contained in:
Francesco Bruno 2024-05-05 16:41:15 +00:00
parent 91dbf1f01a
commit 61fdf4b6c7
2 changed files with 15 additions and 15 deletions

View File

@ -4,45 +4,45 @@
<livewire:project.database.heading :database="$database" /> <livewire:project.database.heading :database="$database" />
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }" class="flex h-full pt-6 sm:flex-row flex-col gap-8"> <div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }" class="flex h-full pt-6 sm:flex-row flex-col gap-8">
<div class="flex sm:flex-col gap-2 xl:w-48 overflow-x-scroll"> <div class="flex sm:flex-col gap-2 xl:w-48 overflow-x-scroll">
<a :class="activeTab === 'general' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'general' && 'menu-item-active'"
@click.prevent="activeTab = 'general'; @click.prevent="activeTab = 'general';
window.location.hash = 'general'" window.location.hash = 'general'"
href="#">General</a> href="#">General</a>
<a :class="activeTab === 'environment-variables' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'environment-variables' && 'menu-item-active'"
@click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'" @click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'"
href="#">Environment href="#">Environment
Variables</a> Variables</a>
<a :class="activeTab === 'servers' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'servers' && 'menu-item-active'"
@click.prevent="activeTab = 'servers'; @click.prevent="activeTab = 'servers';
window.location.hash = 'servers'" window.location.hash = 'servers'"
href="#">Servers href="#">Servers
</a> </a>
<a :class="activeTab === 'storages' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'storages' && 'menu-item-active'"
@click.prevent="activeTab = 'storages'; @click.prevent="activeTab = 'storages';
window.location.hash = 'storages'" window.location.hash = 'storages'"
href="#">Storages href="#">Storages
</a> </a>
<a :class="activeTab === 'import' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'import' && 'menu-item-active'"
@click.prevent="activeTab = 'import'; @click.prevent="activeTab = 'import';
window.location.hash = 'import'" href="#">Import window.location.hash = 'import'" href="#">Import
Backup Backup
</a> </a>
<a :class="activeTab === 'webhooks' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'webhooks' && 'menu-item-active'"
@click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks @click.prevent="activeTab = 'webhooks'; window.location.hash = 'webhooks'" href="#">Webhooks
</a> </a>
<a :class="activeTab === 'resource-limits' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'resource-limits' && 'menu-item-active'"
@click.prevent="activeTab = 'resource-limits'; @click.prevent="activeTab = 'resource-limits';
window.location.hash = 'resource-limits'" window.location.hash = 'resource-limits'"
href="#">Resource Limits href="#">Resource Limits
</a> </a>
<a :class="activeTab === 'resource-operations' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'resource-operations' && 'menu-item-active'"
@click.prevent="activeTab = 'resource-operations'; window.location.hash = 'resource-operations'" @click.prevent="activeTab = 'resource-operations'; window.location.hash = 'resource-operations'"
href="#">Resource Operations href="#">Resource Operations
</a> </a>
<a :class="activeTab === 'tags' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'tags' && 'menu-item-active'"
@click.prevent="activeTab = 'tags'; window.location.hash = 'tags'" href="#">Tags @click.prevent="activeTab = 'tags'; window.location.hash = 'tags'" href="#">Tags
</a> </a>
<a :class="activeTab === 'danger' && 'dark:text-white'" <a class="menu-item" :class="activeTab === 'danger' && 'menu-item-active'"
@click.prevent="activeTab = 'danger'; @click.prevent="activeTab = 'danger';
window.location.hash = 'danger'" window.location.hash = 'danger'"
href="#">Danger Zone href="#">Danger Zone

View File

@ -2,25 +2,25 @@
<livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" /> <livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" />
<div class="flex h-full pt-6 sm:flex-row flex-col gap-8"> <div class="flex h-full pt-6 sm:flex-row flex-col gap-8">
<div class="flex sm:flex-col gap-2 xl:w-48 overflow-x-scroll"> <div class="flex sm:flex-col gap-2 xl:w-48 overflow-x-scroll">
<a class="{{ request()->routeIs('project.service.configuration') ? 'dark:text-white' : '' }}" <a class="{{ request()->routeIs('project.service.configuration') ? 'menu-item-active' : '' }}"
href="{{ route('project.service.configuration', [...$parameters, 'stack_service_uuid' => null]) }}"> href="{{ route('project.service.configuration', [...$parameters, 'stack_service_uuid' => null]) }}">
<button><- Back</button> <button><- Back</button>
</a> </a>
<a :class="activeTab === 'general' && 'dark:text-white'" <a :class="activeTab === 'general' && 'menu-item-active'"
@click.prevent="activeTab = 'general'; window.location.hash = 'general'; if(window.location.search) window.location.search = ''" @click.prevent="activeTab = 'general'; window.location.hash = 'general'; if(window.location.search) window.location.search = ''"
href="#">General</a> href="#">General</a>
<a :class="activeTab === 'storages' && 'dark:text-white'" <a :class="activeTab === 'storages' && 'menu-item-active'"
@click.prevent="activeTab = 'storages'; window.location.hash = 'storages'; if(window.location.search) window.location.search = ''" @click.prevent="activeTab = 'storages'; window.location.hash = 'storages'; if(window.location.search) window.location.search = ''"
href="#">Storages href="#">Storages
</a> </a>
<a :class="activeTab === 'scheduled-tasks' && 'dark:text-white'" <a :class="activeTab === 'scheduled-tasks' && 'menu-item-active'"
@click.prevent="activeTab = 'scheduled-tasks'; window.location.hash = 'scheduled-tasks'" @click.prevent="activeTab = 'scheduled-tasks'; window.location.hash = 'scheduled-tasks'"
href="#">Scheduled Tasks href="#">Scheduled Tasks
</a> </a>
@if (str($serviceDatabase?->databaseType())->contains('mysql') || @if (str($serviceDatabase?->databaseType())->contains('mysql') ||
str($serviceDatabase?->databaseType())->contains('postgres') || str($serviceDatabase?->databaseType())->contains('postgres') ||
str($serviceDatabase?->databaseType())->contains('mariadb')) str($serviceDatabase?->databaseType())->contains('mariadb'))
<a :class="activeTab === 'backups' && 'dark:text-white'" <a :class="activeTab === 'backups' && 'menu-item-active'"
@click.prevent="activeTab = 'backups'; window.location.hash = 'backups'" href="#">Backups</a> @click.prevent="activeTab = 'backups'; window.location.hash = 'backups'" href="#">Backups</a>
@endif @endif
</div> </div>