Skip to content

Commit

Permalink
refactor: rename download zip name (mainsail-crew#1252)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou committed Feb 7, 2023
1 parent b748372 commit c225111
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/panels/GcodefilesPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
this.$socket.emit(
'server.files.zip',
{ items, dest: `gcodes/collection-${timestamp}.zip` },
{ items, dest: `config/gcodes-${timestamp}.zip` },
{ action: 'files/downloadZip', loading: 'gcodeDownloadZip' }
)
Expand Down
9 changes: 8 additions & 1 deletion src/components/panels/Machine/ConfigFilesPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,14 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
}
await addElementToItems(this.absolutePath, this.selectedFiles)
this.$socket.emit('server.files.zip', { items }, { action: 'files/downloadZip', loading: 'configDownloadZip' })
const date = new Date()
const timestamp = `${date.getFullYear()}${date.getMonth()}${date.getDay()}-${date.getHours()}${date.getMinutes()}${date.getSeconds()}`
this.$socket.emit(
'server.files.zip',
{ items, dest: `config/${this.root}-${timestamp}.zip` },
{ action: 'files/downloadZip', loading: 'configDownloadZip' }
)
this.selectedFiles = []
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/panels/Timelapse/TimelapseFilesPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
this.$socket.emit(
'server.files.zip',
{ items, dest: `timelapse/collection-${timestamp}.zip` },
{ items, dest: `timelapse/timelapse-${timestamp}.zip` },
{ action: 'files/downloadZip', loading: 'timelapseDownloadZip' }
)
Expand Down

0 comments on commit c225111

Please sign in to comment.