Changed WebUI to display NodeId and address in all tabs, see #130
This commit is contained in:
parent
070886ef52
commit
00da25be89
@ -19,12 +19,17 @@
|
||||
//
|
||||
|
||||
import React, {Component} from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
import RestAPI from './Services';
|
||||
import Loader from './Loader';
|
||||
|
||||
class Config extends Component {
|
||||
static propTypes = {
|
||||
setTitleExtras: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@ -64,6 +69,7 @@ class Config extends Component {
|
||||
};
|
||||
this.onSubmit = this.onSubmit.bind(this);
|
||||
this.inputIsValid = this.inputIsValid.bind(this);
|
||||
this.setTitleExtras = this.setTitleExtras.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@ -111,6 +117,13 @@ class Config extends Component {
|
||||
.catch(err => this.setState({isConfigLoading: false}));
|
||||
}
|
||||
|
||||
setTitleExtras() {
|
||||
if (!this.state.isConfigLoading) {
|
||||
var nodeId = this.state.customNodeId === '' ? this.state.nodeId : this.state.customNodeId;
|
||||
this.props.setTitleExtras(nodeId + " - " + this.state.ipAddr);
|
||||
}
|
||||
}
|
||||
|
||||
inputIsValid() {
|
||||
return !this.state.playoutDelayErr &&
|
||||
!this.state.maxTicFrameSizeErr &&
|
||||
@ -149,6 +162,7 @@ class Config extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div className='config'>
|
||||
{this.setTitleExtras()}
|
||||
{this.state.isVersionLoading ? <Loader/> : <h3>Version</h3>}
|
||||
<table><tbody>
|
||||
<tr>
|
||||
|
@ -33,13 +33,27 @@ class ConfigTabs extends Component {
|
||||
currentTab: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
titleExtras: ''
|
||||
};
|
||||
this.setTitleExtras = this.setTitleExtras.bind(this);
|
||||
}
|
||||
|
||||
setTitleExtras(extras) {
|
||||
if (this.state.titleExtras != extras)
|
||||
this.setState({titleExtras: extras});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<h1>AES67 Daemon</h1>
|
||||
<h3>Running on {this.state.titleExtras}</h3>
|
||||
<Tabs currentTab={this.props.currentTab}>
|
||||
<div label="Config">
|
||||
<Config/>
|
||||
<Config setTitleExtras={this.setTitleExtras} />
|
||||
</div>
|
||||
<div label="PTP">
|
||||
<PTP/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user