Feat: confirm file storage
This commit is contained in:
		@@ -116,7 +116,10 @@ class Danger extends Component
 | 
				
			|||||||
                ['id' => 'delete_volumes', 'label' => 'All associated volumes with this resource will be permanently deleted'],
 | 
					                ['id' => 'delete_volumes', 'label' => 'All associated volumes with this resource will be permanently deleted'],
 | 
				
			||||||
                ['id' => 'delete_connected_networks', 'label' => 'All connected networks with this resource will be permanently deleted (predefined networks will not be deleted)'],
 | 
					                ['id' => 'delete_connected_networks', 'label' => 'All connected networks with this resource will be permanently deleted (predefined networks will not be deleted)'],
 | 
				
			||||||
                ['id' => 'delete_configurations', 'label' => 'All configuration files will be permanently deleted form the server'],
 | 
					                ['id' => 'delete_configurations', 'label' => 'All configuration files will be permanently deleted form the server'],
 | 
				
			||||||
                ['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images']
 | 
					                ['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images'],
 | 
				
			||||||
 | 
					                // ['id' => 'delete_associated_backups_locally', 'label' => 'All backups associated with this Ressource will be permanently deleted from local storage.'],
 | 
				
			||||||
 | 
					                // ['id' => 'delete_associated_backups_s3', 'label' => 'All backups associated with this Ressource will be permanently deleted from the selected S3 Storage.'],
 | 
				
			||||||
 | 
					                // ['id' => 'delete_associated_backups_sftp', 'label' => 'All backups associated with this Ressource will be permanently deleted from the selected SFTP Storage.']
 | 
				
			||||||
            ]
 | 
					            ]
 | 
				
			||||||
        ]);
 | 
					        ]);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,33 +13,57 @@
 | 
				
			|||||||
    <form wire:submit='submit' class="flex flex-col gap-2">
 | 
					    <form wire:submit='submit' class="flex flex-col gap-2">
 | 
				
			||||||
        <div class="flex gap-2">
 | 
					        <div class="flex gap-2">
 | 
				
			||||||
            @if ($fileStorage->is_directory)
 | 
					            @if ($fileStorage->is_directory)
 | 
				
			||||||
                <x-modal-confirmation action="convertToFile" buttonTitle="Convert to file">
 | 
					                <x-modal-confirmation
 | 
				
			||||||
                    <div>This will delete all files in this directory. It is not reversible. <strong
 | 
					                title="Confirm Directory Conversion to File?"
 | 
				
			||||||
                            class="text-error">Please think
 | 
					                buttonTitle="Convert to file"
 | 
				
			||||||
                            again.</strong><br><br></div>
 | 
					                submitAction="convertToFile"
 | 
				
			||||||
                </x-modal-confirmation>
 | 
					                :actions="['All files in this directory will be permanently deleted and an empty file will be created in its place.']"
 | 
				
			||||||
 | 
					                confirmationText="{{ $fs_path }}"
 | 
				
			||||||
 | 
					                confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
 | 
				
			||||||
 | 
					                shortConfirmationLabel="Filepath"
 | 
				
			||||||
 | 
					                :confirmWithPassword="false"
 | 
				
			||||||
 | 
					                step2ButtonText="Convert to file"
 | 
				
			||||||
 | 
					                />
 | 
				
			||||||
            @else
 | 
					            @else
 | 
				
			||||||
                <x-modal-confirmation action="convertToDirectory" buttonTitle="Convert to directory">
 | 
					                <x-modal-confirmation 
 | 
				
			||||||
                    <div>This will delete the file and make a directory instead. It is not reversible.
 | 
					                title="Confirm File Conversion to Directory?"
 | 
				
			||||||
                        <strong class="text-error">Please think
 | 
					                buttonTitle="Convert to directory"
 | 
				
			||||||
                            again.</strong><br><br>
 | 
					                submitAction="convertToDirectory"
 | 
				
			||||||
                    </div>
 | 
					                :actions="['The selected file will be permanently deleted and an empty directory will be created in its place.']"
 | 
				
			||||||
                </x-modal-confirmation>
 | 
					                confirmationText="{{ $fs_path }}"
 | 
				
			||||||
 | 
					                confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
 | 
				
			||||||
 | 
					                shortConfirmationLabel="Filepath"
 | 
				
			||||||
 | 
					                :confirmWithPassword="false"
 | 
				
			||||||
 | 
					                step2ButtonText="Convert to directory"
 | 
				
			||||||
 | 
					                />
 | 
				
			||||||
            @endif
 | 
					            @endif
 | 
				
			||||||
            <x-modal-confirmation isErrorButton buttonTitle="Delete">
 | 
					 | 
				
			||||||
                <div class="px-2">This storage will be deleted. It is not reversible. <strong
 | 
					 | 
				
			||||||
                        class="text-error">Please
 | 
					 | 
				
			||||||
                        think
 | 
					 | 
				
			||||||
                        again.</strong><br><br></div>
 | 
					 | 
				
			||||||
                <h4>Actions</h4>
 | 
					 | 
				
			||||||
            @if ($fileStorage->is_directory)
 | 
					            @if ($fileStorage->is_directory)
 | 
				
			||||||
                    <x-forms.checkbox id="permanently_delete"
 | 
					                <x-modal-confirmation 
 | 
				
			||||||
                        label="Permanently delete directory from the server?"></x-forms.checkbox>
 | 
					                    title="Confirm Directory Deletion?"
 | 
				
			||||||
 | 
					                    buttonTitle="Delete Directory"
 | 
				
			||||||
 | 
					                    isErrorButton
 | 
				
			||||||
 | 
					                    submitAction="delete"
 | 
				
			||||||
 | 
					                    :checkboxes="$directoryDeletionCheckboxes" 
 | 
				
			||||||
 | 
					                    :actions="['The selected directory and all its contents will be permanently deleted from the container.']"
 | 
				
			||||||
 | 
					                    confirmationText="{{ $fs_path }}"
 | 
				
			||||||
 | 
					                    confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
 | 
				
			||||||
 | 
					                    shortConfirmationLabel="Filepath"
 | 
				
			||||||
 | 
					                    step3ButtonText="Permanently Delete Directory"
 | 
				
			||||||
 | 
					                />
 | 
				
			||||||
            @else
 | 
					            @else
 | 
				
			||||||
                    <x-forms.checkbox id="permanently_delete"
 | 
					                <x-modal-confirmation 
 | 
				
			||||||
                        label="Permanently delete file from the server?"></x-forms.checkbox>
 | 
					                    title="Confirm File Deletion?"
 | 
				
			||||||
 | 
					                    buttonTitle="Delete File"
 | 
				
			||||||
 | 
					                    isErrorButton
 | 
				
			||||||
 | 
					                    submitAction="delete"
 | 
				
			||||||
 | 
					                    :checkboxes="$fileDeletionCheckboxes" 
 | 
				
			||||||
 | 
					                    :actions="['The selected file will be permanently deleted from the container.']"
 | 
				
			||||||
 | 
					                    confirmationText="{{ $fs_path }}"
 | 
				
			||||||
 | 
					                    confirmationLabel="Please confirm the execution of the actions by entering the Filepath below"
 | 
				
			||||||
 | 
					                    shortConfirmationLabel="Filepath"
 | 
				
			||||||
 | 
					                    step3ButtonText="Permanently Delete File"
 | 
				
			||||||
 | 
					                />
 | 
				
			||||||
            @endif
 | 
					            @endif
 | 
				
			||||||
            </x-modal-confirmation>
 | 
					 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        @if (!$fileStorage->is_directory)
 | 
					        @if (!$fileStorage->is_directory)
 | 
				
			||||||
            <x-forms.textarea label="Content" rows="20" id="fileStorage.content"></x-forms.textarea>
 | 
					            <x-forms.textarea label="Content" rows="20" id="fileStorage.content"></x-forms.textarea>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,7 +7,6 @@
 | 
				
			|||||||
        title="Confirm Resource Deletion?"
 | 
					        title="Confirm Resource Deletion?"
 | 
				
			||||||
        buttonTitle="Delete Resource"
 | 
					        buttonTitle="Delete Resource"
 | 
				
			||||||
        isErrorButton
 | 
					        isErrorButton
 | 
				
			||||||
        type="button" 
 | 
					 | 
				
			||||||
        submitAction="delete" 
 | 
					        submitAction="delete" 
 | 
				
			||||||
        buttonTitle="Delete Resource" 
 | 
					        buttonTitle="Delete Resource" 
 | 
				
			||||||
        :checkboxes="$checkboxes" 
 | 
					        :checkboxes="$checkboxes" 
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user