mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Feature: Added detect octoprint offline printer (#2068)
This commit is contained in:
parent
024b912467
commit
588429c868
@ -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) {
|
||||
return <Container service={service}>
|
||||
<Block label="octoprint.printer_state" value={jobStats.state} />
|
||||
</Container>
|
||||
}
|
||||
|
||||
if (printerStatsError) {
|
||||
return <Container service={service} error={printerStatsError} />;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user