You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by GitBox <gi...@apache.org> on 2019/10/03 17:41:51 UTC

[GitHub] [metron] sardell commented on a change in pull request #1514: METRON-2190: [UI] Alerts UI: Indicating loading and preventing parallel requests

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

 ##########
 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:
   Link to ASF Jira ticket with description of issue related to the FIXMEs in this function: https://issues.apache.org/jira/browse/METRON-2258

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services