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