[GitHub] [incubator-druid] vogievetsky commented on a change in pull request #7703: Web console: add log tailing to task log view
vogievetsky commented on a change in pull request #7703: Web console: add log tailing to task log view URL: https://github.com/apache/incubator-druid/pull/7703#discussion_r287138069 ## File path: web-console/src/components/show-log/show-log.tsx ## @@ -71,12 +74,39 @@ export class ShowLog extends React.Component { } } + async tail() { + await this.getLogInfo(); + if (this.state.tail) { + if (this.log.current) { +this.log.current.scrollTo(0, this.log.current.scrollHeight); + } + setTimeout(() => { +this.tail(); + }, 2000); +} +} + + private handleCheckboxChange = () => { +this.setState({ + tail: !this.state.tail +}); +if (!this.state.tail) { + this.tail(); +} + } + + render() { const { endpoint, downloadFilename } = this.props; const { logValue } = this.state; return +
[GitHub] [incubator-druid] vogievetsky commented on a change in pull request #7703: Web console: add log tailing to task log view
vogievetsky commented on a change in pull request #7703: Web console: add log tailing to task log view URL: https://github.com/apache/incubator-druid/pull/7703#discussion_r285784062 ## File path: web-console/src/components/show-log.tsx ## @@ -71,12 +73,39 @@ export class ShowLog extends React.Component { } } + private tail() { + this.getLogInfo().then(() => { +if (this.state.tail) { + if (this.log.current) { +this.log.current.scrollTo(0, this.log.current.scrollHeight); } + setTimeout(function() { +this.tail(); + }.bind(this), 2000); +} + }); Review comment: oh my the indentation in this function is all messed up also you do not need to do `.bind(this)` you can just use `() => {}` syntax This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org
[GitHub] [incubator-druid] vogievetsky commented on a change in pull request #7703: Web console: add log tailing to task log view
vogievetsky commented on a change in pull request #7703: Web console: add log tailing to task log view URL: https://github.com/apache/incubator-druid/pull/7703#discussion_r285784080 ## File path: web-console/src/components/show-log.tsx ## @@ -43,15 +43,17 @@ export interface ShowLogProps extends React.Props { export interface ShowLogState { logValue: string; + tail: boolean; } export class ShowLog extends React.Component { + log = React.createRef(); Review comment: could you denote with with a `public` prefix and also add a empty line after this one? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org
[GitHub] [incubator-druid] vogievetsky commented on a change in pull request #7703: Web console: add log tailing to task log view
vogievetsky commented on a change in pull request #7703: Web console: add log tailing to task log view URL: https://github.com/apache/incubator-druid/pull/7703#discussion_r285784284 ## File path: web-console/src/components/show-log.tsx ## @@ -71,12 +73,39 @@ export class ShowLog extends React.Component { } } + private tail() { + this.getLogInfo().then(() => { Review comment: don't use `.then` use `async` / `await` instead This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org