LogsView bugfix

This commit is contained in:
Kyrylo Gliebov 2018-12-11 12:18:08 +01:00 committed by Kirill Glebov
parent 6f6c6b7714
commit 09039778c2

View file

@ -237,7 +237,6 @@ class Logs extends React.Component {
this.start = null;
this.end = null;
this.hostname = null;
this.earlier_than = null;
this.state = {
serverTimeOffset: null,
cursor: null,
@ -344,26 +343,14 @@ class Logs extends React.Component {
this.getServerTimeOffset();
}
componentDidMount() {
if (this.props.recording) {
if (this.start === null && this.end === null) {
this.end = this.props.recording.start + 3600;
this.start = this.props.recording.start;
this.earlier_than = this.props.recording.start;
}
if (this.props.recording.hostname) {
this.hostname = this.props.recording.hostname;
}
this.getLogs();
}
}
componentDidUpdate() {
if (this.props.recording) {
if (this.start === null && this.end === null) {
this.end = this.props.recording.start + 3600;
this.start = this.props.recording.start;
this.earlier_than = this.props.recording.start;
}
if (this.props.recording.hostname) {
this.hostname = this.props.recording.hostname;
}
this.getLogs();
}
@ -373,6 +360,16 @@ class Logs extends React.Component {
}
}
componentWillUnmount() {
this.journalCtl.stop();
this.setState({
serverTimeOffset: null,
cursor: null,
after: null,
entries: [],
});
}
render() {
let r = this.props.recording;
if (r == null) {