1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +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,6 +61,13 @@ 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;
if (data.failed == 1) {
clearInterval(interval);
this.setState({
isLoading: false,
errorMsg: data.failed_reason
});
} else {
this.setState({ this.setState({
zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%' zipProgress: data.total == 0 ? '100%' : (data.zipped/data.total*100).toFixed(2) + '%'
}); });
@@ -69,6 +76,7 @@ class ZipDownloadDialog extends React.Component {
this.props.toggleDialog(); this.props.toggleDialog();
location.href = `${fileServerRoot}zip/${zipToken}`; location.href = `${fileServerRoot}zip/${zipToken}`;
} }
}
}).catch((error) => { }).catch((error) => {
clearInterval(interval); clearInterval(interval);
let errorMsg = Utils.getErrorMsg(error); let errorMsg = Utils.getErrorMsg(error);