Fix: Force add super-admin views to git
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m52s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m52s
The resources/views directory is ignored by .gitignore, so the custom super-admin views were not being tracked or deployed, causing 'View [super-admin.session.login] not found' errors in production. This commit forces them to be tracked.
This commit is contained in:
101
resources/views/super-admin/layouts/header.blade.php
Normal file
101
resources/views/super-admin/layouts/header.blade.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<header class="sticky top-0 z-[10001] flex items-center justify-between gap-1 border-b border-gray-200 bg-white px-4 py-2.5 transition-all dark:border-gray-800 dark:bg-gray-900">
|
||||
<div class="flex items-center gap-1.5">
|
||||
<a href="{{ route('super-admin.tenants.index') }}">
|
||||
<img class="h-7 max-sm:hidden" src="{{ request()->cookie('dark_mode') ? vite()->asset('images/dark-logo.svg') : vite()->asset('images/logo.svg') }}" id="logo-image" alt="Growup Pro" />
|
||||
<img class="h-7 sm:hidden" src="{{ request()->cookie('dark_mode') ? vite()->asset('images/mobile-dark-logo.svg') : vite()->asset('images/mobile-light-logo.svg') }}" id="logo-image-mobile" alt="Growup Pro" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2.5">
|
||||
<!-- Dark mode -->
|
||||
<v-dark>
|
||||
<div class="flex">
|
||||
<span class="{{ request()->cookie('dark_mode') ? 'icon-light' : 'icon-dark' }} p-1.5 rounded-md text-2xl cursor-pointer transition-all hover:bg-gray-100 dark:hover:bg-gray-950"></span>
|
||||
</div>
|
||||
</v-dark>
|
||||
|
||||
<!-- Admin profile -->
|
||||
<x-admin::dropdown position="bottom-right">
|
||||
<x-slot:toggle>
|
||||
@php($user = auth()->user())
|
||||
|
||||
@if ($user && $user->image)
|
||||
<button class="flex h-9 w-9 cursor-pointer overflow-hidden rounded-full hover:opacity-80 focus:opacity-80">
|
||||
<img src="{{ $user->image_url }}" class="h-full w-full object-cover" />
|
||||
</button>
|
||||
@else
|
||||
<button class="flex h-9 w-9 cursor-pointer items-center justify-center rounded-full bg-pink-400 font-semibold leading-6 text-white">
|
||||
{{ substr($user->name ?? 'S', 0, 1) }}
|
||||
</button>
|
||||
@endif
|
||||
</x-slot>
|
||||
|
||||
<x-slot:content class="mt-2 border-t-0 !p-0">
|
||||
<div class="flex items-center gap-1.5 border border-x-0 border-b-gray-300 px-5 py-2.5 dark:border-gray-800">
|
||||
<img src="{{ asset('favicon.ico') }}" width="24" height="24" class="object-contain" />
|
||||
<p class="text-gray-400">
|
||||
Versão {{ core()->version() }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-1 pb-2.5 pt-1">
|
||||
<a class="cursor-pointer px-5 py-2 text-base text-gray-800 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-950" href="{{ route('admin.user.account.edit') }}">
|
||||
Minha Conta
|
||||
</a>
|
||||
|
||||
<!--Admin logout-->
|
||||
<x-admin::form method="DELETE" action="{{ route('super-admin.session.destroy') }}" id="adminLogout"></x-admin::form>
|
||||
|
||||
<a class="cursor-pointer px-5 py-2 text-base text-gray-800 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-950" href="#" onclick="event.preventDefault(); document.getElementById('adminLogout').submit();">
|
||||
Sair
|
||||
</a>
|
||||
</div>
|
||||
</x-slot>
|
||||
</x-admin::dropdown>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@pushOnce('scripts')
|
||||
<script type="text/x-template" id="v-dark-template">
|
||||
<div class="flex">
|
||||
<span class="cursor-pointer rounded-md p-1.5 text-2xl transition-all hover:bg-gray-100 dark:hover:bg-gray-950" :class="[isDarkMode ? 'icon-light' : 'icon-dark']" @click="toggle"></span>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
app.component('v-dark', {
|
||||
template: '#v-dark-template',
|
||||
data() {
|
||||
return {
|
||||
isDarkMode: {{ request()->cookie('dark_mode') ?? 0 }},
|
||||
logo: "{{ vite()->asset('images/logo.svg') }}",
|
||||
dark_logo: "{{ vite()->asset('images/dark-logo.svg') }}",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
toggle() {
|
||||
this.isDarkMode = parseInt(this.isDarkModeCookie()) ? 0 : 1;
|
||||
var expiryDate = new Date();
|
||||
expiryDate.setMonth(expiryDate.getMonth() + 1);
|
||||
document.cookie = 'dark_mode=' + this.isDarkMode + '; path=/; expires=' + expiryDate.toGMTString();
|
||||
document.documentElement.classList.toggle('dark', this.isDarkMode === 1);
|
||||
if (this.isDarkMode) {
|
||||
this.$emitter.emit('change-theme', 'dark');
|
||||
if(document.getElementById('logo-image')) document.getElementById('logo-image').src = this.dark_logo;
|
||||
} else {
|
||||
this.$emitter.emit('change-theme', 'light');
|
||||
if(document.getElementById('logo-image')) document.getElementById('logo-image').src = this.logo;
|
||||
}
|
||||
},
|
||||
isDarkModeCookie() {
|
||||
const cookies = document.cookie.split(';');
|
||||
for (const cookie of cookies) {
|
||||
const [name, value] = cookie.trim().split('=');
|
||||
if (name === 'dark_mode') return value;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@endPushOnce
|
||||
Reference in New Issue
Block a user