fix(xo-web/remotes): fix editing bucket and directory for S3 (#5276)

This commit is contained in:
Nicolas Raynaud 2020-09-28 15:33:06 +02:00 committed by GitHub
parent ccd34c1610
commit f755365e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View File

@ -22,6 +22,7 @@
- [API] Fix `this.removeSubjectFromResourceSet is not a function` error on calling `resourceSet.removeSubject` via `xo-cli` [#5265](https://github.com/vatesfr/xen-orchestra/issues/5265) (PR [#5266](https://github.com/vatesfr/xen-orchestra/pull/5266))
- [Import OVA] Fix frozen UI when dropping a big OVA on the page (PR [#5274](https://github.com/vatesfr/xen-orchestra/pull/5274))
- [Remotes/S3] Fix S3 backup of 50GB+ files [#5197](https://github.com/vatesfr/xen-orchestra/issues/5197) (PR[ #5242](https://github.com/vatesfr/xen-orchestra/pull/5242) )
- [Remotes] Fix editing bucket and directory for S3 remotes [#5233](https://github.com/vatesfr/xen-orchestra/issues/5233) (PR [5276](https://github.com/vatesfr/xen-orchestra/pull/5276))
### Packages to release

View File

@ -56,12 +56,20 @@ export default decorate([
name,
options = remote.options || '',
password = remote.password,
path = remote.path,
port = remote.port,
proxyId = remote.proxy,
type = remote.type,
username = remote.username,
} = state
let { path = remote.path } = state
if (type === 's3') {
const {
parsedPath,
bucket = parsedPath.split('/')[0],
directory = parsedPath.split('/')[1],
} = state
path = bucket + '/' + directory
}
return editRemote(remote, {
name,
url: format({
@ -96,8 +104,6 @@ export default decorate([
path,
port,
proxyId,
bucket,
directory,
type = 'nfs',
username,
} = state
@ -109,6 +115,7 @@ export default decorate([
type,
}
if (type === 's3') {
const { bucket, directory } = state
urlParams.path = bucket + '/' + directory
}
username && (urlParams.username = username)
@ -150,9 +157,9 @@ export default decorate([
password = remote.password || '',
parsedPath,
path = parsedPath || '',
parsedBucket = parsedPath && parsedPath.split('/')[0],
parsedBucket = parsedPath != null && parsedPath.split('/')[0],
bucket = parsedBucket || '',
parsedDirectory,
parsedDirectory = parsedPath != null && parsedPath.split('/')[1],
directory = parsedDirectory || '',
port = remote.port,
proxyId = remote.proxy,