Disable auto refresh in subgraph view

master
ken 2021-08-12 19:36:29 +00:00
parent 799dec38b3
commit dfa85ac256
2 changed files with 10 additions and 5 deletions

View File

@ -35,6 +35,7 @@ import {
setZoomValue,
toggleAutoUpdate,
} from "../features/tools/toolsSlice";
import { appViews } from "./Shared";
class Toolbar extends React.Component {
constructor(props) {
@ -50,7 +51,7 @@ class Toolbar extends React.Component {
zoomIn = () => {
var zoomTo = this.props.zoomValue + this.zoomIncrement;
if (zoomTo > this.props.zoomMaximum){
if (zoomTo > this.props.zoomMaximum) {
zoomTo = this.props.zoomMaximum;
}
this.props.setZoomValue(zoomTo);
@ -118,7 +119,6 @@ class Toolbar extends React.Component {
}
title="Disable/Enable Auto Updates"
disabled={this.state.buttonStates[2]}
style={this.props.autoUpdate ? { opacity: 1 } : { opacity: 0.4 }}
></button>
);
}
@ -127,13 +127,14 @@ class Toolbar extends React.Component {
componentDidUpdate(prevProps, prevState) {
if (this.props.currentView !== prevProps.currentView) {
if (this.props.currentView === "OverlaysView") {
if (this.props.currentView === appViews.OverlaysView) {
this.setState({ buttonStates: [true, true, false, true, true] });
//[zoomIn, zoomOut, refresh, config, legend]
}
if (this.props.currentView === "TopologyView") {
} else if (this.props.currentView === appViews.TopologyView) {
this.setState({ buttonStates: [false, false, false, false, false] });
//[zoomIn, zoomOut, refresh, config, legend]
} else if (this.props.currentView === appViews.SubgraphView) {
this.setState({ buttonStates: [false, false, true, false, false] });
}
}
}

View File

@ -283,6 +283,10 @@ h5 {
box-shadow: 0 5px 8px rgba(139, 255, 236, 0.5);
}
.refreshBtn{
opacity: 1.0;
}
.refreshBtnDisabled,
.configBtnDisabled,
.infoBtnDisabled,