Hide Protospace stats on member details page

This commit is contained in:
Tanner Collin 2022-02-04 22:18:05 +00:00
parent d854c326e8
commit 704333e7a2

View File

@ -229,102 +229,104 @@ export function Home(props) {
</div> </div>
} }
</Grid.Column> </Grid.Column>
<Grid.Column> <Grid.Column>
<Segment> {user.member.set_details &&
<Header size='medium'>Quick Links</Header> <Segment>
<p><a href='http://protospace.ca/' target='_blank' rel='noopener noreferrer'>Main Website</a></p> <Header size='medium'>Quick Links</Header>
<p><a href='http://wiki.protospace.ca/Welcome_to_Protospace' target='_blank' rel='noopener noreferrer'>Protospace Wiki</a> <Link to='/auth/wiki'>[register]</Link></p> <p><a href='http://protospace.ca/' target='_blank' rel='noopener noreferrer'>Main Website</a></p>
<p><a href='https://forum.protospace.ca' target='_blank' rel='noopener noreferrer'>Protospace Forum</a> <Link to='/auth/discourse'>[register]</Link></p> <p><a href='http://wiki.protospace.ca/Welcome_to_Protospace' target='_blank' rel='noopener noreferrer'>Protospace Wiki</a> <Link to='/auth/wiki'>[register]</Link></p>
{!!user && <p><a href='https://drive.google.com/drive/folders/0By-vvp6fxFekfmU1cmdxaVRlaldiYXVyTE9rRnNVNjhkc3FjdkFIbjBwQkZ3MVVQX2Ezc3M?resourcekey=0-qVLjcYr8ZCmLypdINk2svg' target='_blank' rel='noopener noreferrer'>Google Drive</a></p>} <p><a href='https://forum.protospace.ca' target='_blank' rel='noopener noreferrer'>Protospace Forum</a> <Link to='/auth/discourse'>[register]</Link></p>
{!!user && isAdmin(user) && <p><a href='https://estancia.hippocmms.ca/' target='_blank' rel='noopener noreferrer'>Property Management Portal</a></p>} {!!user && <p><a href='https://drive.google.com/drive/folders/0By-vvp6fxFekfmU1cmdxaVRlaldiYXVyTE9rRnNVNjhkc3FjdkFIbjBwQkZ3MVVQX2Ezc3M?resourcekey=0-qVLjcYr8ZCmLypdINk2svg' target='_blank' rel='noopener noreferrer'>Google Drive</a></p>}
{!!user && isAdmin(user) && <p><a href='https://estancia.hippocmms.ca/' target='_blank' rel='noopener noreferrer'>Property Management Portal</a></p>}
<img className='swordfish' src='/swordfish.png' onClick={() => refreshStats()} /> <img className='swordfish' src='/swordfish.png' onClick={() => refreshStats()} />
<div> <div>
<Header size='medium'>Protospace Stats</Header> <Header size='medium'>Protospace Stats</Header>
<p>Next member meeting: {getDateStat('next_meeting')}</p> <p>Next member meeting: {getDateStat('next_meeting')}</p>
<p>Next monthly clean: {getDateStat('next_clean')}</p> <p>Next monthly clean: {getDateStat('next_clean')}</p>
<p>Member count: {getStat('member_count')} <Link to='/charts'>[more]</Link></p> <p>Member count: {getStat('member_count')} <Link to='/charts'>[more]</Link></p>
<p>Green members: {getStat('green_count')}</p> <p>Green members: {getStat('green_count')}</p>
<p>Card scans today: {getZeroStat('card_scans')}</p> <p>Card scans today: {getZeroStat('card_scans')}</p>
<p> <p>
Minecraft players: {mcPlayers.length} {mcPlayers.length > 5 && '🔥'} <Popup content={ Minecraft players: {mcPlayers.length} {mcPlayers.length > 5 && '🔥'} <Popup content={
<React.Fragment> <React.Fragment>
<p> <p>
Server IP:<br /> Server IP:<br />
games.protospace.ca games.protospace.ca
</p> </p>
<p> <p>
Players:<br /> Players:<br />
{mcPlayers.length ? mcPlayers.map(x => <React.Fragment>{x}<br /></React.Fragment>) : 'None'} {mcPlayers.length ? mcPlayers.map(x => <React.Fragment>{x}<br /></React.Fragment>) : 'None'}
</p> </p>
</React.Fragment> </React.Fragment>
} trigger={<a>[more]</a>} /> } trigger={<a>[more]</a>} />
{' '}<a href='http://games.protospace.ca:8123/?worldname=world&mapname=flat&zoom=3&x=74&y=64&z=354' target='_blank'>[map]</a> {' '}<a href='http://games.protospace.ca:8123/?worldname=world&mapname=flat&zoom=3&x=74&y=64&z=354' target='_blank'>[map]</a>
</p> </p>
{stats && stats.hasOwnProperty('mumble_users') && <p> {stats && stats.hasOwnProperty('mumble_users') && <p>
Mumble users: {mumbleUsers.length} <Popup content={ Mumble users: {mumbleUsers.length} <Popup content={
<React.Fragment> <React.Fragment>
<p> <p>
Server IP:<br /> Server IP:<br />
mumble.protospace.ca mumble.protospace.ca
</p> </p>
<p> <p>
Users:<br /> Users:<br />
{mumbleUsers.length ? mumbleUsers.map(x => <React.Fragment>{x}<br /></React.Fragment>) : 'None'} {mumbleUsers.length ? mumbleUsers.map(x => <React.Fragment>{x}<br /></React.Fragment>) : 'None'}
</p> </p>
</React.Fragment> </React.Fragment>
} trigger={<a>[more]</a>} /> } trigger={<a>[more]</a>} />
</p>} </p>}
<p> <p>
Trotec availability: {getTrackStat('TROTECS300')} <Popup content={ Trotec availability: {getTrackStat('TROTECS300')} <Popup content={
<React.Fragment> <React.Fragment>
<p> <p>
Last use:<br /> Last use:<br />
{getTrackLast('TROTECS300')}<br /> {getTrackLast('TROTECS300')}<br />
{getTrackAgo('TROTECS300')}<br /> {getTrackAgo('TROTECS300')}<br />
by {getTrackName('TROTECS300')} by {getTrackName('TROTECS300')}
</p> </p>
</React.Fragment> </React.Fragment>
} trigger={<a>[more]</a>} /> } trigger={<a>[more]</a>} />
</p> </p>
<p> <p>
Rabbit availability: {getTrackStat('FRICKIN-LASER')} <Popup content={ Rabbit availability: {getTrackStat('FRICKIN-LASER')} <Popup content={
<React.Fragment> <React.Fragment>
<p> <p>
Last use:<br /> Last use:<br />
{getTrackLast('FRICKIN-LASER')}<br /> {getTrackLast('FRICKIN-LASER')}<br />
{getTrackAgo('FRICKIN-LASER')}<br /> {getTrackAgo('FRICKIN-LASER')}<br />
by {getTrackName('FRICKIN-LASER')} by {getTrackName('FRICKIN-LASER')}
</p> </p>
</React.Fragment> </React.Fragment>
} trigger={<a>[more]</a>} /> } trigger={<a>[more]</a>} />
</p> </p>
<p> <p>
Precix availability: {getTrackStat('CNC-PRECIX')} <Popup content={ Precix availability: {getTrackStat('CNC-PRECIX')} <Popup content={
<React.Fragment> <React.Fragment>
<p> <p>
Last use:<br /> Last use:<br />
{getTrackLast('CNC-PRECIX')}<br /> {getTrackLast('CNC-PRECIX')}<br />
{getTrackAgo('CNC-PRECIX')}<br /> {getTrackAgo('CNC-PRECIX')}<br />
by {getTrackName('CNC-PRECIX')} by {getTrackName('CNC-PRECIX')}
</p> </p>
</React.Fragment> </React.Fragment>
} trigger={<a>[more]</a>} /> } trigger={<a>[more]</a>} />
</p> </p>
{user && <p>Alarm status: {alarmStat()}{doorOpenStat()}</p>} {user && <p>Alarm status: {alarmStat()}{doorOpenStat()}</p>}
</div> </div>
<SignForm token={token} /> <SignForm token={token} />
</Segment>
</Segment>
}
</Grid.Column> </Grid.Column>
</Grid> </Grid>
</Container> </Container>