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, setZoomValue,
toggleAutoUpdate, toggleAutoUpdate,
} from "../features/tools/toolsSlice"; } from "../features/tools/toolsSlice";
import { appViews } from "./Shared";
class Toolbar extends React.Component { class Toolbar extends React.Component {
constructor(props) { constructor(props) {
@ -50,7 +51,7 @@ class Toolbar extends React.Component {
zoomIn = () => { zoomIn = () => {
var zoomTo = this.props.zoomValue + this.zoomIncrement; var zoomTo = this.props.zoomValue + this.zoomIncrement;
if (zoomTo > this.props.zoomMaximum){ if (zoomTo > this.props.zoomMaximum) {
zoomTo = this.props.zoomMaximum; zoomTo = this.props.zoomMaximum;
} }
this.props.setZoomValue(zoomTo); this.props.setZoomValue(zoomTo);
@ -118,7 +119,6 @@ class Toolbar extends React.Component {
} }
title="Disable/Enable Auto Updates" title="Disable/Enable Auto Updates"
disabled={this.state.buttonStates[2]} disabled={this.state.buttonStates[2]}
style={this.props.autoUpdate ? { opacity: 1 } : { opacity: 0.4 }}
></button> ></button>
); );
} }
@ -127,13 +127,14 @@ class Toolbar extends React.Component {
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (this.props.currentView !== prevProps.currentView) { 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] }); this.setState({ buttonStates: [true, true, false, true, true] });
//[zoomIn, zoomOut, refresh, config, legend] //[zoomIn, zoomOut, refresh, config, legend]
} } else if (this.props.currentView === appViews.TopologyView) {
if (this.props.currentView === "TopologyView") {
this.setState({ buttonStates: [false, false, false, false, false] }); this.setState({ buttonStates: [false, false, false, false, false] });
//[zoomIn, zoomOut, refresh, config, legend] //[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); box-shadow: 0 5px 8px rgba(139, 255, 236, 0.5);
} }
.refreshBtn{
opacity: 1.0;
}
.refreshBtnDisabled, .refreshBtnDisabled,
.configBtnDisabled, .configBtnDisabled,
.infoBtnDisabled, .infoBtnDisabled,