mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Default sorter specified by table columns
This commit is contained in:
committed by
Tom Wilkie
parent
7b77210108
commit
a40b5a31a8
@@ -36,7 +36,12 @@ export default class NodeDetailsTable extends React.Component {
|
||||
}
|
||||
|
||||
getDefaultSortBy() {
|
||||
// first metric
|
||||
// default sorter specified by columns
|
||||
const defaultSortColumn = _.find(this.props.columns, {defaultSort: true});
|
||||
if (defaultSortColumn) {
|
||||
return defaultSortColumn.id;
|
||||
}
|
||||
// otherwise choose first metric
|
||||
return _.get(this.props.nodes, [0, 'metrics', 0, 'id']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user