mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-11 03:41:12 +00:00
File size sort
This commit is contained in:
@@ -46,6 +46,13 @@ class MylibRepoListView extends React.Component {
|
||||
this.props.sortRepoList(sortBy, sortOrder);
|
||||
}
|
||||
|
||||
sortBySize = (e) => {
|
||||
e.preventDefault();
|
||||
const sortBy = 'size';
|
||||
const sortOrder = this.props.sortOrder == 'asc' ? 'desc' : 'asc';
|
||||
this.props.sortRepoList(sortBy, sortOrder);
|
||||
}
|
||||
|
||||
renderRepoListView = () => {
|
||||
return (
|
||||
<Fragment>
|
||||
@@ -79,7 +86,7 @@ class MylibRepoListView extends React.Component {
|
||||
<th width="4%"><span className="sr-only">{gettext('Library Type')}</span></th>
|
||||
<th width="38%"><a className="d-block table-sort-op" href="#" onClick={this.sortByName}>{gettext('Name')} {this.props.sortBy === 'name' && sortIcon}</a></th>
|
||||
<th width="14%"><span className="sr-only">{gettext('Actions')}</span></th>
|
||||
<th width={showStorageBackend ? '15%' : '20%'}>{gettext('Size')}</th>
|
||||
<th width={showStorageBackend ? '15%' : '20%'} onClick={this.sortBySize}>{gettext('Size')} {this.props.sortBy === 'size' && sortIcon}</th>
|
||||
{showStorageBackend ? <th width="10%">{gettext('Storage backend')}</th> : null}
|
||||
<th width={showStorageBackend ? '15%' : '20%'}><a className="d-block table-sort-op" href="#" onClick={this.sortByTime}>{gettext('Last Update')} {this.props.sortBy === 'time' && sortIcon}</a></th>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user