fix: move s3 storages to separate view
This commit is contained in:
parent
9a9be466f7
commit
f952553c76
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Team\Storage;
|
||||
namespace App\Livewire\Storage;
|
||||
|
||||
use App\Models\S3Storage;
|
||||
use Livewire\Component;
|
||||
@ -65,7 +65,7 @@ public function submit()
|
||||
$this->storage->team_id = currentTeam()->id;
|
||||
$this->storage->testConnection();
|
||||
$this->storage->save();
|
||||
return redirect()->route('team.storage.show', $this->storage->uuid);
|
||||
return redirect()->route('storage.show', $this->storage->uuid);
|
||||
} catch (\Throwable $e) {
|
||||
$this->dispatch('error', 'Failed to create storage.', $e->getMessage());
|
||||
// return handleError($e, $this);
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Team\Storage;
|
||||
namespace App\Livewire\Storage;
|
||||
|
||||
use App\Models\S3Storage;
|
||||
use Livewire\Component;
|
||||
@ -43,7 +43,7 @@ public function delete()
|
||||
{
|
||||
try {
|
||||
$this->storage->delete();
|
||||
return redirect()->route('team.storage.index');
|
||||
return redirect()->route('storage.index');
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Team\Storage;
|
||||
namespace App\Livewire\Storage;
|
||||
|
||||
use App\Models\S3Storage;
|
||||
use Livewire\Component;
|
||||
@ -13,6 +13,6 @@ public function mount() {
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.team.storage.index');
|
||||
return view('livewire.storage.index');
|
||||
}
|
||||
}
|
22
app/Livewire/Storage/Show.php
Normal file
22
app/Livewire/Storage/Show.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Storage;
|
||||
|
||||
use App\Models\S3Storage;
|
||||
use Livewire\Component;
|
||||
|
||||
class Show extends Component
|
||||
{
|
||||
public $storage = null;
|
||||
public function mount()
|
||||
{
|
||||
$this->storage = S3Storage::ownedByCurrentTeam()->whereUuid(request()->storage_uuid)->first();
|
||||
if (!$this->storage) {
|
||||
abort(404);
|
||||
}
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.storage.show');
|
||||
}
|
||||
}
|
@ -17,6 +17,6 @@ public function mount()
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.team.storage.show');
|
||||
return view('livewire.storage.show');
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public function testConnection(bool $shouldSave = false)
|
||||
if ($this->unusable_email_sent === false && is_transactional_emails_active()) {
|
||||
$mail = new MailMessage();
|
||||
$mail->subject('Coolify: S3 Storage Connection Error');
|
||||
$mail->view('emails.s3-connection-error', ['name' => $this->name, 'reason' => $e->getMessage(), 'url' => route('team.storage.show', ['storage_uuid' => $this->uuid])]);
|
||||
$mail->view('emails.s3-connection-error', ['name' => $this->name, 'reason' => $e->getMessage(), 'url' => route('storage.show', ['storage_uuid' => $this->uuid])]);
|
||||
$users = collect([]);
|
||||
$members = $this->team->members()->get();
|
||||
foreach ($members as $user) {
|
||||
|
@ -156,6 +156,20 @@ class="{{ request()->is('destination*') ? 'menu-item-active menu-item' : 'menu-i
|
||||
Destinations
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a title="S3 Storages"
|
||||
class="{{ request()->is('storages*') ? 'menu-item-active menu-item' : 'menu-item' }}"
|
||||
href="{{ route('storage.index') }}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24">
|
||||
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
|
||||
<path d="M4 6a8 3 0 1 0 16 0A8 3 0 1 0 4 6"/>
|
||||
<path d="M4 6v6a8 3 0 0 0 16 0V6"/>
|
||||
<path d="M4 12v6a8 3 0 0 0 16 0v-6"/>
|
||||
</g>
|
||||
</svg>
|
||||
S3 Storages
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a title="Notifications"
|
||||
class="{{ request()->is('notifications*') ? 'menu-item-active menu-item' : 'menu-item' }}"
|
||||
|
@ -5,7 +5,7 @@
|
||||
<livewire:team.create/>
|
||||
</x-modal-input>
|
||||
</div>
|
||||
<div class="subtitle">Team settings & shared environment variables.</div>
|
||||
<div class="subtitle">Team wide configurations.</div>
|
||||
<nav class="navbar-main">
|
||||
<a class="{{ request()->routeIs('team.index') ? 'dark:text-white' : '' }}" href="{{ route('team.index') }}">
|
||||
<button>General</button>
|
||||
@ -14,10 +14,6 @@
|
||||
href="{{ route('team.member.index') }}">
|
||||
<button>Members</button>
|
||||
</a>
|
||||
<a class="{{ request()->routeIs('team.storage.index') ? 'dark:text-white' : '' }}"
|
||||
href="{{ route('team.storage.index') }}">
|
||||
<button>S3 Storages</button>
|
||||
</a>
|
||||
<a class="{{ request()->routeIs('team.shared-variables.index') ? 'dark:text-white' : '' }}"
|
||||
href="{{ route('team.shared-variables.index') }}">
|
||||
<button>Shared Variables</button>
|
||||
|
@ -2,12 +2,12 @@
|
||||
<form class="flex flex-col gap-2 pb-6" wire:submit='submit'>
|
||||
<div class="flex items-start gap-2">
|
||||
<div class="pb-4">
|
||||
<h2>Storage Details</h2>
|
||||
<div>{{ $storage->name }}</div>
|
||||
<h1>Storage Details</h1>
|
||||
<div class="subtitle">{{ $storage->name }}</div>
|
||||
@if ($storage->is_usable)
|
||||
<div> Usable </div>
|
||||
<div>Usable</div>
|
||||
@else
|
||||
<div class="text-red-500"> Not Usable </div>
|
||||
<div class="text-red-500">Not Usable</div>
|
||||
@endif
|
||||
</div>
|
||||
<x-forms.button type="submit">
|
@ -1,13 +1,11 @@
|
||||
<div>
|
||||
<x-team.navbar :team="auth()->user()->currentTeam()" />
|
||||
<div class="flex items-start gap-2">
|
||||
<h2 class="pb-4">S3 Storages</h2>
|
||||
<h1>S3 Storages</h1>
|
||||
<x-modal-input buttonTitle="+ Add" title="New S3 Storage">
|
||||
<livewire:team.storage.create />
|
||||
<livewire:storage.create />
|
||||
</x-modal-input>
|
||||
{{-- <a class="dark:text-white hover:no-underline" href="/team/storages/new"> <x-forms.button>+ Add
|
||||
</x-forms.button></a> --}}
|
||||
</div>
|
||||
<div class="subtitle">S3 storages for backups.</div>
|
||||
<div class="grid gap-2 lg:grid-cols-2">
|
||||
@forelse ($s3 as $storage)
|
||||
<div x-data x-on:click="goto('{{ $storage->uuid }}')" @class(['gap-2 border cursor-pointer box group border-transparent'])>
|
||||
@ -27,7 +25,7 @@
|
||||
</div>
|
||||
<script>
|
||||
function goto(uuid) {
|
||||
window.location.href = '/team/storages/' + uuid;
|
||||
window.location.href = '/storages/' + uuid;
|
||||
}
|
||||
</script>
|
||||
</div>
|
3
resources/views/livewire/storage/show.blade.php
Normal file
3
resources/views/livewire/storage/show.blade.php
Normal file
@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<livewire:storage.form :storage="$storage" />
|
||||
</div>
|
@ -1,6 +0,0 @@
|
||||
<div>
|
||||
<x-team.navbar :team="auth()
|
||||
->user()
|
||||
->currentTeam()" />
|
||||
<livewire:team.storage.form :storage="$storage" />
|
||||
</div>
|
@ -1,3 +0,0 @@
|
||||
<div>
|
||||
{{-- If you look to others for fulfillment, you will never truly be fulfilled. --}}
|
||||
</div>
|
@ -27,11 +27,11 @@
|
||||
use App\Livewire\Notifications\Discord as NotificationDiscord;
|
||||
|
||||
use App\Livewire\Team\Index as TeamIndex;
|
||||
|
||||
use App\Livewire\Team\Storage\Index as TeamStorageIndex;
|
||||
use App\Livewire\Team\Storage\Show as TeamStorageShow;
|
||||
use App\Livewire\Team\Member\Index as TeamMemberIndex;
|
||||
|
||||
use App\Livewire\Storage\Index as StorageIndex;
|
||||
use App\Livewire\Storage\Show as StorageShow;
|
||||
|
||||
use App\Livewire\CommandCenter\Index as CommandCenterIndex;
|
||||
use App\Livewire\ForcePasswordReset;
|
||||
use App\Livewire\Project\Index as ProjectIndex;
|
||||
@ -135,14 +135,12 @@
|
||||
Route::get('/telegram', NotificationTelegram::class)->name('notifications.telegram');
|
||||
Route::get('/discord', NotificationDiscord::class)->name('notifications.discord');
|
||||
});
|
||||
Route::get('/storages', StorageIndex::class)->name('storage.index');
|
||||
Route::get('/storages/{storage_uuid}', StorageShow::class)->name('storage.show');
|
||||
Route::prefix('team')->group(function () {
|
||||
Route::get('/', TeamIndex::class)->name('team.index');
|
||||
// Route::get('/new', TeamCreate::class)->name('team.create');
|
||||
Route::get('/members', TeamMemberIndex::class)->name('team.member.index');
|
||||
Route::get('/shared-variables', TeamSharedVariablesIndex::class)->name('team.shared-variables.index');
|
||||
Route::get('/storages', TeamStorageIndex::class)->name('team.storage.index');
|
||||
// Route::get('/storages/new', TeamStorageCreate::class)->name('team.storage.create');
|
||||
Route::get('/storages/{storage_uuid}', TeamStorageShow::class)->name('team.storage.show');
|
||||
});
|
||||
|
||||
Route::get('/command-center', CommandCenterIndex::class)->name('command-center');
|
||||
|
Loading…
Reference in New Issue
Block a user