mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Fetch the resource view topologies on first topologies load
This commit is contained in:
@@ -618,10 +618,14 @@ export function receiveTopologies(topologies) {
|
||||
state.get('nodeDetails'),
|
||||
dispatch
|
||||
);
|
||||
// populate search matches on first load
|
||||
// Populate search matches on first load
|
||||
if (firstLoad && state.get('searchQuery')) {
|
||||
dispatch(focusSearch());
|
||||
}
|
||||
// Fetch all the relevant nodes once on first load
|
||||
if (firstLoad && isResourceViewModeSelector(state)) {
|
||||
getResourceViewNodesSnapshot(getState, dispatch);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -188,14 +188,11 @@ export function getAllNodes(getState, dispatch) {
|
||||
|
||||
/**
|
||||
* One-time update of all the nodes of topologies that appear in the current resource view.
|
||||
* TODO: Replace the one-time snapshot with periodic polling.
|
||||
*/
|
||||
export function getResourceViewNodesSnapshot(getState, dispatch) {
|
||||
const topologyIds = layersTopologyIdsSelector(getState());
|
||||
// TODO: Remove the timeout and replace it with normal polling once we figure how to make
|
||||
// resource view dynamic (from the UI point of view, the challenge is to make it stable).
|
||||
setTimeout(() => {
|
||||
getNodesForTopologies(getState, dispatch, topologyIds);
|
||||
}, 1200);
|
||||
getNodesForTopologies(getState, dispatch, topologyIds);
|
||||
}
|
||||
|
||||
export function getTopologies(options, dispatch, initialPoll) {
|
||||
|
||||
Reference in New Issue
Block a user