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<ShowLogProps, 
ShowLogState> {
     }
   }
 
+  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 <div className="show-log">
       <div className="top-actions">
+        <Checkbox
+          label="Tail Log"
 
 Review comment:
   please use "Sentence case" 

----------------------------------------------------------------
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

Reply via email to