|
|
@ -150,16 +150,21 @@ export default class Browse extends React.Component { |
|
|
|
if (prefix === currentPath) return |
|
|
|
if (prefix === currentPath) return |
|
|
|
browserHistory.push(utils.pathJoin(currentBucket, encPrefix)) |
|
|
|
browserHistory.push(utils.pathJoin(currentBucket, encPrefix)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Download the selected file.
|
|
|
|
if (!web.LoggedIn()) { |
|
|
|
web.CreateURLToken() |
|
|
|
let url = `${window.location.origin}/minio/download/${currentBucket}/${encPrefix}?token=''` |
|
|
|
.then(res => { |
|
|
|
window.location = url |
|
|
|
let url = `${window.location.origin}/minio/download/${currentBucket}/${encPrefix}?token=${res.token}` |
|
|
|
} else { |
|
|
|
window.location = url |
|
|
|
// Download the selected file.
|
|
|
|
}) |
|
|
|
web.CreateURLToken() |
|
|
|
.catch(err => dispatch(actions.showAlert({ |
|
|
|
.then(res => { |
|
|
|
type: 'danger', |
|
|
|
let url = `${window.location.origin}/minio/download/${currentBucket}/${encPrefix}?token=${res.token}` |
|
|
|
message: err.message |
|
|
|
window.location = url |
|
|
|
}))) |
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => dispatch(actions.showAlert({ |
|
|
|
|
|
|
|
type: 'danger', |
|
|
|
|
|
|
|
message: err.message |
|
|
|
|
|
|
|
}))) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -421,18 +426,23 @@ export default class Browse extends React.Component { |
|
|
|
objects: this.props.checkedObjects, |
|
|
|
objects: this.props.checkedObjects, |
|
|
|
prefix: this.props.currentPath |
|
|
|
prefix: this.props.currentPath |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!web.LoggedIn()) { |
|
|
|
|
|
|
|
let requestUrl = location.origin + "/minio/zip?token=''" |
|
|
|
|
|
|
|
this.xhr = new XMLHttpRequest() |
|
|
|
|
|
|
|
dispatch(actions.downloadSelected(requestUrl, req, this.xhr)) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
web.CreateURLToken() |
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
|
|
let requestUrl = location.origin + "/minio/zip?token=" + res.token |
|
|
|
|
|
|
|
|
|
|
|
web.CreateURLToken() |
|
|
|
this.xhr = new XMLHttpRequest() |
|
|
|
.then(res => { |
|
|
|
dispatch(actions.downloadSelected(requestUrl, req, this.xhr)) |
|
|
|
let requestUrl = location.origin + "/minio/zip?token=" + res.token |
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => dispatch(actions.showAlert({ |
|
|
|
this.xhr = new XMLHttpRequest() |
|
|
|
type: 'danger', |
|
|
|
dispatch(actions.downloadSelected(requestUrl, req, this.xhr)) |
|
|
|
message: err.message |
|
|
|
}) |
|
|
|
}))) |
|
|
|
.catch(err => dispatch(actions.showAlert({ |
|
|
|
} |
|
|
|
type: 'danger', |
|
|
|
|
|
|
|
message: err.message |
|
|
|
|
|
|
|
}))) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
clearSelected() { |
|
|
|
clearSelected() { |
|
|
|