Adjust prices, add negative protocoin warning

This commit is contained in:
Tanner Collin 2023-02-13 23:24:37 +00:00
parent 7c0b44477a
commit d946348fec
2 changed files with 14 additions and 4 deletions

View File

@ -1312,6 +1312,9 @@ class ProtocoinViewSet(Base):
logger.error(msg) logger.error(msg)
return Response(200) return Response(200)
# status 0 = complete
# status 3 = cancelled
is_completed = request.data['job_status'] == '0' is_completed = request.data['job_status'] == '0'
is_print = request.data['source'] == '1' is_print = request.data['source'] == '1'
@ -1335,8 +1338,8 @@ class ProtocoinViewSet(Base):
logger.error(msg) logger.error(msg)
return Response(200) return Response(200)
INK_PROTOCOIN_PER_ML = 0.20 INK_PROTOCOIN_PER_ML = 0.75
DEFAULT_PAPER_PROTOCOIN_PER_M = 0.25 DEFAULT_PAPER_PROTOCOIN_PER_M = 0.50
PROTOCOIN_PER_PRINT = 2.0 PROTOCOIN_PER_PRINT = 2.0
total_cost = PROTOCOIN_PER_PRINT total_cost = PROTOCOIN_PER_PRINT

View File

@ -22,6 +22,11 @@ function MemberInfo(props) {
return ( return (
<div> <div>
{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>}
<Grid stackable> <Grid stackable>
<Grid.Column width={5}> <Grid.Column width={5}>
<Image <Image
@ -231,9 +236,11 @@ export function Home(props) {
const getTrackAgo = (x) => stats && stats.track && stats.track[x] ? moment.unix(stats.track[x]['time']).tz('America/Edmonton').fromNow() : ''; const getTrackAgo = (x) => stats && stats.track && stats.track[x] ? moment.unix(stats.track[x]['time']).tz('America/Edmonton').fromNow() : '';
const getTrackName = (x) => stats && stats.track && stats.track[x] && stats.track[x]['first_name'] ? stats.track[x]['first_name'] : 'Unknown'; const getTrackName = (x) => stats && stats.track && stats.track[x] && stats.track[x]['first_name'] ? stats.track[x]['first_name'] : 'Unknown';
const alarmStat = () => stats && stats.alarm && moment().unix() - stats.alarm['time'] < 300 ? stats.alarm['data'] < 270 ? 'Armed' : 'Disarmed' : 'Unknown'; //const alarmStat = () => stats && stats.alarm && moment().unix() - stats.alarm['time'] < 300 ? stats.alarm['data'] < 270 ? 'Armed' : 'Disarmed' : 'Unknown';
const alarmStat = () => 'Unknown';
const doorOpenStat = () => alarmStat() === 'Disarmed' && stats.alarm['data'] > 360 ? ', door open' : ''; //const doorOpenStat = () => alarmStat() === 'Disarmed' && stats.alarm['data'] > 360 ? ', door open' : '';
const doorOpenStat = () => '';
const show_signup = stats?.at_protospace; const show_signup = stats?.at_protospace;