hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x...@apache.org
Subject [44/50] [abbrv] hadoop git commit: YARN-7804. [UI2] Refresh action on Grid view page should not be redirected to graph view. Contributed by Gergely Novák.
Date Tue, 10 Apr 2018 19:39:22 GMT
YARN-7804. [UI2] Refresh action on Grid view page should not be redirected to graph view. Contributed
by Gergely Novák.


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

Branch: refs/heads/HDFS-7240
Commit: 7c1e77dda4cb3ba8952328d142aafcf0366b5903
Parents: 7623cc5
Author: Sunil G <sunilg@apache.org>
Authored: Tue Apr 10 16:09:09 2018 +0530
Committer: Sunil G <sunilg@apache.org>
Committed: Tue Apr 10 16:09:09 2018 +0530

----------------------------------------------------------------------
 .../main/webapp/app/components/timeline-view.js | 35 ++++++++++++++------
 .../webapp/app/controllers/yarn-app-attempt.js  |  9 ++++-
 .../webapp/app/controllers/yarn-app/attempts.js | 11 ++++--
 .../app/templates/components/timeline-view.hbs  | 12 +++----
 .../webapp/app/templates/yarn-app-attempt.hbs   |  2 ++
 .../webapp/app/templates/yarn-app/attempts.hbs  |  2 ++
 6 files changed, 52 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c1e77dd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
index 65a8cb1..3588009 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js
@@ -25,6 +25,13 @@ export default Ember.Component.extend({
   tableDefinition: TableDefinition.create({
     searchType: 'manual',
   }),
+  graphDrawn: false,
+
+  actions: {
+    changeViewType(param) {
+      this.sendAction("changeViewType", param);
+    }
+  },
 
   canvas: {
     svg: undefined,
@@ -235,12 +242,10 @@ export default Ember.Component.extend({
   },
 
   didInsertElement: function() {
-    // init tooltip
-    this.initTooltip();
+    // init model
     this.modelArr = [];
     this.containerIdArr = [];
 
-    // init model
     if (this.get("rmModel")) {
       this.get("rmModel").forEach(function(o) {
         if(!this.modelArr.contains(o)) {
@@ -258,16 +263,30 @@ export default Ember.Component.extend({
       }.bind(this));
     }
 
-    if(this.modelArr.length === 0) {
+    if (this.modelArr.length === 0) {
       return;
     }
 
     this.modelArr.sort(function(a, b) {
       var tsA = a.get("startTs");
       var tsB = b.get("startTs");
-
       return tsA - tsB;
     });
+
+    if (this.get('attemptModel')) {
+      this.setAttemptsGridColumnsAndRows();
+    } else {
+      this.setContainersGridColumnsAndRows();
+    }
+  },
+
+  didUpdate: function() {
+    if (this.get("viewType") === "grid" || this.graphDrawn) {
+      return;
+    }
+
+    this.initTooltip();
+
     var begin = 0;
     if (this.modelArr.length > 0) {
       begin = this.modelArr[0].get("startTs");
@@ -289,11 +308,7 @@ export default Ember.Component.extend({
       this.setSelected(this.modelArr[0]);
     }
 
-    if (this.get('attemptModel')) {
-      this.setAttemptsGridColumnsAndRows();
-    } else {
-      this.setContainersGridColumnsAndRows();
-    }
+    this.graphDrawn = true;
   },
 
   setAttemptsGridColumnsAndRows: function() {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c1e77dd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js
index 4c8b8a1..116920d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app-attempt.js
@@ -19,8 +19,15 @@
 import Ember from 'ember';
 
 export default Ember.Controller.extend({
-  queryParams: ["service"],
+  queryParams: ["service", "viewType"],
   service: undefined,
+  viewType: "graph",
+
+  actions: {
+    changeViewType(param) {
+      this.set("viewType", param);
+    }
+  },
 
   breadcrumbs: Ember.computed("model.attempt.appId", "model.attempt.id", function () {
     var appId = this.get("model.attempt.appId");

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c1e77dd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/attempts.js
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/attempts.js
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/attempts.js
index a6cba9e..32638e5 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/attempts.js
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-app/attempts.js
@@ -19,6 +19,13 @@
 import Ember from 'ember';
 
 export default Ember.Controller.extend({
-  queryParams: ["service"],
-  service: undefined
+  queryParams: ["service", "viewType"],
+  service: undefined,
+  viewType: "graph",
+
+  actions: {
+    changeViewType(param) {
+      this.set("viewType", param);
+    }
+  },
 });

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c1e77dd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs
index b7cdb59..0a1209d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/timeline-view.hbs
@@ -26,16 +26,16 @@
       {{/if}}
     </div>
     <ul class="nav nav-tabs" role="tablist">
-      <li class="active">
-        <a href="#graphViewTab" role="tab" data-toggle="tab">Graph View</a>
+      <li class="{{if (eq viewType "graph") "active" ""}}">
+        <a href="#graphViewTab" role="tab" data-toggle="tab" {{action "changeViewType"
"graph"}}>Graph View</a>
       </li>
-      <li class="">
-        <a href="#gridViewTab" role="tab" data-toggle="tab">Grid View</a>
+      <li class="{{if (eq viewType "grid") "active" ""}}">
+        <a href="#gridViewTab" role="tab" data-toggle="tab" {{action "changeViewType"
"grid"}}>Grid View</a>
       </li>
     </ul>
     <div class="panel-body">
       <div class="tab-content">
-        <div role="tabpanel" class="tab-pane active" id="graphViewTab">
+        <div role="tabpanel" class="tab-pane {{if (eq viewType "graph") "active" ""}}"
id="graphViewTab">
           <br/><br/>
           <div class="col-md-7 container-fluid" id={{parent-id}}></div>
           <!-- diag info -->
@@ -56,7 +56,7 @@
             </div>
           </div>
         </div>
-        <div role="tabpanel" class="tab-pane" id="gridViewTab">
+        <div role="tabpanel" class="tab-pane {{if (eq viewType "grid") "active" ""}}"
id="gridViewTab">
           {{em-table columns=gridColumns rows=gridRows definition=tableDefinition}}
         </div>
       </div>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c1e77dd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs
index 2e2f6d0..7d9aec1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app-attempt.hbs
@@ -56,6 +56,8 @@
           tsModel=model.tsContainers
           label="shortAppAttemptId"
           attemptModel=false
+          changeViewType="changeViewType"
+          viewType=viewType
         }}
       {{else}}
         <div class="col-md-12 container-fluid">

http://git-wip-us.apache.org/repos/asf/hadoop/blob/7c1e77dd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/attempts.hbs
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/attempts.hbs
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/attempts.hbs
index 5857d89..62105d3 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/attempts.hbs
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-app/attempts.hbs
@@ -26,6 +26,8 @@
     label="shortAppAttemptId"
     attemptModel=true
     serviceName=model.serviceName
+    changeViewType="changeViewType"
+    viewType=viewType
   }}
 {{else}}
   <div class="col-md-12 container-fluid">


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message