diff --git a/nezha-fronted/src/components/cli/fileDirectory.vue b/nezha-fronted/src/components/cli/fileDirectory.vue index 3183e4567..e13f9341d 100644 --- a/nezha-fronted/src/components/cli/fileDirectory.vue +++ b/nezha-fronted/src/components/cli/fileDirectory.vue @@ -297,7 +297,8 @@ export default { { name: 'dashboard.panel.chartForm.group', key: 'group' }, { name: 'config.menus.perms', key: 'permissionsString' } - ] + ], + oldRenameStr: '' } }, computed: { @@ -470,7 +471,19 @@ export default { }, 300) }, setRename () { - this.renameBox = false + const params = { + uuid: this.uuid, + oldPath: this.fileDirectory + '/' + this.oldRenameStr, + newPath: this.fileDirectory + '/' + this.renameStr + } + this.$put('/terminal/sftp/rename', params).then(res => { + this.renameBox = false + if (res.code == 200) { + this.getSftpPath(this.fileDirectory) + } else { + this.$message.error(res.msg) + } + }) }, delFile () { const item = this.delObj @@ -610,6 +623,7 @@ export default { switch (command) { case 'rename': this.renameStr = row.name + this.oldRenameStr = row.name this.renameBox = true break case 'download':