You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
refactor: uploading counters vuex state
This commit is contained in:
@@ -3,7 +3,15 @@ const getters = {
|
||||
isFiles: state => !state.loading && state.route.name === 'Files',
|
||||
isListing: (state, getters) => getters.isFiles && state.req.isDir,
|
||||
isEditor: (state, getters) => getters.isFiles && (state.req.type === 'text' || state.req.type === 'textImmutable'),
|
||||
selectedCount: state => state.selected.length
|
||||
selectedCount: state => state.selected.length,
|
||||
progress : state => {
|
||||
if (state.uploading.progress.length == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
let sum = state.uploading.progress.reduce((acc, val) => acc + val)
|
||||
return Math.ceil(sum / state.uploading.size * 100);
|
||||
}
|
||||
}
|
||||
|
||||
export default getters
|
||||
|
||||
Reference in New Issue
Block a user