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 React, {Component} from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
import RestAPI from './Services';
|
import RestAPI from './Services';
|
||||||
import Loader from './Loader';
|
import Loader from './Loader';
|
||||||
|
|
||||||
class Config extends Component {
|
class Config extends Component {
|
||||||
|
static propTypes = {
|
||||||
|
setTitleExtras: PropTypes.func.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
@ -64,6 +69,7 @@ class Config extends Component {
|
|||||||
};
|
};
|
||||||
this.onSubmit = this.onSubmit.bind(this);
|
this.onSubmit = this.onSubmit.bind(this);
|
||||||
this.inputIsValid = this.inputIsValid.bind(this);
|
this.inputIsValid = this.inputIsValid.bind(this);
|
||||||
|
this.setTitleExtras = this.setTitleExtras.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -111,6 +117,13 @@ class Config extends Component {
|
|||||||
.catch(err => this.setState({isConfigLoading: false}));
|
.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() {
|
inputIsValid() {
|
||||||
return !this.state.playoutDelayErr &&
|
return !this.state.playoutDelayErr &&
|
||||||
!this.state.maxTicFrameSizeErr &&
|
!this.state.maxTicFrameSizeErr &&
|
||||||
@ -149,6 +162,7 @@ class Config extends Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className='config'>
|
<div className='config'>
|
||||||
|
{this.setTitleExtras()}
|
||||||
{this.state.isVersionLoading ? <Loader/> : <h3>Version</h3>}
|
{this.state.isVersionLoading ? <Loader/> : <h3>Version</h3>}
|
||||||
<table><tbody>
|
<table><tbody>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -33,13 +33,27 @@ class ConfigTabs extends Component {
|
|||||||
currentTab: PropTypes.string.isRequired
|
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() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>AES67 Daemon</h1>
|
<h1>AES67 Daemon</h1>
|
||||||
|
<h3>Running on {this.state.titleExtras}</h3>
|
||||||
<Tabs currentTab={this.props.currentTab}>
|
<Tabs currentTab={this.props.currentTab}>
|
||||||
<div label="Config">
|
<div label="Config">
|
||||||
<Config/>
|
<Config setTitleExtras={this.setTitleExtras} />
|
||||||
</div>
|
</div>
|
||||||
<div label="PTP">
|
<div label="PTP">
|
||||||
<PTP/>
|
<PTP/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user