Browse Source

AMBARI-1062. Convert Apache license header comment style in Handlebars files to Handlebars comments rather than JavaScript comments. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1418916 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
78939c196e
100 changed files with 898 additions and 750 deletions
  1. 3 0
      AMBARI-666-CHANGES.txt
  2. 69 171
      ambari-web/app/assets/data/hosts/hosts.json
  3. 53 0
      ambari-web/app/assets/data/racks/racks.json
  4. 1 2
      ambari-web/app/controllers.js
  5. 43 30
      ambari-web/app/controllers/global/cluster_controller.js
  6. 0 22
      ambari-web/app/controllers/installer.js
  7. 3 3
      ambari-web/app/controllers/main/apps_controller.js
  8. 1 1
      ambari-web/app/controllers/main/charts/heatmap.js
  9. 2 2
      ambari-web/app/controllers/main/dashboard.js
  10. 2 24
      ambari-web/app/controllers/main/host/add_controller.js
  11. 7 7
      ambari-web/app/controllers/main/host/details.js
  12. 0 22
      ambari-web/app/controllers/main/service/add_controller.js
  13. 77 23
      ambari-web/app/controllers/main/service/item.js
  14. 0 2
      ambari-web/app/controllers/wizard/step8_controller.js
  15. 2 2
      ambari-web/app/initialize.js
  16. 29 12
      ambari-web/app/mappers/alerts_mapper.js
  17. 3 3
      ambari-web/app/mappers/cluster_mapper.js
  18. 5 1
      ambari-web/app/mappers/hosts_mapper.js
  19. 3 8
      ambari-web/app/mappers/jobs_mapper.js
  20. 11 9
      ambari-web/app/mappers/racks_mapper.js
  21. 19 6
      ambari-web/app/mappers/runs_mapper.js
  22. 41 38
      ambari-web/app/mappers/server_data_mapper.js
  23. 41 11
      ambari-web/app/mappers/services_mapper.js
  24. 1 1
      ambari-web/app/models.js
  25. 15 16
      ambari-web/app/models/alert.js
  26. 55 19
      ambari-web/app/models/component.js
  27. 2 2
      ambari-web/app/models/host.js
  28. 31 2
      ambari-web/app/models/job.js
  29. 3 47
      ambari-web/app/models/rack.js
  30. 52 6
      ambari-web/app/models/run.js
  31. 53 114
      ambari-web/app/models/service.js
  32. 1 1
      ambari-web/app/routes/main.js
  33. 6 6
      ambari-web/app/styles/application.less
  34. 2 2
      ambari-web/app/templates/application.hbs
  35. 3 2
      ambari-web/app/templates/common/form.hbs
  36. 2 2
      ambari-web/app/templates/common/form/checkbox.hbs
  37. 2 2
      ambari-web/app/templates/common/form/field.hbs
  38. 3 2
      ambari-web/app/templates/common/grid/filter.hbs
  39. 3 2
      ambari-web/app/templates/common/grid/header.hbs
  40. 3 2
      ambari-web/app/templates/common/grid/pager.hbs
  41. 3 2
      ambari-web/app/templates/common/metric.hbs
  42. 3 2
      ambari-web/app/templates/common/time_range.hbs
  43. 2 2
      ambari-web/app/templates/installer.hbs
  44. 2 2
      ambari-web/app/templates/login.hbs
  45. 3 2
      ambari-web/app/templates/main.hbs
  46. 2 2
      ambari-web/app/templates/main/admin.hbs
  47. 2 2
      ambari-web/app/templates/main/admin/advanced.hbs
  48. 2 2
      ambari-web/app/templates/main/admin/advanced/uninstall.hbs
  49. 2 2
      ambari-web/app/templates/main/admin/audit.hbs
  50. 2 2
      ambari-web/app/templates/main/admin/authentication.hbs
  51. 2 2
      ambari-web/app/templates/main/admin/security.hbs
  52. 2 2
      ambari-web/app/templates/main/admin/user.hbs
  53. 2 2
      ambari-web/app/templates/main/admin/user/edit.hbs
  54. 2 2
      ambari-web/app/templates/main/admin/user/row.hbs
  55. 3 2
      ambari-web/app/templates/main/apps.hbs
  56. 3 2
      ambari-web/app/templates/main/apps/item.hbs
  57. 2 2
      ambari-web/app/templates/main/apps/item/bar.hbs
  58. 3 3
      ambari-web/app/templates/main/apps/item/dag.hbs
  59. 3 3
      ambari-web/app/templates/main/apps/list_row.hbs
  60. 17 0
      ambari-web/app/templates/main/apps/runs.hbs
  61. 3 2
      ambari-web/app/templates/main/background_operations_popup.hbs
  62. 2 2
      ambari-web/app/templates/main/charts.hbs
  63. 3 2
      ambari-web/app/templates/main/charts/heatmap.hbs
  64. 2 2
      ambari-web/app/templates/main/charts/heatmap/heatmap_host.hbs
  65. 2 2
      ambari-web/app/templates/main/charts/heatmap/heatmap_host_detail.hbs
  66. 2 2
      ambari-web/app/templates/main/charts/heatmap/heatmap_rack.hbs
  67. 2 2
      ambari-web/app/templates/main/charts/horizon.hbs
  68. 2 2
      ambari-web/app/templates/main/charts/horizon/chart.hbs
  69. 2 2
      ambari-web/app/templates/main/charts/linear_time.hbs
  70. 4 4
      ambari-web/app/templates/main/dashboard.hbs
  71. 2 2
      ambari-web/app/templates/main/dashboard/service/hbase.hbs
  72. 2 2
      ambari-web/app/templates/main/dashboard/service/hdfs.hbs
  73. 2 2
      ambari-web/app/templates/main/dashboard/service/hive.hbs
  74. 3 2
      ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
  75. 2 2
      ambari-web/app/templates/main/dashboard/service/oozie.hbs
  76. 2 2
      ambari-web/app/templates/main/dashboard/service/zookeeper.hbs
  77. 3 2
      ambari-web/app/templates/main/host.hbs
  78. 2 2
      ambari-web/app/templates/main/host/add.hbs
  79. 3 2
      ambari-web/app/templates/main/host/audit.hbs
  80. 3 2
      ambari-web/app/templates/main/host/details.hbs
  81. 2 2
      ambari-web/app/templates/main/host/metrics.hbs
  82. 3 2
      ambari-web/app/templates/main/host/summary.hbs
  83. 3 2
      ambari-web/app/templates/main/menu.hbs
  84. 3 2
      ambari-web/app/templates/main/menu_item.hbs
  85. 2 2
      ambari-web/app/templates/main/service.hbs
  86. 2 2
      ambari-web/app/templates/main/service/add.hbs
  87. 2 2
      ambari-web/app/templates/main/service/info/configs.hbs
  88. 2 2
      ambari-web/app/templates/main/service/info/metrics.hbs
  89. 4 3
      ambari-web/app/templates/main/service/info/summary.hbs
  90. 2 2
      ambari-web/app/templates/main/service/item.hbs
  91. 3 3
      ambari-web/app/templates/main/service/menu_item.hbs
  92. 2 2
      ambari-web/app/templates/main/test.hbs
  93. 18 0
      ambari-web/app/templates/wizard/master_hosts.hbs
  94. 18 0
      ambari-web/app/templates/wizard/master_hosts_popup.hbs
  95. 18 0
      ambari-web/app/templates/wizard/slave_component_hosts.hbs
  96. 18 0
      ambari-web/app/templates/wizard/slave_component_hosts_popup.hbs
  97. 18 0
      ambari-web/app/templates/wizard/slave_hosts.hbs
  98. 2 2
      ambari-web/app/templates/wizard/step1.hbs
  99. 4 8
      ambari-web/app/templates/wizard/step10.hbs
  100. 10 5
      ambari-web/app/templates/wizard/step2.hbs

+ 3 - 0
AMBARI-666-CHANGES.txt

@@ -398,6 +398,9 @@ AMBARI-666 branch (unreleased changes)
 
   IMPROVEMENTS
 
+  AMBARI-1062. Convert Apache license header comment style in Handlebars files
+  to Handlebars comments rather than JavaScript comments. (yusaku)
+
   AMBARI-1061. Data loading refactoring for cluster management. (yusaku)
 
   AMBARI-1060. Data loading for App Browser. (yusaku)

+ 69 - 171
ambari-web/app/assets/data/hosts/hosts.json

@@ -1,181 +1,79 @@
 {
-  "href" : "http://localhost:8080/api/hosts?fields=*",
+  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts?fields=*",
   "items" : [
     {
-      "href" : "http://localhost:8080/api/hosts/host01",
+      "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com",
       "Hosts" : {
         "cpu_count" : 1,
         "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack1",
-        "total_mem" : 2055208,
+        "last_registration_time" : 1352386560520,
+        "rack_info" : "/default-rack",
+        "total_mem" : 3082813,
         "os_arch" : "x86_64",
-        "host_name" : "host01",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
+        "host_name" : "dev.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.1"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host02",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack1",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host02",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.2"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host03",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack1",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host03",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.3"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host04",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack1",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host04",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.4"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host05",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack1",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host05",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.5"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host06",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack2",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host06",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.6"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host07",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack2",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host07",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.7"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host08",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack2",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host08",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.8"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host09",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack2",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host09",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.9"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host10",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack2",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host10",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.10"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/hosts/host11",
-      "Hosts" : {
-        "cpu_count" : 1,
-        "cluster_name" : "mycluster",
-        "last_registration_time" : 1352357436171,
-        "rack_info" : "/rack3",
-        "total_mem" : 2055208,
-        "os_arch" : "x86_64",
-        "host_name" : "host11",
-        "disk_info" : "[{\"available\":\"47476780\",\"mountpoint\":\"/\",\"used\":\"3605224\",\"percent\":\"8%\",\"size\":\"51606140\",\"type\":\"ext4\"},{\"available\":\"1027100\",\"mountpoint\":\"/dev/shm\",\"used\":\"364\",\"percent\":\"1%\",\"size\":\"1027464\",\"type\":\"tmpfs\"},{\"available\":\"432210\",\"mountpoint\":\"/boot\",\"used\":\"38034\",\"percent\":\"9%\",\"size\":\"495844\",\"type\":\"ext4\"},{\"available\":\"44459808\",\"mountpoint\":\"/home\",\"used\":\"184284\",\"percent\":\"1%\",\"size\":\"47033288\",\"type\":\"ext4\"},{\"available\":\"0\",\"mountpoint\":\"/media/VBOXADDITIONS_4.1.23_80858\",\"used\":\"52206\",\"percent\":\"100%\",\"size\":\"52206\",\"type\":\"iso9660\"}]",
-        "last_heartbeat_time" : 1352357625241,
-        "os_type" : "centos6",
-        "ip" : "10.0.2.11"
-      }
+        "ip" : "10.0.2.15"
+      },
+      "host_components" : [
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/SECONDARY_NAMENODE",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "SECONDARY_NAMENODE",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/JOBTRACKER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "JOBTRACKER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/DATANODE",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "DATANODE",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HDFS_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "HDFS_CLIENT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/TASKTRACKER",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "TASKTRACKER",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/NAMENODE",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "NAMENODE",
+            "host_name" : "dev.hortonworks.com"
+          }
+        },
+        {
+          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/MAPREDUCE_CLIENT",
+          "HostRoles" : {
+            "cluster_name" : "mycluster",
+            "component_name" : "MAPREDUCE_CLIENT",
+            "host_name" : "dev.hortonworks.com"
+          }
+        }
+      ]
     }
   ]
-}
+}

+ 53 - 0
ambari-web/app/assets/data/racks/racks.json

@@ -0,0 +1,53 @@
+{
+  "href": "http://localhost:8080/api/racks?fields=*",
+  "items": [
+    {
+      "href": "http://localhost:8080/api/racks/1",
+      "Racks": {
+        "id": 1,
+        "name": "Rack-0",
+        "hosts": ["host01", "host06", "host05"],
+        "status": "LIVE",
+        "live_hosts_count": 5,
+        "critical_hosts_count": 0,
+        "dead_hosts_count": 2
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/racks/2",
+      "Racks": {
+        "id": 2,
+        "name": "Rack-0",
+        "hosts": ["host02", "host02", "host04"],
+        "status": "LIVE",
+        "live_hosts_count": 5,
+        "critical_hosts_count": 0,
+        "dead_hosts_count": 2
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/racks/3",
+      "Racks": {
+        "id": 3,
+        "name": "Rack-0",
+        "hosts": ["host05", "host01", "host02"],
+        "status": "LIVE",
+        "live_hosts_count": 5,
+        "critical_hosts_count": 0,
+        "dead_hosts_count": 2
+      }
+    },
+    {
+      "href": "http://localhost:8080/api/racks/4",
+      "Racks": {
+        "id": 4,
+        "name": "Rack-0",
+        "hosts": ["host01", "host06", "host05"],
+        "status": "LIVE",
+        "live_hosts_count": 5,
+        "critical_hosts_count": 0,
+        "dead_hosts_count": 2
+      }
+    }
+  ]
+}

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

@@ -60,5 +60,4 @@ require('controllers/wizard/step7_controller');
 require('controllers/wizard/step8_controller');
 require('controllers/wizard/step9_controller');
 require('controllers/wizard/step10_controller');
-require('controllers/cluster_controller');
-require('controllers/cluster_controller');
+require('controllers/global/cluster_controller');

+ 43 - 30
ambari-web/app/controllers/cluster_controller.js → ambari-web/app/controllers/global/cluster_controller.js

@@ -20,25 +20,27 @@ var App = require('app');
 
 App.ClusterController = Em.Controller.extend({
   name: 'clusterController',
-  cluster: null,
-  isLoaded: function(){
-    return true;
+  cluster:null,
+  isLoaded: false,
+  updateLoadStatus: function(item){
     var loadList = this.get('dataLoadList');
     var loaded = true;
+    loadList.set(item, true);
     for(var i in loadList){
-      if(loadList.hasOwnProperty(i) && !loadList[i]){
+      if(loadList.hasOwnProperty(i) && !loadList[i] && loaded){
         loaded = false;
       }
     }
-    return loaded;
-  }.property('dataLoadList'),
+    this.set('isLoaded', loaded);
+  },
   dataLoadList: Em.Object.create({
     'hosts': false,
     'jobs': false,
     'runs': false,
     'services': false,
-    'components': false,
-    'cluster' : false
+    'cluster' : false,
+    'racks' : false,
+    'alerts' : false
   }),
   /**
    * load cluster name
@@ -56,7 +58,9 @@ App.ClusterController = Em.Controller.extend({
       },
       error: function (request, ajaxOptions, error) {
         //do something
-        console.log('failed on loading cluster name')
+        console.log('failed on loading cluster name');
+        //hack skip loading when data ain't received
+        if(!App.testMode) self.set('isLoaded', true);
       },
       statusCode: require('data/statusCodes')
     });
@@ -74,43 +78,52 @@ App.ClusterController = Em.Controller.extend({
     if(!this.get('clusterName')){
         return;
     }
-    var clusterUrl = (App.testMode) ? '/data/clusters/cluster.json': '/api/clusters/mycluster?fields=Clusters';
-    var jobsUrl = (App.testMode) ? "/data/apps/jobs.json" : "/api/jobs?fields=*";
-    var runsUrl = (App.testMode) ? "/data/apps/runs.json" : "/api/runs?fields=*";
-    var hostsUrl = (App.testMode) ? "/data/hosts/hosts.json" : "/api/hosts?fields=*";
-    var servicesUrl = (App.testMode) ?
-        "/data/dashboard/services.json" :
-        "/api/clusters/mycluster/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/host_components/*";
+
+     var alertsUrl = "/data/alerts/alerts.json";
+     var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
+     var hostsUrl = this.getUrl('/data/hosts/hosts.json', '/hosts?fields=*');
+     var servicesUrl = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/host_components/*');
+
+     var jobsUrl = "/data/apps/jobs.json";
+     var runsUrl = "/data/apps/runs.json";
+
+     var racksUrl = "/data/racks/racks.json";
+
+    App.HttpClient.get(alertsUrl, App.alertsMapper,{
+      complete:function(jqXHR, textStatus){
+        self.updateLoadStatus('alerts');
+      }
+    });
+    App.HttpClient.get(racksUrl, App.racksMapper,{
+      complete:function(jqXHR, textStatus){
+        self.updateLoadStatus('racks');
+      }
+    });
     App.HttpClient.get(clusterUrl, App.clusterMapper,{
       complete:function(jqXHR, textStatus){
-        self.set('dataLoadList.cluster', true);
+        self.updateLoadStatus('cluster');
       }
     });
      App.HttpClient.get(jobsUrl, App.jobsMapper,{
        complete:function(jqXHR, textStatus) {
-         self.set('dataLoadList.jobs', true);
-       }
-     });
-     App.HttpClient.get(runsUrl, App.runsMapper,{
-       complete:function(jqXHR, textStatus) {
-         self.set('dataLoadList.runs', true);
+         self.updateLoadStatus('jobs');
+         App.HttpClient.get(runsUrl, App.runsMapper,{
+           complete:function(jqXHR, textStatus) {
+             self.updateLoadStatus('runs');
+           }
+         });
        }
      });
     App.HttpClient.get(hostsUrl, App.hostsMapper,{
       complete:function(jqXHR, textStatus){
-        self.set('dataLoadList.hosts', true);
+        self.updateLoadStatus('hosts');
       }
     });
     App.HttpClient.get(servicesUrl, App.servicesMapper,{
       complete:function(jqXHR, textStatus){
-        self.set('dataLoadList.services', true);
+        self.updateLoadStatus('services');
       }
     });
-    /*App.HttpClient.get(servicesUrl, App.componentsMapper,{
-      complete:function(jqXHR, textStatus){
-        self.set('dataLoadList.components', true);
-      }
-    });*/
   }.observes('clusterName'),
   clusterName: function(){
     return (this.get('cluster')) ? this.get('cluster').Clusters.cluster_name : 'mycluster';

+ 0 - 22
ambari-web/app/controllers/installer.js

@@ -358,28 +358,6 @@ App.InstallerController = Em.Controller.extend({
     }
   },
 
-  /**
-   * Return hosts, which were add at <code>Specify Host(step2)</code> step
-   * @paramm isNew whether return all hosts or only new ones
-   */
-  getHostList: function (isNew) {
-    var hosts = [];
-    var hostArray = App.db.getHosts()
-    console.log('in instsllerController.getHostList: host names is ', hostArray);
-
-    for (var i in hostArray) {
-      var hostInfo = App.HostInfo.create({
-        name: hostArray[i].name,
-        bootStatus: hostArray[i].bootStatus
-      });
-
-      hosts.pushObject(hostInfo);
-    }
-
-    console.log('TRACE: pushing ' + hosts);
-    return hosts;
-  },
-
   /**
    * Remove host from model. Used at <code>Confirm hosts(step2)</code> step
    * @param hosts Array of hosts, which we want to delete

+ 3 - 3
ambari-web/app/controllers/main/apps_controller.js

@@ -45,7 +45,7 @@ App.MainAppsController = Em.ArrayController.extend({
   getRunById: function(id) {
     var r;
     this.get('content').forEach(function(item){
-      if (item.get('id') == id) {
+      if (item.get('workflowId') == id) {
         r = item;
       }
     });
@@ -59,7 +59,7 @@ App.MainAppsController = Em.ArrayController.extend({
   issetStaredRun: function(id) {
     var r = false;
     this.get('staredRuns').forEach(function(item){
-      if (item.get('id') == id) {
+      if (item.get('workflowId') == id) {
         r = true;
       }
     });
@@ -78,7 +78,7 @@ App.MainAppsController = Em.ArrayController.extend({
     event.target.classList.toggle('stared');
     var cell = event.target.parentNode.parentNode;
     var row = cell.parentNode;
-    var id = parseInt(jQuery(event.target).parent().children(1).text());
+    var id = jQuery(event.target).parent().children(1).text();
     if (!this.issetStaredRun(id)) {
       this.get('staredRuns').push(this.getRunById(id));
     }

+ 1 - 1
ambari-web/app/controllers/main/charts/heatmap.js

@@ -27,7 +27,7 @@ App.MainChartsHeatmapController = Em.Controller.extend({
    * @this App.MainChartsHeatmapController
    */
   visualSchema: function() {
-    var maxHostsPerRack = this.cluster.get('maxHostsPerRack');
+    var maxHostsPerRack = this.get('cluster.maxHostsPerRack');
     switch(maxHostsPerRack) {
       case 10:
         return 'rack-5-2'

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

@@ -115,6 +115,6 @@ App.MainDashboardController = Em.Controller.extend({
   }.property('alerts', 'alertsFilteredBy'),
   
   alertsCount: function() {
-    return this.alerts.filterProperty('status', 'corrupt').length;
-  }.property()
+    return this.get('alerts').filterProperty('status', 'corrupt').length;
+  }.property('alerts')
 })

+ 2 - 24
ambari-web/app/controllers/main/host/add_controller.js

@@ -259,12 +259,12 @@ App.AddHostController = Em.Controller.extend({
       this.content.hosts = Em.Object.create();
     }
 
-    //TODO : rewire it as model. or not :)
     var hostsInfo = Em.Object.create();
 
+
+    hostsInfo.oldHostNames = App.Host.find().getEach('id').join(" <br/>");
     hostsInfo.hostNames = App.db.getAllHostNames() || ''; //empty string if undefined
 
-    //TODO : should we check installType for add host wizard????
     var installType = App.db.getInstallType();
     //false if installType not equals 'manual'
     hostsInfo.manualInstall = installType && installType.installType === 'manual' || false;
@@ -308,28 +308,6 @@ App.AddHostController = Em.Controller.extend({
     }
   },
 
-  /**
-   * Return hosts, which were add at <code>Specify Host(step2)</code> step
-   * @paramm isNew whether return all hosts or only new ones
-   */
-  getHostList: function (isNew) {
-    var hosts = [];
-    var hostArray = App.db.getHosts()
-    console.log('in addHostController.getHostList: host names is ', hostArray);
-
-    for (var i in hostArray) {
-      var hostInfo = App.HostInfo.create({
-        name: hostArray[i].name,
-        bootStatus: hostArray[i].bootStatus
-      });
-
-      hosts.pushObject(hostInfo);
-    }
-
-    console.log('TRACE: pushing ' + hosts);
-    return hosts;
-  },
-
   /**
    * Remove host from model. Used at <code>Confirm hosts(step2)</code> step
    * @param hosts Array of hosts, which we want to delete

+ 7 - 7
ambari-web/app/controllers/main/host/details.js

@@ -89,11 +89,11 @@ App.MainHostDetailsController = Em.Controller.extend({
           }
 
           console.log('Send request for STARTING successfully');
-          component.set('workStatus', "STARTING");
+          component.set('workStatus', App.Component.Status.starting);
 
           if(App.testMode){
             setTimeout(function(){
-              component.set('workStatus', "STARTED");
+              component.set('workStatus', App.Component.Status.started);
             },10000);
           } else{
             App.router.get('backgroundOperationsController.eventsArray').push({
@@ -103,7 +103,7 @@ App.MainHostDetailsController = Em.Controller.extend({
                 return result;
               },
               "do" : function(){
-                component.set('workStatus', "STARTED");
+                component.set('workStatus', App.Component.Status.started);
               }
             });
           }
@@ -140,11 +140,11 @@ App.MainHostDetailsController = Em.Controller.extend({
 
           console.log('Send request for STOPPING successfully');
 
-          component.set('workStatus', "STOPPING");
+          component.set('workStatus', App.Component.Status.stopping);
 
           if(App.testMode){
             setTimeout(function(){
-              component.set('workStatus', "STOPPED");
+              component.set('workStatus', App.Component.Status.stopped);
             },10000);
           } else{
             App.router.get('backgroundOperationsController.eventsArray').push({
@@ -154,7 +154,7 @@ App.MainHostDetailsController = Em.Controller.extend({
                 return result;
               },
               "do" : function(){
-                component.set('workStatus', "STOPPED");
+                component.set('workStatus', App.Component.Status.stopped);
               }
             });
           }
@@ -221,7 +221,7 @@ App.MainHostDetailsController = Em.Controller.extend({
     components.forEach(function(cInstance){
       var cName = cInstance.get('componentName');
       if(slaveComponents.contains(cName)) {
-        if(cInstance.get('workStatus')==="STOPPED" &&
+        if(cInstance.get('workStatus')===App.Component.Status.stopped &&
           !cInstance.get('decommissioned')){
           workingComponents.push(cName);
         }

+ 0 - 22
ambari-web/app/controllers/main/service/add_controller.js

@@ -285,28 +285,6 @@ App.AddServiceController = Em.Controller.extend({
     }
   },
 
-  /**
-   * Return hosts, which were add at <code>Specify Host(step2)</code> step
-   * @paramm isNew whether return all hosts or only new ones
-   */
-  getHostList: function (isNew) {
-    var hosts = [];
-    var hostArray = App.db.getHosts()
-    console.log('in AddServiceController.getHostList: host names is ', hostArray);
-
-    for (var i in hostArray) {
-      var hostInfo = App.HostInfo.create({
-        name: hostArray[i].name,
-        bootStatus: hostArray[i].bootStatus
-      });
-
-      hosts.pushObject(hostInfo);
-    }
-
-    console.log('TRACE: pushing ' + hosts);
-    return hosts;
-  },
-
   /**
    * Remove host from model. Used at <code>Confirm hosts(step2)</code> step
    * @param hosts Array of hosts, which we want to delete

+ 77 - 23
ambari-web/app/controllers/main/service/item.js

@@ -26,12 +26,12 @@ App.MainServiceItemController = Em.Controller.extend({
    * @param url
    * @param data Object to send
    */
-  sendCommandToServer : function(url, postData){
+  sendCommandToServer : function(url, postData, callback){
     var url =  (App.testMode) ?
       '/data/wizard/deploy/poll_1.json' : //content is the same as ours
-      '/api/clusters/' + App.router.getClusterName() + url; //'/services/' + this.get('content.serviceName').toUpperCase();
+      '/api/clusters/' + App.router.getClusterName() + url;
 
-    var method = App.testMode ? 'GET' : (postData ? 'PUT' : 'POST');
+    var method = App.testMode ? 'GET' : 'PUT';
 
     $.ajax({
       type: method,
@@ -39,12 +39,19 @@ App.MainServiceItemController = Em.Controller.extend({
       data: JSON.stringify(postData),
       dataType: 'json',
       timeout: 5000,
-      success: function (data) {
-        //do something
+      success: function(data){
+        if(data && data.Requests){
+          callback(data.Requests.id);
+        } else{
+          callback(null);
+          console.log('cannot get request id from ', data);
+        }
       },
 
       error: function (request, ajaxOptions, error) {
         //do something
+        callback(null);
+        console.log('error on change component host status')
       },
 
       statusCode: require('data/statusCodes')
@@ -66,16 +73,37 @@ App.MainServiceItemController = Em.Controller.extend({
       body: Em.I18n.t('services.service.confirmation.body'),
       primary: 'Yes',
       secondary: 'No',
-      onPrimary: function() {
-        self.content.set('workStatus', true);
-
-        self.sendCommandToServer('/services/' + self.get('content.serviceName').toUpperCase(),{
-          ServiceInfo:{
+      onPrimary: function () {
+        self.sendCommandToServer('/services/' + self.get('content.serviceName').toUpperCase(), {
+          ServiceInfo: {
             state: 'STARTED'
           }
-        });
+        }, function (requestId) {
 
-        App.router.get('backgroundOperationsController').showPopup();
+          if (!requestId) {
+            return;
+          }
+
+          self.content.set('workStatus', App.Service.Health.starting);
+          console.log('Send request for STARTING successfully');
+          if (App.testMode) {
+            setTimeout(function () {
+              self.content.set('workStatus', App.Service.Health.live);
+            }, 10000);
+          } else {
+            App.router.get('backgroundOperationsController.eventsArray').push({
+              "when": function (controller) {
+                var result = (controller.getOperationsForRequestId(requestId).length == 0);
+                console.log('startService.when = ', result)
+                return result;
+              },
+              "do": function () {
+                self.content.set('workStatus', App.Service.Health.live);
+              }
+            });
+          }
+          App.router.get('backgroundOperationsController').showPopup();
+        });
         this.hide();
       },
       onSecondary: function() {
@@ -100,18 +128,37 @@ App.MainServiceItemController = Em.Controller.extend({
       primary: 'Yes',
       secondary: 'No',
       onPrimary: function() {
-        self.content.set('workStatus', false);
-
         self.sendCommandToServer('/services/' + self.get('content.serviceName').toUpperCase(),{
           ServiceInfo:{
             state: 'INSTALLED'
           }
+        }, function (requestId) {
+          if (!requestId) {
+            return
+          }
+          console.log('Send request for STOPPING successfully');
+          self.content.set('workStatus', App.Service.Health.stopping);
+          if (App.testMode) {
+            setTimeout(function () {
+              self.content.set('workStatus', App.Service.Health.dead);
+            }, 10000);
+          } else {
+            App.router.get('backgroundOperationsController.eventsArray').push({
+              "when": function (controller) {
+                var result = (controller.getOperationsForRequestId(requestId).length == 0);
+                console.log('stopService.when = ', result)
+                return result;
+              },
+              "do": function () {
+                self.content.set('workStatus', App.Service.Health.dead);
+              }
+            });
+          }
+          App.router.get('backgroundOperationsController').showPopup();
         });
-
-        App.router.get('backgroundOperationsController').showPopup();
         this.hide();
       },
-      onSecondary: function() {
+      onSecondary: function () {
         this.hide();
       }
     });
@@ -158,16 +205,23 @@ App.MainServiceItemController = Em.Controller.extend({
       primary: 'Yes',
       secondary: 'No',
       onPrimary: function() {
-        self.content.set('runSmokeTest', true);
-      
+
         var serviceName = self.get('content.serviceName').toUpperCase();
         var smokeName = serviceName + "_SERVICE_CHECK";
-        self.sendCommandToServer('/services/' + serviceName + '/actions/' + smokeName);
-
-        App.router.get('backgroundOperationsController').showPopup();
+        self.sendCommandToServer('/services/' + serviceName + '/actions/' + smokeName,
+            null,
+            function (requestId) {
+
+              if (!requestId) {
+                return;
+              }
+              self.content.set('runSmokeTest', true);
+              App.router.get('backgroundOperationsController').showPopup();
+            }
+        );
         this.hide();
       },
-      onSecondary: function() {
+      onSecondary: function () {
         this.hide();
       }
     });

+ 0 - 2
ambari-web/app/controllers/wizard/step8_controller.js

@@ -747,8 +747,6 @@ App.WizardStep8Controller = Em.Controller.extend({
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
     var url = '/api/clusters/' + clusterName + '/services/' + service;
 
-    debugger;
-
     $.ajax({
       type: httpMethod,
       url: url,

+ 2 - 2
ambari-web/app/initialize.js

@@ -20,7 +20,6 @@
 window.App = require('app');
 
 App.testMode = false;
-//App.testMode = true;
 
 require('messages');
 require('utils/data_table');
@@ -33,11 +32,12 @@ require('router');
 
 require('mappers/server_data_mapper');
 require('mappers/services_mapper');
-require('mappers/components_mapper');
 require('mappers/hosts_mapper');
 require('mappers/cluster_mapper');
 require('mappers/jobs_mapper');
 require('mappers/runs_mapper');
+require('mappers/racks_mapper');
+require('mappers/alerts_mapper');
 
 require('utils/http_client');
 

+ 29 - 12
ambari-web/app/mappers/alerts_mapper.js

@@ -16,20 +16,37 @@
  * limitations under the License.
  */
 
-//todo: refactor it
-App.alertsMapper = App.ServerDataMapper.create({
+
+App.alertsMapper = App.QuickDataMapper.create({
+  model: App.Alert,
+  config:{
+    $alert_id:'' ,
+    title: "service_description",
+    service_type: "service_type",
+    date: "last_check",
+    status: "current_state",
+    message: "plugin_output",
+    host_name: "host_name",
+    current_attempt: "current_attempt",
+    last_hard_state_change: "last_hard_state_change",
+    last_hard_state: "last_hard_state",
+    last_time_ok: "last_time_ok",
+    last_wime_warning: "last_time_warning",
+    last_time_unknown: "last_time_unknown",
+    last_time_critical: "last_time_critical",
+    is_flapping: "is_flapping",
+    last_check: "last_check"
+  },
   map: function (json) {
+    if (!this.get('model')) {
+      return;
+    }
     if (json.alerts) {
-      $.each(json.alerts, function (i, _alert) {
-        var alert = App.store.createRecord(App.Alert, {
-          alertId: _alert.service_description,
-          title: _alert.service_description,
-          serviceType: _alert.service_type,
-          date: new Date(_alert.last_hard_state_change * 1000),
-          status: _alert.current_state,
-          message: _alert.plugin_output
-        });
-      });
+      var result = [];
+      json.alerts.forEach(function (item) {
+        result.push(this.parseIt(item, this.config));
+      }, this);
+      App.store.loadMany(this.get('model'), result);
     }
   }
 });

+ 3 - 3
ambari-web/app/mappers/cluster_mapper.js

@@ -30,11 +30,11 @@ App.clusterMapper = App.QuickDataMapper.create({
     config : {
       id:'Clusters.cluster_id',
       cluster_name: 'Clusters.cluster_name',
-      stackName: 'Clusters.stack_name',
+      stack_name: 'Clusters.stack_name',
       version: 'Clusters.version',
-      $hosts: "",
+      $hosts: [1, 2, 3, 4],
       $racks: [1,2,3,4],
-      maxHostsPerRack: 'Clusters.max_hosts_per_rack'
+      max_hosts_per_rack: 'Clusters.max_hosts_per_rack'
     }
 
 });

+ 5 - 1
ambari-web/app/mappers/hosts_mapper.js

@@ -23,7 +23,11 @@ App.hostsMapper = App.QuickDataMapper.create({
     id : 'Hosts.host_name',
     host_name : 'Hosts.host_name',
     cluster_id: 'Hosts.cluster_name',//1
-    $components: [1,2,3],
+    components_key: 'host_components',
+    components_type: 'array',
+    components: {
+      item : 'HostRoles.component_name'
+    },
     cpu : 'Hosts.cpu_count',
     memory : 'Hosts.total_mem',
     disk_info: 'Hosts.disk_info',

File diff suppressed because it is too large
+ 3 - 8
ambari-web/app/mappers/jobs_mapper.js


+ 11 - 9
ambari-web/app/mappers/components_mapper.js → ambari-web/app/mappers/racks_mapper.js

@@ -16,14 +16,16 @@
  * limitations under the License.
  */
 
-App.componentsMapper = App.QuickDataMapper.create({
-  model : App.Component,
-  config : {
-    id : 'ServiceComponentInfo.component_name',
-    component_name : 'ServiceComponentInfo.component_name',
-    label : 'ServiceComponentInfo.component_name',
-    service_id: 'ServiceComponentInfo.service_name',
-    host_id: 'host_components[0].HostRoles.host_name',
-    $work_status: 'true'
+
+App.racksMapper = App.QuickDataMapper.create({
+  model: App.Rack,
+  config: {
+    id: "Racks.id",
+    name: "Racks.name",
+    $hosts: ["host01", "host06", "host05"],
+    status: "Racks.status",
+    live_hosts_count: "Racks.live_hosts_count",
+    critical_hosts_count: "Racks.critical_hosts_count",
+    dead_hosts_count: "Racks.dead_hosts_count"
   }
 });

+ 19 - 6
ambari-web/app/mappers/runs_mapper.js

@@ -21,27 +21,40 @@ var App = require('app');
 App.runsMapper = App.QuickDataMapper.create({
   model : App.Run,
   map : function(json) {
-    console.log('json', json.workflows);
     if(!this.get('model')) {
       return;
     }
     if(json.workflows) {
       var result = [];
       json.workflows.forEach(function(item) {
-        result.push(this.parseIt(item, this.config));
+        var o = this.parseIt(item, this.config);
+
+        var r = '{dag: {';
+        item.workflowContext.workflowDag.entries.forEach(function(item) {
+          r += '"' + item.source + '": [';
+          item.targets.forEach(function(target) {
+            r += '"' + target + '",';
+          });
+          r = r.substr(0, r.length - 1);
+          r += '],';
+        });
+        r = r.substr(0, r.length - 1);
+        r += '}}';
+        o.workflow_context = r;
+        result.push(o);
       }, this);
-      console.log('result', result);
       App.store.loadMany(this.get('model'), result);
     }
   },
   config : {
     run_id: 'workflowName',
+    workflow_id: 'workflowId',
     $parent_run_id: null,
     //workflow_context:'{dag: {"1":["2","3"],"2":["3","4"],"4":["2","5"]}}',
+    //last_update_time:'1347639541501',
     user_name:'userName',
     start_time: 'startTime',
-    //last_update_time:'1347639541501',
-    app_id: 'workflowId'
-    //jobs:[1, 2, 3, 4, 5]
+    elapsed_time: 'elapsedTime',
+    $app_id: 1
   }
 });

+ 41 - 38
ambari-web/app/mappers/server_data_mapper.js

@@ -38,61 +38,64 @@ App.ServerDataMapper = Em.Object.extend({
 
 
 App.QuickDataMapper = App.ServerDataMapper.extend({
-  config : {},
-  model : null,
-  map:function(json){
-    if(!this.get('model')) {return;}
-    if(json.items){
+  config: {},
+  model: null,
+  map: function (json) {
+    if (!this.get('model')) {
+      return;
+    }
+
+    if (json.items) {
       var result = [];
-      if(this.get('model') != "App.Component" ){
-        json.items.forEach(function(item){
-          result.push(this.parseIt(item, this.config));
-        }, this)
-      }else{
-        json.items.forEach(function(item){
-          item.components.forEach(function(component){
-           // debugger;
-            result.push(this.parseIt(component, this.config));
-          }, this)
-        }, this)
-      }
-      //console.log(this.get('model') ,result);
-    App.store.loadMany(this.get('model'), result);
+
+      json.items.forEach(function (item) {
+        result.push(this.parseIt(item, this.config));
+      }, this)
+
+      //console.log(this.get('model'), result);
+      App.store.loadMany(this.get('model'), result);
     }
   },
-  parseIt : function(data, config){
+
+  parseIt: function (data, config) {
     var result = {};
-    for(var i in config){
-      if(i.substr(0, 1) === '$'){
+    for (var i in config) {
+      if (i.substr(0, 1) === '$') {
         i = i.substr(1, i.length);
-        result[i] = config['$'+i];
+        result[i] = config['$' + i];
       } else {
-      if(i.substr(-4) !== '_key' && typeof config[i] == 'string'){
-        result[i] = this.getJsonProperty(data, config[i]);
-      } else if(typeof config[i] == 'object'){
-        result[i] = [];
-        var _data = data[config[i+'_key']];
-        var l = _data.length;
-        for(var index = 0; index<l; index++){
-          result[i].push(this.parseIt(_data[index], config[i]));
-        }
+        if (i.substr(-5) !== '_type' && i.substr(-4) !== '_key' && typeof config[i] == 'string') {
+          result[i] = this.getJsonProperty(data, config[i]);
+        } else if (typeof config[i] == 'object') {
+          result[i] = [];
+          var _data = this.getJsonProperty(data, config[i+'_key']);
+          var _type = config[i + '_type'];
+          var l = _data.length;
+          for (var index = 0; index < l; index++) {
+            if(_type == 'array'){
+              result[i].push(this.getJsonProperty(_data[index], config[i].item));
+            } else {
+              result[i].push(this.parseIt(_data[index], config[i]));
+            }
+          }
         }
       }
     }
     return result;
   },
-  getJsonProperty:function(json, path){
+
+  getJsonProperty: function (json, path) {
     var pathArr = path.split('.');
     var current = json;
-    while(pathArr.length){
-      if(pathArr[0].substr(-1) == ']'){
-        var index = parseInt(pathArr[0].substr(-2,1));
-        var attr = pathArr[0].substr(0, pathArr[0].length-3);
+    while (pathArr.length) {
+      if (pathArr[0].substr(-1) == ']') {
+        var index = parseInt(pathArr[0].substr(-2, 1));
+        var attr = pathArr[0].substr(0, pathArr[0].length - 3);
         current = current[attr][index];
       } else {
         current = current[pathArr[0]];
       }
-      pathArr.splice(0,1);
+      pathArr.splice(0, 1);
     }
     return current;
   }

+ 41 - 11
ambari-web/app/mappers/services_mapper.js

@@ -21,18 +21,48 @@ App.servicesMapper = App.QuickDataMapper.create({
   config : {
     id : 'ServiceInfo.service_name',
     service_name : 'ServiceInfo.service_name',
-    label : 'ServiceInfo.service_name',
-    $health_status: 'LIVE',
-    $work_status: 'true',
-    $serviceAudit: [1, 2, 3],
+    $work_status: 'DEAD',
+    $service_audit: [1, 2, 3],
+    $alerts: [1, 2, 3],
     components_key : 'components',
+    components_type : 'array',
     components : {
-        id : 'ServiceComponentInfo.component_name',
-        component_name : 'ServiceComponentInfo.component_name',
-        //service_id : 'ServiceComponentInfo.service_name',
-        service_name : 'ServiceComponentInfo.service_name',
-        state: 'host_components[0].HostRoles.state',
-        host_name: 'host_components[0].HostRoles.host_name'
-      }
+        item : 'ServiceComponentInfo.component_name'
+    }
+  },
+
+  model2 : App.Component,
+  config2: {
+    id : 'ServiceComponentInfo.component_name',
+    component_name : 'ServiceComponentInfo.component_name',
+    service_id : 'ServiceComponentInfo.service_name',
+    work_status: 'host_components[0].HostRoles.state',
+    host_id: 'host_components[0].HostRoles.host_name',
+    $decommissioned: false
+  },
+
+  map: function (json) {
+    if (!this.get('model')) {
+      return;
+    }
+
+    if (json.items) {
+      var result = [];
+
+      json.items.forEach(function (item) {
+        result.push(this.parseIt(item, this.config));
+      }, this)
+
+      App.store.loadMany(this.get('model'), result);
+
+      result = [];
+      json.items.forEach(function(item){
+        item.components.forEach(function(component){
+          result.push(this.parseIt(component, this.config2));
+        }, this)
+      }, this);
+
+      App.store.loadMany(this.get('model2'), result);
+    }
   }
 });

+ 1 - 1
ambari-web/app/models.js

@@ -23,6 +23,7 @@ require('models/form'); // should be the 1st
 require('models/authentication');
 require('models/cluster');
 require('models/hosts');
+require('models/quick_links');
 require('models/service');
 require('models/component');
 require('models/service_config');
@@ -37,4 +38,3 @@ require('models/job');
 require('models/run');
 require('models/app');
 require('models/background_operation');
-require('models/protoRelations');

+ 15 - 16
ambari-web/app/models/alert.js

@@ -29,13 +29,22 @@ App.AlertStatus = {
  */
 App.Alert = DS.Model.extend({
   alertId: DS.attr('string'),
-  title: DS.attr('string'),
+  primaryKey: 'alertId',
+  title: DS.attr('string'),//service_description in ajax response
   serviceType: DS.attr('string'),
   date: DS.attr('date'),
-  status: DS.attr('string'),
-  message: DS.attr('string'),
-  primaryKey: 'alertId',
-
+  status: DS.attr('string'),//current_state in ajax response
+  message: DS.attr('string'),//plugin_output in ajax response
+  hostName: DS.attr('string'),
+  currentAttempt: DS.attr('string'),
+  lastHardStateChange: DS.attr('number'),
+  lastHardState: DS.attr('number'),
+  lastTimeOk: DS.attr('number'),
+  lastTimeWarning: DS.attr('number'),
+  lastTimeUnknown: DS.attr('number'),
+  lastTimeCritical: DS.attr('number'),
+  isFlapping: DS.attr('number'),
+  lastCheck: DS.attr('number'),
   /**
    * Used to show correct icon in UI
    */
@@ -77,7 +86,7 @@ App.Alert = DS.Model.extend({
           return 'Hive';
       }
     }
-    return '';
+    return 'unknown';
   }.property('serviceType'),
 
   /**
@@ -106,15 +115,5 @@ App.Alert = DS.Model.extend({
 
 });
 
-/*
- * App.Alert.reopenClass() has to be called as opposed
- * to DS.Model.extend() containing URL. Only then will
- * the 'url' property show up for the instance and the 
- * RESTAdapter will contact server.
- */
-App.Alert.reopenClass({
-//  url: "http://nagiosserver/hdp/nagios/nagios_alerts.php?q1=alerts&alert_type=all"
-});
-
 App.Alert.FIXTURES = [
 ];

+ 55 - 19
ambari-web/app/models/component.js

@@ -15,31 +15,67 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/*
+
 var App = require('app');
 
 App.Component = DS.Model.extend({
-  componentName:DS.attr('string'),
-  label:DS.attr('string'),
-  type:DS.attr('boolean'),
-  service:DS.belongsTo('App.Service'),
-  host:DS.belongsTo('App.Host'),
-  workStatus:DS.attr('string'),
-  isMaster:function () {
-    return this.get('type');
-  }.property('type'),
-  isSlave:function () {
-    return !this.get('type');
-  }.property('type'),
-  // checkedForHostFilter: true // this is for host page to set checkboxes checked
+
+  componentName: DS.attr('string'),
+
+  displayName: function () {
+    return App.format.role(this.get('componentName'));
+  }.property('componentName'),
+
+  service: DS.belongsTo('App.Service'),
+  //service_id: DS.attr('string'),
+
+  host: DS.belongsTo('App.Host'),
+  //host_id: DS.attr('string'),
+
+  workStatus: DS.attr('string'),
+
+  isMaster: function () {
+    switch (this.get('componentName')) {
+      case 'NAMENODE':
+      case 'SNAMENODE':
+      case 'JOBTRACKER':
+      case 'ZOOKEEPER_SERVER':
+      case 'HIVE_SERVER':
+      case 'HBASE_MASTER':
+      case 'NAGIOS_SERVER':
+      case 'GANGLIA_SERVER':
+      case 'OOZIE_SERVER':
+      case 'TEMPLETON_SERVER':
+        return true;
+      default:
+        return false;
+    }
+    return this.get('componentName');
+  }.property('componentName'),
+
   decommissioned: DS.attr('boolean')
 });
 
 App.Component.Status = {
-  started:"STARTED",
-  starting:"STARTING",
-  stopped:"STOPPED",
-  stopping:"STOPPING"
+  started: "STARTED",
+  starting: "STARTING",
+  stopped: "INSTALLED",
+  stopping: "STOPPING",
+
+  getKeyName:function(value){
+    switch(value){
+      case this.started:
+        return 'started';
+      case this.starting:
+        return 'starting';
+      case this.stopped:
+        return 'installed';
+      case this.stopping:
+        return 'stopping';
+    }
+    return 'none';
+  }
 }
 
-App.Component.FIXTURES = [];*/
+App.Component.FIXTURES = [];
+

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

@@ -59,11 +59,11 @@ App.Host = DS.Model.extend({
     var status;
 
     var masterComponents = components.filterProperty('isMaster', true);
-    if(components.everyProperty('workStatus', "STARTED")){
+    if(components.everyProperty('workStatus', App.Component.Status.started)){
       status = 'LIVE';
     } else if(false && this.get('isNotHeartBeating')){ //todo uncomment on real data
       status = 'DEAD-YELLOW';
-    } else if(masterComponents.length > 0 && !masterComponents.everyProperty('workStatus', "STARTED")){
+    } else if(masterComponents.length > 0 && !masterComponents.everyProperty('workStatus', App.Component.Status.started)){
       status = 'DEAD';
     } else{
       status = 'DEAD-ORANGE';

File diff suppressed because it is too large
+ 31 - 2
ambari-web/app/models/job.js


+ 3 - 47
ambari-web/app/models/rack.js

@@ -29,7 +29,8 @@ App.Rack = DS.Model.extend({
 });
 
 App.Rack.FIXTURES = [
-  {
+  //here example of data
+  /*{
     id: 1,
     name: 'Rack-0',
     hosts: ['host01', 'host06', 'host05'],
@@ -37,50 +38,5 @@ App.Rack.FIXTURES = [
     live_hosts_count: 5,
     critical_hosts_count: 0,
     dead_hosts_count: 2
-  },
-  {
-    id: 2,
-    name: 'Rack-1',
-    hosts: ['host04', 'host02', 'host03'],
-    status: 'LIVE',
-    live_hosts_count: 2,
-    critical_hosts_count: 0,
-    dead_hosts_count: 1
-  },
-  {
-    id: 3,
-    name: 'Rack-2',
-    hosts: [1, 2, 3, 4, 8, 9, 10],
-    status: 'LIVE',
-    live_hosts_count: 5,
-    critical_hosts_count: 0,
-    dead_hosts_count: 2
-  },
-  {
-    id: 4,
-    name: 'Rack-3',
-    hosts: [5, 6, 7],
-    status: 'LIVE',
-    live_hosts_count: 2,
-    critical_hosts_count: 0,
-    dead_hosts_count: 1
-  },
-  {
-    id: 5,
-    name: 'Rack-4',
-    hosts: [1, 2, 3, 4, 8, 9, 10],
-    status: 'LIVE',
-    live_hosts_count: 5,
-    critical_hosts_count: 0,
-    dead_hosts_count: 2
-  },
-  {
-    id: 6,
-    name: 'Rack-5',
-    hosts: [5, 6, 7],
-    status: 'LIVE',
-    live_hosts_count: 2,
-    critical_hosts_count: 0,
-    dead_hosts_count: 1
-  }
+  }*/
 ];

+ 52 - 6
ambari-web/app/models/run.js

@@ -24,12 +24,42 @@ var misc = require('utils/misc');
 App.Run = DS.Model.extend({
   runId:DS.attr('string'),
   parentRunId:DS.attr('string'),
-  workflowContext:DS.attr('string'),
+  workflowId:DS.attr('string'),
   userName:DS.attr('string'),
   startTime:DS.attr('string'),
-  lastUpdateTime:DS.attr('string'),
-  appId:DS.attr('number'),
-  jobs:DS.hasMany('App.Job'),
+  elapsedTime:DS.attr('string'),
+  appId:DS.attr('string'),
+  /**
+   *
+   */
+  /*workflowContext:function() {
+    var r = '{dag: {';
+    console.log('entries', this.get('entries'));
+    this.get('entries').forEach(function(item) {
+      r += '"' + item.source + '": [';
+      item.targets.forEach(function(target) {
+        r += '"' + target + '",';
+      });
+      r += '],';
+    });
+    r += '}}';
+    console.log('dag', r);
+    return r;
+  }.property('entries'),*/
+  workflowContext:DS.attr('string'),
+  /**
+   * Jobs in the current run
+   */
+  jobs: function() {
+    var self = this;
+    var r = Array();
+    App.Job.find().forEach(function(job) {
+      if (job.get('workflowId') == self.get('workflowId')) {
+        r.push(job);
+      }
+    });
+    return r;
+  }.property('workflowId'),
   /**
    * Number of comleted jobs.
    * Field calculates dynamically using <code>jobs</code> property
@@ -37,8 +67,15 @@ App.Run = DS.Model.extend({
   numJobsCompleted: function() {
     return this.get('jobs').filterProperty('status', 'RUNNING').length;
   }.property('jobs.@each.status'),
+  /**
+   * Sum of the child jobs duration
+   */
   duration: function() {
-    return date.dateFormatInterval(parseInt((parseInt(this.get('lastUpdateTime')) - parseInt(this.get('startTime')))/1000));
+    var d = 0;
+    this.get('jobs').forEach(function(job) {
+      d += job.get('elapsedTime') / 1000 || 0;
+    });
+    return date.dateFormatInterval(parseInt(d));
   }.property('lastUpdateTime', 'startTime'),
   /**
    * Status of running jobs
@@ -97,8 +134,17 @@ App.Run = DS.Model.extend({
    * Field calculates dynamically using <code>jobs</code> property
    */
   numJobsTotal: function() {
-    return this.get('jobs.content').length;
+    return this.get('jobs').length;
   }.property('jobs'),
+  /**
+   *
+   */
+  lastUpdateTime: function() {
+    return parseInt(this.get('startTime')) + parseInt(this.get('elapsedTime'));
+  }.property('elapsedTime', 'startTime'),
+  /**
+   *
+   */
   lastUpdateTimeFormatted: function() {
     return date.dateFormat(this.get('lastUpdateTime'));
   }.property('lastUpdateTime')

+ 53 - 114
ambari-web/app/models/service.js

@@ -19,125 +19,64 @@
 
 var App = require('app');
 
+App.Service = DS.Model.extend({
 
+  serviceName: DS.attr('string'),
+  serviceAudit: DS.hasMany('App.ServiceAudit'),
 
+  workStatus: DS.attr('string'),
+  alerts: DS.hasMany('App.Alert'),
+  quickLinks: DS.hasMany('App.QuickLinks'),
+  components: DS.hasMany('App.Component'),
 
-App.Component = DS.Model.extend({
-  componentName:DS.attr('string'),
-  label:DS.attr('string'),
-  type:DS.attr('boolean'),
-  service:DS.belongsTo('App.Service'),
-  host:DS.belongsTo('App.Host'),
-  workStatus:DS.attr('string'),
-  isMaster:function () {
-    return this.get('type');
-  }.property('type'),
-  isSlave:function () {
-    return !this.get('type');
-  }.property('type'),
-  // checkedForHostFilter: true // this is for host page to set checkboxes checked
-  decommissioned: DS.attr('boolean')
+  displayName: function () {
+    switch (this.get('serviceName')) {
+      case 'hdfs':
+        return 'HDFS';
+      case 'mapreduce':
+        return 'MapReduce';
+      case 'hbase':
+        return 'HBase';
+      case 'oozie':
+        return 'Oozie';
+      case 'hive':
+        return 'Hive/HCatalog';
+      case 'zookeeper':
+        return 'ZooKeeper';
+      case 'pig':
+        return 'Pig';
+      case 'sqoop':
+        return 'Sqoop';
+      case 'templeton':
+        return 'Templeton';
+      case 'ganglia':
+        return 'Ganglia';
+      case 'nagios':
+        return 'Nagios';
+    }
+    return this.get('serviceName');
+  }.property('serviceName')
 });
 
-App.Component.Status = {
-  started:"STARTED",
-  starting:"STARTING",
-  stopped:"STOPPED",
-  stopping:"STOPPING"
-}
+App.Service.Health = {
+  live: "LIVE",
+  dead: "DEAD",
+  starting: "STARTING",
+  stopping: "STOPPING",
 
-App.Component.FIXTURES = [
-  {
-    id:1,
-    component_name:'NameNode',
-    label:'NN',
-    type:true,
-    service_id:1,
-    host_id:1,
-    work_status:App.Component.Status.stopped
-  },
-  {
-    id:2,
-    component_name:'SNameNode',
-    label:'SNN',
-    type:true,
-    service_id:1,
-    host_id:2,
-    work_status:App.Component.Status.started
-  },
-  {
-    id:3,
-    component_name:'DataNode',
-    label:'DN',
-    service_id:1,
-    type:false,
-    host_id:2,
-    work_status:App.Component.Status.started,
-    decommissioned: true
-  },
-  {
-    id:4,
-    component_name:'JobTracker',
-    label:'JT',
-    type:true,
-    service_id:2,
-    host_id:4,
-    work_status:App.Component.Status.started
-  },
-  {
-    id:5,
-    component_name:'TaskTracker',
-    label:'TT',
-    type:false,
-    service_id:2,
-    host_id:4,
-    work_status:App.Component.Status.started
-  },
-  {
-    id:6,
-    component_name:'HBase Master',
-    label:'HBM',
-    type:true,
-    service_id:3,
-    host_id:4,
-    work_status:App.Component.Status.started
-  },
-  {
-    id:7,
-    component_name:'Region Server',
-    label:'RS',
-    type:false,
-    service_id:3,
-    host_id:2,
-    work_status:App.Component.Status.started
-  },
-  {
-    id:8,
-    component_name:'Oozie',
-    label:'Oz',
-    type:false,
-    service_id:5,
-    host_id:2,
-    work_status:App.Component.Status.started
+  getKeyName:function(value){
+    switch(value){
+      case this.live:
+        return 'live';
+      case this.dead:
+        return 'dead';
+      case this.starting:
+        return 'starting';
+      case this.stopping:
+        return 'stopping';
+    }
+    return 'none';
   }
-];
-/*
-App.Service = DS.Model.extend({
-  serviceName:DS.attr('string'),
-  label:DS.attr('string'),
-  components:DS.hasMany('App.Component'),
-  serviceAudit:DS.hasMany('App.ServiceAudit'),
-  healthStatus:DS.attr('string'),
-  workStatus:DS.attr('boolean'),
-  alerts:DS.hasMany('App.Alert'),
-  quickLinks:DS.hasMany('App.QuickLinks')
-});
-
-App.Service.Health = {
-  live:"LIVE",
-  dead:"DEAD",
-  start:"STARTING",
-  stop:"STOPPING"
-}
+};
 
-*/
+App.Service.FIXTURES = [];

+ 1 - 1
ambari-web/app/routes/main.js

@@ -313,7 +313,7 @@ module.exports = Em.Route.extend({
       Ember.run.next(function () {
         var service = router.get('mainServiceItemController.content');
         if (!service) {
-          service = App.Service.find(1); // getting the first service to display
+          service = App.Service.find().objectAt(0); // getting the first service to display
         }
         router.transitionTo('service.summary', service);
       });

+ 6 - 6
ambari-web/app/styles/application.less

@@ -453,11 +453,11 @@ a:focus {
     min-width: 20px;
     margin-left: 0;
   }
-  .health-status-LIVE {
+  .health-status-LIVE, .health-status-STARTING {
     .tab-marker-position;
     background-image: @status-live-marker;
   }
-  .health-status-DEAD {
+  .health-status-DEAD, .health-status-STOPPING {
     .tab-marker-position;
     background-image: @status-dead-marker;
   }
@@ -679,11 +679,11 @@ a:focus {
       // background-position: 12px 9px;
       // background-repeat: no-repeat;
     }
-    .health-status-LIVE {
+    .health-status-LIVE , .health-status-STARTING {
       .tab-marker-position;
       background-image: @status-live-marker;
     }
-    .health-status-DEAD {
+    .health-status-DEAD, .health-status-STOPPING {
       .tab-marker-position;
       background-image: @status-dead-marker;
     }
@@ -925,12 +925,12 @@ a:focus {
     border-top-color: #000000;
     border-bottom-color: #000000;
   }
-  .health-status-STARTED, .health-status-STARTING {
+  .health-status-started, .health-status-starting {
     background-image: @status-live-marker;
     background-repeat: no-repeat;
     background-position: 0px 4px;
   }
-  .health-status-STOPPED, .health-status-STOPPING {
+  .health-status-installed, .health-status-stopping {
     background-image: @status-dead-marker;
     background-repeat: no-repeat;
     background-position: 0px 4px;

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div id="main">
   <div id="top-nav">

+ 3 - 2
ambari-web/app/templates/common/form.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 {{#each field in view.fields}}
   {{view App.FormFieldTemplate fieldBinding="field"}}
 {{/each}}

+ 2 - 2
ambari-web/app/templates/common/form/checkbox.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="controls">
   <label class="checkbox" for="input{{unbound view.field.name}}">

+ 2 - 2
ambari-web/app/templates/common/form/field.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <label class="control-label"
        for="input{{unbound view.field.name}}">{{unbound view.field.displayName}}</label>

+ 3 - 2
ambari-web/app/templates/common/grid/filter.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 {{#each filter in view.filters}}
 <li>
   <label class="checkbox">

+ 3 - 2
ambari-web/app/templates/common/grid/header.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 {{view.label}}<i {{action toggleFilter target="view"}} class="icon-filter"></i>
 {{#if view.showFilter}}
 {{view view.filter}}

+ 3 - 2
ambari-web/app/templates/common/grid/pager.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <ul>
     <li {{bindAttr class="view.prevPageDisabled"}}><a {{action activatePrevPage target="view"}} href="#">Prev</a></li>
   {{#each page in view.pages}}

+ 3 - 2
ambari-web/app/templates/common/metric.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div class="span title">
   Metrics <i class="icon-question-sign"></i>
 </div>

+ 3 - 2
ambari-web/app/templates/common/time_range.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div class="span title">
   Time Range <i class="icon-question-sign"></i>
 </div>

+ 2 - 2
ambari-web/app/templates/installer.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div id="installer">
   <div class="container">

+ 2 - 2
ambari-web/app/templates/login.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="well login span4">
     <h2>{{t login.header}}</h2>

+ 3 - 2
ambari-web/app/templates/main.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 {{#if isClusterDataLoaded}}
 <div id="main-nav">
   <div class="navbar">

+ 2 - 2
ambari-web/app/templates/main/admin.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="row-fluid">
   <div id="main-admin-menu" class="well span2">

+ 2 - 2
ambari-web/app/templates/main/admin/advanced.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <h5>{{t admin.advanced.title}}<i class="icon-question-sign"></i></h5>
 <div class="row">

+ 2 - 2
ambari-web/app/templates/main/admin/advanced/uninstall.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,6 +14,6 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 Confirm Uninstall

+ 2 - 2
ambari-web/app/templates/main/admin/audit.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <table class="table table-striped">
   <thead>

+ 2 - 2
ambari-web/app/templates/main/admin/authentication.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 {{view App.FormFieldTemplate fieldBinding="view.form.field.method" id="user-auth-method"}}
 

+ 2 - 2
ambari-web/app/templates/main/admin/security.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <h5>{{t admin.security.title}}<i class="icon-question-sign"></i></h5>
 <div>

+ 2 - 2
ambari-web/app/templates/main/admin/user.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 {{#if view.ldapUser}}
   <p class="text-info">{{t admin.users.ldapAuthentionUsed}}.</p>

+ 2 - 2
ambari-web/app/templates/main/admin/user/edit.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <form class="form-horizontal">
   {{#each field in view.userForm.fields}}

+ 2 - 2
ambari-web/app/templates/main/admin/user/row.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <tr>
   <td>{{user.id}}</td>

+ 3 - 2
ambari-web/app/templates/main/apps.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div id="apps">
   <!--<div class="breadcrumb">
     <li><a href='#' {{action "routeHome" target="controller"}}><i class="icon-home"></i></a><span class="divider">/</span></li>

+ 3 - 2
ambari-web/app/templates/main/apps/item.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <td colspan="10">
   <ul class="nav nav-tabs">
     {{#each tab in view.menuTabs}}

+ 2 - 2
ambari-web/app/templates/main/apps/item/bar.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="btn-group">
   <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">

+ 3 - 3
ambari-web/app/templates/main/apps/item/dag.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
     <div id="dag_viewer"></div>
 
     <table class="table table-bordered table-striped" id="innerTable">
@@ -33,7 +33,7 @@
       <tbody>
       {{#each job in view.content}}
       <tr>
-        <td>{{job.id}}</td>
+        <td>{{job.workflowEntityName}}</td>
         <td>{{job.jobId}}</td>
         <td>{{job.status}}</td>
         <td>{{job.maps}}&nbsp;({{job.mapsProgress}}%)</td>

+ 3 - 3
ambari-web/app/templates/main/apps/list_row.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,9 +14,9 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
-<td><a href="#" {{action "starClick" target="controller"}}"><span class="icon-star"></span><span class="hidden">{{run.id}}</span></a></td>
+<td><a href="#" {{action "starClick" target="controller"}}"><span class="icon-star"></span><span class="hidden">{{run.workflowId}}</span></a></td>
 <td><a href="javascript:void(0)">ID&nbsp;{{run.appId}}</a></td>
 <td>{{run.appName}}</td>
 <td>{{run.type}}</td>

+ 17 - 0
ambari-web/app/templates/main/apps/runs.hbs

@@ -0,0 +1,17 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}

+ 3 - 2
ambari-web/app/templates/main/background_operations_popup.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 {{#each operation in allOperations}}
   {{#view App.MainBackgroundOperation contentBinding="operation"}}
     <a class="open-details" {{action openDetails target="view"}} href="#">

+ 2 - 2
ambari-web/app/templates/main/charts.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 {{view App.MetricFilteringWidget controllerBinding="App.router.mainChartsController"}}
 {{view App.TimeRangeWidget controllerBinding="App.router.mainChartsController"}}

+ 3 - 2
ambari-web/app/templates/main/charts/heatmap.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div class="heatmap">
   {{#each rack in controller.cluster.racks}}
     {{view App.MainChartsHeatmapRackView rackBinding="rack" visualSchemaBinding="controller.visualSchema"}}

+ 2 - 2
ambari-web/app/templates/main/charts/heatmap/heatmap_host.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,6 +14,6 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div {{bindAttr class="view.content.healthStatus view.hostClass"}}></div>

+ 2 - 2
ambari-web/app/templates/main/charts/heatmap/heatmap_host_detail.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <h6>{{view.details.name}}</h6>
 CPU: {{view.details.cpuUsage}}%<br/>

+ 2 - 2
ambari-web/app/templates/main/charts/heatmap/heatmap_rack.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="rackHeader">
   <div class="statusName clearfix">

+ 2 - 2
ambari-web/app/templates/main/charts/horizon.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 {{#each node in view.hosts}}
   {{view App.MainChartsHorizonChartView hostBinding="node"}}

+ 2 - 2
ambari-web/app/templates/main/charts/horizon/chart.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="row">
   <div {{bindAttr class="view.healthStatusClass"}}></div>

+ 2 - 2
ambari-web/app/templates/main/charts/linear_time.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 <div id="{{unbound view.id}}-container" class="chart-container">
   <div id="{{unbound view.id}}-yaxis" class="chart-y-axis"></div>
   <div id="{{unbound view.id}}-xaxis" class="chart-x-axis"></div>

+ 4 - 4
ambari-web/app/templates/main/dashboard.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="row">
   <div class="span6">
@@ -92,8 +92,8 @@
               <div class="span11">
                 <div class="row-fluid">
                   <div class="span8 title">{{title}}
-                    {{#if service.serviceName}}
-                      <a class="serviceLink" href="{{unbound serviceLink}}">{{service.serviceName}}</a>
+                    {{#if serviceName}}
+                      <a class="serviceLink" href="{{unbound serviceLink}}">{{serviceName}}</a>
                     {{/if}}
                   </div>
                   <div class="span4 date-time">{{dateDisplay}}</div>

+ 2 - 2
ambari-web/app/templates/main/dashboard/service/hbase.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="clearfix">
   <div class="name span2">

+ 2 - 2
ambari-web/app/templates/main/dashboard/service/hdfs.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="clearfix">
   <div class="name span2">

+ 2 - 2
ambari-web/app/templates/main/dashboard/service/hive.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="clearfix">
   <div class="name span2">

+ 3 - 2
ambari-web/app/templates/main/dashboard/service/mapreduce.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div class="clearfix">
   <div class="name span2">
     {{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}

+ 2 - 2
ambari-web/app/templates/main/dashboard/service/oozie.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="clearfix">
   <div class="name span2">

+ 2 - 2
ambari-web/app/templates/main/dashboard/service/zookeeper.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="clearfix">
   <div class="name span2">

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div id="hosts" class="box">
   <div class="box-header">
     <div class="button-section">

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div id="add-host">
   <div class="container">

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,6 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <h5>Audit</h5>
 

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <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> /

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="host-metrics">
 	<div class="span4">

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div class="row">
   <div class="span5 host-configuration">
     <div class="box">

+ 3 - 2
ambari-web/app/templates/main/menu.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <ul class="nav nav-tabs">
     {{#each view.items}}
     <li {{bindAttr class="active"}} ><a {{action navigate routing }} href="#">{{unbound label}}</a></li>

+ 3 - 2
ambari-web/app/templates/main/menu_item.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <a href="#/main/{{unbound view.content.routing}}">
   {{unbound view.content.label}}
   {{#if view.alertsCount}}

+ 2 - 2
ambari-web/app/templates/main/service.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div class="row-fluid">
   <div id="services-menu" class="well span2" style="padding: 8px 0">

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <div id="add-service">
   <div class="container">

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

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <!--<div>-->
     <!--<fieldset class="fieldset">-->

+ 2 - 2
ambari-web/app/templates/main/service/info/metrics.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <h5>Metrics</h5>
 {{outlet}}

+ 4 - 3
ambari-web/app/templates/main/service/info/summary.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div class="row-fluid service-block">
 <div class="span6">
 {{#if view.service.quickLinks.length}}
@@ -46,7 +47,7 @@
       <tr>
         {{#if component.isMaster}}
         <td class="summary-label">{{component.displayName}}</td>
-        <td><a {{action selectHost component.host}} href="javascript:void(null)">{{component.hostComponents}}</a></td>
+        <td><a {{action selectHost component.host}} href="javascript:void(null)">{{component.host.hostName}}</a></td>
         {{else}}
         <td class="summary-label">{{component.displayName}}s</td>
         <td><a {{action filterHosts component}} href="javascript:void(null)">{{component.displayName}}s</a></td>

+ 2 - 2
ambari-web/app/templates/main/service/item.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 {{view App.MainServiceInfoMenuView}}
 <div class="service-button">

+ 3 - 3
ambari-web/app/templates/main/service/menu_item.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,10 +14,10 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <a href="#/main/services/{{unbound view.content.id}}/summary">
-  {{view App.MainDashboardServiceHealthView serviceBinding="view.content"}}&nbsp;<span>{{unbound view.content.label}}</span>
+  {{view App.MainDashboardServiceHealthView class="service-health" serviceBinding="view.content"}}&nbsp;<span>{{unbound view.content.displayName}}</span>
   {{#if view.serviceOperationsCount}}
     <span class="label operations-count" {{action "showPopup" target="App.router.backgroundOperationsController"}}>
       {{view.serviceOperationsCount}}

+ 2 - 2
ambari-web/app/templates/main/test.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 SERVICES
 

+ 18 - 0
ambari-web/app/templates/wizard/master_hosts.hbs

@@ -1,3 +1,21 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
 {{#if view.hasNoHosts}}
   No host assigned
 {{/if}}

+ 18 - 0
ambari-web/app/templates/wizard/master_hosts_popup.hbs

@@ -1,3 +1,21 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
 <ul>
   {{#each host in view.serviceConfig.value}}
     <li>{{host}}</li>

+ 18 - 0
ambari-web/app/templates/wizard/slave_component_hosts.hbs

@@ -1,3 +1,21 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
 {{#if view.hasNoHosts}}
   none -
   <a href="#" {{action showEditSlaveComponentGroups view.serviceConfig.category target="controller"}}>

+ 18 - 0
ambari-web/app/templates/wizard/slave_component_hosts_popup.hbs

@@ -1,3 +1,21 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
 <div id="slave-hosts-popup" class="alert alert-info">Select which hosts should belong to which {{selectedComponentName}} group.</div>
 <table class="table table-striped">
   <thead>

+ 18 - 0
ambari-web/app/templates/wizard/slave_hosts.hbs

@@ -1,3 +1,21 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
 {{#if view.hasNoHosts}}
   No host assigned
 {{else}}

+ 2 - 2
ambari-web/app/templates/wizard/step1.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <h2>{{t installer.step1.body.header}}</h2>
 <p class="alert alert-info">

+ 4 - 8
ambari-web/app/templates/wizard/step10.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,7 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
 
 <h2>{{t installer.step10.header}}</h2>
 <div class="alert alert-info">
@@ -37,11 +37,7 @@
   </ul>
   {{/each}}
 </div>
-
 <div class="btn-area">
-  <a
-          class="btn pull-left" {{bindAttr disabled="isSubmitDisabled"}} {{action back}}>&larr;
-    Back</a>
-  <a
-          class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action complete}}>Complete &rarr;</a>
+  <a class="btn pull-left" {{bindAttr disabled="isSubmitDisabled"}} {{action back}}>&larr; Back</a>
+  <a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}} {{action complete}}>Complete &rarr;</a>
 </div>

+ 10 - 5
ambari-web/app/templates/wizard/step2.hbs

@@ -1,4 +1,4 @@
-<!--
+{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
@@ -14,7 +14,8 @@
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
--->
+}}
+
 <div id="installOptions">
   <h2>{{t installer.step2.header}}</h2>
 
@@ -33,9 +34,13 @@
       </p>
 
       {{#if view.parentView.controller.hideBackButton}}
-      {{#if content.hostNames }}
-      <p class="alert alert-info">{{t hosts.add.step2.warning}}</p>
-      {{/if}}
+        {{#if content.oldHostNames }}
+          <p class="alert alert-info">
+            {{t hosts.add.step2.warning}}
+            <br/>
+            {{content.oldHostNames}}
+          </p>
+        {{/if}}
       {{/if}}
 
       <div class="controls">

Some files were not shown because too many files changed in this diff