added dynamic value on block
This commit is contained in:
parent
dd0ec52bab
commit
f99b70273b
@ -8,9 +8,9 @@ export default function Component({ service }) {
|
|||||||
const { data: printerStats, error: printerStatsError } = useWidgetAPI(widget, "printer_stats");
|
const { data: printerStats, error: printerStatsError } = useWidgetAPI(widget, "printer_stats");
|
||||||
const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats");
|
const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats");
|
||||||
|
|
||||||
if (printerStatsError && jobStats && jobStats.state==="Offline") {
|
if (printerStatsError && jobStats) {
|
||||||
return <Container service={service}>
|
return <Container service={service}>
|
||||||
<Block label="octoprint.printer_state" value="Not Operational" />
|
<Block label="octoprint.printer_state" value={jobStats.state} />
|
||||||
</Container>
|
</Container>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user