From 5625de925a4c418d4b63cdd950828b649ec56d5c Mon Sep 17 00:00:00 2001 From: Alexandre_BRAVO Date: Mon, 25 Nov 2024 18:23:00 +0100 Subject: [PATCH] ajout composant fileExistsDialog (non fonctionnel) --- src/components/FileExistsDialog.vue | 30 ++++++++++++++++++++++------- src/components/FileTable.vue | 7 +++++-- src/output.css | 8 ++++++++ 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/components/FileExistsDialog.vue b/src/components/FileExistsDialog.vue index cacacca..1cb629f 100644 --- a/src/components/FileExistsDialog.vue +++ b/src/components/FileExistsDialog.vue @@ -1,17 +1,17 @@ @@ -50,6 +62,8 @@ export default { return { displayRename: false, + displayOverwrite: false, + forAll: false, oldFileName, newFileName, extension, @@ -57,14 +71,17 @@ export default { }, methods: { onOverwrite() { - this.$emit('overwrite', {forAll : false}); + this.$emit('overwrite', {forAll : this.forAll}); }, onCancel() { this.$emit('cancel'); }, toggleRename() { this.displayRename = !this.displayRename; - }, + }, + toggleOverwrite(){ + this.displayOverwrite = !this.displayOverwrite; + }, save() { if(this.newFileName !== ''){ // Séparer le nom de fichier sans l'extension @@ -77,8 +94,7 @@ export default { this.newFileName = newFileNameWithOriginalExtension; } - this.$emit("rename", { initialFileName: this.initialFileName, newFileName: this.newFileName }); - this.onCancel(); + this.$emit("rename", { oldFileName: this.oldFileName, newFileName: this.newFileName }); } }, onInputChange() { diff --git a/src/components/FileTable.vue b/src/components/FileTable.vue index 14c4a85..4da6eed 100644 --- a/src/components/FileTable.vue +++ b/src/components/FileTable.vue @@ -120,7 +120,7 @@ - + @@ -192,7 +192,7 @@ export default { async fetchFiles() { try { const client = getClient(); - const directoryItems = await client.getDirectoryContents(this.root_path + this.current_dir); // Remplacez "admin" par le nom de l'utilisateur courant + const directoryItems = await client.getDirectoryContents(this.root_path + this.current_dir); this.files = directoryItems.map(file => ({ basename: file.basename, @@ -425,6 +425,9 @@ export default { closeEditDialog() { this.editDialogDisabled = true; }, + closeFileExistsDialog() { + this.fileExistDialogDisabled = true; + }, /** * Change le nom du fichier sur le serveur Cloud via un client WebDAV * @param names Contient un initialFileName et un newFileName diff --git a/src/output.css b/src/output.css index 7964bba..9457292 100644 --- a/src/output.css +++ b/src/output.css @@ -741,6 +741,14 @@ video { flex-direction: column; } +.content-center { + align-content: center; +} + +.content-evenly { + align-content: space-evenly; +} + .items-start { align-items: flex-start; }