Infrastructure Components
@@ -407,61 +486,12 @@ class InfrastructureComponents extends Component {
( )
}
-
- this.isExternalIC(index)}
- onChecked={(index, event) => this.onICChecked(index, event)}
- width='30'
- />
- this.modifyNameColumn(name, component)}
- />
- this.stateLabelStyle(state, component)}
- />
-
-
- this.modifyUptimeColumn(uptime, component)}
- />
- this.stateUpdateModifier(stateUpdateAt, component)}
- />
- {this.state.currentUser.role === "Admin" ?
- this.setState({editModal: true, modalIC: this.state.ics[index], modalIndex: index})}
- onExport={index => this.exportIC(index)}
- onDelete={index => this.setState({deleteModal: true, modalIC: this.state.ics[index], modalIndex: index})}
- />
- :
- this.exportIC(index)}
- />
- }
-
+ {managerTable}
+ {simulatorTable}
+ {gatewayTable}
+ {serviceTable}
+ {equipmentTable}
{this.state.currentUser.role === "Admin" && this.state.numberOfExternalICs > 0 ?
@@ -481,9 +511,10 @@ class InfrastructureComponents extends Component {
-
this.closeNewModal(data)} />
+ this.closeNewModal(data)} managers={this.state.managers} />
this.closeEditModal(data)} ic={this.state.modalIC} />
this.closeImportModal(data)} />
+ this.closeDeleteModal(e)} />
this.closeICModal(data)}
@@ -492,8 +523,8 @@ class InfrastructureComponents extends Component {
userRole={this.state.currentUser.role}
sendControlCommand={(command, ic) => this.sendControlCommand(command, ic)}/>
- this.closeDeleteModal(e)} />
+
);
}
}
diff --git a/src/ic/new-ic.js b/src/ic/new-ic.js
index 70ba920..b95b543 100644
--- a/src/ic/new-ic.js
+++ b/src/ic/new-ic.js
@@ -34,7 +34,8 @@ class NewICDialog extends React.Component {
category: '',
managedexternally: false,
description: '',
- location: ''
+ location: '',
+ manager: ''
};
}
@@ -48,7 +49,8 @@ class NewICDialog extends React.Component {
uuid: this.state.uuid,
managedexternally: this.state.managedexternally,
location: this.state.location,
- description: this.state.description
+ description: this.state.description,
+ manager: this.state.manager
};
if (this.state.websocketurl != null && this.state.websocketurl !== "" && this.state.websocketurl !== 'http://') {
@@ -88,6 +90,7 @@ class NewICDialog extends React.Component {
let websocketurl = true;
let type = true;
let category = true;
+ let manager = true;
if (this.state.name === '') {
name = false;
@@ -97,6 +100,10 @@ class NewICDialog extends React.Component {
uuid = false;
}
+ if(this.state.managedexternally && manager === ''){
+ manager = false;
+ }
+
if (this.state.type === '') {
type = false;
}
@@ -105,7 +112,7 @@ class NewICDialog extends React.Component {
category = false;
}
- this.valid = name && uuid && websocketurl && type && category;
+ this.valid = name && uuid && websocketurl && type && category && manager;
// return state to control
if (target === 'name') return name ? "success" : "error";
@@ -113,6 +120,7 @@ class NewICDialog extends React.Component {
if (target === 'websocketurl') return websocketurl ? "success" : "error";
if (target === 'type') return type ? "success" : "error";
if (target === 'category') return category ? "success" : "error";
+ if (target === 'manager') return manager ? "success" : "error";
return this.valid;
}
@@ -149,30 +157,49 @@ class NewICDialog extends React.Component {
return (
);