mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 10:50:24 +00:00
Download tips (#3242)
* Download out of limit prompt * Canonical format * Remove gettext * delete wrap
This commit is contained in:
@@ -14,6 +14,7 @@ import MoveDirentDialog from '../dialog/move-dirent-dialog';
|
|||||||
import CopyDirentDialog from '../dialog/copy-dirent-dialog';
|
import CopyDirentDialog from '../dialog/copy-dirent-dialog';
|
||||||
import ShareDialog from '../dialog/share-dialog';
|
import ShareDialog from '../dialog/share-dialog';
|
||||||
import DirentRightMenu from './dirent-right-menu';
|
import DirentRightMenu from './dirent-right-menu';
|
||||||
|
import toaster from '../toast';
|
||||||
|
|
||||||
import '../../css/dirent-list-item.css';
|
import '../../css/dirent-list-item.css';
|
||||||
|
|
||||||
@@ -345,8 +346,11 @@ class DirentListItem extends React.Component {
|
|||||||
this.zipToken = res.data['zip_token'];
|
this.zipToken = res.data['zip_token'];
|
||||||
this.addDownloadAnimation();
|
this.addDownloadAnimation();
|
||||||
this.interval = setInterval(this.addDownloadAnimation, 1000);
|
this.interval = setInterval(this.addDownloadAnimation, 1000);
|
||||||
}).catch(() => {
|
}).catch((error) => {
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
|
this.setState({isProgressDialogShow: false});
|
||||||
|
let errorMessage = error.response.data.error_msg;
|
||||||
|
toaster.danger(errorMessage);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let url = URLDecorator.getUrl({type: 'download_file_url', repoID: repoID, filePath: direntPath});
|
let url = URLDecorator.getUrl({type: 'download_file_url', repoID: repoID, filePath: direntPath});
|
||||||
@@ -378,6 +382,7 @@ class DirentListItem extends React.Component {
|
|||||||
onCancelDownload = () => {
|
onCancelDownload = () => {
|
||||||
let zipToken = this.zipToken;
|
let zipToken = this.zipToken;
|
||||||
seafileAPI.cancelZipTask(zipToken).then(res => {
|
seafileAPI.cancelZipTask(zipToken).then(res => {
|
||||||
|
clearInterval(this.interval);
|
||||||
this.setState({
|
this.setState({
|
||||||
isProgressDialogShow: false,
|
isProgressDialogShow: false,
|
||||||
});
|
});
|
||||||
|
@@ -82,6 +82,11 @@ class MutipleDirOperationToolbar extends React.Component {
|
|||||||
this.zipToken = res.data['zip_token'];
|
this.zipToken = res.data['zip_token'];
|
||||||
this.addDownloadAnimation();
|
this.addDownloadAnimation();
|
||||||
this.interval = setInterval(this.addDownloadAnimation, 1000);
|
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 = () => {
|
onCancelDownload = () => {
|
||||||
seafileAPI.cancelZipTask(this.zipToken).then(() => {
|
seafileAPI.cancelZipTask(this.zipToken).then(() => {
|
||||||
|
clearInterval(this.interval);
|
||||||
this.setState({isProgressDialogShow: false});
|
this.setState({isProgressDialogShow: false});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user