From 40f5b2286cfcf9258a2cd7b9113c71d16d96e7c3 Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Tue, 5 Jan 2021 15:26:53 +0100 Subject: [PATCH] ICs: fix parameter transfer for new ICs, add opalrt as additional simulator type --- src/ic/edit-ic.js | 2 +- src/ic/new-ic.js | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ic/edit-ic.js b/src/ic/edit-ic.js index f2bd679..7ce6d5d 100644 --- a/src/ic/edit-ic.js +++ b/src/ic/edit-ic.js @@ -120,7 +120,7 @@ class EditICDialog extends React.Component { let typeOptions = []; switch(this.state.category){ case "simulator": - typeOptions = ["dummy","generic","dpsim","rtlab","rscad"]; + typeOptions = ["dummy","generic","dpsim","rtlab","rscad", "opalrt"]; break; case "controller": typeOptions = ["kubernetes","villas-controller"]; diff --git a/src/ic/new-ic.js b/src/ic/new-ic.js index 134c62b..4f52667 100644 --- a/src/ic/new-ic.js +++ b/src/ic/new-ic.js @@ -28,10 +28,13 @@ class NewICDialog extends React.Component { this.state = { name: '', websocketurl: '', + apiurl: '', uuid: '', type: '', category: '', managedexternally: false, + description: '', + location: '' }; } @@ -44,12 +47,18 @@ class NewICDialog extends React.Component { category: this.state.category, uuid: this.state.uuid, managedexternally: this.state.managedexternally, + location: this.state.location, + description: this.state.description }; if (this.state.websocketurl != null && this.state.websocketurl !== "" && this.state.websocketurl !== 'http://') { data.websocketurl = this.state.websocketurl; } + if (this.state.apiurl != null && this.state.apiurl !== "" && this.state.apiurl !== 'http://') { + data.apiurl = this.state.apiurl; + } + this.props.onClose(data); this.setState({managedexternally: false}); } @@ -69,7 +78,7 @@ class NewICDialog extends React.Component { } resetState() { - this.setState({ name: '', websocketurl: 'http://', uuid: this.uuidv4(), type: '', category: '', managedexternally: false}); + this.setState({ name: '', websocketurl: 'http://', apiurl: 'http://', uuid: this.uuidv4(), type: '', category: '', managedexternally: false, description: '', location: ''}); } validateForm(target) { @@ -120,7 +129,7 @@ class NewICDialog extends React.Component { let typeOptions = []; switch(this.state.category){ case "simulator": - typeOptions = ["dummy","generic","dpsim","rtlab","rscad"]; + typeOptions = ["dummy","generic","dpsim","rtlab","rscad","opalrt"]; break; case "controller": typeOptions = ["kubernetes","villas-controller"];