mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Subtract pinned search-filtered nodes from status node count
The status node count in the bottom was not reflecting the filtering done by the pinned searches.
This commit is contained in:
@@ -3,7 +3,8 @@ import { connect } from 'react-redux';
|
||||
|
||||
class Status extends React.Component {
|
||||
render() {
|
||||
const {errorUrl, topologiesLoaded, topology, websocketClosed} = this.props;
|
||||
const {errorUrl, filteredNodeCount, topologiesLoaded, topology,
|
||||
websocketClosed} = this.props;
|
||||
|
||||
let title = '';
|
||||
let text = 'Trying to reconnect...';
|
||||
@@ -23,9 +24,9 @@ class Status extends React.Component {
|
||||
showWarningIcon = true;
|
||||
} else if (topology) {
|
||||
const stats = topology.get('stats');
|
||||
text = `${stats.get('node_count')} nodes`;
|
||||
text = `${stats.get('node_count') - filteredNodeCount} nodes`;
|
||||
if (stats.get('filtered_nodes')) {
|
||||
text = `${text} (${stats.get('filtered_nodes')} filtered)`;
|
||||
text = `${text} (${stats.get('filtered_nodes') + filteredNodeCount} filtered)`;
|
||||
}
|
||||
classNames += ' status-stats';
|
||||
showWarningIcon = false;
|
||||
@@ -43,6 +44,7 @@ class Status extends React.Component {
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
errorUrl: state.get('errorUrl'),
|
||||
filteredNodeCount: state.get('nodes').filter(node => node.get('filtered')).size,
|
||||
topologiesLoaded: state.get('topologiesLoaded'),
|
||||
topology: state.get('currentTopology'),
|
||||
websocketClosed: state.get('websocketClosed')
|
||||
|
||||
Reference in New Issue
Block a user