2020-05-17 00:40:48 +00:00
|
|
|
|
import React, { useState, useEffect, useReducer } from 'react';
|
2023-05-30 21:10:05 +00:00
|
|
|
|
import { Link, useParams, useHistory } from 'react-router-dom';
|
2020-02-24 04:07:18 +00:00
|
|
|
|
import moment from 'moment-timezone';
|
2021-08-18 20:40:11 +00:00
|
|
|
|
import QRCode from 'react-qr-code';
|
2020-01-09 22:11:56 +00:00
|
|
|
|
import './light.css';
|
2023-05-30 21:10:05 +00:00
|
|
|
|
import { Button, Container, Divider, Grid, Header, Icon, Image, Message, Popup, Segment, Table } from 'semantic-ui-react';
|
2021-08-18 20:40:11 +00:00
|
|
|
|
import { statusColor, BasicTable, siteUrl, staticUrl, requester, isAdmin } from './utils.js';
|
2020-01-09 22:11:56 +00:00
|
|
|
|
import { LoginForm, SignupForm } from './LoginSignup.js';
|
2020-01-13 03:18:41 +00:00
|
|
|
|
import { AccountForm } from './Account.js';
|
2021-12-08 22:02:30 +00:00
|
|
|
|
import { SignForm } from './Sign.js';
|
2023-06-03 18:56:01 +00:00
|
|
|
|
import { StorageButton } from './Storage.js';
|
2020-02-21 06:10:52 +00:00
|
|
|
|
import { PayPalSubscribeDeal } from './PayPal.js';
|
2020-01-09 22:11:56 +00:00
|
|
|
|
|
|
|
|
|
function MemberInfo(props) {
|
|
|
|
|
const user = props.user;
|
|
|
|
|
const member = user.member;
|
2023-05-30 21:10:05 +00:00
|
|
|
|
const history = useHistory();
|
2020-01-09 22:11:56 +00:00
|
|
|
|
|
2022-01-14 00:32:21 +00:00
|
|
|
|
const lastTrans = user.transactions?.slice(0,3);
|
|
|
|
|
const lastTrain = user.training?.sort((a, b) => a.session.datetime < b.session.datetime ? 1 : -1).slice(0,3);
|
|
|
|
|
const lastCard = user.cards?.sort((a, b) => a.last_seen < b.last_seen)[0];
|
2020-01-09 22:11:56 +00:00
|
|
|
|
|
2022-03-19 21:40:01 +00:00
|
|
|
|
const unpaidTraining = user.training?.filter(x => x.attendance_status === 'Waiting for payment');
|
|
|
|
|
|
2020-01-09 22:11:56 +00:00
|
|
|
|
return (
|
|
|
|
|
<div>
|
2023-02-13 23:24:37 +00:00
|
|
|
|
{member.protocoin < 0 && <Message error>
|
|
|
|
|
<Message.Header>Your Protocoin balance is negative!</Message.Header>
|
|
|
|
|
<p>Visit the <Link to='/paymaster'>Paymaster</Link> page or pay a Director to buy Protocoin.</p>
|
|
|
|
|
</Message>}
|
|
|
|
|
|
2020-01-09 22:11:56 +00:00
|
|
|
|
<Grid stackable>
|
2020-01-12 04:58:29 +00:00
|
|
|
|
<Grid.Column width={5}>
|
|
|
|
|
<Image
|
|
|
|
|
size='small'
|
|
|
|
|
src={member.photo_medium ? staticUrl + '/' + member.photo_medium : '/nophoto.png'}
|
2020-01-11 06:27:30 +00:00
|
|
|
|
/>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</Grid.Column>
|
|
|
|
|
|
2020-01-12 04:58:29 +00:00
|
|
|
|
<Grid.Column width={11}>
|
2020-01-20 02:54:44 +00:00
|
|
|
|
<Header size='large'>{member.preferred_name} {member.last_name}</Header>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
|
2021-09-22 07:29:24 +00:00
|
|
|
|
{member.is_allowed_entry ?
|
2022-04-10 07:13:36 +00:00
|
|
|
|
<></>
|
2021-09-22 07:29:24 +00:00
|
|
|
|
:
|
2021-09-23 21:13:36 +00:00
|
|
|
|
<p>You are not allowed entry into Protospace ❌</p>
|
2021-09-22 07:29:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-01-12 04:58:29 +00:00
|
|
|
|
<BasicTable>
|
|
|
|
|
<Table.Body>
|
|
|
|
|
<Table.Row>
|
|
|
|
|
<Table.Cell>Status:</Table.Cell>
|
2020-01-20 02:54:44 +00:00
|
|
|
|
<Table.Cell>
|
|
|
|
|
<Icon name='circle' color={statusColor[member.status]} />
|
|
|
|
|
{member.status || 'Unknown'}
|
|
|
|
|
</Table.Cell>
|
2020-01-12 04:58:29 +00:00
|
|
|
|
</Table.Row>
|
2022-08-22 21:33:38 +00:00
|
|
|
|
<Table.Row>
|
|
|
|
|
<Table.Cell>Protocoin:</Table.Cell>
|
2022-08-23 03:09:03 +00:00
|
|
|
|
<Table.Cell>₱ {member.protocoin.toFixed(2)} <Link to='/paymaster'>[buy]</Link></Table.Cell>
|
2022-08-22 21:33:38 +00:00
|
|
|
|
</Table.Row>
|
2023-05-30 21:10:05 +00:00
|
|
|
|
<Table.Row>
|
|
|
|
|
<Table.Cell>Shelf:</Table.Cell>
|
|
|
|
|
<Table.Cell>
|
|
|
|
|
{user.storage.length ?
|
2023-06-03 18:56:01 +00:00
|
|
|
|
user.storage.sort((a, b) => a.location == 'member_shelves' ? -1 : 1).map((x, i) =>
|
|
|
|
|
<StorageButton storage={x} />
|
2023-05-30 21:10:05 +00:00
|
|
|
|
)
|
|
|
|
|
:
|
2023-05-30 23:44:05 +00:00
|
|
|
|
<>None <Link to='/claimshelf'>[claim]</Link></>
|
2023-05-30 21:10:05 +00:00
|
|
|
|
}
|
|
|
|
|
</Table.Cell>
|
|
|
|
|
</Table.Row>
|
2020-01-12 04:58:29 +00:00
|
|
|
|
<Table.Row>
|
|
|
|
|
<Table.Cell>Expiry:</Table.Cell>
|
2022-01-17 21:46:53 +00:00
|
|
|
|
<Table.Cell>{member.expire_date ? moment(member.expire_date).format('ll') : 'Unknown'}</Table.Cell>
|
2020-01-12 04:58:29 +00:00
|
|
|
|
</Table.Row>
|
|
|
|
|
</Table.Body>
|
|
|
|
|
</BasicTable>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</Grid.Column>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
2022-03-19 21:40:01 +00:00
|
|
|
|
{!lastTrans.length && <Message>
|
2020-01-26 10:39:59 +00:00
|
|
|
|
<Message.Header>Welcome, new member!</Message.Header>
|
|
|
|
|
<p>
|
|
|
|
|
<a href={staticUrl + '/' + member.member_forms} target='_blank'>
|
2022-12-21 23:45:19 +00:00
|
|
|
|
View your application forms.
|
|
|
|
|
</a>
|
2020-01-26 10:39:59 +00:00
|
|
|
|
</p>
|
|
|
|
|
</Message>}
|
|
|
|
|
|
2020-02-21 06:10:52 +00:00
|
|
|
|
{!!lastTrans.length && !member.photo_medium && <Message warning>
|
2020-01-13 08:01:42 +00:00
|
|
|
|
<Message.Header>Please set a member photo!</Message.Header>
|
|
|
|
|
<p>Visit the <Link to='/account'>account settings</Link> page to set one.</p>
|
|
|
|
|
</Message>}
|
|
|
|
|
|
2020-05-01 03:55:13 +00:00
|
|
|
|
{!lastTrans.length && <React.Fragment>
|
2020-02-21 06:10:52 +00:00
|
|
|
|
<Header size='medium'>PayPal</Header>
|
|
|
|
|
<p>Create a ${user.member.monthly_fees} / month subscription, get your first three months for the price of two:</p>
|
|
|
|
|
<PayPalSubscribeDeal
|
|
|
|
|
amount={user.member.monthly_fees}
|
|
|
|
|
name='Protospace Membership'
|
|
|
|
|
custom={JSON.stringify({ deal: 3, member: user.member.id })}
|
|
|
|
|
/>
|
2021-08-18 20:40:11 +00:00
|
|
|
|
|
|
|
|
|
<p>Click "Checkout as Guest" if you don't have a PayPal account.</p>
|
|
|
|
|
|
2022-04-28 20:52:51 +00:00
|
|
|
|
<QRCode value={siteUrl + 'subscribe?monthly_fees=' + user.member.monthly_fees + '&id=' + user.member.id} />
|
2020-05-01 03:55:13 +00:00
|
|
|
|
</React.Fragment>}
|
2020-02-21 06:10:52 +00:00
|
|
|
|
|
2022-03-19 21:40:01 +00:00
|
|
|
|
{unpaidTraining.map(x =>
|
|
|
|
|
<Message warning>
|
|
|
|
|
<Message.Header>Please pay your course fee!</Message.Header>
|
|
|
|
|
<p>Pay ${x.session.cost} for <Link to={'/classes/'+x.session.id}>{x.session.course_data.name}</Link> to avoid losing your spot.</p>
|
|
|
|
|
</Message>
|
|
|
|
|
)}
|
|
|
|
|
|
2023-05-06 23:21:25 +00:00
|
|
|
|
<Header size='medium'>Latest Training</Header>
|
|
|
|
|
|
|
|
|
|
{!member.orientation_date && <p>
|
|
|
|
|
⚠️ You need to attend a <Link to={'/courses/249/'}>New Member Orientation</Link> to use any tool larger than a screwdriver.
|
|
|
|
|
</p>}
|
|
|
|
|
|
2022-01-14 00:32:21 +00:00
|
|
|
|
<BasicTable>
|
|
|
|
|
<Table.Body>
|
|
|
|
|
{lastTrain.length ?
|
|
|
|
|
lastTrain.map(x =>
|
|
|
|
|
<Table.Row key={x.id}>
|
|
|
|
|
<Table.Cell style={{ minWidth: '8rem' }}>
|
|
|
|
|
<Link to={'/classes/'+x.session.id}>{moment(x.session.datetime).tz('America/Edmonton').format('ll')}</Link>
|
|
|
|
|
</Table.Cell>
|
|
|
|
|
<Table.Cell>{x.session.course_data.name}</Table.Cell>
|
|
|
|
|
</Table.Row>
|
|
|
|
|
)
|
|
|
|
|
:
|
2023-05-06 23:21:25 +00:00
|
|
|
|
<Table.Row><Table.Cell>None</Table.Cell></Table.Row>
|
2022-01-14 00:32:21 +00:00
|
|
|
|
}
|
2022-05-07 06:28:33 +00:00
|
|
|
|
{user.training.length > 3 &&
|
|
|
|
|
<Table.Row><Table.Cell>
|
|
|
|
|
<Link to='/training'>[more]</Link>
|
|
|
|
|
</Table.Cell></Table.Row>
|
|
|
|
|
}
|
2022-01-14 00:32:21 +00:00
|
|
|
|
</Table.Body>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
|
|
|
|
|
<Header size='medium'>Latest Transactions</Header>
|
|
|
|
|
<BasicTable>
|
|
|
|
|
<Table.Body>
|
|
|
|
|
{lastTrans.length ?
|
|
|
|
|
lastTrans.map(x =>
|
|
|
|
|
<Table.Row key={x.id}>
|
|
|
|
|
<Table.Cell style={{ minWidth: '8rem' }}>
|
|
|
|
|
<Link to={'/transactions/'+x.id}>{moment(x.date).format('ll')}</Link>
|
|
|
|
|
</Table.Cell>
|
|
|
|
|
<Table.Cell>{x.account_type}</Table.Cell>
|
2022-08-22 21:33:38 +00:00
|
|
|
|
<Table.Cell>{x.protocoin !== '0.00' ? '₱ ' + x.protocoin : '$ ' + x.amount}</Table.Cell>
|
2022-01-14 00:32:21 +00:00
|
|
|
|
</Table.Row>
|
|
|
|
|
)
|
|
|
|
|
:
|
|
|
|
|
<Table.Row><Table.Cell>None</Table.Cell></Table.Row>
|
|
|
|
|
}
|
2022-05-07 06:28:33 +00:00
|
|
|
|
{user.transactions.length > 3 &&
|
|
|
|
|
<Table.Row><Table.Cell>
|
|
|
|
|
<Link to='/transactions'>[more]</Link>
|
|
|
|
|
</Table.Cell></Table.Row>
|
|
|
|
|
}
|
2022-01-14 00:32:21 +00:00
|
|
|
|
</Table.Body>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
|
2020-01-09 22:11:56 +00:00
|
|
|
|
<Header size='medium'>Details</Header>
|
2020-01-11 23:53:42 +00:00
|
|
|
|
<BasicTable>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
<Table.Body>
|
|
|
|
|
<Table.Row>
|
|
|
|
|
<Table.Cell>Application:</Table.Cell>
|
2022-01-17 21:46:53 +00:00
|
|
|
|
<Table.Cell>{member.application_date ? moment(member.application_date).format('ll') : 'Unknown'}</Table.Cell>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</Table.Row>
|
|
|
|
|
<Table.Row>
|
|
|
|
|
<Table.Cell>Start:</Table.Cell>
|
2022-01-17 21:46:53 +00:00
|
|
|
|
<Table.Cell>{member.current_start_date ? moment(member.current_start_date).format('ll') : 'Unknown'}</Table.Cell>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</Table.Row>
|
|
|
|
|
<Table.Row>
|
|
|
|
|
<Table.Cell>Vetted:</Table.Cell>
|
2022-01-17 21:46:53 +00:00
|
|
|
|
<Table.Cell>{member.vetted_date ? moment(member.vetted_date).format('ll') : 'Not vetted'}</Table.Cell>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</Table.Row>
|
|
|
|
|
<Table.Row>
|
2022-01-14 00:32:21 +00:00
|
|
|
|
<Table.Cell>Monthly dues:</Table.Cell>
|
|
|
|
|
<Table.Cell>${member.monthly_fees || 'Unknown'}.00</Table.Cell>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</Table.Row>
|
|
|
|
|
<Table.Row>
|
2022-01-14 00:32:21 +00:00
|
|
|
|
<Table.Cell>Last scan:</Table.Cell>
|
2020-02-28 09:30:22 +00:00
|
|
|
|
<Table.Cell>
|
2022-01-14 00:32:21 +00:00
|
|
|
|
{lastCard && lastCard.last_seen ?
|
|
|
|
|
lastCard.last_seen > '2021-11-14T02:01:35.415685Z' ?
|
|
|
|
|
moment.utc(lastCard.last_seen).tz('America/Edmonton').format('lll')
|
|
|
|
|
:
|
|
|
|
|
moment.utc(lastCard.last_seen).tz('America/Edmonton').format('ll')
|
|
|
|
|
:
|
|
|
|
|
'Unknown'
|
|
|
|
|
}
|
2020-02-28 09:30:22 +00:00
|
|
|
|
{user.cards.length > 1 && <Link to='/cards'> [more]</Link>}
|
|
|
|
|
</Table.Cell>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</Table.Row>
|
|
|
|
|
</Table.Body>
|
2020-01-11 23:53:42 +00:00
|
|
|
|
</BasicTable>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
|
2022-03-19 21:40:01 +00:00
|
|
|
|
{!!lastTrans.length && <p>
|
2020-01-26 10:39:59 +00:00
|
|
|
|
<a href={staticUrl + '/' + member.member_forms} target='_blank'>
|
|
|
|
|
View application forms
|
|
|
|
|
</a>
|
|
|
|
|
</p>}
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function Home(props) {
|
2020-11-17 20:27:12 +00:00
|
|
|
|
const { user, token } = props;
|
2020-02-10 08:02:45 +00:00
|
|
|
|
const [stats, setStats] = useState(JSON.parse(localStorage.getItem('stats', 'false')));
|
2020-05-17 00:40:48 +00:00
|
|
|
|
const [refreshCount, refreshStats] = useReducer(x => x + 1, 0);
|
2020-08-27 19:39:51 +00:00
|
|
|
|
|
2020-02-10 08:02:45 +00:00
|
|
|
|
useEffect(() => {
|
2020-11-17 20:27:12 +00:00
|
|
|
|
requester('/stats/', 'GET', token)
|
2020-02-10 08:02:45 +00:00
|
|
|
|
.then(res => {
|
|
|
|
|
setStats(res);
|
|
|
|
|
localStorage.setItem('stats', JSON.stringify(res));
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
console.log(err);
|
2020-02-10 09:15:14 +00:00
|
|
|
|
setStats(false);
|
2020-02-10 08:02:45 +00:00
|
|
|
|
});
|
2020-11-18 08:47:22 +00:00
|
|
|
|
}, [refreshCount, token]);
|
2020-02-10 08:02:45 +00:00
|
|
|
|
|
2022-01-17 21:46:53 +00:00
|
|
|
|
const getStat = (x) => stats && stats[x] ? stats[x] : 'Unknown';
|
2020-06-22 20:51:04 +00:00
|
|
|
|
const getZeroStat = (x) => stats && stats[x] ? stats[x] : '0';
|
2022-02-16 05:35:38 +00:00
|
|
|
|
const getDateStat = (x) => stats && stats[x] ? moment.utc(stats[x]).tz('America/Edmonton').format('MMM Do @ LT') : 'Unknown';
|
2020-02-10 08:02:45 +00:00
|
|
|
|
|
2022-03-17 19:50:57 +00:00
|
|
|
|
const getNextStat = (x) => {
|
|
|
|
|
if (stats && stats[x]) {
|
|
|
|
|
const datetime = moment.utc(stats[x].datetime).tz('America/Edmonton');
|
|
|
|
|
if (datetime.isSame(moment().tz('America/Edmonton'), 'day') ) {
|
|
|
|
|
return <>{datetime.format('LT')} | <Link to={'/classes/' + stats[x].id}>{stats[x].name}</Link></>;
|
|
|
|
|
} else {
|
|
|
|
|
return <>{datetime.format('MMM Do')} | <Link to={'/classes/' + stats[x].id}>{stats[x].name}</Link></>;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return 'Unknown';
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-21 00:14:53 +00:00
|
|
|
|
const mcPlayers = stats && stats['minecraft_players'] ? stats['minecraft_players'] : [];
|
2020-10-31 22:54:05 +00:00
|
|
|
|
const mumbleUsers = stats && stats['mumble_users'] ? stats['mumble_users'] : [];
|
2020-04-21 00:14:53 +00:00
|
|
|
|
|
2022-01-17 21:46:53 +00:00
|
|
|
|
const getTrackStat = (x) => stats && stats.track && stats.track[x] ? moment().unix() - stats.track[x]['time'] > 60 ? 'Free' : 'In Use' : 'Unknown';
|
2020-09-20 00:23:27 +00:00
|
|
|
|
const getTrackLast = (x) => stats && stats.track && stats.track[x] ? moment.unix(stats.track[x]['time']).tz('America/Edmonton').format('llll') : 'Unknown';
|
|
|
|
|
const getTrackAgo = (x) => stats && stats.track && stats.track[x] ? moment.unix(stats.track[x]['time']).tz('America/Edmonton').fromNow() : '';
|
2022-02-04 22:13:07 +00:00
|
|
|
|
const getTrackName = (x) => stats && stats.track && stats.track[x] && stats.track[x]['first_name'] ? stats.track[x]['first_name'] : 'Unknown';
|
2020-07-26 00:04:58 +00:00
|
|
|
|
|
2023-06-20 22:14:46 +00:00
|
|
|
|
const alarmStat = () => stats && stats.alarm ? stats.alarm.toString() : 'Unknown'; // toString prevents crash from cached alarm Object
|
2021-09-08 03:34:12 +00:00
|
|
|
|
|
2023-03-02 04:36:40 +00:00
|
|
|
|
const closedStat = (x) => stats && stats.closing ? moment().unix() > stats.closing['time'] ? 'Closed' : 'Open until ' + stats.closing['time_str'] : 'Unknown';
|
|
|
|
|
|
2023-03-18 23:59:36 +00:00
|
|
|
|
const printer3dStat = (x) => stats && stats.printer3d && stats.printer3d[x] ? stats.printer3d[x].state === 'Printing' ? 'Printing (' + stats.printer3d[x].progress + '%)' : stats.printer3d[x].state : 'Unknown';
|
2023-03-18 23:42:09 +00:00
|
|
|
|
|
2021-11-15 05:57:18 +00:00
|
|
|
|
const show_signup = stats?.at_protospace;
|
2021-09-04 20:27:16 +00:00
|
|
|
|
|
2020-01-09 22:11:56 +00:00
|
|
|
|
return (
|
|
|
|
|
<Container>
|
|
|
|
|
<Grid stackable padded columns={2}>
|
|
|
|
|
<Grid.Column>
|
|
|
|
|
{user ?
|
|
|
|
|
user.member.set_details ?
|
|
|
|
|
<MemberInfo user={user} />
|
|
|
|
|
:
|
2022-02-04 22:22:55 +00:00
|
|
|
|
<AccountForm {...props} />
|
2020-01-09 22:11:56 +00:00
|
|
|
|
:
|
|
|
|
|
<div>
|
2021-11-15 05:57:18 +00:00
|
|
|
|
<LoginForm {...props} />
|
2020-01-09 22:11:56 +00:00
|
|
|
|
|
2021-11-15 05:57:18 +00:00
|
|
|
|
<Divider section horizontal>Or</Divider>
|
2020-01-09 22:11:56 +00:00
|
|
|
|
|
2021-09-04 20:27:16 +00:00
|
|
|
|
<SignupForm {...props} show_signup={show_signup} />
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</Grid.Column>
|
|
|
|
|
|
2022-02-04 22:18:05 +00:00
|
|
|
|
<Grid.Column>
|
2022-02-05 21:15:03 +00:00
|
|
|
|
{user?.member?.set_details !== false &&
|
2022-02-04 22:18:05 +00:00
|
|
|
|
<Segment>
|
|
|
|
|
<Header size='medium'>Quick Links</Header>
|
2022-12-21 23:44:01 +00:00
|
|
|
|
<p><a href='https://protospace.ca/' target='_blank' rel='noopener noreferrer'>Main Website</a></p>
|
|
|
|
|
<p><a href='https://wiki.protospace.ca/Welcome_to_Protospace' target='_blank' rel='noopener noreferrer'>Protospace Wiki</a> — <Link to='/auth/wiki'>[register]</Link></p>
|
2022-03-14 04:41:15 +00:00
|
|
|
|
<p><a href='https://forum.protospace.ca' target='_blank' rel='noopener noreferrer'>Forum (Spacebar)</a> — <Link to='/auth/discourse'>[register]</Link></p>
|
2022-02-04 22:18:05 +00:00
|
|
|
|
{!!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>}
|
2020-02-10 06:29:13 +00:00
|
|
|
|
|
2022-02-04 22:18:05 +00:00
|
|
|
|
<img className='swordfish' src='/swordfish.png' onClick={() => refreshStats()} />
|
2020-01-09 22:11:56 +00:00
|
|
|
|
|
2022-02-04 22:18:05 +00:00
|
|
|
|
<div>
|
|
|
|
|
<Header size='medium'>Protospace Stats</Header>
|
2022-03-20 20:18:57 +00:00
|
|
|
|
<p>Next meeting: {getDateStat('next_meeting')}</p>
|
|
|
|
|
<p>Next clean: {getDateStat('next_clean')}</p>
|
2022-03-17 19:50:57 +00:00
|
|
|
|
<p className='nowrap-stat'>Next class: {getNextStat('next_class')}</p>
|
|
|
|
|
<p className='nowrap-stat'>Last class: {getNextStat('prev_class')}</p>
|
2022-02-04 22:18:05 +00:00
|
|
|
|
<p>Member count: {getStat('member_count')} <Link to='/charts'>[more]</Link></p>
|
|
|
|
|
<p>Card scans today: {getZeroStat('card_scans')}</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
Minecraft players: {mcPlayers.length} {mcPlayers.length > 5 && '🔥'} <Popup content={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<p>
|
|
|
|
|
Server IP:<br />
|
|
|
|
|
games.protospace.ca
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Players:<br />
|
|
|
|
|
{mcPlayers.length ? mcPlayers.map(x => <React.Fragment>{x}<br /></React.Fragment>) : 'None'}
|
|
|
|
|
</p>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
} 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>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
{stats && stats.hasOwnProperty('mumble_users') && <p>
|
|
|
|
|
Mumble users: {mumbleUsers.length} <Popup content={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<p>
|
|
|
|
|
Server IP:<br />
|
|
|
|
|
mumble.protospace.ca
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
Users:<br />
|
|
|
|
|
{mumbleUsers.length ? mumbleUsers.map(x => <React.Fragment>{x}<br /></React.Fragment>) : 'None'}
|
|
|
|
|
</p>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
} trigger={<a>[more]</a>} />
|
|
|
|
|
</p>}
|
|
|
|
|
|
|
|
|
|
<p>
|
2022-09-15 03:57:40 +00:00
|
|
|
|
Trotec availability: {getTrackStat('TROTECS300')} <Popup content={
|
2022-02-04 22:18:05 +00:00
|
|
|
|
<React.Fragment>
|
|
|
|
|
<p>
|
2022-09-15 03:57:40 +00:00
|
|
|
|
Last use:<br />
|
|
|
|
|
{getTrackLast('TROTECS300')}<br />
|
|
|
|
|
{getTrackAgo('TROTECS300')}<br />
|
|
|
|
|
by {getTrackName('TROTECS300')}
|
2022-02-04 22:18:05 +00:00
|
|
|
|
</p>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
} trigger={<a>[more]</a>} />
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
Rabbit availability: {getTrackStat('FRICKIN-LASER')} <Popup content={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<p>
|
|
|
|
|
Last use:<br />
|
|
|
|
|
{getTrackLast('FRICKIN-LASER')}<br />
|
|
|
|
|
{getTrackAgo('FRICKIN-LASER')}<br />
|
|
|
|
|
by {getTrackName('FRICKIN-LASER')}
|
|
|
|
|
</p>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
} trigger={<a>[more]</a>} />
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
Precix availability: {getTrackStat('CNC-PRECIX')} <Popup content={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<p>
|
|
|
|
|
Last use:<br />
|
|
|
|
|
{getTrackLast('CNC-PRECIX')}<br />
|
|
|
|
|
{getTrackAgo('CNC-PRECIX')}<br />
|
|
|
|
|
by {getTrackName('CNC-PRECIX')}
|
|
|
|
|
</p>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
} trigger={<a>[more]</a>} />
|
|
|
|
|
</p>
|
|
|
|
|
|
2023-04-26 20:47:02 +00:00
|
|
|
|
<p>
|
|
|
|
|
Media computer: {getTrackStat('PROTOGRAPH1')} <Popup content={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<p>
|
|
|
|
|
Last use:<br />
|
|
|
|
|
{getTrackLast('PROTOGRAPH1')}<br />
|
|
|
|
|
{getTrackAgo('PROTOGRAPH1')}<br />
|
|
|
|
|
by {getTrackName('PROTOGRAPH1')}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
Last print:<br />
|
|
|
|
|
{getTrackLast('LASTLARGEPRINT')}<br />
|
|
|
|
|
{getTrackAgo('LASTLARGEPRINT')}<br />
|
|
|
|
|
by {getTrackName('LASTLARGEPRINT')}
|
|
|
|
|
</p>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
} trigger={<a>[more]</a>} />
|
|
|
|
|
</p>
|
|
|
|
|
|
2023-03-18 23:42:09 +00:00
|
|
|
|
<p>ORD2 printer: {printer3dStat('ord2')}</p>
|
|
|
|
|
|
|
|
|
|
<p>ORD3 printer: {printer3dStat('ord3')}</p>
|
|
|
|
|
|
2023-06-20 22:14:46 +00:00
|
|
|
|
{user && <p>Alarm status: {alarmStat()}</p>}
|
2023-03-02 04:36:40 +00:00
|
|
|
|
|
|
|
|
|
{user && <p>Hosting status: {closedStat()}</p>}
|
2022-02-04 22:18:05 +00:00
|
|
|
|
</div>
|
2021-12-03 05:18:41 +00:00
|
|
|
|
|
2022-02-04 22:18:05 +00:00
|
|
|
|
<SignForm token={token} />
|
2021-12-03 05:18:41 +00:00
|
|
|
|
|
2022-05-17 02:38:20 +00:00
|
|
|
|
<p>Protogarden:</p>
|
|
|
|
|
|
|
|
|
|
<Link to='/garden'>
|
|
|
|
|
<Image src={staticUrl + '/garden-medium.jpg'} />
|
|
|
|
|
</Link>
|
|
|
|
|
|
2022-02-04 22:18:05 +00:00
|
|
|
|
</Segment>
|
|
|
|
|
}
|
2020-01-09 22:11:56 +00:00
|
|
|
|
</Grid.Column>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Container>
|
|
|
|
|
);
|
|
|
|
|
};
|