Add users, teams, authentication, profile/login/register/navbar views

This commit is contained in:
Andras Bacsai
2023-03-24 14:54:17 +01:00
parent 436d22e385
commit e47d493776
36 changed files with 1106 additions and 66 deletions

View File

@@ -0,0 +1,20 @@
<x-layout>
<div>
<form action="/login" method="POST">
@csrf
<input type="text" name="email" placeholder="email" @env('local') value="test@example.com" @endenv
autofocus />
<input type="password" name="password" placeho lder="Password" @env('local') value="password" @endenv />
<button type="submit">Login</button>
</form>
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</div>
</x-layout>

View File

@@ -0,0 +1,20 @@
<x-layout>
<form action="/register" method="POST">
@csrf
<input type="text" name="name" placeholder="name" @env('local') value="Andras Bacsai" @endenv />
<input type="text" name="email" placeholder="email" @env('local') value="andras@bacsai.com" @endenv />
<input type="password" name="password" placeholder="Password" @env('local') value="password" @endenv />
<input type="password" name="password_confirmation" placeholder="Password"
@env('local') value="password" @endenv />
<button type="submit">Register</button>
</form>
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</x-layout>

View File

@@ -1,3 +0,0 @@
<button wire:loading.remove {{ $attributes }} class="btn btn-primary rounded-none btn-xs no-animation"> {{ $slot }} </button>
<button wire:loading class="btn btn-disabled rounded-none btn-xs no-animation"> {{ $slot }}</button>

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" data-theme="light" class="h-full">
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
@@ -10,11 +10,9 @@
@livewireStyles
</head>
<body class="h-full">
@auth
<x-navbar />
@endauth
<main class="h-full pt-10 p-4">
<body>
<x-navbar />
<main>
{{ $slot }}
</main>

View File

@@ -1,15 +1,15 @@
<nav class="flex space-x-4 p-2 fixed right-0">
@env('local')
<a href="/run-command">Run command</a>
{{-- <livewire:create-token /> --}}
<a href="/debug">Debug</a>
<a href="/debug/logs" target="_blank">Debug Logs</a>
{{-- <a href="/debug/inertia">Debug(inertia)</a> --}}
@endenv
<a href="/">Dashboard</a>
<a href="/profile">Profile</a>
<form action="/logout" method="POST">
@csrf
<button type="submit">Logout</button>
</form>
<nav>
<a href="/">Home</a>
@guest
<a href="/login">Login</a>
<a href="/register">Register</a>
@endguest
@auth
<a href="/demo">Demo</a>
<a href="/profile">Profile</a>
<form action="/logout" method="POST">
@csrf
<button type="submit">Logout</button>
</form>
@endauth
</nav>

View File

@@ -1,5 +1,3 @@
<x-layout>
<livewire:run-command />
</x-layout>

View File

@@ -0,0 +1,10 @@
<x-layout>
<h1>
Coolify v4 🎉
</h1>
@guest
<p>
To see the demo, please <a href='/login'>login<a> or <a href='/register'>register<a>.
</p>
@endguest
</x-layout>

View File

@@ -1,7 +1,8 @@
<div>
<div>
<label for="command">
<input class="py-2 rounded ring-1" id="command" wire:model="command" type="text" />
<input autofocus class="py-2 rounded ring-1" id="command" wire:model="command" type="text"
wire:keydown.enter="runCommand" />
</label>
<button wire:click="runCommand">Run command</button>
@@ -20,8 +21,7 @@
<div>
Activity: <span>{{ $activity?->id ?? 'waiting' }}</span>
</div>
<pre style="width: 100%;overflow-y: scroll;"
@if ($isKeepAliveOn || $manualKeepAlive) wire:poll.750ms="polling" @endif>{{ data_get($activity, 'description') }}</pre>
<pre style="width: 100%;overflow-y: scroll;" @if ($isKeepAliveOn || $manualKeepAlive) wire:poll.750ms="polling" @endif>{{ data_get($activity, 'description') }}</pre>
<div>
<div>Details:</div>
<pre style="width: 100%;overflow-y: scroll;">{{ json_encode(data_get($activity, 'properties'), JSON_PRETTY_PRINT) }}</pre>

View File

@@ -0,0 +1,6 @@
<div>
@foreach (auth()->user()->otherTeams() as $team)
<button wire:key="{{ $team->id }}" wire:click="switch_to('{{ $team->id }}')">Switch to:
{{ $team->name }}</button>
@endforeach
</div>

View File

@@ -0,0 +1,17 @@
<x-layout>
<div>
<div>
<h3>User</h3>
<p>Name: {{ auth()->user()->name }}</p>
<p>Id: {{ auth()->user()->id }}</p>
<p>Uuid: {{ auth()->user()->uuid }}</p>
</div>
<div>
<h3>Current Team</h3>
<p>Name: {{ session('currentTeam')->name }}</p>
<p>Id: {{ session('currentTeam')->id }}</p>
<p>Uuid: {{ session('currentTeam')->uuid }}</p>
</div>
<livewire:switch-team>
</div>
</x-layout>

View File

@@ -1,22 +0,0 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ $title ?? 'Coolify' }}</title>
<meta name="csrf-token" content="{{ csrf_token() }}">
@vite(['resources/js/app.js', 'resources/css/app.css'])
</head>
<body class="antialiased">
<h1 class="text-3xl font-bold">
Coolify v4
</h1>
<p class="mt-4">
<a href="/demo"> See demo </a>
</p>
</body>
</html>