|
|
@ -47,6 +47,7 @@ import * as mime from '../mime' |
|
|
|
import { minioBrowserPrefix } from '../constants' |
|
|
|
import { minioBrowserPrefix } from '../constants' |
|
|
|
import CopyToClipboard from 'react-copy-to-clipboard' |
|
|
|
import CopyToClipboard from 'react-copy-to-clipboard' |
|
|
|
import storage from 'local-storage-fallback' |
|
|
|
import storage from 'local-storage-fallback' |
|
|
|
|
|
|
|
import InfiniteScroll from 'react-infinite-scroller'; |
|
|
|
|
|
|
|
|
|
|
|
export default class Browse extends React.Component { |
|
|
|
export default class Browse extends React.Component { |
|
|
|
componentDidMount() { |
|
|
|
componentDidMount() { |
|
|
@ -110,9 +111,6 @@ export default class Browse extends React.Component { |
|
|
|
if (!decPathname.endsWith('/')) |
|
|
|
if (!decPathname.endsWith('/')) |
|
|
|
decPathname += '/' |
|
|
|
decPathname += '/' |
|
|
|
if (decPathname === minioBrowserPrefix + '/') { |
|
|
|
if (decPathname === minioBrowserPrefix + '/') { |
|
|
|
dispatch(actions.setCurrentBucket('')) |
|
|
|
|
|
|
|
dispatch(actions.setCurrentPath('')) |
|
|
|
|
|
|
|
dispatch(actions.setObjects([])) |
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
let obj = utils.pathSlice(decPathname) |
|
|
|
let obj = utils.pathSlice(decPathname) |
|
|
@ -140,6 +138,11 @@ export default class Browse extends React.Component { |
|
|
|
this.props.dispatch(actions.setVisibleBuckets(buckets.filter(bucket => bucket.indexOf(e.target.value) > -1))) |
|
|
|
this.props.dispatch(actions.setVisibleBuckets(buckets.filter(bucket => bucket.indexOf(e.target.value) > -1))) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listObjects() { |
|
|
|
|
|
|
|
const {dispatch} = this.props |
|
|
|
|
|
|
|
dispatch(actions.listObjects()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
selectPrefix(e, prefix) { |
|
|
|
selectPrefix(e, prefix) { |
|
|
|
e.preventDefault() |
|
|
|
e.preventDefault() |
|
|
|
const {dispatch, currentPath, web, currentBucket} = this.props |
|
|
|
const {dispatch, currentPath, web, currentBucket} = this.props |
|
|
@ -231,7 +234,7 @@ export default class Browse extends React.Component { |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
this.hideDeleteConfirmation() |
|
|
|
this.hideDeleteConfirmation() |
|
|
|
dispatch(actions.selectPrefix(currentPath)) |
|
|
|
dispatch(actions.removeObject(deleteConfirmation.object)) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(e => dispatch(actions.showAlert({ |
|
|
|
.catch(e => dispatch(actions.showAlert({ |
|
|
|
type: 'danger', |
|
|
|
type: 'danger', |
|
|
@ -360,7 +363,6 @@ export default class Browse extends React.Component { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
|
render() { |
|
|
|
const {total, free} = this.props.storageInfo |
|
|
|
const {total, free} = this.props.storageInfo |
|
|
|
const {showMakeBucketModal, alert, sortNameOrder, sortSizeOrder, sortDateOrder, showAbout, showBucketPolicy} = this.props |
|
|
|
const {showMakeBucketModal, alert, sortNameOrder, sortSizeOrder, sortDateOrder, showAbout, showBucketPolicy} = this.props |
|
|
@ -370,7 +372,7 @@ export default class Browse extends React.Component { |
|
|
|
const {policies, currentBucket, currentPath} = this.props |
|
|
|
const {policies, currentBucket, currentPath} = this.props |
|
|
|
const {deleteConfirmation} = this.props |
|
|
|
const {deleteConfirmation} = this.props |
|
|
|
const {shareObject} = this.props |
|
|
|
const {shareObject} = this.props |
|
|
|
const {web, prefixWritable} = this.props |
|
|
|
const {web, prefixWritable, istruncated} = this.props |
|
|
|
|
|
|
|
|
|
|
|
// Don't always show the SettingsModal. This is done here instead of in
|
|
|
|
// Don't always show the SettingsModal. This is done here instead of in
|
|
|
|
// SettingsModal.js so as to allow for #componentWillMount to handle
|
|
|
|
// SettingsModal.js so as to allow for #componentWillMount to handle
|
|
|
@ -476,7 +478,6 @@ export default class Browse extends React.Component { |
|
|
|
</OverlayTrigger> |
|
|
|
</OverlayTrigger> |
|
|
|
</Dropdown.Menu> |
|
|
|
</Dropdown.Menu> |
|
|
|
</Dropdown> |
|
|
|
</Dropdown> |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
@ -545,10 +546,18 @@ export default class Browse extends React.Component { |
|
|
|
</header> |
|
|
|
</header> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="feb-container"> |
|
|
|
<div className="feb-container"> |
|
|
|
<ObjectsList dataType={ this.dataType.bind(this) } |
|
|
|
<InfiniteScroll loadMore={ this.listObjects.bind(this) } |
|
|
|
selectPrefix={ this.selectPrefix.bind(this) } |
|
|
|
hasMore={ istruncated } |
|
|
|
showDeleteConfirmation={ this.showDeleteConfirmation.bind(this) } |
|
|
|
useWindow={ true } |
|
|
|
shareObject={ this.shareObject.bind(this) } /> |
|
|
|
initialLoad={ false }> |
|
|
|
|
|
|
|
<ObjectsList dataType={ this.dataType.bind(this) } |
|
|
|
|
|
|
|
selectPrefix={ this.selectPrefix.bind(this) } |
|
|
|
|
|
|
|
showDeleteConfirmation={ this.showDeleteConfirmation.bind(this) } |
|
|
|
|
|
|
|
shareObject={ this.shareObject.bind(this) } /> |
|
|
|
|
|
|
|
</InfiniteScroll> |
|
|
|
|
|
|
|
<div className="text-center" style={ { display: istruncated ? 'block' : 'none' } }> |
|
|
|
|
|
|
|
<span>Loading...</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<UploadModal /> |
|
|
|
<UploadModal /> |
|
|
|
{ createButton } |
|
|
|
{ createButton } |
|
|
|