Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export { IndexList } from './index_list.container';
export { IndexList } from './index_list';

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,8 @@ import {
DetailPanel,
IndexTable,
} from '../../components';
import {
REFRESH_RATE_INDEX_LIST
} from '../../../../constants';

export class IndexList extends React.PureComponent {
componentDidMount() {
this.props.loadIndices();
this.interval = setInterval(this.props.reloadIndices, REFRESH_RATE_INDEX_LIST);
}

componentWillUnmount() {
clearInterval(this.interval);
}

render() {
const {
match: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import {
pageSizeChanged,
sortChanged,
showSystemIndicesChanged,
loadIndices,
reloadIndices
} from '../../../../store/actions';

import { IndexTable as PresentationComponent } from './index_table';
Expand Down Expand Up @@ -64,6 +66,12 @@ const mapDispatchToProps = (dispatch) => {
},
closeDetailPanel: () => {
dispatch(closeDetailPanel());
},
loadIndices: () => {
dispatch(loadIndices());
},
reloadIndices: () => {
dispatch(reloadIndices());
}
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ import { FormattedMessage, injectI18n } from '@kbn/i18n/react';
import { Route } from 'react-router-dom';
import { NoMatch } from '../../../no_match';
import { healthToColor } from '../../../../services';
import { toastNotifications } from 'ui/notify';

import '../../../../styles/table.less';

import {
REFRESH_RATE_INDEX_LIST
} from '../../../../constants';
import {
EuiButton,
EuiCallOut,
EuiHealth,
EuiLink,
Expand Down Expand Up @@ -93,6 +97,8 @@ export class IndexTableUi extends Component {
};
}
componentDidMount() {
this.props.loadIndices();
this.interval = setInterval(this.props.reloadIndices, REFRESH_RATE_INDEX_LIST);
const {
filterChanged,
filterFromURI
Expand All @@ -102,6 +108,9 @@ export class IndexTableUi extends Component {
filterChanged(EuiSearchBar.Query.parse(decodedFilter));
}
}
componentWillUnmount() {
clearInterval(this.interval);
}
onSort = column => {
const { sortField, isSortAscending, sortChanged } = this.props;

Expand Down Expand Up @@ -326,6 +335,7 @@ export class IndexTableUi extends Component {
showSystemIndicesChanged,
indices,
intl,
loadIndices,
} = this.props;
const { selectedIndicesMap } = this.state;
const atLeastOneItemSelected = Object.keys(selectedIndicesMap).length > 0;
Expand Down Expand Up @@ -406,6 +416,24 @@ export class IndexTableUi extends Component {
onChange={this.onFilterChanged}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
color="secondary"
onClick={() => {
loadIndices();
toastNotifications.addSuccess(intl.formatMessage({
id: 'xpack.idxMgmt.indexTable.reloadingIndicesMessage',
defaultMessage: 'Reloading indices'
}));
}}
iconType="refresh"
>
<FormattedMessage
id="xpack.idxMgmt.indexTable.reloadIndicesButton"
defaultMessage="Reload indices"
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
{this.renderFilterError()}
<EuiSpacer size="m" />
Expand Down