mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
Merge branch 'Octoprint_Fix' into LocalMain
This commit is contained in:
commit
c439661a93
@ -1,3 +1,5 @@
|
||||
import { Buffer } from 'buffer';
|
||||
|
||||
import Container from "components/services/widget/container";
|
||||
import Block from "components/services/widget/block";
|
||||
import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||
@ -9,7 +11,12 @@ export default function Component({ service }) {
|
||||
const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats");
|
||||
|
||||
if (printerStatsError) {
|
||||
return <Container service={service} error={printerStatsError} />;
|
||||
const msg = JSON.parse(Buffer.from(printerStatsError.resultData.data).toString());
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block label="OFFLINE" value={msg.error} />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
if (jobStatsError) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user