Skip to content

Commit 9eb8e4e

Browse files
committed
Bring 3D printer status and camera back
1 parent 3b60b22 commit 9eb8e4e

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

webclient/src/Display.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ export function LCARS3Display(props) {
127127
}
128128

129129
<div className='display-printers'>
130+
<DisplayBambuCamera name={'p1s1'} />
131+
<DisplayBambuCamera name={'p1s2'} />
130132
</div>
131133

132134
<div className='display-classes'>
@@ -411,7 +413,7 @@ export function DisplayBambuCamera(props) {
411413
const [pic, setPic] = useState(false);
412414

413415
const getPic = () => {
414-
requester('http://localhost/' + name + '/pic', 'GET')
416+
requester('http://localhost/' + name + '/pic.jpg', 'GET')
415417
.then(res => res.blob())
416418
.then(imageBlob => {
417419
const imageObjectURL = URL.createObjectURL(imageBlob);

webclient/src/Home.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export function Home(props) {
271271
return 'Unknown / Offline';
272272
}
273273

274-
const gcode_states = {IDLE: 'Idle', FINISH: 'Finished', RUNNING: 'Running', PAUSE: 'Paused', FAILED: 'Failed', PREPARE: 'Preparing'};
274+
const gcode_states = {IDLE: 'Idle', FINISH: 'Finished', RUNNING: 'Running', PAUSE: 'Paused', FAILED: 'Failed', PREPARE: 'Preparing', OFFLINE: 'Offline'};
275275

276276
const printer_state = gcode_states?.[info?.gcode_state] || info?.gcode_state || 'Unknown';
277277

@@ -448,6 +448,10 @@ export function Home(props) {
448448
} trigger={<a>[more]</a>} />
449449
</p>
450450

451+
<p>P1S printer L: {p1sPrinter3dStat('p1s1')}</p>
452+
453+
<p>P1S printer R: {p1sPrinter3dStat('p1s2')}</p>
454+
451455
{stats && stats?.solar?.hasOwnProperty('total') && <p>
452456
Members' solar power: {stats.solar.total.toLocaleString()} W <Popup content={
453457
<React.Fragment>

0 commit comments

Comments
 (0)