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 @@ -38,6 +38,7 @@ export const ElasticsearchNodesPage: React.FC<ComponentProps> = ({ clusters }) =
const globalState = useContext(GlobalStateContext);
const { showCgroupMetricsElasticsearch } = useContext(ExternalConfigContext);
const { services } = useKibana<{ data: any }>();
const [isLoading, setIsLoading] = React.useState(false);
const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context);
const { getPaginationRouteOptions, updateTotalItemCount, getPaginationTableProps } =
useTable('elasticsearch.nodes');
Expand Down Expand Up @@ -69,6 +70,7 @@ export const ElasticsearchNodesPage: React.FC<ComponentProps> = ({ clusters }) =
const bounds = services.data?.query.timefilter.timefilter.getBounds();
const url = `../api/monitoring/v1/clusters/${clusterUuid}/elasticsearch/nodes`;
if (services.http?.fetch && clusterUuid) {
setIsLoading(true);
const response = await services.http?.fetch(url, {
method: 'POST',
body: JSON.stringify({
Expand All @@ -81,6 +83,7 @@ export const ElasticsearchNodesPage: React.FC<ComponentProps> = ({ clusters }) =
}),
});

setIsLoading(false);
setData(response);
updateTotalItemCount(response.totalNodeCount);
const alertsResponse = await fetchAlerts({
Expand Down Expand Up @@ -129,6 +132,7 @@ export const ElasticsearchNodesPage: React.FC<ComponentProps> = ({ clusters }) =
setupMode={setupMode}
nodes={data.nodes}
alerts={alerts}
isLoading={isLoading}
showCgroupMetricsElasticsearch={showCgroupMetricsElasticsearch}
{...getPaginationTableProps()}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function EuiMonitoringSSPTable({
...props
}) {
const [queryText, setQueryText] = React.useState('');
const [isLoading, setIsLoading] = React.useState(false);
const [page, setPage] = React.useState({
index: pagination.pageIndex,
size: pagination.pageSize,
Expand Down Expand Up @@ -72,7 +73,9 @@ export function EuiMonitoringSSPTable({
setSort({ sort });
// angular version
if (props.fetchMoreData) {
setIsLoading(true);
await props.fetchMoreData({ page, sort: { sort }, queryText });
setIsLoading(false);
onTableChange({ page, sort });
}
// react version
Expand All @@ -87,7 +90,9 @@ export function EuiMonitoringSSPTable({
setQueryText(queryText);
// angular version
if (props.fetchMoreData) {
setIsLoading(true);
await props.fetchMoreData({ page: newPage, sort, queryText });
setIsLoading(false);
} else {
// react version
onTableChange({ page, sort: sort.sort, queryText });
Expand All @@ -105,6 +110,7 @@ export function EuiMonitoringSSPTable({
pagination={pagination}
onChange={onChange}
columns={columns}
loading={props.isLoading || isLoading}
/>
{footerContent}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export function MonitoringElasticsearchNodesProvider({ getService, getPageObject

async clickNameCol() {
await find.clickByCssSelector(`[data-test-subj="${SUBJ_TABLE_SORT_NAME_COL}"] > button`);
await find.byCssSelector('.euiBasicTable-loading');
await this.waitForTableToFinishLoading();
}

Expand Down