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

Infrastructure Components:only export button visible to users without admin role #239

This commit is contained in:
Laura Fuentes Grau 2020-07-27 12:42:53 +02:00
parent 9ed698f428
commit ae53a16701

View file

@ -302,24 +302,24 @@ class InfrastructureComponents extends Component {
/>
}
</Table>
<div style={{ float: 'left' }}>
<ICAction
runDisabled={this.state.selectedICs.length === 0}
runAction={this.runAction}
actions={[ { id: '0', title: 'Reset', data: { action: 'reset' } }, { id: '1', title: 'Shutdown', data: { action: 'shutdown' } } ]}/>
</div>
<div style={{ float: 'right' }}>
<Button onClick={() => this.setState({ importModal: true })} style={buttonStyle}><Icon icon="upload" /> Import</Button>
</div>
{this.state.currentUser.role === "Admin" ?
<div style={{ float: 'right' }}>
<Button onClick={() => this.setState({ newModal: true })} style={buttonStyle}><Icon icon="plus" /> Infrastructure Component</Button>
</div>
:
<div> </div>
<div style={{ float: 'left' }}>
<ICAction
runDisabled={this.state.selectedICs.length === 0}
runAction={this.runAction}
actions={[{ id: '0', title: 'Reset', data: { action: 'reset' } }, { id: '1', title: 'Shutdown', data: { action: 'shutdown' } }]} />
</div>
:
<div> </div>
}
{this.state.currentUser.role === "Admin" ?
<div style={{ float: 'right' }}>
<Button onClick={() => this.setState({ newModal: true })} style={buttonStyle}><Icon icon="plus" /> Infrastructure Component</Button>
<Button onClick={() => this.setState({ importModal: true })} style={buttonStyle}><Icon icon="upload" /> Import</Button>
</div>
:
<div> </div>
}
<div style={{ clear: 'both' }} />