1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Add API host parameter to IC table, make the parameter editable

This commit is contained in:
Sonja Happ 2020-07-06 12:50:40 +02:00
parent cc156d751b
commit 1f6a4a07ba
2 changed files with 12 additions and 0 deletions

View file

@ -31,6 +31,7 @@ class EditICDialog extends React.Component {
this.state = {
name: '',
host: '',
apihost: '',
type: '',
category: '',
properties: {},
@ -50,6 +51,10 @@ class EditICDialog extends React.Component {
data.host = this.state.host;
}
if (this.state.apihost != null && this.state.apihost !== "" && this.state.apihost !== "http://" && this.state.apihost !== this.props.ic.apihost) {
data.apihost = this.state.apihost;
}
if (this.state.type != null && this.state.type !== "" && this.state.type !== this.props.ic.type) {
data.type = this.state.type;
}
@ -77,6 +82,7 @@ class EditICDialog extends React.Component {
this.setState({
name: this.props.ic.name,
host: this.props.ic.host,
apihost: this.props.ic.apihost,
type: this.props.ic.type,
category: this.props.ic.category,
properties: _.merge({}, _.get(this.props.ic, 'rawProperties'), _.get(this.props.ic, 'properties'))
@ -97,6 +103,11 @@ class EditICDialog extends React.Component {
<FormControl type="text" placeholder={this.props.ic.host} value={this.state.host || 'http://' } onChange={(e) => this.handleChange(e)} />
<FormControl.Feedback />
</FormGroup>
<FormGroup controlId="apihost">
<FormLabel column={false}>API Host</FormLabel>
<FormControl type="text" placeholder={this.props.ic.apihost} value={this.state.apihost || 'http://' } onChange={(e) => this.handleChange(e)} />
<FormControl.Feedback />
</FormGroup>
<FormGroup controlId="category">
<FormLabel column={false}>Category (e.g. Simulator, Gateway, ...)</FormLabel>
<FormControl type="text" placeholder={this.props.ic.category} value={this.state.category} onChange={(e) => this.handleChange(e)} />

View file

@ -280,6 +280,7 @@ class InfrastructureComponents extends Component {
<TableColumn title='Location' dataKeys={['properties.location', 'rawProperties.location']} />
{/* <TableColumn title='Realm' dataKeys={['properties.realm', 'rawProperties.realm']} /> */}
<TableColumn title='Host' dataKey='host' />
<TableColumn title='API Host' dataKey='apihost' />
<TableColumn title='Last Update' dataKey='stateUpdatedAt' modifier={InfrastructureComponents.stateUpdateModifier} />
<TableColumn
width='200'