Added octoprint offline feature
This commit is contained in:
parent
024b912467
commit
9c2c2df9b0
@ -8,6 +8,12 @@ export default function Component({ service }) {
|
||||
const { data: printerStats, error: printerStatsError } = useWidgetAPI(widget, "printer_stats");
|
||||
const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats");
|
||||
|
||||
if (printerStatsError && jobStats && jobStats.state==="Offline") {
|
||||
return <Container service={service}>
|
||||
<Block label="STATUS" value="Not Operational" />
|
||||
</Container>
|
||||
}
|
||||
|
||||
if (printerStatsError) {
|
||||
return <Container service={service} error={printerStatsError} />;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user