forked from p15670423/monkey
Merge pull request #654 from guardicore/feature/ui_performance_fixes
UI performance fixes
This commit is contained in:
commit
05c99c424d
|
@ -41,9 +41,12 @@ export const basic_options = {
|
||||||
physics: {
|
physics: {
|
||||||
barnesHut: {
|
barnesHut: {
|
||||||
gravitationalConstant: -120000,
|
gravitationalConstant: -120000,
|
||||||
avoidOverlap: 0.5
|
avoidOverlap: 0.5,
|
||||||
|
springLength: 100,
|
||||||
|
springConstant: 0.025
|
||||||
},
|
},
|
||||||
minVelocity: 0.75
|
minVelocity: 0.3,
|
||||||
|
maxVelocity: 25
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ class MapPageComponent extends AuthComponent {
|
||||||
telemetryLastTimestamp: null,
|
telemetryLastTimestamp: null,
|
||||||
isScrolledUp: false,
|
isScrolledUp: false,
|
||||||
telemetryLines: 0,
|
telemetryLines: 0,
|
||||||
telemetryCurrentLine: 0
|
telemetryCurrentLine: 0,
|
||||||
|
telemetryUpdateInProgress: false
|
||||||
};
|
};
|
||||||
this.telemConsole = React.createRef();
|
this.telemConsole = React.createRef();
|
||||||
this.handleScroll = this.handleScroll.bind(this);
|
this.handleScroll = this.handleScroll.bind(this);
|
||||||
|
@ -72,16 +73,20 @@ class MapPageComponent extends AuthComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
updateTelemetryFromServer = () => {
|
updateTelemetryFromServer = () => {
|
||||||
|
if( this.state.telemetryUpdateInProgress ) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setState({telemetryUpdateInProgress: true});
|
||||||
this.authFetch('/api/telemetry-feed?timestamp=' + this.state.telemetryLastTimestamp)
|
this.authFetch('/api/telemetry-feed?timestamp=' + this.state.telemetryLastTimestamp)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if ('telemetries' in res) {
|
if ('telemetries' in res) {
|
||||||
let newTelem = this.state.telemetry.concat(res['telemetries']);
|
let newTelem = this.state.telemetry.concat(res['telemetries']);
|
||||||
|
|
||||||
this.setState(
|
this.setState(
|
||||||
{
|
{
|
||||||
telemetry: newTelem,
|
telemetry: newTelem,
|
||||||
telemetryLastTimestamp: res['timestamp']
|
telemetryLastTimestamp: res['timestamp'],
|
||||||
|
telemetryUpdateInProgress: false
|
||||||
});
|
});
|
||||||
this.props.onStatusChange();
|
this.props.onStatusChange();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue