mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 10:22:46 +00:00
show detailed error msg when download folder
This commit is contained in:
@@ -61,13 +61,21 @@ class ZipDownloadDialog extends React.Component {
|
|||||||
const zipToken = this.state.zipToken;
|
const zipToken = this.state.zipToken;
|
||||||
seafileAPI.queryZipProgress(zipToken).then((res) => {
|
seafileAPI.queryZipProgress(zipToken).then((res) => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
this.setState({
|
if (data.failed == 1) {
|
||||||
zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%'
|
|
||||||
});
|
|
||||||
if (data['total'] == data['zipped']) {
|
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
this.props.toggleDialog();
|
this.setState({
|
||||||
location.href = `${fileServerRoot}zip/${zipToken}`;
|
isLoading: false,
|
||||||
|
errorMsg: data.failed_reason
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setState({
|
||||||
|
zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%'
|
||||||
|
});
|
||||||
|
if (data['total'] == data['zipped']) {
|
||||||
|
clearInterval(interval);
|
||||||
|
this.props.toggleDialog();
|
||||||
|
location.href = `${fileServerRoot}zip/${zipToken}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
|
Reference in New Issue
Block a user