Add media computer track stat and last print
This commit is contained in:
parent
03056d559f
commit
9224c546a9
|
@ -1473,6 +1473,18 @@ class ProtocoinViewSet(Base):
|
||||||
)
|
)
|
||||||
utils.log_transaction(tx)
|
utils.log_transaction(tx)
|
||||||
|
|
||||||
|
track = cache.get('track', {})
|
||||||
|
|
||||||
|
devicename = 'LASTLARGEPRINT'
|
||||||
|
first_name = username.split('.')[0].title()
|
||||||
|
|
||||||
|
track[devicename] = dict(
|
||||||
|
time=time.time(),
|
||||||
|
username=username,
|
||||||
|
first_name=first_name,
|
||||||
|
)
|
||||||
|
cache.set('track', track)
|
||||||
|
|
||||||
return Response(200)
|
return Response(200)
|
||||||
except OperationalError:
|
except OperationalError:
|
||||||
self.printer_report(request, pk)
|
self.printer_report(request, pk)
|
||||||
|
|
|
@ -359,6 +359,26 @@ export function Home(props) {
|
||||||
} trigger={<a>[more]</a>} />
|
} trigger={<a>[more]</a>} />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
<p>ORD2 printer: {printer3dStat('ord2')}</p>
|
<p>ORD2 printer: {printer3dStat('ord2')}</p>
|
||||||
|
|
||||||
<p>ORD3 printer: {printer3dStat('ord3')}</p>
|
<p>ORD3 printer: {printer3dStat('ord3')}</p>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user