Bläddra i källkod

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

Aleksandr Kovalenko 11 år sedan
förälder
incheckning
b960e606ea

+ 4 - 4
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",

+ 4 - 4
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",

+ 2 - 2
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",

+ 12 - 2
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'),
 
   /**