-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Monitoring] Use server side pagination for Logstash Pipelines page (#…
…46587) * Basic version working for cluster pipelines * More support * Refactoring * Fixes * Fix sorting issues * Reduce the number of buckets too * Fix tests * This is actually not helping - it seems that the filter in the query doesn't work as expected - maybe related to the fact that are using nested fields * Add more data for metric.debug * Support sorting on throughput and node count * Fix broken test * Use getMetrics and support with numOfBuckets parameter * Fix test for realz * Fix logstash management pages by introducing a new api to just retrieve ids * We need this to go back to 1000 but it doesn't affect the number of created buckets * Fix issue with pagination data when filtering * Fix sorting by id not working * Make this a little more sturdy
- Loading branch information
1 parent
e81494f
commit 96e40d6
Showing
30 changed files
with
653 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
x-pack/legacy/plugins/monitoring/public/components/table/eui_table_ssp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { | ||
EuiBasicTable, | ||
EuiSpacer, | ||
EuiSearchBar | ||
} from '@elastic/eui'; | ||
|
||
export function EuiMonitoringSSPTable({ | ||
rows: items, | ||
search = {}, | ||
pagination, | ||
columns: _columns, | ||
onTableChange, | ||
fetchMoreData, | ||
...props | ||
}) { | ||
const [isLoading, setIsLoading] = React.useState(false); | ||
const [queryText, setQueryText] = React.useState(''); | ||
const [page, setPage] = React.useState({ | ||
index: pagination.pageIndex, | ||
size: pagination.pageSize | ||
}); | ||
const [sort, setSort] = React.useState(props.sorting); | ||
|
||
if (search.box && !search.box['data-test-subj']) { | ||
search.box['data-test-subj'] = 'monitoringTableToolBar'; | ||
} | ||
|
||
const columns = _columns.map(column => { | ||
if (!column['data-test-subj']) { | ||
column['data-test-subj'] = 'monitoringTableHasData'; | ||
} | ||
|
||
if (!('sortable' in column)) { | ||
column.sortable = true; | ||
} | ||
|
||
return column; | ||
}); | ||
|
||
const onChange = async ({ page, sort }) => { | ||
setPage(page); | ||
setSort({ sort }); | ||
setIsLoading(true); | ||
await fetchMoreData({ page, sort: { sort }, queryText }); | ||
setIsLoading(false); | ||
onTableChange({ page, sort }); | ||
}; | ||
|
||
const onQueryChange = async ({ queryText }) => { | ||
const newPage = { ...page, index: 0 }; | ||
setPage(newPage); | ||
setQueryText(queryText); | ||
setIsLoading(true); | ||
await fetchMoreData({ page: newPage, sort, queryText }); | ||
setIsLoading(false); | ||
}; | ||
|
||
return ( | ||
<div data-test-subj={`${props.className}Container`}> | ||
<EuiSearchBar {...search} onChange={onQueryChange}/> | ||
<EuiSpacer size="l"/> | ||
<EuiBasicTable | ||
{...props} | ||
items={items} | ||
pagination={pagination} | ||
onChange={onChange} | ||
loading={isLoading} | ||
columns={columns} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.