mirror of
https://github.com/status-im/consul.git
synced 2025-01-18 17:52:17 +00:00
676a520ce3
* Refactor grid styling for Topology page * Crate TopologyMetrics Button component and move styling * Create intention ID * fixup button styling * Return a link to the create intention page * Rename Button to Popover component * Fixup serializer test * ui: Inline Topology Intention Actions (#9153) * Add arrow and dot to/from metrics back in * Add addional space to have metrics wrap and show in smaller screens * Move logic for finding positioning * Use color variables Co-authored-by: John Cowen <johncowen@users.noreply.github.com>
24 lines
673 B
JavaScript
24 lines
673 B
JavaScript
import Component from '@glimmer/component';
|
|
import { tracked } from '@glimmer/tracking';
|
|
import { action } from '@ember/object';
|
|
|
|
export default class TopologyMetricsUpLines extends Component {
|
|
@tracked iconPositions;
|
|
|
|
@action
|
|
getIconPositions() {
|
|
const center = this.args.center;
|
|
const lines = [...document.querySelectorAll('#upstream-lines path')];
|
|
|
|
this.iconPositions = lines.map(item => {
|
|
const pathLen = parseFloat(item.getTotalLength());
|
|
const partLen = item.getPointAtLength(Math.ceil(pathLen * 0.666));
|
|
return {
|
|
id: item.id,
|
|
x: partLen.x - center.x,
|
|
y: partLen.y - center.y * 0.81,
|
|
};
|
|
});
|
|
}
|
|
}
|