mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 05:29:26 -02:30
Use alpha decay percentage instead of absolute value for loading screen.
This commit is contained in:
@@ -226,9 +226,7 @@ function MeshGraph({ showLegend, zoom }) {
|
|||||||
.attr('y2', (d) => d.target.y);
|
.attr('y2', (d) => d.target.y);
|
||||||
|
|
||||||
node.attr('transform', (d) => `translate(${d.x},${d.y})`);
|
node.attr('transform', (d) => `translate(${d.x},${d.y})`);
|
||||||
if (simulation.alpha() < simulation.alphaMin()) {
|
calculateAlphaDecay(simulation.alpha(), simulation.alphaMin(), 35);
|
||||||
d3.select('.simulation-loader').style('visibility', 'hidden');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
svg.call(zoom);
|
svg.call(zoom);
|
||||||
@@ -310,9 +308,17 @@ function MeshGraph({ showLegend, zoom }) {
|
|||||||
setIsNodeSelected(true);
|
setIsNodeSelected(true);
|
||||||
setSelectedNode(n);
|
setSelectedNode(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calculateAlphaDecay(a, aMin, x) {
|
||||||
|
const decayPercentage = Math.min((aMin / a) * 100);
|
||||||
|
if (decayPercentage >= x) {
|
||||||
|
d3.select('.simulation-loader').style('visibility', 'hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function redirectToDetailsPage() {
|
async function redirectToDetailsPage() {
|
||||||
|
// TODO: redirect to top-level instances details page
|
||||||
const { id: nodeId } = selectedNode;
|
const { id: nodeId } = selectedNode;
|
||||||
const {
|
const {
|
||||||
data: { results },
|
data: { results },
|
||||||
|
|||||||
Reference in New Issue
Block a user