ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-5115.Mirroring: auto-refresh of data loses paging. (akovalenko)
Date Mon, 17 Mar 2014 19:36:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk bfac23716 -> b960e606e


AMBARI-5115.Mirroring: auto-refresh of data loses paging. (akovalenko)


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

Branch: refs/heads/trunk
Commit: b960e606eab5c17c41eb0f47cc5fb41f387a10cb
Parents: bfac237
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon Mar 17 21:33:55 2014 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon Mar 17 21:36:03 2014 +0200

----------------------------------------------------------------------
 .../app/assets/data/mirroring/dataset1_instances.json |  8 ++++----
 .../app/assets/data/mirroring/dataset2_instances.json |  8 ++++----
 .../app/assets/data/mirroring/dataset3_instances.json |  4 ++--
 ambari-web/app/views/common/table_view.js             | 14 ++++++++++++--
 4 files changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b960e606/ambari-web/app/assets/data/mirroring/dataset1_instances.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/dataset1_instances.json b/ambari-web/app/assets/data/mirroring/dataset1_instances.json
index bc748e8..d2f71b1 100644
--- a/ambari-web/app/assets/data/mirroring/dataset1_instances.json
+++ b/ambari-web/app/assets/data/mirroring/dataset1_instances.json
@@ -3,7 +3,7 @@
     "instance": "2013-10-24T00:00Z",
     "status": "KILLED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000004-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-14T06:23:33Z",
     "endTime": "2014-01-09T06:24:29Z",
@@ -13,7 +13,7 @@
     "instance": "2013-10-24T01:00Z",
     "status": "KILLED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000005-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:25:35Z",
     "endTime": "2014-01-09T06:26:02Z",
@@ -23,7 +23,7 @@
     "instance": "2013-10-24T02:00Z",
     "status": "KILLED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000006-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:30:35Z",
     "endTime": "2014-01-07T06:31:03Z",
@@ -33,7 +33,7 @@
     "instance": "2013-10-24T03:00Z",
     "status": "KILLED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000007-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:35:35Z",
     "endTime": "2014-01-02T06:36:03Z",

http://git-wip-us.apache.org/repos/asf/ambari/blob/b960e606/ambari-web/app/assets/data/mirroring/dataset2_instances.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/dataset2_instances.json b/ambari-web/app/assets/data/mirroring/dataset2_instances.json
index efa8d88..5405fb5 100644
--- a/ambari-web/app/assets/data/mirroring/dataset2_instances.json
+++ b/ambari-web/app/assets/data/mirroring/dataset2_instances.json
@@ -3,7 +3,7 @@
     "instance": "2012-10-24T00:00Z",
     "status": "RUNNING",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000004-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:23:33Z",
     "endTime": "2014-01-09T06:24:29Z",
@@ -13,7 +13,7 @@
     "instance": "2012-10-24T01:00Z",
     "status": "SUCCEEDED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000005-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:25:35Z",
     "endTime": "2014-01-09T06:26:02Z",
@@ -23,7 +23,7 @@
     "instance": "2012-10-24T02:00Z",
     "status": "FAILED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000006-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:30:35Z",
     "endTime": "2014-01-09T06:31:03Z",
@@ -33,7 +33,7 @@
     "instance": "2012-10-24T03:00Z",
     "status": "SUSPENDED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000007-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:35:35Z",
     "endTime": "2014-01-09T06:36:03Z",

http://git-wip-us.apache.org/repos/asf/ambari/blob/b960e606/ambari-web/app/assets/data/mirroring/dataset3_instances.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/dataset3_instances.json b/ambari-web/app/assets/data/mirroring/dataset3_instances.json
index 4996717..60b89a2 100644
--- a/ambari-web/app/assets/data/mirroring/dataset3_instances.json
+++ b/ambari-web/app/assets/data/mirroring/dataset3_instances.json
@@ -3,7 +3,7 @@
     "instance": "2014-10-24T00:00Z",
     "status": "FAILED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000004-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:23:33Z",
     "endTime": "2014-01-09T06:24:29Z",
@@ -13,7 +13,7 @@
     "instance": "2014-10-24T01:00Z",
     "status": "SUSPENDED",
     "logFile": "http://c6407.ambari.apache.org:11000/oozie?job=0000005-140108205147729-oozie-oozi-W",
-    "cluster": "mcluster-bcp",
+    "cluster": "tdk",
     "sourceCluster": "mcluster",
     "startTime": "2014-01-09T06:25:35Z",
     "endTime": "2014-01-09T06:26:02Z",

http://git-wip-us.apache.org/repos/asf/ambari/blob/b960e606/ambari-web/app/views/common/table_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/table_view.js b/ambari-web/app/views/common/table_view.js
index 4e4eb90..002478b 100644
--- a/ambari-web/app/views/common/table_view.js
+++ b/ambari-web/app/views/common/table_view.js
@@ -243,8 +243,18 @@ App.TableView = Em.View.extend(App.UserPref, {
   /**
    * Calculates default value for startIndex property after applying filter or changing displayLength
    */
-  updatePaging: function () {
-    this.set('startIndex', Math.min(1, this.get('filteredContent.length')));
+  updatePaging: function (controller, property) {
+    var displayLength = this.get('displayLength');
+    var filteredContentLength = this.get('filteredContent.length');
+    if (property == 'displayLength') {
+      this.set('startIndex', Math.min(1, filteredContentLength));
+    } else if (this.get('startIndex') > filteredContentLength) {
+      this.set('startIndex', Math.floor((filteredContentLength - 1) / displayLength) * displayLength
+ 1);
+    } else if (!filteredContentLength) {
+      this.set('startIndex', 0);
+    } else if (!this.get('startIndex')) {
+      this.set('startIndex', 1);
+    }
   }.observes('displayLength', 'filteredContent.length'),
 
   /**


Mime
View raw message