ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-11343. Admin View shows wrong version number on the about tab (alexantonenko)
Date Fri, 22 May 2015 15:46:07 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 832f7e1ec -> 0e772bef5


AMBARI-11343. Admin View shows wrong version number on the about tab (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 0e772bef5109e08acf163a6136f3486da66d258f
Parents: 832f7e1
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri May 22 18:20:10 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Fri May 22 18:46:01 2015 +0300

----------------------------------------------------------------------
 .../ui/admin-web/app/scripts/controllers/mainCtrl.js | 11 +++++++++++
 .../ui/admin-web/app/scripts/services/Cluster.js     | 15 ++++++++++++++-
 .../ui/admin-web/app/views/modals/AboutModal.html    |  6 ++++--
 3 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0e772bef/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
index baec0cf..b740a6a 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/mainCtrl.js
@@ -30,13 +30,17 @@ angular.module('ambariAdminConsole')
     Auth.signout();
   };
 
+  $scope.ambariVersion = null;
+
   $scope.about = function() {
+   var ambariVersion = $scope.ambariVersion;
   	var modalInstance = $modal.open({
   		templateUrl:'views/modals/AboutModal.html',
   		controller: ['$scope', function($scope) {
   			$scope.ok = function() {
   				modalInstance.close();
   			};
+        $scope.ambariVersion = ambariVersion;
   		}]
   	});
   };
@@ -46,6 +50,12 @@ angular.module('ambariAdminConsole')
   $scope.cluster = null;
   $scope.isLoaded = null;
 
+  function loadAmbariVersion() {
+    Cluster.getAmbariVersion().then(function(version){
+      $scope.ambariVersion = version;
+    });
+  }
+
   function loadClusterData(){
     Cluster.getStatus().then(function(cluster) {
       $scope.cluster = cluster;
@@ -58,6 +68,7 @@ angular.module('ambariAdminConsole')
     });
   }
   loadClusterData();
+  loadAmbariVersion();
 
   $scope.viewInstances = [];
   View.getAllVisibleInstance().then(function(instances) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e772bef/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
index d14baa4..c27ed91 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
@@ -47,6 +47,19 @@ angular.module('ambariAdminConsole')
 
       return deferred.promise;
     },
+    getAmbariVersion: function() {
+      var deferred = $q.defer();
+
+      $http.get(Settings.baseUrl + '/services/AMBARI/components/AMBARI_SERVER?fields=RootServiceComponents/component_version,RootServiceComponents/properties/server.os_family&minimal_response=true',
{mock: '2.1'})
+      .then(function(data) {
+        deferred.resolve(data.data.RootServiceComponents.component_version);
+      })
+      .catch(function(data) {
+        deferred.reject(data);
+      });
+
+      return deferred.promise;
+    },
     getPermissions: function() {
       var deferred = $q.defer();
 
@@ -165,4 +178,4 @@ angular.module('ambariAdminConsole')
       return deferred.promise;
     }
   };
-}]);
\ No newline at end of file
+}]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e772bef/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AboutModal.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AboutModal.html
b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AboutModal.html
index d1ac132..a78db29 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AboutModal.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/modals/AboutModal.html
@@ -28,7 +28,9 @@
       <div class="project">Apache Ambari</div>
       <br>
       <span id="i18n-33">Version</span>
-      <script id="metamorph-199-start" type="text/x-placeholder"></script>2.0.0<script
id="metamorph-199-end" type="text/x-placeholder"></script>
+      <script id="metamorph-199-start" type="text/x-placeholder"></script>
+      <span ng-bind="ambariVersion"></span>
+      <script id="metamorph-199-end" type="text/x-placeholder"></script>
       <br>
       <br>
       <a href="http://ambari.apache.org/" target="_blank"><span id="i18n-34">Get
involved!</span></a>
@@ -39,4 +41,4 @@
 </div>
 <div class="modal-footer">
     <button class="btn btn-success" ng-click="ok()">OK</button>
-</div>
\ No newline at end of file
+</div>


Mime
View raw message