Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
christophrumpel committed Apr 3, 2024
1 parent 963fd2f commit 41d5975
Show file tree
Hide file tree
Showing 25 changed files with 439 additions and 437 deletions.
171 changes: 86 additions & 85 deletions composer.lock

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions resources/js/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import moment from 'moment'
window.moment = moment
import momentTimezone from 'moment-timezone'
window.moment = momentTimezone

window.moment = moment

window.moment = momentTimezone

import Alpine from 'alpinejs'
import trap from '@alpinejs/focus'
Alpine.plugin(trap)
Alpine.start()
window.Alpine = Alpine
241 changes: 121 additions & 120 deletions resources/views/api/api-token-manager.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,137 +38,138 @@
<x-slot name="actions">
<x-action-message class="mr-3" on="created">
{{ __('Created.') }}
</x-jet-action-message>
</x-action-message>

<x-button>
{{ __('Create') }}
</x-jet-button>
<x-button>
{{ __('Create') }}
</x-button>
</x-slot>
</x-jet-form-section>

@if ($this->user->tokens->isNotEmpty())
<x-section-border/>

<!-- Manage API Tokens -->
<div class="mt-10 sm:mt-0">
<x-action-section>
<x-slot name="title">
{{ __('Manage API Tokens') }}
</x-slot>

<x-slot name="description">
{{ __('You may delete any of your existing tokens if they are no longer needed.') }}
</x-slot>

<!-- API Token List -->
<x-slot name="content">
<div class="space-y-6">
@foreach ($this->user->tokens->sortBy('name') as $token)
<div class="flex items-center justify-between">
<div>
{{ $token->name }}
</div>

<div class="flex items-center">
@if ($token->last_used_at)
<div class="text-sm text-gray-400">
{{ __('Last used') }} {{ $token->last_used_at->diffForHumans() }}
</div>
@endif

@if (Laravel\Jetstream\Jetstream::hasPermissions())
<button class="cursor-pointer ml-6 text-sm text-gray-400 underline"
wire:click="manageApiTokenPermissions({{ $token->id }})">
{{ __('Permissions') }}
</button>
@endif

<button class="cursor-pointer ml-6 text-sm text-red-500"
wire:click="confirmApiTokenDeletion({{ $token->id }})">
{{ __('Delete') }}
</button>
</div>
</div>
@endforeach
</div>
</x-slot>
</x-jet-action-section>
</div>
@endif
</x-form-section>

<!-- Token Value Modal -->
<x-dialog-modal wire:model.live="displayingToken">
<x-slot name="title">
{{ __('API Token') }}
</x-slot>
@if ($this->user->tokens->isNotEmpty())
<x-section-border/>

<x-slot name="content">
<div>
{{ __('Please copy your new API token. For your security, it won\'t be shown again.') }}
</div>

<x-input x-ref="plaintextToken" type="text" readonly :value="$plainTextToken"
class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full"
autofocus autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
@showing-token-modal.window="setTimeout(() => $refs.plaintextToken.select(), 250)"
/>
</x-slot>

<x-slot name="footer">
<x-secondary-button wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
{{ __('Close') }}
</x-jet-secondary-button>
</x-slot>
</x-jet-dialog-modal>

<!-- API Token Permissions Modal -->
<x-dialog-modal wire:model.live="managingApiTokenPermissions">
<!-- Manage API Tokens -->
<div class="mt-10 sm:mt-0">
<x-action-section>
<x-slot name="title">
{{ __('API Token Permissions') }}
{{ __('Manage API Tokens') }}
</x-slot>

<x-slot name="description">
{{ __('You may delete any of your existing tokens if they are no longer needed.') }}
</x-slot>

<!-- API Token List -->
<x-slot name="content">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
<label class="flex items-center">
<x-checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
<span class="ml-2 text-sm text-gray-600">{{ $permission }}</span>
</label>
<div class="space-y-6">
@foreach ($this->user->tokens->sortBy('name') as $token)
<div class="flex items-center justify-between">
<div>
{{ $token->name }}
</div>

<div class="flex items-center">
@if ($token->last_used_at)
<div class="text-sm text-gray-400">
{{ __('Last used') }} {{ $token->last_used_at->diffForHumans() }}
</div>
@endif

@if (Laravel\Jetstream\Jetstream::hasPermissions())
<button class="cursor-pointer ml-6 text-sm text-gray-400 underline"
wire:click="manageApiTokenPermissions({{ $token->id }})">
{{ __('Permissions') }}
</button>
@endif

<button class="cursor-pointer ml-6 text-sm text-red-500"
wire:click="confirmApiTokenDeletion({{ $token->id }})">
{{ __('Delete') }}
</button>
</div>
</div>
@endforeach
</div>
</x-slot>
</x-action-section>
</div>
@endif

<x-slot name="footer">
<x-secondary-button wire:click="$set('managingApiTokenPermissions', false)"
wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>
<!-- Token Value Modal -->
<x-dialog-modal wire:model.live="displayingToken">
<x-slot name="title">
{{ __('API Token') }}
</x-slot>

<x-button class="ml-2" wire:click="updateApiToken" wire:loading.attr="disabled">
{{ __('Save') }}
</x-jet-button>
</x-slot>
</x-jet-dialog-modal>

<!-- Delete Token Confirmation Modal -->
<x-confirmation-modal wire:model.live="confirmingApiTokenDeletion">
<x-slot name="title">
{{ __('Delete API Token') }}
</x-slot>

<x-slot name="content">
{{ __('Are you sure you would like to delete this API token?') }}
</x-slot>

<x-slot name="footer">
<x-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')"
wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>

<x-danger-button class="ml-2" wire:click="deleteApiToken" wire:loading.attr="disabled">
{{ __('Delete') }}
</x-jet-danger-button>
</x-slot>
</x-jet-confirmation-modal>
<x-slot name="content">
<div>
{{ __('Please copy your new API token. For your security, it won\'t be shown again.') }}
</div>

<x-input x-ref="plaintextToken" type="text" readonly :value="$plainTextToken"
class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full"
autofocus autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
@showing-token-modal.window="setTimeout(() => $refs.plaintextToken.select(), 250)"
/>
</x-slot>

<x-slot name="footer">
<x-secondary-button wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
{{ __('Close') }}
</x-secondary-button>
</x-slot>
</x-dialog-modal>

<!-- API Token Permissions Modal -->
<x-dialog-modal wire:model.live="managingApiTokenPermissions">
<x-slot name="title">
{{ __('API Token Permissions') }}
</x-slot>

<x-slot name="content">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
<label class="flex items-center">
<x-checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
<span class="ml-2 text-sm text-gray-600">{{ $permission }}</span>
</label>
@endforeach
</div>
</x-slot>

<x-slot name="footer">
<x-secondary-button wire:click="$set('managingApiTokenPermissions', false)"
wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-secondary-button>

<x-button class="ml-2" wire:click="updateApiToken" wire:loading.attr="disabled">
{{ __('Save') }}
</x-button>
</x-slot>
</x-dialog-modal>

<!-- Delete Token Confirmation Modal -->
<x-confirmation-modal wire:model.live="confirmingApiTokenDeletion">
<x-slot name="title">
{{ __('Delete API Token') }}
</x-slot>

<x-slot name="content">
{{ __('Are you sure you would like to delete this API token?') }}
</x-slot>

<x-slot name="footer">
<x-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')"
wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-secondary-button>

<x-danger-button class="ml-2" wire:click="deleteApiToken"
wire:loading.attr="disabled">
{{ __('Delete') }}
</x-danger-button>
</x-slot>
</x-confirmation-modal>
</div>
4 changes: 2 additions & 2 deletions resources/views/auth/confirm-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<div class="flex justify-end mt-4">
<x-button class="ml-4">
{{ __('Confirm') }}
</x-jet-button>
</x-button>
</div>
</form>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
4 changes: 2 additions & 2 deletions resources/views/auth/forgot-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<div class="flex items-center justify-end mt-4">
<x-button>
{{ __('Email Password Reset Link') }}
</x-jet-button>
</x-button>
</div>
</form>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
4 changes: 2 additions & 2 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@

<x-button class="ml-4">
{{ __('Log in') }}
</x-jet-button>
</x-button>
</div>
</form>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
6 changes: 3 additions & 3 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
]) !!}
</div>
</div>
</x-jet-label>
</x-label>
</div>
@endif

Expand All @@ -56,8 +56,8 @@

<x-button class="ml-4">
{{ __('Register') }}
</x-jet-button>
</x-button>
</div>
</form>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
4 changes: 2 additions & 2 deletions resources/views/auth/reset-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
<div class="flex items-center justify-end mt-4">
<x-button>
{{ __('Reset Password') }}
</x-jet-button>
</x-button>
</div>
</form>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
4 changes: 2 additions & 2 deletions resources/views/auth/two-factor-challenge.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@

<x-button class="ml-4">
{{ __('Log in') }}
</x-jet-button>
</x-button>
</div>
</form>
</div>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
4 changes: 2 additions & 2 deletions resources/views/auth/verify-email.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div>
<x-button type="submit">
{{ __('Resend Verification Email') }}
</x-jet-button>
</x-button>
</div>
</form>

Expand All @@ -33,5 +33,5 @@
</button>
</form>
</div>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
10 changes: 5 additions & 5 deletions resources/views/components/action-section.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<x-jet-section-title>
<x-slot name="title">{{ $title }}</x-slot>
<x-slot name="description">{{ $description }}</x-slot>
</x-jet-section-title>
</x-section-title>

<div class="mt-5 md:mt-0 md:col-span-2">
<div class="px-4 py-5 sm:p-6 bg-white shadow sm:rounded-lg">
{{ $content }}
<div class="mt-5 md:mt-0 md:col-span-2">
<div class="px-4 py-5 sm:p-6 bg-white shadow sm:rounded-lg">
{{ $content }}
</div>
</div>
</div>
</div>
Loading

0 comments on commit 41d5975

Please sign in to comment.