You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2017/06/22 13:16:38 UTC

[11/21] ambari git commit: AMBARI-21313 Log Search UI: implement service for string constants (additional patch). (ababiichuk)

AMBARI-21313 Log Search UI: implement service for string constants (additional patch). (ababiichuk)


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

Branch: refs/heads/branch-feature-logsearch-ui
Commit: 84a59d71183edfbb85de1090a5aa1092d60621cf
Parents: e71ad96
Author: ababiichuk <ab...@hortonworks.com>
Authored: Thu Jun 22 15:32:08 2017 +0300
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Thu Jun 22 15:32:08 2017 +0300

----------------------------------------------------------------------
 .../app/menu-button/menu-button.component.html  |    4 +-
 .../app/menu-button/menu-button.component.ts    |   22 +-
 .../src/app/top-menu/top-menu.component.ts      |   40 +-
 .../ambari-logsearch-web-new/yarn.lock          | 5312 ++++++++++++++++++
 4 files changed, 5357 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/84a59d71/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html
index 6bdbac4..1afe6c0 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html
@@ -16,13 +16,13 @@
 -->
 
 <div #dropdown [ngClass]="{'dropdown': hasSubItems, 'text-center': true}">
-  <span (mousedown)="onMouseDown()" (mouseup)="onMouseUp($event)" (click)="$event.stopPropagation()">
+  <span (mousedown)="onMouseDown($event)" (mouseup)="onMouseUp($event)" (click)="$event.stopPropagation()">
     <a *ngIf="title" class="icon" [ngClass]="iconClassNames"></a>
     <span *ngIf="!title" class="icon" [ngClass]="iconClassNames"></span>
   </span>
   <a #dropdownToggle [ngClass]="{'dropdown-toggle': hasSubItems, 'caret': true}" [attr.data-toggle]="hasSubItems ? 'dropdown': null" *ngIf="hasSubItems"></a>
   <br>
-  <span class="icon-title" *ngIf="title" (mousedown)="onMouseDown()" (mouseup)="onMouseUp($event)" (click)="$event.stopPropagation()">{{title | translate}}</span>
+  <span class="icon-title" *ngIf="title" (mousedown)="onMouseDown($event)" (mouseup)="onMouseUp($event)" (click)="$event.stopPropagation()">{{title | translate}}</span>
   <ul class="dropdown-menu" *ngIf="hasSubItems">
     <li *ngFor="let item of subItems">
       <a href="#">{{item.title}}</a>

http://git-wip-us.apache.org/repos/asf/ambari/blob/84a59d71/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts
index 7a967ad..2af5a44 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts
@@ -56,18 +56,22 @@ export class MenuButtonComponent implements AfterViewInit {
 
   private readonly longClickInterval = 1000;
 
-  onMouseDown() {
-    this.clickStartTime = (new Date()).getTime();
+  onMouseDown(event: MouseEvent): void {
+    if (event.button === 0) {
+      this.clickStartTime = (new Date()).getTime();
+    }
   }
 
-  onMouseUp(event: Event) {
-    const clickEndTime = (new Date()).getTime();
-    if (this.hasSubItems && clickEndTime - this.clickStartTime >= this.longClickInterval) {
-      this.dropdown.nativeElement.classList.add('open');
-    } else {
-      this.actions[this.action]();
+  onMouseUp(event: MouseEvent): void {
+    if (event.button === 0) {
+      const clickEndTime = (new Date()).getTime();
+      if (this.hasSubItems && clickEndTime - this.clickStartTime >= this.longClickInterval) {
+        this.dropdown.nativeElement.classList.add('open');
+      } else {
+        this.actions[this.action]();
+      }
+      event.stopPropagation();
     }
-    event.stopPropagation();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/84a59d71/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts
index d5f05875..641fca0 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts
@@ -39,10 +39,16 @@ export class TopMenuComponent implements OnInit {
       action: 'undo',
       subItems: [
         {
-          title: 'Item 1'
+          title: 'Apply \'Last week\' filter'
         },
         {
-          title: 'Item 2'
+          title: 'Clear all filters'
+        },
+        {
+          title: 'Apply \'HDFS\' filter'
+        },
+        {
+          title: 'Apply \'Errors\' filter'
         }
       ]
     },
@@ -52,10 +58,13 @@ export class TopMenuComponent implements OnInit {
       action: 'redo',
       subItems: [
         {
-          title: 'Item 1'
+          title: 'Apply \'Warnings\' filter'
         },
         {
-          title: 'Item 2'
+          title: 'Switch to graph mode'
+        },
+        {
+          title: 'Apply \'Custom Date\' filter'
         }
       ]
     },
@@ -70,18 +79,29 @@ export class TopMenuComponent implements OnInit {
       action: 'openHistory',
       subItems: [
         {
-          title: 'Item 1'
+          title: 'Apply \'Custom Date\' filter'
+        },
+        {
+          title: 'Switch to graph mode'
+        },
+        {
+          title: 'Apply \'Warnings\' filter'
+        },
+        {
+          title: 'Apply \'Last week\' filter'
+        },
+        {
+          title: 'Clear all filters'
         },
         {
-          title: 'Item 2'
+          title: 'Apply \'HDFS\' filter'
+        },
+        {
+          title: 'Apply \'Errors\' filter'
         }
       ]
     },
     {
-      iconClassNames: ['fa', 'fa-bell'],
-      action: 'openAlerts'
-    },
-    {
       iconClassNames: ['fa', 'fa-user'],
       action: 'openUserDetails'
     }