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

show running state of scenario with icon (closes #223)

This commit is contained in:
Sonja Happ 2020-06-23 15:22:25 +02:00
parent 85390df0b8
commit 7894282618
2 changed files with 13 additions and 4 deletions

View file

@ -63,7 +63,7 @@ class CustomTable extends Component {
let cell = [];
if (content != null) {
content = content.toString();
//content = content.toString();
// check if cell should be a link
const linkKey = child.props.linkKey;
@ -79,7 +79,7 @@ class CustomTable extends Component {
// add label to content
const labelKey = child.props.labelKey;
if (labelKey && data[labelKey] != null) {
var labelContent = data[labelKey];
let labelContent = data[labelKey];
if (child.props.labelModifier) {
labelContent = child.props.labelModifier(labelContent, data);
@ -90,7 +90,7 @@ class CustomTable extends Component {
cell.push(<span>
&nbsp;
<FormLabel column={false} className={labelStyle}>
{labelContent.toString()}
{labelContent}
</FormLabel>
</span>
);

View file

@ -214,6 +214,15 @@ class Scenarios extends Component {
FileSaver.saveAs(blob, 'scenario - ' + scenario.name + '.json');
}
modifyRunningColumn(running){
if(running){
return <Icon icon='times' />
} else {
return <Icon icon='check' />
}
}
render() {
const buttonStyle = {
@ -227,7 +236,7 @@ class Scenarios extends Component {
<Table data={this.state.scenarios}>
<TableColumn title='Name' dataKey='name' link='/scenarios/' linkKey='id' />
<TableColumn title='ID' dataKey='id' />
<TableColumn title='Running' dataKey='running' />
<TableColumn title='Running' dataKey='running' modifier={(running) => this.modifyRunningColumn(running)}/>
<TableColumn
width='200'
editButton