Bladeren bron

AMBARI-1059. Refactor cluster management. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1418993 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 jaren geleden
bovenliggende
commit
26429c08a4
29 gewijzigde bestanden met toevoegingen van 338 en 115 verwijderingen
  1. 67 28
      ambari-web/app/assets/data/hosts/hosts.json
  2. 15 1
      ambari-web/app/controllers/application.js
  3. 3 7
      ambari-web/app/controllers/installer.js
  4. 2 1
      ambari-web/app/controllers/main.js
  5. 9 3
      ambari-web/app/controllers/wizard/step3_controller.js
  6. 1 1
      ambari-web/app/controllers/wizard/step9_controller.js
  7. 14 14
      ambari-web/app/data/config_properties.js
  8. 2 2
      ambari-web/app/data/service_configs.js
  9. 2 1
      ambari-web/app/messages.js
  10. 3 3
      ambari-web/app/models/host.js
  11. 22 3
      ambari-web/app/routes/add_host_routes.js
  12. 21 3
      ambari-web/app/routes/add_service_routes.js
  13. 18 17
      ambari-web/app/styles/application.less
  14. 31 0
      ambari-web/app/styles/apps.less
  15. 11 2
      ambari-web/app/templates/application.hbs
  16. 1 1
      ambari-web/app/templates/main/background_operations_popup.hbs
  17. 1 1
      ambari-web/app/templates/main/host/add.hbs
  18. 2 2
      ambari-web/app/templates/main/host/details.hbs
  19. 1 1
      ambari-web/app/templates/main/service/add.hbs
  20. 6 1
      ambari-web/app/templates/main/service/info/configs.hbs
  21. 1 1
      ambari-web/app/templates/wizard/step3_host_log_popup.hbs
  22. 6 1
      ambari-web/app/templates/wizard/step7.hbs
  23. 15 5
      ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs
  24. 2 2
      ambari-web/app/utils/misc.js
  25. 9 0
      ambari-web/app/views/common/chart/linear_time.js
  26. 3 3
      ambari-web/app/views/main.js
  27. 9 3
      ambari-web/app/views/main/service/info/configs.js
  28. 9 3
      ambari-web/app/views/wizard/step7_view.js
  29. 52 5
      ambari-web/app/views/wizard/step9_view.js

+ 67 - 28
ambari-web/app/assets/data/hosts/hosts.json

@@ -11,15 +11,18 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev1.hortonworks.com",
+        "public_host_name" : "dev1.hortonworks.com",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_one" : 8.24583333333,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -91,14 +94,17 @@
         "total_mem" : 3086813,
         "os_arch" : "x86_64",
         "host_name" : "dev2.hortonworks.com",
+        "public_host_name" : "dev2.hortonworks.com",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
-        "os_type" : "centos6","load" : {
+        "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
+        "load" : {
           "load_fifteen" : 9.13213888889,
           "load_five" : 8.68588888889
-        },
-
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -170,14 +176,17 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev3.hortonworks.com",
+        "public_host_name" : "dev3.hortonworks.com",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_one" : 8.24583333333,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -248,14 +257,17 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com2",
+        "public_host_name" : "dev.hortonworks.com2",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_one" : 8.24583333333
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -318,13 +330,16 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com3",
+        "public_host_name" : "dev.hortonworks.com3",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -387,13 +402,16 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com4",
+        "public_host_name" : "dev.hortonworks.com4",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -456,15 +474,18 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com5",
+        "public_host_name" : "dev.hortonworks.com5",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_one" : 8.24583333333,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -527,15 +548,18 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com6",
+        "public_host_name" : "dev.hortonworks.com6",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_one" : 8.24583333333,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -598,15 +622,18 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com7",
+        "public_host_name" : "dev.hortonworks.com7",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_one" : 8.24583333333,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -669,14 +696,17 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com8",
+        "public_host_name" : "dev.hortonworks.com8",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -739,15 +769,18 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com9",
+        "public_host_name" : "dev.hortonworks.com9",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_one" : 8.24583333333,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -810,15 +843,18 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com10",
+        "public_host_name" : "dev.hortonworks.com10",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_one" : 8.24583333333,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {
@@ -881,15 +917,18 @@
         "total_mem" : 3082813,
         "os_arch" : "x86_64",
         "host_name" : "dev.hortonworks.com11",
+        "public_host_name" : "dev.hortonworks.com11",
         "disk_info" : "[{\"available\":\"47295056\",\"mountpoint\":\"/\",\"used\":\"3786948\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1542800\",\"mountpoint\":\"/dev/shm\",\"used\":\"248\",\"percent\":\"1%\",\"size\":\"1543048\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459872\",\"mountpoint\":\"/home\",\"used\":\"184220\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"902105496\",\"mountpoint\":\"/media/sf_ambari\",\"used\":\"74551908\",\"percent\":\"8%\",\"size\":\"976657404\",\"type\":\"vboxsf\"}]",
         "last_heartbeat_time" : 1352461939047,
         "os_type" : "centos6",
+        "ip" : "10.0.2.15"
+      },
+      "metrics" : {
         "load" : {
           "load_fifteen" : 9.13213888889,
           "load_one" : 8.24583333333,
           "load_five" : 8.68588888889
-        },
-        "ip" : "10.0.2.15"
+        }
       },
       "host_components" : [
         {

+ 15 - 1
ambari-web/app/controllers/application.js

@@ -21,6 +21,20 @@ var App = require('app');
 
 App.ApplicationController = Em.Controller.extend({
 
-  name: 'applicationController'
+  name: 'applicationController',
+  clusterName: function () {
+    var name = App.db.getClusterName();
+    if (name) {
+      return name.capitalize();
+    }
+    return 'My Cluster';
+  }.property(),
+  isClusterDataLoaded: function() {
+    return App.router.get('clusterController.isLoaded');
+  }.property('App.router.clusterController.isLoaded'),
 
+  init: function(){
+    this._super();
+    $('title').text('Ambari - ' + this.get('clusterName'));
+  }
 });

+ 3 - 7
ambari-web/app/controllers/installer.js

@@ -527,19 +527,15 @@ App.InstallerController = App.WizardController.extend({
         var data = [];
 
         // loop through all the service components
-        for (var i = 0 ; i < displayOrderConfig.length ; i++) {
-          var entry = jsonData.services.filterProperty("name",displayOrderConfig[i].serviceName)[0];
-
-          // dont show the service whose isHidden is true
-          if ( displayOrderConfig[i].isHidden ) {
-            continue;
-          }
+        for (var i = 0; i < displayOrderConfig.length; i++) {
+          var entry = jsonData.services.findProperty("name", displayOrderConfig[i].serviceName);
 
           var myService = Service.create({
             serviceName: entry.name,
             displayName: displayOrderConfig[i].displayName,
             isDisabled: i === 0 ,
             isSelected: true,
+            isHidden: displayOrderConfig[i].isHidden,
             description: entry.comment,
             version: entry.version
           });

+ 2 - 1
ambari-web/app/controllers/main.js

@@ -24,7 +24,8 @@ App.MainController = Em.Controller.extend({
   clusterName: function () {
     var name = App.db.getClusterName();
     if (name) {
-      return name.capitalize();
+      var displayName = name.length > 13 ? name.substr(0, 10) + "..." : name;
+      return displayName.capitalize();
     }
     return 'My Cluster';
   }.property(),

+ 9 - 3
ambari-web/app/controllers/wizard/step3_controller.js

@@ -271,7 +271,13 @@ App.WizardStep3Controller = Em.Controller.extend({
 
         // keep polling until all hosts are registered
         var allRegistered = true;
-        hosts.forEach(function (_host) {
+        hosts.forEach(function (_host, index) {
+          // Change name of first host for test mode.
+          if (App.testMode === true) {
+            if (index == 0) {
+              _host.set('name', 'localhost.localdomain');
+            }
+          }
           if (jsonData.items.someProperty('Hosts.host_name', _host.name)) {
             if (_host.get('bootStatus') != 'REGISTERED') {
               _host.set('bootStatus', 'REGISTERED');
@@ -398,7 +404,7 @@ App.WizardStep3Controller = Em.Controller.extend({
         host: host,
         didInsertElement: function () {
           var self = this;
-          var button = $(this.get('element')).find('#textTrigger');
+          var button = $(this.get('element')).find('.textTrigger');
           button.click(function () {
             if(self.get('isTextArea')){
               $(this).text('click to highlight');
@@ -428,7 +434,7 @@ App.WizardStep3Controller = Em.Controller.extend({
             element.select();
             element.css('resize', 'none');
           },
-          disabled: true,
+          readOnly: true,
           value: function(){
             return this.get('content');
           }.property('content')

+ 1 - 1
ambari-web/app/controllers/wizard/step9_controller.js

@@ -211,7 +211,7 @@ App.WizardStep9Controller = Em.Controller.extend({
     var method = 'PUT';
 
     if (App.testMode) {
-      debugger;
+      //debugger;
       url = '/data/wizard/deploy/poll_6.json';
       method = 'GET';
       this.numPolls = 6;

+ 14 - 14
ambari-web/app/data/config_properties.js

@@ -617,7 +617,7 @@ module.exports =
       "isVisible": true,
       "filename": "core-site.xml",
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1057,7 +1057,7 @@ module.exports =
       "displayType": "advanced",
       "isVisible": false,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1069,7 +1069,7 @@ module.exports =
       "displayType": "advanced",
       "isVisible": false,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1638,7 +1638,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1650,7 +1650,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1662,7 +1662,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1674,7 +1674,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1686,7 +1686,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1698,7 +1698,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1710,7 +1710,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1746,7 +1746,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1782,7 +1782,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1794,7 +1794,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",
@@ -1806,7 +1806,7 @@ module.exports =
       "displayType": "user",
       "isVisible": true,
       "serviceName": "MISC",
-      "category": "Users/Groups"
+      "category": "Users and Groups"
     },
     {
       "id": "puppet var",

+ 2 - 2
ambari-web/app/data/service_configs.js

@@ -107,8 +107,8 @@ module.exports = [
     serviceName: 'MISC',
     displayName: 'Misc',
     configCategories: [
-      App.ServiceConfigCategory.create({ name: 'General'}),
-      App.ServiceConfigCategory.create({ name: 'Users/Groups'})
+      // App.ServiceConfigCategory.create({ name: 'General'}),
+      App.ServiceConfigCategory.create({ name: 'Users and Groups'})
     ],
     configs: configProperties.filterProperty('serviceName', 'MISC')
   }

+ 2 - 1
ambari-web/app/messages.js

@@ -37,7 +37,8 @@ Em.I18n.translations = {
   'services.zookeeper.description':'ZooKeeper desc',
   'services.hbase.description':'Non-relational distributed database and centralized service for configuration management & synchronization',
 
-  'topnav.help.href':'http://incubator.apache.org/ambari/install.html',
+  'topnav.logo.href':'http://incubator.apache.org/ambari/',
+  'topnav.help.href':'https://cwiki.apache.org/confluence/display/AMBARI/Ambari',
 
   'installer.header':'Cluster Install Wizard',
   'installer.navigation.warning.header':'Navigation Warning',

+ 3 - 3
ambari-web/app/models/host.js

@@ -59,9 +59,9 @@ App.Host = DS.Model.extend({
   }.property('lastHeartBeatTime'),
 
   loadAvg: function() {
-    if (this.get('loadOne') != null) return this.get('loadOne');
-    if (this.get('loadFive') != null) return this.get('loadFive');
-    if (this.get('loadFifteen') != null) return this.get('loadFifteen');
+    if (this.get('loadOne') != null) return this.get('loadOne').toFixed(2);
+    if (this.get('loadFive') != null) return this.get('loadFive').toFixed(2);
+    if (this.get('loadFifteen') != null) return this.get('loadFifteen').toFixed(2);
   }.property('loadOne', 'loadFive', 'loadFifteen'),
 
   updateHostStatus: function(){

+ 22 - 3
ambari-web/app/routes/add_host_routes.js

@@ -24,15 +24,33 @@ module.exports = Em.Route.extend({
 
     Ember.run.next(function () {
       var addHostController = router.get('addHostController');
+      App.ModalPopup.show({
+        classNames: ['full-width-modal'],
+        header:Em.I18n.t('hosts.add.header'),
+        bodyClass:  App.AddHostView.extend({
+          controllerBinding: 'App.router.addHostController'
+        }),
+        primary:Em.I18n.t('form.cancel'),
+        secondary: null,
+
+        onPrimary:function () {
+          this.hide();
+          router.transitionTo('hosts.index');
+        },
+        onClose: function() {
+          this.hide();
+          router.transitionTo('hosts.index');
+        }
+      });
       router.transitionTo('step' + addHostController.get('currentStep'));
     });
 
   },
 
-  connectOutlets: function (router, context) {
+  /*connectOutlets: function (router, context) {
     console.log('in /hosts/add:connectOutlets');
     router.get('mainController').connectOutlet('addHost');
-  },
+  },*/
 
   step1: Em.Route.extend({
     route: '/step1',
@@ -221,9 +239,10 @@ module.exports = Em.Route.extend({
       if (true) {   // this function will be moved to installerController where it will validate
         var addHostController = router.get('addHostController');
         addHostController.finish();
-        router.transitionTo('hosts');
+        $(context.currentTarget).parents("#modal").find(".close").trigger('click');
       } else {
         console.log('cluster installation failure');
+        //$(context.currentTarget).parents("#modal").find(".close").trigger('click');
       }
     }
   }),

+ 21 - 3
ambari-web/app/routes/add_service_routes.js

@@ -24,6 +24,24 @@ module.exports = Em.Route.extend({
     if (App.db.getUser().admin) {
       Em.run.next(function () {
         var addServiceController = router.get('addServiceController');
+        App.ModalPopup.show({
+          classNames: ['full-width-modal'],
+          header:Em.I18n.t('services.add.header'),
+          bodyClass:  App.AddServiceView.extend({
+            controllerBinding: 'App.router.addServiceController'
+          }),
+          primary:Em.I18n.t('form.cancel'),
+          secondary: null,
+
+          onPrimary:function () {
+            this.hide();
+            App.router.transitionTo('main.services');
+          },
+          onClose: function() {
+            this.hide();
+            App.router.transitionTo('main.services')
+          }
+        });
         router.transitionTo('step' + addServiceController.get('currentStep'));
       });
     } else {
@@ -34,10 +52,10 @@ module.exports = Em.Route.extend({
 
   },
 
-  connectOutlets: function (router) {
+  /*connectOutlets: function (router) {
     console.log('in /service/add:connectOutlets');
     router.get('mainController').connectOutlet('addService');
-  },
+  },*/
 
   step1: Em.Route.extend({
     route: '/step1',
@@ -221,7 +239,7 @@ module.exports = Em.Route.extend({
     complete: function (router, context) {
       if (true) {   // this function will be moved to installerController where it will validate
         router.get('addServiceController').finish();
-        router.transitionTo('services');
+        $(context.currentTarget).parents("#modal").find(".close").trigger('click');
       }
     }
   }),

+ 18 - 17
ambari-web/app/styles/application.less

@@ -61,16 +61,21 @@ footer {
     font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
   }
 
-  .navbar .brand {
-    color: #666666;
-    display: block;
-    font-size: 16px;
-    font-weight: normal;
-    line-height: 1;
-    margin-left: 0;
-    margin-right: 40px;
-    margin-top: 3px;
-    padding: 14px 10px;
+  .navbar {
+    .brand {
+      color: #666666;
+      display: block;
+      font-size: 16px;
+      font-weight: normal;
+      line-height: 1;
+      margin-left: 0;
+      margin-top: 3px;
+      padding: 14px 5px 14px 10px;
+    }
+
+    .brand.cluster-name {
+      padding-left: 0px;
+    }
   }
 /*
   .navbar-inner {
@@ -112,10 +117,6 @@ footer {
     text-decoration: none;
   }
 
-  .navbar .brand {
-    margin-right: 40px;
-  }
-
   .navbar #logo {
     float: left;
     padding-top: 7px;
@@ -1884,7 +1885,7 @@ ul.inline li {
 }
 .content-area {
   position: relative;
-  #textTrigger {
+  .textTrigger {
     cursor: pointer;
     position: absolute;
     right: 0;
@@ -1907,10 +1908,10 @@ ul.inline li {
   background-position: 0;
 }
 // COMBOBOX FIXES END
-@media all and (max-width: 1024px) {
+@media all and (max-width: 1152px) {
   #main-nav {
     li.span2 {
-      width: 125px;
+      width: 120px;
     }
   }
 }

+ 31 - 0
ambari-web/app/styles/apps.less

@@ -359,6 +359,37 @@
   }
 }
 
+/*90% width modal window*/
+.full-width-modal {
+  .modal {
+    width: 90%;
+    margin: -350px 0 0 -45%;
+  }
+
+  .clear {
+    clear:both;
+  }
+  > div > .dataTable {
+    border: 1px solid silver;
+    th {
+      border-top:none;
+    }
+  }
+  .content {
+    padding: 0;
+  }
+
+
+//fix stripped in inner table
+  .table-striped tbody tr:nth-child(odd)
+  td .table-striped tbody
+  tr:nth-child(odd) td,
+  tr:nth-child(even) th{
+    background-color: none;
+  }
+
+}
+
 @media all and (max-width: 1024px) {
   .big-modal {
     .modal {

+ 11 - 2
ambari-web/app/templates/application.hbs

@@ -21,8 +21,17 @@
     <div class="navbar navbar-static-top">
       <div class="navbar-inner">
         <div class="container">
-          <a {{action gotoStep1}}><img id="logo" src="/img/logo-small.gif"></a>
-          <a class="brand" href="#">{{t app.name}}</a>
+          <a {{translateAttr href="topnav.logo.href"}} target="_blank"><img id="logo" src="/img/logo-small.gif"></a>
+          <a class="brand" {{translateAttr href="topnav.logo.href"}} target="_blank">{{t app.name}}</a>
+          {{#if isClusterDataLoaded}}
+            <a class="brand cluster-name" href="#">
+              - {{clusterName}}
+            </a>
+          {{else}}
+            <a class="brand cluster-name" href="#">
+              loading...
+            </a>
+          {{/if}}
           <ul class="nav">
             <li class="right"><a class="help" {{translateAttr href="topnav.help.href"}} target="_blank">Help</a></li>
             {{#if App.router.loggedIn}}

+ 1 - 1
ambari-web/app/templates/main/background_operations_popup.hbs

@@ -24,7 +24,7 @@
         {{#if view.isOpen}}Hide{{else}}Show{{/if}} info about {{operation.command}} {{operation.role}} on {{operation.host_name}}
       </a>
       <div class="content-area">
-      <div id="textTrigger">click to highlight</div>
+      <div class="textTrigger">click to highlight</div>
       {{#if view.isOpen}}
       {{#if view.isTextArea}}
       <div>

+ 1 - 1
ambari-web/app/templates/main/host/add.hbs

@@ -20,7 +20,7 @@
   <div class="container">
     <div class="container-fluid">
 
-      <a class="btn back" {{action backToHostsList}}>← Back to Hosts</a>
+      <!--<a class="btn back" {{action backToHostsList}}>← Back to Hosts</a>-->
 
       <div class="row-fluid">
         <div class="span3">

+ 2 - 2
ambari-web/app/templates/main/host/details.hbs

@@ -17,8 +17,8 @@
 }}
 
 <div id="host-details">
-  <a href='#' {{action "routeHome" target="controller"}}><i class="icon-home"></i></a> /
-  <a href="javascript:void(null)" data-toggle="modal" {{action backToHostsList}}>Hosts</a> /
+  <a href="javascript:void(null)" data-toggle="modal" {{action backToHostsList}}><i class="icon-arrow-left"></i>&nbsp;Back to Hosts</a>
+  &nbsp;/&nbsp;
   <span {{bindAttr class=":host-title view.content.healthClass"}}>{{unbound view.content.publicHostName}}</span>
   {{#if controller.isAdmin}}
   <div class="host-maintenance">

+ 1 - 1
ambari-web/app/templates/main/service/add.hbs

@@ -20,7 +20,7 @@
   <div class="container">
     <div class="container-fluid">
 
-      <a class="btn back" {{action backToServices}}>← Back to Services</a>
+      <!--<a class="btn back" {{action backToServices}}>← Back to Services</a>-->
 
       <div class="row-fluid">
         <div class="span3">

+ 6 - 1
ambari-web/app/templates/main/service/info/configs.hbs

@@ -139,7 +139,12 @@
 
       <div class="accordion-group">
         <div class="accordion-heading">
-          <a class="accordion-toggle" {{action "onToggleBlock" category.name target="view"}}>
+          {{#if category.isCollapsed}}
+          <i class='icon-caret-left pull-right accordion-toggle'></i>
+          {{else}}
+          <i class='icon-caret-down pull-right accordion-toggle'></i>
+          {{/if}}
+          <a class="accordion-toggle" {{action "onToggleBlock" category target="view"}}>
             {{category.name}}
           </a>
         </div>

+ 1 - 1
ambari-web/app/templates/wizard/step3_host_log_popup.hbs

@@ -19,7 +19,7 @@
 
 <div id="host-log">
   <div class="content-area">
-      <div id="textTrigger">click to highlight</div>
+      <div class="textTrigger">click to highlight</div>
     {{#if view.isTextArea}}
     <div>
       {{view view.textArea contentBinding="view.host.bootLog"}}

+ 6 - 1
ambari-web/app/templates/wizard/step7.hbs

@@ -37,7 +37,12 @@
   <div class="accordion">
     {{#each category in selectedService.configCategories}}
     <div class="accordion-group {{unbound category.name}}">
-      <div class="accordion-heading" {{action "onToggleBlock" category.name target="view"}}>
+      <div class="accordion-heading" {{action "onToggleBlock" category target="view"}}>
+        {{#if category.isCollapsed}}
+        <i class='icon-caret-left pull-right accordion-toggle'></i>
+        {{else}}
+        <i class='icon-caret-down pull-right accordion-toggle'></i>
+        {{/if}}
         <a class="accordion-toggle">
           {{category.name}}
         </a>

+ 15 - 5
ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs

@@ -19,17 +19,27 @@
 <p>Click on the task to see the log:</p>
 <div id="host-log">
   {{#each role in view.roles}}
-    {{#each taskInfo in role.taskInfos}}
-    <div>
-      <a href="#" {{action toggleTaskLog taskInfo}}>{{#if taskInfo.isLogHidden}}Show{{else}}Hide{{/if}} {{role.roleName}} {{taskInfo.command}} log ({{taskInfo.status}})</a>
-      <div {{bindAttr class="taskInfo.isLogHidden:hidden"}}>
+  {{#each taskInfo in role.taskInfos}}
+  <div>
+    <a href="#" {{action toggleTaskLog taskInfo}}>{{#if taskInfo.isLogHidden}}Show{{else}}Hide{{/if}} {{role.roleName}}
+      {{taskInfo.command}} log ({{taskInfo.status}})</a>
+    <div class="content-area" {{bindAttr class="taskInfo.isLogHidden:hidden"}}>
+      <div class="textTrigger" {{action "textTrigger" taskInfo target="view"}}>{{taskInfo.buttonLabel}}</div>
+      {{#if taskInfo.isTextArea}}
+      <div>
+        {{view view.textArea contentBinding="taskInfo" roleBinding="role"}}
+      </div>
+      {{else}}
+      <div>
         <h5>stderr:</h5>
         <pre class="stderr">{{taskInfo.stderr}}</pre>
         <h5>stdout:</h5>
         <pre class="stdout">{{taskInfo.stdout}}</pre>
       </div>
+      {{/if}}
     </div>
-    {{/each}}
+  </div>
+  {{/each}}
   {{/each}}
 </div>
 

+ 2 - 2
ambari-web/app/utils/misc.js

@@ -25,9 +25,9 @@ module.exports = {
         value = '<1KB';
       } else {
         if (value < 1048576) {
-          value = Math.round(value / 102.4) / 10 + 'KB';
+          value = (Math.round(value / 102.4) / 10).toFixed(1) + 'KB';
         } else {
-          value = Math.round(value / 104857.6) / 10 + 'MB';
+          value = (Math.round(value / 104857.6) / 10).toFixed(1) + 'MB';
         }
       }
     }

+ 9 - 0
ambari-web/app/views/common/chart/linear_time.js

@@ -317,6 +317,7 @@ App.ChartLinearTimeView = Ember.View.extend({
           scheme: this._paletteScheme
         });
         var self = this;
+        var series_min_length = 100000000;
         seriesData.forEach(function (series, index) {
           series.color = /*this.colorForSeries(series) ||*/ palette.color();
           series.stroke = 'rgba(0,0,0,0.3)';
@@ -338,7 +339,15 @@ App.ChartLinearTimeView = Ember.View.extend({
             }
             series.name = string_utils.pad(series.name, 30, '&nbsp;', 2) + string_utils.pad('min', 5, '&nbsp;', 3) + string_utils.pad(this.get('yAxisFormatter')(min), 12, '&nbsp;', 3) + string_utils.pad('avg', 5, '&nbsp;', 3) + string_utils.pad(this.get('yAxisFormatter')(avg/series.data.length), 12, '&nbsp;', 3) + string_utils.pad('max', 12, '&nbsp;', 3) + string_utils.pad(this.get('yAxisFormatter')(max), 5, '&nbsp;', 3);
           }
+          if (series.data.length < series_min_length) {
+            series_min_length = series.data.length;
+          }
         }.bind(this));
+        seriesData.forEach(function(series, index) {
+          if (series.data.length > series_min_length) {
+            series.data.length = series_min_length;
+          }
+        });
         var chartId = "#" + this.id + "-chart" + p;
         var chartOverlayId = "#" + this.id + "-container" + p;
         var xaxisElementId = "#" + this.id + "-xaxis" + p;

+ 3 - 3
ambari-web/app/views/main.js

@@ -36,7 +36,7 @@ App.MainBackgroundOperation = Em.View.extend({
     this.set('isTextArea', false);
   },
   buttonLabel:function(){
-    var button = $(this.get('element')).find('#textTrigger');
+    var button = $(this.get('element')).find('.textTrigger');
     if(this.get('isTextArea')){
       button.text('press CTRL+C');
     } else {
@@ -45,7 +45,7 @@ App.MainBackgroundOperation = Em.View.extend({
   }.observes('isTextArea'),
   didInsertElement: function () {
     var self = this;
-    var button = $(this.get('element')).find('#textTrigger');
+    var button = $(this.get('element')).find('.textTrigger');
     button.click(function () {
       self.set('isTextArea', !self.get('isTextArea'));
     });
@@ -70,7 +70,7 @@ App.MainBackgroundOperation = Em.View.extend({
       element.select();
       element.css('resize', 'none');
     },
-    disabled: true,
+    readOnly: true,
     value: function(){
       var operation = this.get('content');
       var content = "";

+ 9 - 3
ambari-web/app/views/main/service/info/configs.js

@@ -25,7 +25,8 @@ App.MainServiceInfoConfigsView = Em.View.extend({
     controller.loadStep();
   },
   onToggleBlock: function(event){
-    $("#" + event.context).toggle('blind', 500);
+    $(document.getElementById(event.context.name)).toggle('blind', 500);
+    event.context.set('isCollapsed', !event.context.get('isCollapsed'));
   }
 });
 
@@ -40,8 +41,13 @@ App.ServiceConfigsByCategoryView = Ember.View.extend({
   categoryConfigs: function () {
     return this.get('serviceConfigs').filterProperty('category', this.get('category.name'))
   }.property('serviceConfigs.@each').cacheable(),
-  didInsertElement: function(){
-    $("#Advanced").hide();
+  didInsertElement: function () {
+    if (this.get('category.name') == 'Advanced') {
+      this.set('category.isCollapsed', true);
+      $("#Advanced").hide();
+    } else {
+      this.set('category.isCollapsed', false);
+    }
   },
   layout: Ember.Handlebars.compile('<div {{bindAttr id="view.category.name"}} class="accordion-body collapse in"><div class="accordion-inner">{{yield}}</div></div>')
 });

+ 9 - 3
ambari-web/app/views/wizard/step7_view.js

@@ -28,7 +28,8 @@ App.WizardStep7View = Em.View.extend({
     controller.loadStep();
   },
   onToggleBlock: function(event){
-    $("#" + event.context).toggle('blind', 500);
+    $(document.getElementById(event.context.name)).toggle('blind', 500);
+    event.context.set('isCollapsed', !event.context.get('isCollapsed'));
   }
 
 });
@@ -49,8 +50,13 @@ App.WizardStep7.ServiceConfigsByCategoryView = Ember.View.extend({
   categoryConfigs: function () {
     return this.get('serviceConfigs').filterProperty('category', this.get('category.name'))
   }.property('serviceConfigs.@each').cacheable(),
-  didInsertElement: function(){
-    $("#Advanced").hide();
+  didInsertElement: function () {
+    if (this.get('category.name') == 'Advanced') {
+      this.set('category.isCollapsed', true);
+      $("#Advanced").hide();
+    } else {
+      this.set('category.isCollapsed', false);
+    }
   },
   layout: Ember.Handlebars.compile('<div {{bindAttr id="view.category.name"}} class="accordion-body collapse in"><div class="accordion-inner">{{yield}}</div></div>')
 });

+ 52 - 5
ambari-web/app/views/wizard/step9_view.js

@@ -140,7 +140,7 @@ App.HostStatusView = Em.View.extend({
 
         roles: function () {
           var roleArr = [];
-          var tasks = this.get('startedTasks');
+          var tasks = this.getStartedTasks(host);
           if (tasks.length) {
             var _roles = tasks.mapProperty('Tasks.role').uniq();
             _roles.forEach(function (_role) {
@@ -148,11 +148,16 @@ App.HostStatusView = Em.View.extend({
               var roleObj = {};
               roleObj.roleName = App.format.role(_role);
               tasks.filterProperty('Tasks.role', _role).forEach(function (_task) {
-                var taskInfo = Ember.Object.create();
+                var taskInfo = Ember.Object.create({
+                  isTextArea: false,
+                  buttonLabel: function(){
+                    return (this.get('isTextArea')) ? 'Press CTRL+C': 'Click to highlight';
+                  }.property('isTextArea')
+                });
                 taskInfo.set('command', _task.Tasks.command.toLowerCase());
                 taskInfo.set('status', App.format.taskStatus(_task.Tasks.status));
                 taskInfo.set('url', _task.href);
-                taskInfo.set('isLogHidden', true);
+                taskInfo.set('isLogHidden', false);
                 taskInfos.pushObject(taskInfo);
               }, this);
               roleObj.taskInfos = taskInfos;
@@ -164,7 +169,26 @@ App.HostStatusView = Em.View.extend({
 
         didInsertElement: function () {
           console.log('The value of event context is: ' + host.name);
-          this.set('startedTasks', this.getStartedTasks(host));
+          this.get('roles').forEach(function(role){
+            role.taskInfos.forEach(function(task){
+              task.set('isLogHidden', true);
+            });
+          });
+          $(this.get('element')).find('.content-area').each(function(index, value){
+            var button = $(value).find('.textTrigger');
+            $(value).mouseenter(
+              function () {
+                var element = $(this);
+                element.css('border', '1px solid #dcdcdc');
+                button.css('visibility', 'visible');
+              }).mouseleave(
+              function () {
+                var element = $(this);
+                element.css('border', 'none');
+                button.css('visibility', 'hidden');
+              })
+          });
+
         },
 
         getStartedTasks: function (host) {
@@ -187,6 +211,7 @@ App.HostStatusView = Em.View.extend({
                 taskInfo.set('stdout', task.Tasks.stdout);
                 taskInfo.set('stderr', task.Tasks.stderr);
                 taskInfo.set('isLogHidden', false);
+                taskInfo.set('isTextArea', false);
               },
               error: function () {
                 alert('Failed to retrieve task log');
@@ -195,7 +220,29 @@ App.HostStatusView = Em.View.extend({
           } else {
             taskInfo.set('isLogHidden', true);
           }
-        }
+        },
+        textTrigger: function(event){
+          var task = event.context;
+          task.set('isTextArea', !task.get('isTextArea'));
+        },
+        textArea: Em.TextArea.extend({
+          didInsertElement: function(){
+            var element = $(this.get('element'));
+            element.width($(this.get('parentView').get('element')).width() - 10);
+            element.height($(this.get('parentView').get('element')).height());
+            element.select();
+            element.css('resize', 'none');
+          },
+          readOnly: true,
+          value: function(){
+            var taskInfo = this.get('content');
+            var content = "";
+            content += this.get('role').role  + " " + taskInfo.command + " log " + taskInfo.status + "\n";
+            content += "stderr: " + taskInfo.stderr + "\n";
+            content += "stdout: " + taskInfo.stdout + "\n";
+            return content;
+          }.property('content')
+        })
       })
     });
   }