You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2017/10/09 06:01:24 UTC

[26/50] [abbrv] ambari git commit: AMBARI-22112 Log Search UI: refine Capture feature. (Istvan Tobias via ababiichuk)

AMBARI-22112 Log Search UI: refine Capture feature. (Istvan Tobias via ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b0421821
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b0421821
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b0421821

Branch: refs/heads/branch-feature-AMBARI-14714
Commit: b0421821ea66d5cfda7a5f628890350218595986
Parents: fc58250
Author: Istvan Tobias <>
Authored: Thu Oct 5 12:32:50 2017 +0300
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Thu Oct 5 12:32:50 2017 +0300

----------------------------------------------------------------------
 .../filters-panel/filters-panel.component.less   |  2 +-
 .../src/app/services/filtering.service.ts        | 19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b0421821/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less
index 4607d34..aeb6911 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/components/filters-panel/filters-panel.component.less
@@ -64,6 +64,6 @@
   }
 
   /deep/ .stop-icon {
-    color: @error-color;
+    color: @exclude-color;
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/b0421821/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts b/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
index 9e3a7d2..c3177cc 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-import {Injectable} from '@angular/core';
+import {Injectable, Input} from '@angular/core';
 import {FormControl, FormGroup} from '@angular/forms';
 import {Response} from '@angular/http';
 import {Subject} from 'rxjs/Subject';
@@ -78,6 +78,14 @@ export class FilteringService {
 
   timeZone: string = this.defaultTimeZone;
 
+  /**
+   * A configurable property to indicate the maximum capture time in milliseconds.
+   * @type {number}
+   * @default 600000 (10 minutes)
+   */
+  @Input()
+  maximumCaptureTimeLimit: number = 600000;
+
   filters = {
     clusters: {
       label: 'filter.clusters',
@@ -419,7 +427,13 @@ export class FilteringService {
 
   startCaptureTimer(): void {
     this.startCaptureTime = new Date().valueOf();
-    Observable.timer(0, 1000).takeUntil(this.stopTimer).subscribe(seconds => this.captureSeconds = seconds);
+    const maxCaptureTimeInSeconds = this.maximumCaptureTimeLimit / 1000;
+    Observable.timer(0, 1000).takeUntil(this.stopTimer).subscribe(seconds => {
+      this.captureSeconds = seconds;
+      if (this.captureSeconds >= maxCaptureTimeInSeconds) {
+        this.stopCaptureTimer();
+      }
+    });
   }
 
   stopCaptureTimer(): void {
@@ -427,6 +441,7 @@ export class FilteringService {
     this.stopCaptureTime = new Date().valueOf();
     this.captureSeconds = 0;
     this.stopTimer.next();
+    this.setCustomTimeRange(this.startCaptureTime, this.stopCaptureTime);
     Observable.timer(0, 1000).takeUntil(this.stopAutoRefreshCountdown).subscribe(seconds => {
       this.autoRefreshRemainingSeconds = autoRefreshIntervalSeconds - seconds;
       if (!this.autoRefreshRemainingSeconds) {