Add UI to show if Trotec is in use

This commit is contained in:
Tanner Collin 2020-07-26 00:04:58 +00:00
parent 0f826015f7
commit f7469d67b9

View File

@ -150,6 +150,8 @@ export function Home(props) {
const mcPlayers = stats && stats['minecraft_players'] ? stats['minecraft_players'] : []; const mcPlayers = stats && stats['minecraft_players'] ? stats['minecraft_players'] : [];
const getTrackStat = (x) => stats && stats.track && stats.track[x] && moment().unix() - stats.track[x] > 60 ? 'Free' : 'In Use';
return ( return (
<Container> <Container>
<Grid stackable padded columns={2}> <Grid stackable padded columns={2}>
@ -214,6 +216,8 @@ export function Home(props) {
</React.Fragment> </React.Fragment>
} trigger={<a>[more]</a>} /> } trigger={<a>[more]</a>} />
</p> </p>
<p>Trotec availability: {getTrackStat('TROTECS300')}</p>
</div> </div>
</Segment> </Segment>