1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 23:02:26 +00:00

[upload link] show the latest added file as the the first one & added tips

This commit is contained in:
llj
2021-09-14 18:11:31 +08:00
parent 723786c94e
commit 2890e6adde
2 changed files with 15 additions and 2 deletions

View File

@@ -128,9 +128,10 @@ class FileUploader extends React.Component {
this.resumable.on('fileAdded', this.onFileAdded.bind(this)); this.resumable.on('fileAdded', this.onFileAdded.bind(this));
this.resumable.on('fileProgress', this.onFileProgress.bind(this)); this.resumable.on('fileProgress', this.onFileProgress.bind(this));
this.resumable.on('fileSuccess', this.onFileUploadSuccess.bind(this)); this.resumable.on('fileSuccess', this.onFileUploadSuccess.bind(this));
this.resumable.on('fileError', this.onFileError.bind(this));
this.resumable.on('uploadStart', this.onUploadStart.bind(this));
this.resumable.on('progress', this.onProgress.bind(this)); this.resumable.on('progress', this.onProgress.bind(this));
this.resumable.on('complete', this.onComplete.bind(this)); this.resumable.on('complete', this.onComplete.bind(this));
this.resumable.on('fileError', this.onFileError.bind(this));
this.resumable.on('error', this.onError.bind(this)); this.resumable.on('error', this.onError.bind(this));
this.resumable.on('dragstart', this.onDragStart.bind(this)); this.resumable.on('dragstart', this.onDragStart.bind(this));
} }
@@ -299,6 +300,12 @@ class FileUploader extends React.Component {
return uploadBitrate; return uploadBitrate;
} }
// start uploading
onUploadStart = () => {
const message = gettext('File upload started.');
toaster.info(message);
}
onProgress = () => { onProgress = () => {
let progress = Math.round(this.resumable.progress() * 100); let progress = Math.round(this.resumable.progress() * 100);
this.setState({totalProgress: progress}); this.setState({totalProgress: progress});
@@ -415,6 +422,9 @@ class FileUploader extends React.Component {
} }
onComplete = () => { onComplete = () => {
const message = gettext('All files uploaded');
toaster.success(message);
this.notifiedFolders = []; this.notifiedFolders = [];
// reset upload link loaded // reset upload link loaded
this.isUploadLinkLoaded = false; this.isUploadLinkLoaded = false;
@@ -422,6 +432,9 @@ class FileUploader extends React.Component {
} }
onError = (message) => { onError = (message) => {
const msg = gettext('Error');
toaster.danger(msg);
// reset upload link loaded // reset upload link loaded
this.isUploadLinkLoaded = false; this.isUploadLinkLoaded = false;
// After the error, the user can switch windows // After the error, the user can switch windows

View File

@@ -72,7 +72,7 @@ class UploadProgressDialog extends React.Component {
onUploadRetry={this.props.onUploadRetry} onUploadRetry={this.props.onUploadRetry}
/> />
); );
}) }).reverse()
} }
</tbody> </tbody>
</table> </table>