feat: sftp 去掉重复的备份文件夹 (#1509)

This commit is contained in:
ssongliu 2023-07-03 12:28:18 +08:00 committed by GitHub
parent 597c9ea4c0
commit 46495937b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

View file

@ -223,7 +223,11 @@ func (onedrive *oneDriveClient) ListObjects(prefix string) ([]interface{}, error
}
func (onedrive *oneDriveClient) loadIDByPath(path string) (string, error) {
req, err := onedrive.client.NewRequest("GET", fmt.Sprintf("me/drive/root:%s", path), nil)
pathItem := "root:" + path
if path == "/" {
pathItem = "root"
}
req, err := onedrive.client.NewRequest("GET", fmt.Sprintf("me/drive/%s", pathItem), nil)
if err != nil {
return "", fmt.Errorf("new request for file id failed, err: %v", err)
}

View file

@ -349,9 +349,6 @@
<el-form-item :label="$t('setting.path')">
{{ sftpData.bucket }}
</el-form-item>
<el-form-item :label="$t('setting.backupDir')">
{{ sftpData.backupPath }}
</el-form-item>
<el-form-item :label="$t('commons.table.createdAt')">
{{ dateFormat(0, 0, sftpData.createdAt) }}
</el-form-item>

View file

@ -189,11 +189,11 @@
/>
</el-form-item>
<el-form-item
:label="$t('setting.username')"
:label="$t('commons.login.username')"
prop="accessKey"
:rules="[Rules.requiredInput]"
>
<el-input v-model="dialogData.rowData!.accessKey" />
<el-input v-model.trim="dialogData.rowData!.accessKey" />
</el-form-item>
<el-form-item
:label="$t('commons.login.password')"
@ -204,15 +204,15 @@
type="password"
clearable
show-password
v-model="dialogData.rowData!.credential"
v-model.trim="dialogData.rowData!.credential"
/>
</el-form-item>
<el-form-item :label="$t('setting.path')" prop="bucket" :rules="[Rules.requiredInput]">
<el-input v-model="dialogData.rowData!.bucket" />
<el-input v-model.trim="dialogData.rowData!.bucket" />
</el-form-item>
</div>
<el-form-item
v-if="dialogData.rowData!.type !== 'LOCAL'"
v-if="dialogData.rowData!.type !== 'LOCAL' && dialogData.rowData!.type !== 'SFTP'"
:label="$t('setting.backupDir')"
prop="backupPath"
>