mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-16 18:54:43 +08:00
fix: 解决复制之前文件被删除报错的问题 (#3187)
Refs https://github.com/1Panel-dev/1Panel/issues/2961
This commit is contained in:
parent
1a400e7f81
commit
5f9073cb85
@ -251,8 +251,11 @@ func (f *FileService) MvFile(m request.FileMove) error {
|
|||||||
if !fo.Stat(m.NewPath) {
|
if !fo.Stat(m.NewPath) {
|
||||||
return buserr.New(constant.ErrPathNotFound)
|
return buserr.New(constant.ErrPathNotFound)
|
||||||
}
|
}
|
||||||
for _, path := range m.OldPaths {
|
for _, oldPath := range m.OldPaths {
|
||||||
if path == m.NewPath || strings.Contains(m.NewPath, filepath.Clean(path)+"/") {
|
if !fo.Stat(oldPath) {
|
||||||
|
return buserr.WithName(constant.ErrFileNotFound, oldPath)
|
||||||
|
}
|
||||||
|
if oldPath == m.NewPath || strings.Contains(m.NewPath, filepath.Clean(oldPath)+"/") {
|
||||||
return buserr.New(constant.ErrMovePathFailed)
|
return buserr.New(constant.ErrMovePathFailed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1091,6 +1091,8 @@ const message = {
|
|||||||
fileRecycleBin: 'File Recycle Bin',
|
fileRecycleBin: 'File Recycle Bin',
|
||||||
fileRecycleBinMsg: '{0} recycle bin',
|
fileRecycleBinMsg: '{0} recycle bin',
|
||||||
wordWrap: 'Automatically wrap',
|
wordWrap: 'Automatically wrap',
|
||||||
|
deleteHelper2:
|
||||||
|
'Are you sure you want to delete the selected file? The deletion operation cannot be rolled back',
|
||||||
},
|
},
|
||||||
ssh: {
|
ssh: {
|
||||||
autoStart: 'Auto Start',
|
autoStart: 'Auto Start',
|
||||||
|
@ -1040,6 +1040,7 @@ const message = {
|
|||||||
fileRecycleBin: '檔案回收站',
|
fileRecycleBin: '檔案回收站',
|
||||||
fileRecycleBinMsg: '已{0}回收站',
|
fileRecycleBinMsg: '已{0}回收站',
|
||||||
wordWrap: '自動換行',
|
wordWrap: '自動換行',
|
||||||
|
deleteHelper2: '確定刪除所選檔案? 刪除操作不可回滾',
|
||||||
},
|
},
|
||||||
ssh: {
|
ssh: {
|
||||||
autoStart: '開機自啟',
|
autoStart: '開機自啟',
|
||||||
|
@ -1041,6 +1041,7 @@ const message = {
|
|||||||
fileRecycleBin: '文件回收站',
|
fileRecycleBin: '文件回收站',
|
||||||
fileRecycleBinMsg: '已{0}回收站',
|
fileRecycleBinMsg: '已{0}回收站',
|
||||||
wordWrap: '自动换行',
|
wordWrap: '自动换行',
|
||||||
|
deleteHelper2: '确定删除所选文件?删除操作不可回滚',
|
||||||
},
|
},
|
||||||
ssh: {
|
ssh: {
|
||||||
autoStart: '开机自启',
|
autoStart: '开机自启',
|
||||||
|
@ -3,9 +3,15 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="20" :offset="2">
|
<el-col :span="20" :offset="2">
|
||||||
<el-alert class="mt-2" :show-icon="true" type="warning" :closable="false">
|
<el-alert
|
||||||
|
class="mt-2"
|
||||||
|
:show-icon="true"
|
||||||
|
:type="recycleStatus === 'enable' ? 'warning' : 'error'"
|
||||||
|
:closable="false"
|
||||||
|
>
|
||||||
<div class="delete-warn">
|
<div class="delete-warn">
|
||||||
<span>{{ $t('file.deleteHelper') }}</span>
|
<span v-if="recycleStatus === 'enable'">{{ $t('file.deleteHelper') }}</span>
|
||||||
|
<span v-else>{{ $t('file.deleteHelper2') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-alert>
|
</el-alert>
|
||||||
<div class="mt-4" v-if="recycleStatus === 'enable'">
|
<div class="mt-4" v-if="recycleStatus === 'enable'">
|
||||||
|
@ -85,6 +85,7 @@ const handleParams = () => {
|
|||||||
rules[p.envKey] = [Rules.requiredInput];
|
rules[p.envKey] = [Rules.requiredInput];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
form[p.envKey] = p.default;
|
||||||
}
|
}
|
||||||
emit('update:rules', rules);
|
emit('update:rules', rules);
|
||||||
updateParam();
|
updateParam();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user