diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 1d738089..38215277 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -625,6 +625,7 @@ "wanDownload": "WAN Download" }, "moonraker": { + "time": "Time", "printer_state": "Printer State", "print_status": "Print Status", "print_progress": "Progress", diff --git a/src/widgets/moonraker/component.jsx b/src/widgets/moonraker/component.jsx index 78332135..0a07daf8 100644 --- a/src/widgets/moonraker/component.jsx +++ b/src/widgets/moonraker/component.jsx @@ -35,16 +35,25 @@ export default function Component({ service }) { } const printStatsInfo = printStats.result.status.print_stats.info ?? {}; + const totalDurationSeconds = printStats.result.status.print_stats.total_duration ?? 0; + const fileName = printStats.result.status.print_stats.filename; const { current_layer: currentLayer = "-", total_layer: totalLayer = "-" } = printStatsInfo; return ( - - - - - + <> + + {/* current_layer and total_layer variables are not available if not exposed by the slicer */} + {currentLayer && totalLayer ? : null} + + {totalDurationSeconds > 0 ? : null } + + + {fileName ?
+
+ {fileName} +
+
: null } + ); }