LogsView bugfix
This commit is contained in:
parent
6f6c6b7714
commit
09039778c2
1 changed files with 13 additions and 16 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue