Fix styling

This commit is contained in:
Thijmen
2024-06-10 20:43:34 +00:00
committed by github-actions[bot]
parent 41fb6a1fc9
commit d86274cc37
429 changed files with 5307 additions and 2831 deletions

View File

@@ -8,13 +8,21 @@ use Livewire\Component;
class Create extends Component
{
public string $name;
public string $description;
public string $region = 'us-east-1';
public string $key;
public string $secret;
public string $bucket;
public string $endpoint;
public S3Storage $storage;
protected $rules = [
'name' => 'required|min:3|max:255',
'description' => 'nullable|min:3|max:255',
@@ -24,12 +32,13 @@ class Create extends Component
'bucket' => 'required|max:255',
'endpoint' => 'required|url|max:255',
];
protected $validationAttributes = [
'name' => 'Name',
'description' => 'Description',
'region' => 'Region',
'key' => 'Key',
'secret' => "Secret",
'secret' => 'Secret',
'bucket' => 'Bucket',
'endpoint' => 'Endpoint',
];
@@ -65,6 +74,7 @@ class Create extends Component
$this->storage->team_id = currentTeam()->id;
$this->storage->testConnection();
$this->storage->save();
return redirect()->route('storage.show', $this->storage->uuid);
} catch (\Throwable $e) {
$this->dispatch('error', 'Failed to create storage.', $e->getMessage());

View File

@@ -8,6 +8,7 @@ use Livewire\Component;
class Form extends Component
{
public S3Storage $storage;
protected $rules = [
'storage.is_usable' => 'nullable|boolean',
'storage.name' => 'nullable|min:3|max:255',
@@ -18,13 +19,14 @@ class Form extends Component
'storage.bucket' => 'required|max:255',
'storage.endpoint' => 'required|url|max:255',
];
protected $validationAttributes = [
'storage.is_usable' => 'Is Usable',
'storage.name' => 'Name',
'storage.description' => 'Description',
'storage.region' => 'Region',
'storage.key' => 'Key',
'storage.secret' => "Secret",
'storage.secret' => 'Secret',
'storage.bucket' => 'Bucket',
'storage.endpoint' => 'Endpoint',
];
@@ -33,6 +35,7 @@ class Form extends Component
{
try {
$this->storage->testConnection(shouldSave: true);
return $this->dispatch('success', 'Connection is working.', 'Tested with "ListObjectsV2" action.');
} catch (\Throwable $e) {
$this->dispatch('error', 'Failed to create storage.', $e->getMessage());
@@ -43,6 +46,7 @@ class Form extends Component
{
try {
$this->storage->delete();
return redirect()->route('storage.index');
} catch (\Throwable $e) {
return handleError($e, $this);

View File

@@ -8,9 +8,12 @@ use Livewire\Component;
class Index extends Component
{
public $s3;
public function mount() {
public function mount()
{
$this->s3 = S3Storage::ownedByCurrentTeam()->get();
}
public function render()
{
return view('livewire.storage.index');

View File

@@ -8,13 +8,15 @@ 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) {
if (! $this->storage) {
abort(404);
}
}
public function render()
{
return view('livewire.storage.show');