diff --git a/src/components/panels/GcodefilesPanel.vue b/src/components/panels/GcodefilesPanel.vue index aae54289a..213761f31 100644 --- a/src/components/panels/GcodefilesPanel.vue +++ b/src/components/panels/GcodefilesPanel.vue @@ -361,6 +361,10 @@ {{ mdiRenameBox }} {{ $t('Files.Rename') }} + + {{ mdiContentCopy }} + {{ $t('Files.Duplicate') }} + {{ mdiDelete }} {{ $t('Files.Delete') }} @@ -432,6 +436,35 @@ + + + + + + + + + {{ $t('Files.Cancel') }} + + {{ $t('Files.Duplicate') }} + + + + { + this.$refs.inputFieldDuplicateFile?.focus() + }, 200) + } + + duplicateFileAction() { + this.dialogDuplicateFile.show = false + this.$socket.emit('server.files.copy', { + source: 'gcodes' + this.currentPath + '/' + this.dialogDuplicateFile.item.filename, + dest: 'gcodes' + this.currentPath + '/' + this.dialogDuplicateFile.newName, + }) + } + renameDirectory(item: FileStateGcodefile) { this.dialogRenameDirectory.item = item this.dialogRenameDirectory.newName = item.filename diff --git a/src/components/panels/Machine/ConfigFilesPanel.vue b/src/components/panels/Machine/ConfigFilesPanel.vue index 8c4cd1820..0476a2969 100644 --- a/src/components/panels/Machine/ConfigFilesPanel.vue +++ b/src/components/panels/Machine/ConfigFilesPanel.vue @@ -203,6 +203,10 @@ {{ mdiRenameBox }} {{ $t('Machine.ConfigFilesPanel.Rename') }} + + {{ mdiContentCopy }} + {{ $t('Machine.ConfigFilesPanel.Duplicate') }} + @@ -323,6 +327,37 @@ + + + + + + + + + + {{ $t('Machine.ConfigFilesPanel.Cancel') }} + + + {{ $t('Machine.ConfigFilesPanel.Duplicate') }} + + + + { + this.$refs.inputDialogDuplicateFileName?.focus() + }, 200) + } + + duplicateFileAction() { + this.dialogDuplicateFile.show = false + this.$socket.emit('server.files.copy', { + source: (this.absolutePath + '/' + this.dialogDuplicateFile.item.filename).slice(1), + dest: (this.absolutePath + '/' + this.dialogDuplicateFile.newName).slice(1), + }) + } + removeFile() { this.$socket.emit( 'server.files.delete_file', diff --git a/src/locales/en.json b/src/locales/en.json index 03eae8fae..8d463b752 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -180,6 +180,8 @@ "DeleteDirectoryQuestion": "Do you really want to delete the \"{name}\" directory with all its contents?", "DeleteSelectedQuestion": "Do you really want to delete {count} selected files?", "Download": "Download", + "Duplicate": "Duplicate", + "DuplicateFile": "Duplicate File", "EditFile": "Edit File", "Empty": "Empty", "ExtruderTemp": "Extruder Temp.", @@ -399,6 +401,8 @@ "DeleteDirectoryQuestion": "Delete directory \"{name}\" and all its contents?", "DeleteSelectedQuestion": "Delete {count} selected elements?", "Download": "Download", + "Duplicate": "Duplicate", + "DuplicateFile": "Duplicate File", "EditFile": "Edit file", "Empty": "Empty", "Files": "Files",