Feat: more conformations and fixes

This commit is contained in:
ayntk-ai
2024-09-05 17:54:32 +02:00
parent 08df814408
commit fc3c69f687
12 changed files with 174 additions and 48 deletions

View File

@@ -15,6 +15,8 @@ use App\Models\StandaloneMysql;
use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
use Livewire\Component;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Auth;
class FileStorage extends Component
{
@@ -77,8 +79,13 @@ class FileStorage extends Component
}
}
public function delete()
public function delete($password)
{
if (!Hash::check($password, Auth::user()->password)) {
$this->addError('password', 'The provided password is incorrect.');
return;
}
try {
$message = 'File deleted.';
if ($this->fileStorage->is_directory) {
@@ -121,8 +128,15 @@ class FileStorage extends Component
$this->submit();
}
public function render()
public function render()
{
return view('livewire.project.service.file-storage');
return view('livewire.project.service.file-storage', [
'directoryDeletionCheckboxes' => [
['id' => 'permanently_delete', 'label' => 'The selected directory and all its contents will be permantely deleted form the server.'],
],
'fileDeletionCheckboxes' => [
['id' => 'permanently_delete', 'label' => 'The selected file will be permanently deleted form the server.'],
]
]);
}
}