diff --git a/README.md b/README.md index 31d2ece..6da1145 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Read this in other languages: [Español](READMEes.md), [Português](READMEpt.md) - Upload/Rename/Download/Delete files - Right click in file for extra options - Multipart upload for big files +- File editing ## Getting Started @@ -66,6 +67,7 @@ wrangler publish - Object detection on images using workers-ai ? - Tooltip when hovering a file with absolute time in "x days time ago" format - support for responding to emails +- More advanced file editing with more validations per file type ## Known issues diff --git a/packages/dashboard/src/components/preview/FilePreview.vue b/packages/dashboard/src/components/preview/FilePreview.vue index ec6b8e2..8cea8a0 100644 --- a/packages/dashboard/src/components/preview/FilePreview.vue +++ b/packages/dashboard/src/components/preview/FilePreview.vue @@ -231,7 +231,6 @@ export default { } }, async openFile(file) { - console.log(file) if (bytesToMegabytes(file.size) > 200) { this.q.notify({ message: "File is too big to preview.", @@ -359,7 +358,11 @@ export default { // Edit functions enableEdit: function() { - this.fileDataEdited = this.fileData; + if (typeof this.fileData === 'object') { + this.fileDataEdited = JSON.stringify(this.fileData, null, 2) + } else { + this.fileDataEdited = this.fileData; + } this.editMode = true; }, cancelEdit: function() { @@ -416,8 +419,8 @@ export default { timeout: 5000 // we will timeout it in 5s }) - this.fileData = this.fileDataEdited this.cancelEdit() + this.openFile(this.file) } }, computed: {