mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 06:08:48 +00:00
Feature: Added detect octoprint offline printer (#2068)
This commit is contained in:
parent
024b912467
commit
588429c868
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue