1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

Download tips (#3242)

* Download out of limit prompt

* Canonical format

* Remove gettext

* delete wrap
This commit is contained in:
zxj96
2019-04-11 18:02:39 +08:00
committed by Daniel Pan
parent 0e0d38952b
commit d055eb7a4f
2 changed files with 12 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ import MoveDirentDialog from '../dialog/move-dirent-dialog';
import CopyDirentDialog from '../dialog/copy-dirent-dialog';
import ShareDialog from '../dialog/share-dialog';
import DirentRightMenu from './dirent-right-menu';
import toaster from '../toast';
import '../../css/dirent-list-item.css';
@@ -345,8 +346,11 @@ class DirentListItem extends React.Component {
this.zipToken = res.data['zip_token'];
this.addDownloadAnimation();
this.interval = setInterval(this.addDownloadAnimation, 1000);
}).catch(() => {
}).catch((error) => {
clearInterval(this.interval);
this.setState({isProgressDialogShow: false});
let errorMessage = error.response.data.error_msg;
toaster.danger(errorMessage);
});
} else {
let url = URLDecorator.getUrl({type: 'download_file_url', repoID: repoID, filePath: direntPath});
@@ -378,6 +382,7 @@ class DirentListItem extends React.Component {
onCancelDownload = () => {
let zipToken = this.zipToken;
seafileAPI.cancelZipTask(zipToken).then(res => {
clearInterval(this.interval);
this.setState({
isProgressDialogShow: false,
});

View File

@@ -82,6 +82,11 @@ class MutipleDirOperationToolbar extends React.Component {
this.zipToken = res.data['zip_token'];
this.addDownloadAnimation();
this.interval = setInterval(this.addDownloadAnimation, 1000);
}).catch((error) => {
clearInterval(this.interval);
this.setState({isProgressDialogShow: false});
let errorMessage = error.response.data.error_msg;
toaster.danger(errorMessage);
});
}
}
@@ -110,6 +115,7 @@ class MutipleDirOperationToolbar extends React.Component {
onCancelDownload = () => {
seafileAPI.cancelZipTask(this.zipToken).then(() => {
clearInterval(this.interval);
this.setState({isProgressDialogShow: false});
});
}