ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject git commit: AMBARI-4886. Mirroring: mirroring data should be updated periodically. (akovalenko)
Date Fri, 28 Feb 2014 15:31:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk cfe3c6a6e -> 3c2ec028d


AMBARI-4886. Mirroring: mirroring data should be updated periodically. (akovalenko)


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

Branch: refs/heads/trunk
Commit: 3c2ec028d817e08ea7685ee7e388392e0437c717
Parents: cfe3c6a
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Fri Feb 28 17:29:28 2014 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Fri Feb 28 17:29:28 2014 +0200

----------------------------------------------------------------------
 .../controllers/main/mirroring/jobs_controller.js    |  3 +--
 .../app/controllers/main/mirroring_controller.js     |  8 ++------
 ambari-web/app/views/main/mirroring_view.js          | 15 ++++++++++++++-
 3 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3c2ec028/ambari-web/app/controllers/main/mirroring/jobs_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring/jobs_controller.js b/ambari-web/app/controllers/main/mirroring/jobs_controller.js
index 410228f..7c4cdbf 100644
--- a/ambari-web/app/controllers/main/mirroring/jobs_controller.js
+++ b/ambari-web/app/controllers/main/mirroring/jobs_controller.js
@@ -27,9 +27,8 @@ App.MainDatasetJobsController = Em.Controller.extend({
 
   jobs: function () {
     var datasetName = this.get('content.name');
-    var mainMirroringController = App.router.get('mainMirroringController');
     return (this.get('isLoaded') && datasetName) ?
-        mainMirroringController.get('datasets').findProperty('name', datasetName).get('datasetJobs')
: [];
+        App.Dataset.find().findProperty('name', datasetName).get('datasetJobs') : [];
   }.property('content', 'isLoaded'),
 
   actionDesc: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/3c2ec028/ambari-web/app/controllers/main/mirroring_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring_controller.js b/ambari-web/app/controllers/main/mirroring_controller.js
index b1370d6..fee1278 100644
--- a/ambari-web/app/controllers/main/mirroring_controller.js
+++ b/ambari-web/app/controllers/main/mirroring_controller.js
@@ -33,8 +33,6 @@ App.MainMirroringController = Em.ArrayController.extend({
   // counter for target cluster load queries
   clusterCount: 0,
 
-  datasets: [],
-
   selectedDataset: null,
 
   isDatasetsLoaded: false,
@@ -45,14 +43,13 @@ App.MainMirroringController = Em.ArrayController.extend({
     return this.get('isDatasetsLoaded') && this.get('isTargetClustersLoaded');
   }.property('isDatasetsLoaded', 'isTargetClustersLoaded'),
 
+  datasets: App.Dataset.find(),
+
   loadData: function () {
-    this.set('isDatasetsLoaded', false);
-    this.set('isTargetClustersLoaded', false);
     this.get('datasetsData').clear();
     this.set('clustersData', {});
     this.set('datasetCount', 0);
     this.set('clusterCount', 0);
-    this.set('datasets', []);
     this.loadDatasets();
     this.loadClusters();
   },
@@ -169,7 +166,6 @@ App.MainMirroringController = Em.ArrayController.extend({
         if (a.get('name') > b.get('name'))  return 1;
         return 0;
       });
-      this.set('datasets', sortedDatasets);
       this.set('isDatasetsLoaded', true);
       var selectedDataset = this.get('selectedDataset');
       if (!selectedDataset) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/3c2ec028/ambari-web/app/views/main/mirroring_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/mirroring_view.js b/ambari-web/app/views/main/mirroring_view.js
index 8627593..9d0976d 100644
--- a/ambari-web/app/views/main/mirroring_view.js
+++ b/ambari-web/app/views/main/mirroring_view.js
@@ -24,6 +24,19 @@ App.MainMirroringView = Em.View.extend({
 
   didInsertElement: function () {
     var controller = this.get('controller');
-    controller.loadData();
+    controller.set('isDatasetsLoaded', false);
+    controller.set('isTargetClustersLoaded', false);
+    this.loadDataPeriodically();
+  },
+
+  // updata datasets data, when Mirroring page is opened
+  loadDataPeriodically: function () {
+    if (this.get('isVisible')) {
+      var self = this;
+      this.get('controller').loadData();
+      setTimeout(function () {
+        self.loadDataPeriodically();
+      }, App.contentUpdateInterval);
+    }
   }
 });


Mime
View raw message