1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 08:53:14 +00:00

show detailed error msg when download folder

This commit is contained in:
lian
2021-07-16 16:19:06 +08:00
parent 32bc79abd9
commit 1ce4a39e0b

View File

@@ -61,13 +61,21 @@ class ZipDownloadDialog extends React.Component {
const zipToken = this.state.zipToken;
seafileAPI.queryZipProgress(zipToken).then((res) => {
const data = res.data;
this.setState({
zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%'
});
if (data['total'] == data['zipped']) {
if (data.failed == 1) {
clearInterval(interval);
this.props.toggleDialog();
location.href = `${fileServerRoot}zip/${zipToken}`;
this.setState({
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) => {
clearInterval(interval);