Added octoprint offline feature

This commit is contained in:
Batuhan Şanlı 2023-09-26 12:29:51 +03:00
parent 024b912467
commit 9c2c2df9b0

View File

@ -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} />;
}