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

Category and type of IC (in edit and add) are now selectable via drop down menu #266

This commit is contained in:
Laura Fuentes Grau 2020-10-28 20:35:39 +01:00
parent 7a76e5e71b
commit 0deec45383
2 changed files with 71 additions and 12 deletions

View file

@ -99,6 +99,26 @@ class EditICDialog extends React.Component {
}
render() {
let typeOptions = [];
switch(this.state.category){
case "Simulator":
typeOptions = ["Dummy","Generic","DPsim","RTLAB","RSCAD"];
break;
case "Controller":
typeOptions = ["Kubernetes","VILLAS-controller"];
break;
case "Gateway":
typeOptions = ["VILLAS-node","VILLAS-relay"];
break;
case "Service":
typeOptions = ["EMS","Custom"];
break;
case "Equipment":
typeOptions = ["Chroma-emulator","Chroma-loads","SMA-sunnyboy","FLEPS","Sonnenbatterie"];
break;
default:
typeOptions =[];
}
return (
<Dialog
show={this.props.show}
@ -129,14 +149,23 @@ class EditICDialog extends React.Component {
<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)} />
<FormControl.Feedback />
<FormLabel column={false}>Category</FormLabel>
<FormControl as="select" value={this.state.category} onChange={(e) => this.handleChange(e)}>
<option>Simulator</option>
<option>Controller</option>
<option>Service</option>
<option>Gateway</option>
<option>Equipment</option>
</FormControl>
</FormGroup>
<FormGroup controlId="type">
<FormLabel column={false}>Type (e.g. RTDS, VILLASnode, ...)</FormLabel>
<FormControl type="text" placeholder={this.props.ic.type} value={this.state.type} onChange={(e) => this.handleChange(e)} />
<FormControl.Feedback />
<FormLabel column={false}>Type</FormLabel>
<FormControl as="select" value={this.state.type} onChange={(e) => this.handleChange(e)}>
<option default>Select type</option>
{typeOptions.map((name,index) => (
<option key={index}>{name}</option>
))}
</FormControl>
</FormGroup>
<FormGroup controlId='properties'>
<FormLabel column={false}>Properties</FormLabel>

View file

@ -116,6 +116,26 @@ class NewICDialog extends React.Component {
}
render() {
let typeOptions = [];
switch(this.state.category){
case "Simulator":
typeOptions = ["Dummy","Generic","DPsim","RTLAB","RSCAD"];
break;
case "Controller":
typeOptions = ["Kubernetes","VILLAS-controller"];
break;
case "Gateway":
typeOptions = ["VILLAS-node","VILLAS-relay"];
break;
case "Service":
typeOptions = ["EMS","Custom"];
break;
case "Equipment":
typeOptions = ["Chroma-emulator","Chroma-loads","SMA-sunnyboy","FLEPS","Sonnenbatterie"];
break;
default:
typeOptions =[];
}
return (
<Dialog show={this.props.show} title="New Infrastructure Component" buttonTitle="Add" onClose={(c) => this.onClose(c)} onReset={() => this.resetState()} valid={this.valid}>
<form>
@ -137,14 +157,24 @@ class NewICDialog extends React.Component {
<FormControl.Feedback />
</FormGroup>
<FormGroup controlId="category">
<FormLabel>Category of component (e.g. Simulator, Gateway, ...)</FormLabel>
<FormControl type="text" placeholder="Enter category" value={this.state.category} onChange={(e) => this.handleChange(e)} />
<FormControl.Feedback />
<FormLabel>Category of component</FormLabel>
<FormControl as="select" value={this.state.category} onChange={(e) => this.handleChange(e)}>
<option default>Select category</option>
<option>Simulator</option>
<option>Controller</option>
<option>Service</option>
<option>Gateway</option>
<option>Equipment</option>
</FormControl>
</FormGroup>
<FormGroup controlId="type">
<FormLabel>Type of component (e.g. RTDS, VILLASnode, ...)</FormLabel>
<FormControl type="text" placeholder="Enter type" value={this.state.type} onChange={(e) => this.handleChange(e)} />
<FormControl.Feedback />
<FormLabel>Type of component</FormLabel>
<FormControl as="select" value={this.state.type} onChange={(e) => this.handleChange(e)}>
<option default>Select type</option>
{typeOptions.map((name,index) => (
<option key={index}>{name}</option>
))}
</FormControl>
</FormGroup>
<FormGroup controlId="uuid" valid={this.validateForm('uuid')}>
<FormLabel>UUID</FormLabel>