Reset Logs View on Player Rewind

This commit is contained in:
Justin Stephenson 2019-11-06 11:27:54 -05:00
parent 046a1d4cb1
commit f2e5bc2903
2 changed files with 12 additions and 1 deletions

View file

@ -974,6 +974,9 @@ export class Player extends React.Component {
this.clearInputPlayer(); this.clearInputPlayer();
this.reset(); this.reset();
this.sync(); this.sync();
if (this.props.logsEnabled) {
this.props.onRewindStart();
}
} }
fastForwardToEnd() { fastForwardToEnd() {

View file

@ -403,6 +403,7 @@ class Recording extends React.Component {
this.handleTsChange = this.handleTsChange.bind(this); this.handleTsChange = this.handleTsChange.bind(this);
this.handleLogTsChange = this.handleLogTsChange.bind(this); this.handleLogTsChange = this.handleLogTsChange.bind(this);
this.handleLogsClick = this.handleLogsClick.bind(this); this.handleLogsClick = this.handleLogsClick.bind(this);
this.handleLogsReset = this.handleLogsReset.bind(this);
this.state = { this.state = {
curTs: null, curTs: null,
logsTs: null, logsTs: null,
@ -422,6 +423,12 @@ class Recording extends React.Component {
this.setState({logsEnabled: !this.state.logsEnabled}); this.setState({logsEnabled: !this.state.logsEnabled});
} }
handleLogsReset() {
this.setState({logsEnabled: false}, () => {
this.setState({logsEnabled: true});
});
}
goBackToList() { goBackToList() {
if (cockpit.location.path[0]) { if (cockpit.location.path[0]) {
if ("search_rec" in cockpit.location.options) { if ("search_rec" in cockpit.location.options) {
@ -446,7 +453,8 @@ class Recording extends React.Component {
search={this.props.search} search={this.props.search}
onTsChange={this.handleTsChange} onTsChange={this.handleTsChange}
recording={r} recording={r}
logsEnabled={this.state.logsEnabled} />); logsEnabled={this.state.logsEnabled}
onRewindStart={this.handleLogsReset} />);
return ( return (
<React.Fragment> <React.Fragment>