diff --git a/pkg/lib/cockpit-components-logs-panel.jsx b/pkg/lib/cockpit-components-logs-panel.jsx index 778deb45f112..7831bdc55f44 100644 --- a/pkg/lib/cockpit-components-logs-panel.jsx +++ b/pkg/lib/cockpit-components-logs-panel.jsx @@ -31,6 +31,7 @@ const _ = cockpit.gettext; class JournalOutput { constructor() { this.logs = [ ]; + this.reboot_key = 0; } render_line(ident, prio, message, count, time, entry) { @@ -45,7 +46,7 @@ class JournalOutput { } return ( -
+
{ warning ? @@ -71,12 +72,12 @@ class JournalOutput { } render_day_header(day) { - return
{day}
; + return
{day}
; } render_reboot_separator() { return ( -
+
{_("Reboot")}
@@ -118,10 +119,13 @@ export class LogsPanel extends React.Component { }); } - componentDillUnmount() { + componentWillUnmount() { this.journalctl.stop(); } + // TODO: refactor, the state object can't store neither functions nor React components + // Better approach: store just data to the component's state and render rows directly in the render() method + // Do not use helper functions (the "render_*" above) to generate elements but make components from them (start with CapitalLetter) render() { return (