mmiklavc commented on a change in pull request #1514: METRON-2190: [UI] Alerts 
UI: Indicating loading and preventing parallel requests
URL: https://github.com/apache/metron/pull/1514#discussion_r331152228
 
 

 ##########
 File path: 
metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
 ##########
 @@ -549,24 +522,52 @@ export class AlertsListComponent implements OnInit, 
OnDestroy {
     this.cdRef.detectChanges();
   }
 
-  toggleQueryBuilder() {
+  getStaleDataWarning() {
+    if (this.autoPollingSvc.getIsPollingActive()) {
+      return `<i class="fa fa-warning" aria-hidden="true"></i> Data is in a 
stale state!
+        Click <i class="fa fa-search" aria-hidden="true"></i> to update your 
view based
+        on your current filter and time-range configuration!`;
+    } else {
+      return `<i class="fa fa-warning" aria-hidden="true"></i> Data is in a 
stale state!
+        Automatic refresh is turned on. Your filter and/or time-range changes 
will apply automatically on next refresh.`;
+    }
+  }
+
+  getPollingCongestionWarning() {
+    return `<i class="fa fa-warning" aria-hidden="true"></i> Refresh interval 
is shorter than the response time.
+      Please increase the refresh interval in the <i class="fa fa-sliders" 
aria-hidden="true"></i> menu above,
+      or try to simplify your query filter.`;
+  }
+
+  private updatePollingInterval(refreshInterval: number): void {
+    this.autoPollingSvc.setInterval(refreshInterval);
+  }
+
+  private restoreAutoPollingState() {
+    if (this.autoPollingSvc.getIsPollingActive()) {
+      this.autoPollingSvc.setSuppression(false);
+    }
+  }
+
+  isQueryBuilderModeManual() {
+    return this.queryBuilder.getFilteringMode() === FilteringMode.MANUAL;
+  }
+
+  toggleQueryBuilderMode() {
+    // FIXME setting timerange on toggle feels like a hack
     this.setSelectedTimeRange([this.selectedTimeRange]);
-    if (!this.hideQueryBuilder) {
-      this.hideQueryBuilder = true;
-      this.manualQuery.nativeElement.value = this.queryBuilder.query;
+    if (this.queryBuilder.getFilteringMode() === FilteringMode.BUILDER) {
+      this.queryBuilder.setFilteringMode(FilteringMode.MANUAL);
     } else {
-      this.hideQueryBuilder = false;
+      this.queryBuilder.setFilteringMode(FilteringMode.BUILDER);
+      // FIXME: this could lead to a large blocking load depending on the 
response time
 
 Review comment:
   @tiborm Please create a Jira to track these "need fixing" instances and link 
them back here as well in their appropriate code locations.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to