Add admin dashboard route and view
This commit is contained in:
@@ -27,21 +27,17 @@
|
||||
<li title="Send us feedback or get help!" class="fixed top-0 right-0 p-2 px-4 pt-4 mt-auto text-xs">
|
||||
<div class="justify-center" wire:click="help" onclick="help.showModal()">
|
||||
<svg class="icon" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="currentColor" d="M140 180a12 12 0 1 1-12-12a12 12 0 0 1 12 12M128 72c-22.06 0-40 16.15-40 36v4a8 8 0 0 0 16 0v-4c0-11 10.77-20 24-20s24 9 24 20s-10.77 20-24 20a8 8 0 0 0-8 8v8a8 8 0 0 0 16 0v-.72c18.24-3.35 32-17.9 32-35.28c0-19.85-17.94-36-40-36m104 56A104 104 0 1 1 128 24a104.11 104.11 0 0 1 104 104m-16 0a88 88 0 1 0-88 88a88.1 88.1 0 0 0 88-88"/>
|
||||
<path fill="currentColor"
|
||||
d="M140 180a12 12 0 1 1-12-12a12 12 0 0 1 12 12M128 72c-22.06 0-40 16.15-40 36v4a8 8 0 0 0 16 0v-4c0-11 10.77-20 24-20s24 9 24 20s-10.77 20-24 20a8 8 0 0 0-8 8v8a8 8 0 0 0 16 0v-.72c18.24-3.35 32-17.9 32-35.28c0-19.85-17.94-36-40-36m104 56A104 104 0 1 1 128 24a104.11 104.11 0 0 1 104 104m-16 0a88 88 0 1 0-88 88a88.1 88.1 0 0 0 88-88" />
|
||||
</svg>
|
||||
</div>
|
||||
</li>
|
||||
<li class="pb-6" title="Logout">
|
||||
<form action="/logout" method="POST" class=" hover:bg-transparent">
|
||||
<form action="/logout" method="POST" class="hover:bg-transparent">
|
||||
@csrf
|
||||
<button class="flex items-center gap-2 rounded-none hover:text-white hover:bg-transparent">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5"
|
||||
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M13 12v.01" />
|
||||
<path d="M3 21h18" />
|
||||
<path d="M5 21v-16a2 2 0 0 1 2 -2h7.5m2.5 10.5v7.5" />
|
||||
<path d="M14 7h7m-3 -3l3 3l-3 3" />
|
||||
<svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2a9.985 9.985 0 0 1 8 4h-2.71a8 8 0 1 0 .001 12h2.71A9.985 9.985 0 0 1 12 22m7-6v-3h-8v-2h8V8l5 4z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -139,26 +139,19 @@
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<li title="Logout" class="hover:bg-coolgray-200">
|
||||
<form action="/logout" method="POST" class=" hover:bg-transparent">
|
||||
@csrf
|
||||
<button type="submit" class="rounded-none hover:text-white hover:bg-transparent">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M13 12v.01" />
|
||||
<path d="M3 21h18" />
|
||||
<path d="M5 21v-16a2 2 0 0 1 2 -2h7.5m2.5 10.5v7.5" />
|
||||
<path d="M14 7h7m-3 -3l3 3l-3 3" />
|
||||
</svg>
|
||||
</button>
|
||||
Logout
|
||||
</form>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</details>
|
||||
|
||||
@if (isCloud())
|
||||
<li title="Admin">
|
||||
<a class="hover:bg-transparent" href="/admin">
|
||||
<svg class="text-pink-600 icon" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="currentColor"
|
||||
d="M177.62 159.6a52 52 0 0 1-34 34a12.2 12.2 0 0 1-3.6.55a12 12 0 0 1-3.6-23.45a28 28 0 0 0 18.32-18.32a12 12 0 0 1 22.9 7.2ZM220 144a92 92 0 0 1-184 0c0-28.81 11.27-58.18 33.48-87.28a12 12 0 0 1 17.9-1.33l19.69 19.11L127 19.89a12 12 0 0 1 18.94-5.12C168.2 33.25 220 82.85 220 144m-24 0c0-41.71-30.61-78.39-52.52-99.29l-20.21 55.4a12 12 0 0 1-19.63 4.5L80.71 82.36C67 103.38 60 124.06 60 144a68 68 0 0 0 136 0" />
|
||||
</svg>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<div class="flex-1"></div>
|
||||
@if (isInstanceAdmin() && !isCloud())
|
||||
@persist('upgrade')
|
||||
@@ -178,7 +171,7 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li title="Send us feedback or get help!" class="pb-6 hover:bg-transparent">
|
||||
<li title="Send us feedback or get help!" class="hover:bg-transparent">
|
||||
<div class="justify-center" wire:click="help" onclick="help.showModal()">
|
||||
<svg class="icon" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="currentColor"
|
||||
@@ -186,7 +179,16 @@
|
||||
</svg>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<form action="/logout" method="POST" class="hover:bg-transparent">
|
||||
<li title="Logout" class="mb-6 hover:transparent">
|
||||
@csrf
|
||||
<button type="submit" class="rounded-none hover:text-white hover:bg-transparent">
|
||||
<svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill="currentColor" d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2a9.985 9.985 0 0 1 8 4h-2.71a8 8 0 1 0 .001 12h2.71A9.985 9.985 0 0 1 12 22m7-6v-3h-8v-2h8V8l5 4z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</li>
|
||||
</form>
|
||||
</ul>
|
||||
</nav>
|
||||
@endauth
|
||||
|
||||
17
resources/views/livewire/admin/index.blade.php
Normal file
17
resources/views/livewire/admin/index.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<div>
|
||||
<h1>Admin Dashboard</h1>
|
||||
<h3 class="pt-4">Who am I now?</h3>
|
||||
{{ auth()->user()->name }}
|
||||
<h3 class="pt-4">Users</h3>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<div class="w-96 box" wire:click="switchUser('0')">
|
||||
Root
|
||||
</div>
|
||||
@foreach ($users as $user)
|
||||
<div class="w-96 box" wire:click="switchUser('{{ $user->id }}')">
|
||||
<p>{{ $user->name }}</p>
|
||||
<p>{{ $user->email }}</p>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user