Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

AMBARI-1059. Refactor cluster management. (yusaku)

  • Loading branch information...
commit c357ac4960385fd55240887a6b9b8c0f76d35672 1 parent 5ed4c1c
Yusaku Sako authored
Showing with 583 additions and 568 deletions.
  1. +1 −0  ambari-web/app/controllers.js
  2. +11 −7 ambari-web/app/controllers/global/cluster_controller.js
  3. +1 −1  ambari-web/app/controllers/global/update_controller.js
  4. +41 −202 ambari-web/app/controllers/installer.js
  5. +1 −1  ambari-web/app/controllers/main/charts/heatmap.js
  6. +3 −111 ambari-web/app/controllers/main/host/add_controller.js
  7. +3 −112 ambari-web/app/controllers/main/service/add_controller.js
  8. +199 −0 ambari-web/app/controllers/wizard.js
  9. +41 −32 ambari-web/app/controllers/wizard/step3_controller.js
  10. +1 −1  ambari-web/app/controllers/wizard/step5_controller.js
  11. +2 −1  ambari-web/app/controllers/wizard/step6_controller.js
  12. +8 −0 ambari-web/app/controllers/wizard/step8_controller.js
  13. +1 −1  ambari-web/app/controllers/wizard/step9_controller.js
  14. 0  ambari-web/app/data/{mock → }/services.js
  15. +1 −0  ambari-web/app/initialize.js
  16. +20 −5 ambari-web/app/mappers/alerts_mapper.js
  17. +1 −2  ambari-web/app/messages.js
  18. +26 −4 ambari-web/app/models/hosts.js
  19. +2 −1  ambari-web/app/router.js
  20. +6 −0 ambari-web/app/routes/add_host_routes.js
  21. +6 −0 ambari-web/app/routes/add_service_routes.js
  22. +9 −1 ambari-web/app/routes/installer.js
  23. +4 −4 ambari-web/app/routes/main.js
  24. +22 −0 ambari-web/app/styles/application.less
  25. +18 −0 ambari-web/app/styles/apps.less
  26. +1 −1  ambari-web/app/templates/main/charts/heatmap.hbs
  27. +3 −1 ambari-web/app/templates/main/charts/heatmap/heatmap_host.hbs
  28. +0 −3  ambari-web/app/templates/main/charts/heatmap/heatmap_rack.hbs
  29. +1 −1  ambari-web/app/templates/main/charts/linear_time.hbs
  30. +1 −1  ambari-web/app/templates/main/dashboard.hbs
  31. +5 −0 ambari-web/app/templates/main/dashboard/service/hbase.hbs
  32. +5 −0 ambari-web/app/templates/main/dashboard/service/hdfs.hbs
  33. +5 −0 ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
  34. +3 −3 ambari-web/app/templates/main/host.hbs
  35. +0 −49 ambari-web/app/templates/main/service/info/client_summary.hbs
  36. +15 −9 ambari-web/app/templates/main/service/info/summary.hbs
  37. +1 −1  ambari-web/app/templates/wizard/step3.hbs
  38. +2 −0  ambari-web/app/templates/wizard/step4.hbs
  39. +1 −1  ambari-web/app/templates/wizard/step8.hbs
  40. +10 −1 ambari-web/app/utils/graph.js
  41. +26 −3 ambari-web/app/views/common/chart/linear_time.js
  42. +1 −0  ambari-web/app/views/main/admin/user/create.js
  43. +1 −1  ambari-web/app/views/main/dashboard.js
  44. +2 −2 ambari-web/app/views/main/dashboard/service.js
  45. +3 −0  ambari-web/app/views/main/dashboard/service/hbase.js
  46. +3 −0  ambari-web/app/views/main/dashboard/service/hdfs.js
  47. +3 −0  ambari-web/app/views/main/dashboard/service/mapreduce.js
  48. +10 −1 ambari-web/app/views/main/service/info/summary.js
  49. +1 −1  ambari-web/app/views/main/service/menu.js
  50. +6 −1 ambari-web/app/views/wizard/step1_view.js
  51. +1 −1  ambari-web/app/views/wizard/step3_view.js
  52. +43 −1 ambari-web/app/views/wizard/step8_view.js
  53. +2 −0  ambari-web/vendor/scripts/spin.min.js
View
1  ambari-web/app/controllers.js
@@ -21,6 +21,7 @@
require('controllers/application');
require('controllers/login_controller');
+require('controllers/wizard');
require('controllers/installer');
require('controllers/global/background_operations_controller');
require('controllers/main');
View
18 ambari-web/app/controllers/global/cluster_controller.js
@@ -141,7 +141,7 @@ App.ClusterController = Em.Controller.extend({
}
return null;
}
- }.property('App.router.updateController.isUpdated', 'dataLoadList.hosts'),
+ }.property('App.router.updateController.isUpdated'),
isNagiosInstalled:function () {
if (App.testMode) {
@@ -157,7 +157,8 @@ App.ClusterController = Em.Controller.extend({
* Sorted list of alerts.
* Changes whenever alerts are loaded.
*/
- alerts:function () {
+ alerts:[],
+ updateAlerts: function(){
var alerts = App.Alert.find();
var alertsArray = alerts.toArray();
var sortedArray = alertsArray.sort(function (left, right) {
@@ -171,9 +172,8 @@ App.ClusterController = Em.Controller.extend({
}
return statusDiff;
});
- return sortedArray;
- }.property('dataLoadList.alerts'),
-
+ this.set('alerts', sortedArray);
+ },
loadRuns:function () {
if (this.get('postLoadList.runs')) {
return;
@@ -197,6 +197,9 @@ App.ClusterController = Em.Controller.extend({
* property, which will trigger the alerts property.
*/
loadAlerts:function () {
+ if(App.router.get('updateController.isUpdated')){
+ return;
+ }
var nagiosUrl = this.get('nagiosUrl');
if (nagiosUrl) {
var lastSlash = nagiosUrl.lastIndexOf('/');
@@ -209,10 +212,11 @@ App.ClusterController = Em.Controller.extend({
jsonp:"jsonp",
context:this,
complete:function (jqXHR, textStatus) {
- this.updateLoadStatus('alerts')
+ this.updateLoadStatus('alerts');
+ this.updateAlerts();
},
error: function(jqXHR, testStatus, error) {
- this.showMessage(Em.I18n.t('nagios.alerts.unavailable'));
+ // this.showMessage(Em.I18n.t('nagios.alerts.unavailable'));
console.log('Nagios $.ajax() response:', error);
}
};
View
2  ambari-web/app/controllers/global/update_controller.js
@@ -89,7 +89,7 @@ App.UpdateController = Em.Controller.extend({
updateServiceMetric:function(callback){
var self = this;
self.set('isUpdated', false);
- var servicesUrl = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=*,components/host_components/*');
+ var servicesUrl = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=*,components/host_components/*,components/ServiceComponentInfo');
var callback = callback || function(jqXHR, textStatus){
self.set('isUpdated', true);
};
View
243 ambari-web/app/controllers/installer.js
@@ -19,205 +19,12 @@
var App = require('app');
-App.InstallerController = Em.Controller.extend({
+App.InstallerController = App.WizardController.extend({
name: 'installerController',
- isStepDisabled: [],
-
totalSteps: 10,
- init: function () {
- this.clusters = App.Cluster.find();
- this.isStepDisabled.pushObject(Ember.Object.create({
- step: 1,
- value: false
- }));
- for (var i = 2; i <= this.totalSteps; i++) {
- this.isStepDisabled.pushObject(Ember.Object.create({
- step: i,
- value: true
- }));
- }
- // window.onbeforeunload = function () {
- // return "You have not saved your document yet. If you continue, your work will not be saved."
- //}
- },
-
- setStepsEnable: function () {
- for (var i = 2; i <= this.totalSteps; i++) {
- var step = this.get('isStepDisabled').findProperty('step', i);
- if (i <= this.get('currentStep')) {
- step.set('value', false);
- } else {
- step.set('value', true);
- }
- }
- }.observes('currentStep'),
-
- setLowerStepsDisable: function (stepNo) {
- for (var i = 1; i < stepNo; i++) {
- var step = this.get('isStepDisabled').findProperty('step', i);
- step.set('value', true);
- }
- },
-
- prevInstallStatus: function () {
- console.log('Inside the prevInstallStep function: The name is ' + App.router.get('loginController.loginName'));
- var result = App.db.isCompleted()
- if (result == '1') {
- return true;
- }
- }.property('App.router.loginController.loginName'),
-
- /**
- * Set current step to new value.
- * Method moved from App.router.setInstallerCurrentStep
- * @param currentStep
- * @param completed
- */
- currentStep: function () {
- return App.get('router').getWizardCurrentStep('installer');
- }.property(),
-
- /**
- * Set current step to new value.
- * Method moved from App.router.setInstallerCurrentStep
- * @param currentStep
- * @param completed
- */
- setCurrentStep: function (currentStep, completed) {
- App.db.setWizardCurrentStep('installer', currentStep, completed);
- this.set('currentStep', currentStep);
- },
-
- clusters: null,
-
- isStep1: function () {
- return this.get('currentStep') == 1;
- }.property('currentStep'),
-
- isStep2: function () {
- return this.get('currentStep') == 2;
- }.property('currentStep'),
-
- isStep3: function () {
- return this.get('currentStep') == 3;
- }.property('currentStep'),
-
- isStep4: function () {
- return this.get('currentStep') == 4;
- }.property('currentStep'),
-
- isStep5: function () {
- return this.get('currentStep') == 5;
- }.property('currentStep'),
-
- isStep6: function () {
- return this.get('currentStep') == 6;
- }.property('currentStep'),
-
- isStep7: function () {
- return this.get('currentStep') == 7;
- }.property('currentStep'),
-
- isStep8: function () {
- return this.get('currentStep') == 8;
- }.property('currentStep'),
-
- isStep9: function () {
- return this.get('currentStep') == 9;
- }.property('currentStep'),
-
- isStep10: function () {
- return this.get('currentStep') == 10;
- }.property('currentStep'),
-
- gotoStep1: function () {
- if (this.get('isStepDisabled').findProperty('step', 1).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep1');
- }
-
- },
-
- gotoStep2: function () {
- if (this.get('isStepDisabled').findProperty('step', 2).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep2');
- }
-
- },
-
- gotoStep3: function () {
- if (this.get('isStepDisabled').findProperty('step', 3).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep3');
- }
-
- },
-
- gotoStep4: function () {
-
- if (this.get('isStepDisabled').findProperty('step', 4).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep4');
- }
- },
-
- gotoStep5: function () {
- if (this.get('isStepDisabled').findProperty('step', 5).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep5');
- }
- },
-
- gotoStep6: function () {
- if (this.get('isStepDisabled').findProperty('step', 6).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep6');
- }
-
- },
-
- gotoStep7: function () {
- if (this.get('isStepDisabled').findProperty('step', 7).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep7');
- }
- },
-
- gotoStep8: function () {
- if (this.get('isStepDisabled').findProperty('step', 8).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep8');
- }
- },
-
- gotoStep9: function () {
- if (this.get('isStepDisabled').findProperty('step', 9).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep9');
- }
- },
-
- gotoStep10: function () {
- if (this.get('isStepDisabled').findProperty('step', 10).get('value') === true) {
- return;
- } else {
- App.router.send('gotoStep10');
- }
- },
-
content: Em.Object.create({
cluster: null,
hosts: null,
@@ -691,10 +498,11 @@ App.InstallerController = Em.Controller.extend({
* Generate serviceComponents as pr the stack definition and save it to localdata
* called form stepController step4WizardController
*/
- loadComponents: function (stepController) {
+ loadServiceComponents : function (stepController, displayOrderConfig, apiUrl) {
var self = this;
var method = 'GET';
- var url = (App.testMode) ? '/data/wizard/stack/hdp/version0.1.json' : App.apiPrefix + '/stacks/HDP/version/1.2.0'; // TODO: get this url from the stack selected by the user in Install Options page
+ var testUrl = '/data/wizard/stack/hdp/version/1.2.0.json';
+ var url = (App.testMode) ? testUrl : App.apiPrefix + apiUrl;
$.ajax({
type: method,
url: url,
@@ -703,14 +511,45 @@ App.InstallerController = Em.Controller.extend({
timeout: App.timeout,
success: function (data) {
var jsonData = jQuery.parseJSON(data);
- console.log("TRACE: STep5 -> In success function for the getServiceComponents call");
- console.log("TRACE: STep5 -> value of the url is: " + url);
- var serviceComponents = [];
- jsonData.services.forEach(function (_service) {
+ console.log("TRACE: getService ajax call -> In success function for the getServiceComponents call");
+ console.log("TRACE: jsonData.services : " + jsonData.services);
+
+ // Creating Model
+ var Service = Ember.Object.extend({
+ serviceName: null,
+ displayName: null,
+ isDisabled: true,
+ isSelected: true,
+ description:null,
+ version:null
+ });
+
+ var data = [];
+
+ // loop through all the service components
+ for (var i = 0 ; i < displayOrderConfig.length ; i++) {
+ var entry = jsonData.services.filterProperty("name",displayOrderConfig[i].serviceName)[0];
- }, this);
- stepController.set('components', jsonData.services);
+ // dont show the service whose isHidden is true
+ if ( displayOrderConfig[i].isHidden ) {
+ continue;
+ }
+
+ var myService = Service.create({
+ serviceName: entry.name,
+ displayName: displayOrderConfig[i].displayName,
+ isDisabled: i === 0 ,
+ isSelected: true,
+ description: entry.comment,
+ version: entry.version
+ });
+
+ data.push(myService);
+ }
+
+ stepController.set('serviceComponents', data);
console.log('TRACE: service components: ' + JSON.stringify(stepController.get('components')));
+
},
error: function (request, ajaxOptions, error) {
View
2  ambari-web/app/controllers/main/charts/heatmap.js
@@ -32,7 +32,7 @@ App.MainChartsHeatmapController = Em.Controller.extend({
* @param event
*/
routeHostDetail: function(event){
- App.router.transitionTo('main.hostDetails.summary', event.context)
+ App.router.transitionTo('main.hosts.hostDetails.summary', event.context)
},
showHeatMapMetric: function (event) {
var metricItem = event.context;
View
114 ambari-web/app/controllers/main/host/add_controller.js
@@ -19,7 +19,7 @@
var App = require('app');
-App.AddHostController = Em.Controller.extend({
+App.AddHostController = App.WizardController.extend({
name: 'addHostController',
@@ -52,115 +52,7 @@ App.AddHostController = Em.Controller.extend({
*/
hideBackButton: true,
- isStepDisabled: [],
-
- totalSteps: 9,
-
- init: function () {
- this.isStepDisabled.pushObject(Ember.Object.create({
- step: 1,
- value: false
- }));
- for (var i = 2; i <= this.totalSteps; i++) {
- this.isStepDisabled.pushObject(Ember.Object.create({
- step: i,
- value: true
- }));
- }
- },
-
- setStepsEnable: function () {
- for (var i = 2; i <= this.totalSteps; i++) {
- var step = this.get('isStepDisabled').findProperty('step', i);
- if (i <= this.get('currentStep')) {
- step.set('value', false);
- } else {
- step.set('value', true);
- }
- }
- }.observes('currentStep'),
-
- /**
- * Return current step of Add Host Wizard
- */
- currentStep: function () {
- return App.get('router').getWizardCurrentStep('addHost');
- }.property(),
-
- clusters: null,
-
- /**
- * Set current step to new value.
- * Method moved from App.router.setInstallerCurrentStep
- * @param currentStep
- * @param completed
- */
- setCurrentStep: function (currentStep, completed) {
- App.db.setWizardCurrentStep('addHost', currentStep, completed);
- this.set('currentStep', currentStep);
- },
-
- isStep1: function () {
- return this.get('currentStep') == 1;
- }.property('currentStep'),
-
- isStep2: function () {
- return this.get('currentStep') == 2;
- }.property('currentStep'),
-
- isStep3: function () {
- return this.get('currentStep') == 3;
- }.property('currentStep'),
-
- isStep4: function () {
- return this.get('currentStep') == 4;
- }.property('currentStep'),
-
- isStep5: function () {
- return this.get('currentStep') == 5;
- }.property('currentStep'),
-
- isStep6: function () {
- return this.get('currentStep') == 6;
- }.property('currentStep'),
-
- isStep7: function () {
- return this.get('currentStep') == 7;
- }.property('currentStep'),
-
- gotoStep: function (step) {
- if (this.get('isStepDisabled').findProperty('step', step).get('value') === false) {
- App.router.send('gotoStep' + step);
- }
- },
-
- gotoStep1: function () {
- this.gotoStep(1);
- },
-
- gotoStep2: function () {
- this.gotoStep(2);
- },
-
- gotoStep3: function () {
- this.gotoStep(3);
- },
-
- gotoStep4: function () {
- this.gotoStep(4);
- },
-
- gotoStep5: function () {
- this.gotoStep(5);
- },
-
- gotoStep6: function () {
- this.gotoStep(6);
- },
-
- gotoStep7: function () {
- this.gotoStep(7);
- },
+ totalSteps: 7,
/**
* Load clusterInfo(step1) to model
@@ -361,7 +253,7 @@ App.AddHostController = Em.Controller.extend({
loadServices: function () {
var servicesInfo = App.db.getService();
if(!servicesInfo || !servicesInfo.length){
- servicesInfo = require('data/mock/services').slice(0);
+ servicesInfo = require('data/services').slice(0);
servicesInfo.forEach(function (item) {
item.isSelected = App.Service.find().someProperty('id', item.serviceName)
item.isInstalled = item.isSelected;
View
115 ambari-web/app/controllers/main/service/add_controller.js
@@ -19,7 +19,7 @@
var App = require('app');
-App.AddServiceController = Em.Controller.extend({
+App.AddServiceController = App.WizardController.extend({
name: 'addServiceController',
@@ -52,116 +52,7 @@ App.AddServiceController = Em.Controller.extend({
*/
hideBackButton: true,
- isStepDisabled: [],
-
- totalSteps: 9,
-
- init: function () {
- this.isStepDisabled.pushObject(Ember.Object.create({
- step: 1,
- value: false
- }));
- for (var i = 2; i <= this.totalSteps; i++) {
- this.isStepDisabled.pushObject(Ember.Object.create({
- step: i,
- value: true
- }));
- }
- },
-
- setStepsEnable: function () {
- for (var i = 2; i <= this.totalSteps; i++) {
- var step = this.get('isStepDisabled').findProperty('step', i);
- if (i <= this.get('currentStep')) {
- step.set('value', false);
- } else {
- step.set('value', true);
- }
- }
- }.observes('currentStep'),
-
- /**
- * Return current step of Add Host Wizard
- */
- currentStep: function () {
- return App.get('router').getWizardCurrentStep('addService');
- }.property(),
-
- clusters: null,
-
- /**
- * Set current step to new value.
- * Method moved from App.router.setInstallerCurrentStep
- * @param currentStep
- * @param completed
- */
- setCurrentStep: function (currentStep, completed) {
- App.db.setWizardCurrentStep('addService', currentStep, completed);
- this.set('currentStep', currentStep);
- },
-
- isStep1: function () {
- return this.get('currentStep') == 1;
- }.property('currentStep'),
-
- isStep2: function () {
- return this.get('currentStep') == 2;
- }.property('currentStep'),
-
- isStep3: function () {
- return this.get('currentStep') == 3;
- }.property('currentStep'),
-
- isStep4: function () {
- return this.get('currentStep') == 4;
- }.property('currentStep'),
-
- isStep5: function () {
- return this.get('currentStep') == 5;
- }.property('currentStep'),
-
- isStep6: function () {
- return this.get('currentStep') == 6;
- }.property('currentStep'),
-
- isStep7: function () {
- return this.get('currentStep') == 7;
- }.property('currentStep'),
-
- gotoStep: function (step) {
- if (this.get('isStepDisabled').findProperty('step', step).get('value') === false) {
- App.router.send('gotoStep' + step);
- }
- },
-
- gotoStep1: function () {
- this.gotoStep(1);
- },
-
- gotoStep2: function () {
- this.gotoStep(2);
- },
-
- gotoStep3: function () {
- this.gotoStep(3);
- },
-
- gotoStep4: function () {
- this.gotoStep(4);
- },
-
- gotoStep5: function () {
- this.gotoStep(5);
- },
-
- gotoStep6: function () {
- this.gotoStep(6);
- },
-
- gotoStep7: function () {
- this.gotoStep(7);
- },
-
+ totalSteps: 7,
/**
* Load clusterInfo(step1) to model
@@ -275,7 +166,7 @@ App.AddServiceController = Em.Controller.extend({
loadServices: function () {
var servicesInfo = App.db.getService();
if(!servicesInfo || !servicesInfo.length){
- servicesInfo = require('data/mock/services').slice(0);
+ servicesInfo = require('data/services').slice(0);
servicesInfo.forEach(function(item, index){
servicesInfo[index].isSelected = App.Service.find().someProperty('id', item.serviceName);
servicesInfo[index].isDisabled = servicesInfo[index].isSelected;
View
199 ambari-web/app/controllers/wizard.js
@@ -0,0 +1,199 @@
+/**
+ * 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.
+ */
+
+
+var App = require('app');
+
+App.WizardController = Em.Controller.extend({
+
+ isStepDisabled: [],
+
+ init: function () {
+ this.clusters = App.Cluster.find();
+ this.isStepDisabled.pushObject(Ember.Object.create({
+ step: 1,
+ value: false
+ }));
+ for (var i = 2; i <= this.totalSteps; i++) {
+ this.isStepDisabled.pushObject(Ember.Object.create({
+ step: i,
+ value: true
+ }));
+ }
+ // window.onbeforeunload = function () {
+ // return "You have not saved your document yet. If you continue, your work will not be saved."
+ //}
+ },
+
+ setStepsEnable: function () {
+ for (var i = 2; i <= this.totalSteps; i++) {
+ var step = this.get('isStepDisabled').findProperty('step', i);
+ if (i <= this.get('currentStep')) {
+ step.set('value', false);
+ } else {
+ step.set('value', true);
+ }
+ }
+ }.observes('currentStep'),
+
+ setLowerStepsDisable: function (stepNo) {
+ for (var i = 1; i < stepNo; i++) {
+ var step = this.get('isStepDisabled').findProperty('step', i);
+ step.set('value', true);
+ }
+ },
+
+ prevInstallStatus: function () {
+ console.log('Inside the prevInstallStep function: The name is ' + App.router.get('loginController.loginName'));
+ var result = App.db.isCompleted()
+ if (result == '1') {
+ return true;
+ }
+ }.property('App.router.loginController.loginName'),
+
+ /**
+ * Set current step to new value.
+ * Method moved from App.router.setInstallerCurrentStep
+ * @param currentStep
+ * @param completed
+ */
+ currentStep: function () {
+ return App.get('router').getWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10));
+ }.property(),
+
+ /**
+ * Set current step to new value.
+ * Method moved from App.router.setInstallerCurrentStep
+ * @param currentStep
+ * @param completed
+ */
+ setCurrentStep: function (currentStep, completed) {
+ App.db.setWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10), currentStep, completed);
+ this.set('currentStep', currentStep);
+ },
+
+ clusters: null,
+
+ isStep1: function () {
+ return this.get('currentStep') == 1;
+ }.property('currentStep'),
+
+ isStep2: function () {
+ return this.get('currentStep') == 2;
+ }.property('currentStep'),
+
+ isStep3: function () {
+ return this.get('currentStep') == 3;
+ }.property('currentStep'),
+
+ isStep4: function () {
+ return this.get('currentStep') == 4;
+ }.property('currentStep'),
+
+ isStep5: function () {
+ return this.get('currentStep') == 5;
+ }.property('currentStep'),
+
+ isStep6: function () {
+ return this.get('currentStep') == 6;
+ }.property('currentStep'),
+
+ isStep7: function () {
+ return this.get('currentStep') == 7;
+ }.property('currentStep'),
+
+ isStep8: function () {
+ return this.get('currentStep') == 8;
+ }.property('currentStep'),
+
+ isStep9: function () {
+ return this.get('currentStep') == 9;
+ }.property('currentStep'),
+
+ isStep10: function () {
+ return this.get('currentStep') == 10;
+ }.property('currentStep'),
+
+ gotoStep: function (step) {
+ if (this.get('isStepDisabled').findProperty('step', step).get('value') !== false) {
+ return;
+ }
+ if ((this.get('currentStep') - step) > 1) {
+ App.ModalPopup.show({
+ header: Em.I18n.t('installer.navigation.warning.header'),
+ onPrimary: function () {
+ App.router.send('gotoStep' + step);
+ this.hide();
+ },
+ body: "If you proceed to go back to Step " + step + ", you will lose any changes you have made beyond this step"
+ });
+ } else {
+ App.router.send('gotoStep' + step);
+ }
+ },
+
+ gotoStep1: function () {
+ this.gotoStep(1);
+ },
+
+ gotoStep2: function () {
+ this.gotoStep(2);
+ },
+
+ gotoStep3: function () {
+ this.gotoStep(3);
+ },
+
+ gotoStep4: function () {
+ this.gotoStep(4);
+ },
+
+ gotoStep5: function () {
+ this.gotoStep(5);
+ },
+
+ gotoStep6: function () {
+ this.gotoStep(6);
+ },
+
+ gotoStep7: function () {
+ this.gotoStep(7);
+ },
+
+ gotoStep8: function () {
+ this.gotoStep(8);
+ },
+
+ gotoStep9: function () {
+ this.gotoStep(9);
+ },
+
+ gotoStep10: function () {
+ this.gotoStep(10);
+ },
+
+ load: function (name, reload) {
+ if (this.get('content.' + name) && !reload) {
+ return false;
+ }
+ var result = App.db['get' + name.capitalize()];
+ if (!result) result = this['get' + name.capitalize()];
+ this.set('content.' + name, result);
+ console.log("Installer controller: loaded" + name, result);
+ }
+})
View
73 ambari-web/app/controllers/wizard/step3_controller.js
@@ -23,7 +23,8 @@ App.WizardStep3Controller = Em.Controller.extend({
hosts: [],
content: [],
bootHosts: [],
- registrationAttempt: 7,
+ maxRegistrationAttempts: 20,
+ registrationAttempts: null,
isSubmitDisabled: true,
categories: ['All Hosts', 'Success', 'Error'],
category: 'All Hosts',
@@ -49,13 +50,15 @@ App.WizardStep3Controller = Em.Controller.extend({
}
} else {
this.set('bootHosts', this.get('hosts'));
- this.isHostsRegistered(this.getHostInfo);
+ this.isHostsRegistered();
}
},
clearStep: function () {
this.hosts.clear();
this.bootHosts.clear();
+ this.set('isSubmitDisabled', true);
+ this.set('registrationAttempts', 1);
},
loadStep: function () {
@@ -113,7 +116,7 @@ App.WizardStep3Controller = Em.Controller.extend({
/* Returns the current set of visible hosts on view (All, Succeeded, Failed) */
visibleHosts: function () {
if (this.get('category') === 'Success') {
- return (this.hosts.filterProperty('bootStatus', 'DONE'));
+ return (this.hosts.filterProperty('bootStatus', 'REGISTERED'));
} else if (this.get('category') === 'Error') {
return (this.hosts.filterProperty('bootStatus', 'FAILED'));
} else { // if (this.get('category') === 'All Hosts')
@@ -166,7 +169,7 @@ App.WizardStep3Controller = Em.Controller.extend({
if (self.get('content.hosts.manualInstall') !== true) {
self.doBootstrap();
} else {
- self.isHostsRegistered(self.getHostInfo);
+ self.isHostsRegistered();
}
this.hide();
},
@@ -241,10 +244,10 @@ App.WizardStep3Controller = Em.Controller.extend({
},
startRegistration: function () {
- this.isHostsRegistered(this.getHostInfo);
+ this.isHostsRegistered();
},
- isHostsRegistered: function (callback) {
+ isHostsRegistered: function () {
var self = this;
var hosts = this.get('bootHosts');
var url = App.testMode ? '/data/wizard/bootstrap/single_host_registration.json' : App.apiPrefix + '/hosts';
@@ -254,6 +257,7 @@ App.WizardStep3Controller = Em.Controller.extend({
url: url,
timeout: App.timeout,
success: function (data) {
+ console.log('registration attempt #' + self.get('registrationAttempts'));
var jsonData;
if (App.testMode === true) {
jsonData = data;
@@ -264,31 +268,38 @@ App.WizardStep3Controller = Em.Controller.extend({
console.log("Error: jsonData is null");
return;
}
- if (jsonData.items.length === 0) {
- if (self.get('registrationAttempt') !== 0) {
- count--;
- window.setTimeout(function () {
- self.isHostsRegistered(callback);
- }, 3000);
- return;
- } else {
- self.registerErrPopup(Em.I18n.t('installer.step3.hostRegister.popup.header'), Em.I18n.t('installer.step3.hostRegister.popup.body'));
- return;
- }
- }
- var flag = true;
+
+ // keep polling until all hosts are registered
+ var allRegistered = true;
hosts.forEach(function (_host) {
if (jsonData.items.someProperty('Hosts.host_name', _host.name)) {
- _host.set('bootStatus', 'DONE');
- _host.set('bootLog', 'Success');
+ if (_host.get('bootStatus') != 'REGISTERED') {
+ _host.set('bootStatus', 'REGISTERED');
+ _host.set('bootLog', (_host.get('bootLog') != null ? _host.get('bootLog') : '') + '\nRegistration with the server succeeded.');
+ }
} else {
- flag = false;
+ allRegistered = false;
+ if (_host.get('bootStatus') != 'FAILED' && _host.get('bootStatus') != 'REGISTERING') {
+ _host.set('bootStatus', 'REGISTERING');
+ currentBootLog = _host.get('bootLog') != null ? _host.get('bootLog') : '';
+ _host.set('bootLog', (_host.get('bootLog') != null ? _host.get('bootLog') : '') + '\nRegistering with the server...');
+ }
}
}, this);
- if (flag) {
- callback.apply(self);
+ if (allRegistered) {
+ self.getHostInfo();
+ } else if (self.get('maxRegistrationAttempts') - self.get('registrationAttempts') >= 0) {
+ self.set('registrationAttempts', self.get('registrationAttempts') + 1);
+ window.setTimeout(function () {
+ self.isHostsRegistered();
+ }, 3000);
} else {
- self.registerErrPopup(Em.I18n.t('installer.step3.hostRegister.popup.header'), Em.I18n.t('installer.step3.hostRegister.popup.body'));
+ // maxed out on registration attempts. mark all REGISTERING hosts to FAILED
+ hosts.filterProperty('bootStatus', 'REGISTERING').forEach(function (_host) {
+ _host.set('bootStatus', 'FAILED');
+ _host.set('bootLog', (_host.get('bootLog') != null ? _host.get('bootLog') : '') + '\nRegistration with the server failed.');
+ });
+ self.getHostInfo();
}
},
error: function () {
@@ -315,8 +326,6 @@ App.WizardStep3Controller = Em.Controller.extend({
/**
* Get disk info and cpu count of booted hosts from server
*/
-
-
getHostInfo: function () {
var self = this;
var kbPerGb = 1024;
@@ -336,16 +345,16 @@ App.WizardStep3Controller = Em.Controller.extend({
jsonData = jQuery.parseJSON(data);
}
hosts.forEach(function (_host) {
- if (jsonData.items.someProperty('Hosts.host_name', _host.name)) {
- var host = jsonData.items.findProperty('Hosts.host_name', _host.name);
+ var host = jsonData.items.findProperty('Hosts.host_name', _host.name);
+ if (host) {
_host.cpu = host.Hosts.cpu_count;
_host.memory = ((parseInt(host.Hosts.total_mem))).toFixed(2);
console.log("The value of memory is: " + _host.memory);
}
- }, this);
+ });
self.set('bootHosts', hosts);
console.log("The value of hosts: " + JSON.stringify(hosts));
- self.stopRegistrataion();
+ self.stopRegistration();
},
error: function () {
@@ -356,7 +365,7 @@ App.WizardStep3Controller = Em.Controller.extend({
});
},
- stopRegistrataion: function () {
+ stopRegistration: function () {
this.set('isSubmitDisabled', false);
},
View
2  ambari-web/app/controllers/wizard/step5_controller.js
@@ -58,7 +58,7 @@ App.WizardStep5Controller = Em.Controller.extend({
for (var index in hostInfo) {
var _host = hostInfo[index];
- if (_host.bootStatus === 'DONE') { // TODO: remove "true" after integrating with bootstrap
+ if (_host.bootStatus === 'REGISTERED') {
var hostObj = Ember.Object.create({
host_name:_host.name,
View
3  ambari-web/app/controllers/wizard/step6_controller.js
@@ -166,8 +166,9 @@ App.WizardStep6Controller = Em.Controller.extend({
var hostInfo = this.get('content.hostsInfo');
var hostNames = [];
for (var index in hostInfo) {
- if (hostInfo[index].bootStatus === 'DONE') //TODO: remove true after integration with bootstrap
+ if (hostInfo[index].bootStatus === 'REGISTERED') {
hostNames.push(hostInfo[index].name);
+ }
}
return hostNames;
},
View
8 ambari-web/app/controllers/wizard/step8_controller.js
@@ -28,6 +28,8 @@ App.WizardStep8Controller = Em.Controller.extend({
globals: [],
configMapping: require('data/config_mapping'),
+ isSubmitDisabled : false,
+
selectedServices: function () {
return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
}.property('content.services').cacheable(),
@@ -596,6 +598,12 @@ App.WizardStep8Controller = Em.Controller.extend({
*/
submit: function () {
+ if (this.get('isSubmitDisabled')) {
+ return;
+ }
+
+ this.set('isSubmitDisabled', true);
+
if (App.testMode) {
App.router.send('next');
return;
View
2  ambari-web/app/controllers/wizard/step9_controller.js
@@ -95,7 +95,7 @@ App.WizardStep9Controller = Em.Controller.extend({
console.log("TRACE: host name is: " + hostInfo[index].name);
}
// return hosts;
- return hosts.filterProperty('bootStatus', 'DONE'); //TODO: uncomment after actual hookup with bootstrap
+ return hosts.filterProperty('bootStatus', 'REGISTERED');
},
renderHosts: function (hostsInfo) {
View
0  ambari-web/app/data/mock/services.js → ambari-web/app/data/services.js
File renamed without changes
View
1  ambari-web/app/initialize.js
@@ -30,6 +30,7 @@ App.componentsUpdateInterval = 6000;
App.contentUpdateInterval = 15000;
require('messages');
+require('utils/base64');
require('utils/data_table');
require('utils/db');
require('utils/helper');
View
25 ambari-web/app/mappers/alerts_mapper.js
@@ -42,11 +42,26 @@ App.alertsMapper = App.QuickDataMapper.create({
return;
}
if (json.alerts) {
- var result = [];
- json.alerts.forEach(function (item) {
- result.push(this.parseIt(item, this.config));
- }, this);
- App.store.loadMany(this.get('model'), result);
+ if (App.Alert.find().content.length > 0) {
+ this.update(json);
+ } else {
+ var result = [];
+ json.alerts.forEach(function (item) {
+ result.push(this.parseIt(item, this.config));
+ }, this);
+ App.store.loadMany(this.get('model'), result);
+ }
}
+ },
+ update: function(json){
+ var alerts = App.Alert.find();
+ var result = [];
+ json.alerts.forEach(function (item) {
+ if (!alerts.filterProperty('title', item.service_description).length) {
+ result.push(this.parseIt(item, this.config));
+ }
+ }, this);
+ App.store.loadMany(this.get('model'), result);
+
}
});
View
3  ambari-web/app/messages.js
@@ -40,6 +40,7 @@ Em.I18n.translations = {
'topnav.help.href':'http://incubator.apache.org/ambari/install.html',
'installer.header':'Cluster Install Wizard',
+ 'installer.navigation.warning.header':'Navigation Warning',
'installer.step1.header':'Welcome',
'installer.step1.body.header':'Welcome to Apache Ambari!',
'installer.step1.body':'Ambari makes it easy to install, manage, and monitor Hadoop clusters.<br>' +
@@ -93,8 +94,6 @@ Em.I18n.translations = {
'installer.step3.hosts.remove.popup.body':'Are you sure you want to remove the selected host(s)?',
'installer.step3.hosts.retry.popup.header':'Retry Host Discovery',
'installer.step3.hosts.retry.popup.body':'Are you sure you want to retry discovery of the selected host(s)?',
- 'installer.step3.hostRegister.popup.header':'Error in Host Registration',
- 'installer.step3.hostRegister.popup.body':'All/Some hosts bootstrapped but unable to register with server',
'installer.step3.hostInformation.popup.header':'Error in retrieving host Information',
'installer.step3.hostInformation.popup.body' : 'All bootstrapped hosts registered but unable to retrieve cpu and memory related information',
'installer.step4.header':'Choose Services',
View
30 ambari-web/app/models/hosts.js
@@ -31,33 +31,55 @@ App.HostInfo = Ember.Object.extend({
bootStatusForDisplay:function () {
switch (this.get('bootStatus')) {
- case 'DONE':
+ case 'REGISTERED':
return 'Success';
case 'FAILED':
return 'Failed';
case 'RUNNING':
- return 'Running';
+ return 'Installing';
+ case 'DONE':
+ case 'REGISTERING':
+ default:
+ return 'Registering';
}
}.property('bootStatus'),
bootBarColor:function () {
switch (this.get('bootStatus')) {
- case 'DONE':
+ case 'REGISTERED':
return 'progress-success';
case 'FAILED':
return 'progress-danger';
case 'RUNNING':
+ case 'DONE':
+ case 'REGISTERING':
default:
return 'progress-info';
}
}.property('bootStatus'),
- isBootDone:function () {
+ bootStatusColor:function () {
switch (this.get('bootStatus')) {
+ case 'REGISTERED':
+ return 'text-success';
+ case 'FAILED':
+ return 'text-error';
+ case 'RUNNING':
case 'DONE':
+ case 'REGISTERING':
+ default:
+ return 'text-info';
+ }
+ }.property('bootStatus'),
+
+ isBootDone:function () {
+ switch (this.get('bootStatus')) {
+ case 'REGISTERED':
case 'FAILED':
return true;
case 'RUNNING':
+ case 'DONE':
+ case 'REGISTERING':
default:
return false;
}
View
3  ambari-web/app/router.js
@@ -131,7 +131,8 @@ App.Router = Em.Router.extend({
login: function (postLogin) {
var controller = this.get('loginController');
- var loginName = controller.get('loginName');
+ var loginName = controller.get('loginName').toLowerCase();
+ controller.set('loginName', loginName);
var hash = window.btoa(loginName + ":" + controller.get('password'));
var router = this;
$.ajax({
View
6 ambari-web/app/routes/add_host_routes.js
@@ -174,6 +174,9 @@ module.exports = Em.Route.extend({
controller.setCurrentStep('6', false);
controller.dataLoading().done(function () {
controller.loadAllPriorSteps();
+ if (!App.testMode) { //if test mode is ON don't disable prior steps link.
+ controller.setLowerStepsDisable(6);
+ }
controller.connectOutlet('wizardStep9', controller.get('content'));
})
},
@@ -191,6 +194,9 @@ module.exports = Em.Route.extend({
wizardStep9Controller.navigateStep();
}
},
+ unroutePath: function() {
+ return false;
+ },
next: function (router) {
var addHostController = router.get('addHostController');
var wizardStep9Controller = router.get('wizardStep9Controller');
View
6 ambari-web/app/routes/add_service_routes.js
@@ -175,6 +175,9 @@ module.exports = Em.Route.extend({
controller.setCurrentStep('6', false);
controller.dataLoading().done(function () {
controller.loadAllPriorSteps();
+ if (!App.testMode) { //if test mode is ON don't disable prior steps link.
+ controller.setLowerStepsDisable(6);
+ }
controller.connectOutlet('wizardStep9', controller.get('content'));
})
},
@@ -192,6 +195,9 @@ module.exports = Em.Route.extend({
wizardStep9Controller.navigateStep();
}
},
+ unroutePath: function() {
+ return false;
+ },
next: function (router) {
var addServiceController = router.get('addServiceController');
var wizardStep9Controller = router.get('wizardStep9Controller');
View
10 ambari-web/app/routes/installer.js
@@ -135,8 +135,13 @@ module.exports = Em.Route.extend({
var wizardStep3Controller = router.get('wizardStep3Controller');
installerController.saveConfirmedHosts(wizardStep3Controller);
+
App.db.setBootStatus(true);
- App.db.setService(require('data/mock/services'));
+ var displayOrderConfig = require('data/services');
+ var apiUrl = '/stacks/HDP/version/1.2.0';
+ router.get('installerController').loadServiceComponents(router.get('wizardStep4Controller'), displayOrderConfig, apiUrl);
+ var apiService = router.get('wizardStep4Controller').get('serviceComponents');
+ App.db.setService(apiService);
router.transitionTo('step4');
},
/**
@@ -284,6 +289,9 @@ module.exports = Em.Route.extend({
wizardStep9Controller.navigateStep();
}
},
+ unroutePath: function() {
+ return false;
+ },
next: function (router) {
var installerController = router.get('installerController');
var wizardStep9Controller = router.get('wizardStep9Controller');
View
8 ambari-web/app/routes/main.js
@@ -259,7 +259,7 @@ module.exports = Em.Route.extend({
},
showDetails:function (router, event) {
router.get('mainHostDetailsController').setBack(true);
- router.transitionTo('hostDetails.index', event.context)
+ router.transitionTo('hosts.hostDetails.index', event.context)
},
filterHosts:function (router, component) {
router.transitionTo('hosts');
@@ -335,7 +335,7 @@ module.exports = Em.Route.extend({
},
showDetails:function (router, event) {
router.get('mainHostDetailsController').setBack(true);
- router.transitionTo('hostDetails.index', event.context)
+ router.transitionTo('hosts.hostDetails.index', event.context)
}
}),
showService:Em.Router.transitionTo('service'),
@@ -347,10 +347,10 @@ module.exports = Em.Route.extend({
selectService:Em.Route.transitionTo('services.service'),
selectHost:function (router, event) {
router.get('mainHostDetailsController').setBack(false);
- router.transitionTo('hostDetails.index', event.context);
+ router.transitionTo('hosts.hostDetails.index', event.context);
},
filterHosts:function (router, component) {
router.get('mainHostController').filterByComponent(component.context);
- router.transitionTo('hosts');
+ router.transitionTo('hosts.index');
}
});
View
22 ambari-web/app/styles/application.less
@@ -674,6 +674,12 @@ a:focus {
/*start chart/style graphs*/
.chart-container {
+ cursor: pointer;
+ cursor:-moz-zoom-in;
+ cursor:-webkit-zoom-in;
+ &.chart-container-popup {
+ cursor: auto;
+ }
position: relative;
margin: 20px 15px 0px 15px;
@@ -707,6 +713,14 @@ a:focus {
.rickshaw_legend {
background-color: #999999 !important;
}
+ .rickshaw_graph {
+ .x_tick{
+ .title {
+ bottom: -6px;
+ opacity: 0.75;
+ }
+ }
+ }
.chart-overlay {
position: absolute;
top: 0;
@@ -774,6 +788,9 @@ a:focus {
.add-service-button {
margin: 20px 20px 10px;
}
+ .operations-count{
+ background: #953B39;
+ }
}
.nav-pills.move {
@@ -1535,6 +1552,11 @@ ul.filter {
color: #777777;
margin-top: 5px;
}
+ .heatmap-host {
+ display: block;
+ width: 100%;
+ height: 100%;
+ }
}
/*End Heatmap*/
View
18 ambari-web/app/styles/apps.less
@@ -1,10 +1,28 @@
#apps{
+ select,
+ input[type="text"],
+ input[type="datetime"],
+ input[type="datetime-local"],
+ input[type="date"],
+ input[type="month"],
+ input[type="time"],
+ input[type="week"],
+ input[type="number"],
+ input[type="email"],
+ input[type="url"],
+ input[type="search"],
+ input[type="tel"],
+ input[type="color"] {
+ margin-bottom: 0px;
+ }
+
td .red {
color: red;
}
.table thead th{
vertical-align:top;
+ padding-bottom: 0px;
}
.avg-table {
table-layout: fixed;
View
2  ambari-web/app/templates/main/charts/heatmap.hbs
@@ -29,7 +29,7 @@
<ul class="dropdown-menu">
{{#each category in controller.allMetrics}}
<li class="dropdown-submenu">
- <a tabindex="-1" href="#">{{category.label}}</a>
+ <a tabindex="-1" >{{category.label}}</a>
<ul class="dropdown-menu">
{{#each metric in category.items}}
<li>
View
4 ambari-web/app/templates/main/charts/heatmap/heatmap_host.hbs
@@ -16,4 +16,6 @@
* limitations under the License.
}}
-<div {{bindAttr class="view.content.healthStatus view.hostClass"}} {{bindAttr style="view.hostTemperatureStyle"}}></div>
+<div {{bindAttr class="view.content.healthStatus view.hostClass"}} {{bindAttr style="view.hostTemperatureStyle"}}>
+ <a href="#" class="heatmap-host" {{action "routeHostDetail" view.content target="controller"}}></a>
+</div>
View
3  ambari-web/app/templates/main/charts/heatmap/heatmap_rack.hbs
@@ -44,11 +44,8 @@
<!--</div>-->
<div {{bindAttr class="view.heatmapTogglerClass view.hostsBlockClass"}}>
{{#each rack.hosts}}
- <a href="#" {{action "routeHostDetail" this target="controller"}}>
<div {{bindAttr style="view.hostCssStyle"}}>
{{view App.MainChartsHeatmapHostView contentBinding="this"}}
</div>
- </a>
{{/each}}
-
</div>
View
2  ambari-web/app/templates/main/charts/linear_time.hbs
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
}}
-<div id="{{unbound view.id}}-container" class="chart-container" {{action showGraphInPopup target="view"}}>
+<div id="{{unbound view.id}}-container" class="chart-container" {{action showGraphInPopup target="view"}} title="Click to zoom">
<div id="{{unbound view.id}}-yaxis" class="chart-y-axis"></div>
<div id="{{unbound view.id}}-xaxis" class="chart-x-axis"></div>
<div id="{{unbound view.id}}-legend" class="chart-legend"></div>
View
2  ambari-web/app/templates/main/dashboard.hbs
@@ -26,7 +26,7 @@
</div>
<dl class="dl-horizontal services">
{{#each item in view.content}}
- {{view item.viewName serviceBinding="item.model"}}
+ {{view item.viewName serviceBinding="item.model"}}
{{/each}}
</dl>
</div>
View
5 ambari-web/app/templates/main/dashboard/service/hbase.hbs
@@ -19,6 +19,11 @@
{{#unless view.showOnlyRows}}
<div class="clearfix" {{action toggleInfoView target="view"}}>
<div class="name span2">
+ {{#if view.isCollapsed}}
+ <i class="icon-arrow-down pull-left"></i>
+ {{else}}
+ <i class="icon-arrow-right pull-left"></i>
+ {{/if}}
{{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
<a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
{{#if view.criticalAlertsCount}}
View
5 ambari-web/app/templates/main/dashboard/service/hdfs.hbs
@@ -19,6 +19,11 @@
{{#unless view.showOnlyRows}}
<div class="clearfix" {{action toggleInfoView target="view"}}>
<div class="name span2">
+ {{#if view.isCollapsed}}
+ <i class="icon-arrow-down pull-left"></i>
+ {{else}}
+ <i class="icon-arrow-right pull-left"></i>
+ {{/if}}
{{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
<a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
{{#if view.criticalAlertsCount}}
View
5 ambari-web/app/templates/main/dashboard/service/mapreduce.hbs
@@ -19,6 +19,11 @@
{{#unless view.showOnlyRows}}
<div class="clearfix" {{action toggleInfoView target="view"}}>
<div class="name span2">
+ {{#if view.isCollapsed}}
+ <i class="icon-arrow-down pull-left"></i>
+ {{else}}
+ <i class="icon-arrow-right pull-left"></i>
+ {{/if}}
{{view App.MainDashboardServiceHealthView serviceBinding="view.service"}}
<a {{action selectService view.service href=true}}>{{view.service.displayName}}</a>
{{#if view.criticalAlertsCount}}
View
6 ambari-web/app/templates/main/host.hbs
@@ -31,7 +31,7 @@
<thead>
<tr>
<th>Name</th>
- <th>Rack</th>
+ <th>Ip</th>
<th>CPU</th>
<th>RAM</th>
<th>Disk Usage</th>
@@ -39,7 +39,7 @@
<th>Components</th>
</tr>
<th class="notActive"><div class="view-wrapper">{{view view.nameFilterView viewName="nameFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_nameFilterViewInstance" class="ui-icon ui-icon-circle-close ui-name"></a></th>
- <th class="notActive"><div class="view-wrapper">{{view view.rackFilterView viewName="rackFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_rackFilterViewInstance" class="ui-icon ui-icon-circle-close ui-rack"></a></th>
+ <th class="notActive"><div class="view-wrapper">{{view view.rackFilterView viewName="ipFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_ipFilterViewInstance" class="ui-icon ui-icon-circle-close ui-rack"></a></th>
<th class="notActive"><div class="view-wrapper">{{view view.cpuFilterView viewName="cpuFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_cpuFilterViewInstance" class="ui-icon ui-icon-circle-close ui-cpu"></a></th>
<th class="notActive"><div class="view-wrapper">{{view view.ramFilterView viewName="ramFilterViewInstance"}}</div> <a href="#" {{action "clearFilterButtonClick" target="view"}} id="view_ramFilterViewInstance" class="ui-icon ui-icon-circle-close ui-ram"></a></th>
<th></th>
@@ -57,7 +57,7 @@
<span {{bindAttr class="host.healthClass"}}></span>
<a href="#" {{action "showDetails" host}}>{{unbound host.publicHostName}}</a>
</td>
- <td>{{host.rack}}</td>
+ <td>{{host.ip}}</td>
<td>{{host.cpu}}</td>
<td>{{host.memoryFormatted}}</td>
<td>
View
49 ambari-web/app/templates/main/service/info/client_summary.hbs
@@ -59,53 +59,4 @@
</div>
</div>
</div>
- <div class="span6">
- <div class="box">
- <div class="box-header">
- <h4>Alerts</h4>
-
- <div class="btn-group">
- <a class="btn" target="_blank" rel="tooltip" title="Go to Nagios" {{bindAttr href="controller.nagiosUrl"}}><i
- class="icon-link"></i></a>
- </div>
- </div>
- <ul id='summary-alerts-list' class="alerts">
- {{#if controller.alerts.length}}
- {{#each controller.alerts}}
- <li class="status-{{unbound status}}">
- <div class="container-fluid">
- <div class="row-fluid">
- <div class="span1 status-icon">
- {{#if isOk}}
- <i class="icon-ok icon-large"></i>
- {{else}}
- <i class="icon-remove icon-large"></i>
- {{/if}}
- </div>
- <div class="span11">
- <div class="row-fluid">
- <div class="span7 title">{{title}}
- </div>
- <div rel="tooltip" {{bindAttr data-title="timeSinceAlertDetails"}} data-placement="right" class="span5 date-time">{{timeSinceAlert}}</div>
- </div>
- <div class="row-fluid message">{{message}}</div>
- </div>
- </div>
- </div>
- </li>
- {{/each}}
- {{else}}
- {{#if controller.isNagiosInstalled}}
- <div class="alert alert-info">
- No alerts
- </div>
- {{else}}
- <div class="alert">
- Nagios service required for viewing alerts
- </div>
- {{/if}}
- {{/if}}
- </ul>
- </div>
- </div>
</div>
View
24 ambari-web/app/templates/main/service/info/summary.hbs
@@ -47,16 +47,22 @@
{{#unless view.serviceStatus.mapreduce}}
{{#unless view.serviceStatus.hbase}}
{{#each component in controller.content.components}}
- <tr>
- {{#if component.isMaster}}
- <td class="summary-label">{{component.displayName}}</td>
- <td><a {{action selectHost component.host}} href="javascript:void(null)">{{component.host.publicHostName}}</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>
- {{/if}}
- </tr>
+ <tr>
+ {{#if component.isMaster}}
+ <td class="summary-label">{{component.displayName}}</td>
+ <td><a {{action selectHost component.host}} href="javascript:void(null)">{{component.host.publicHostName}}</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>
+ {{/if}}
+ </tr>
{{/each}}
+ {{#if view.serviceStatus.ganglia}}
+ <tr>
+ <td class="summary-label">Ganglia Web UI</td>
+ <td><a target=_blank href="http://{{unbound view.gangliaServer}}/ganglia">{{view.gangliaServer}}/ganglia</a></td>
+ </tr>
+ {{/if}}
{{/unless}}
{{/unless}}
{{/unless}}
View
2  ambari-web/app/templates/wizard/step3.hbs
@@ -90,7 +90,7 @@
</td>
<td>
<a href="javascript:void(null)"
- data-toggle="modal" {{action hostLogPopup host target="controller"}}>{{host.bootStatusForDisplay}}</a>
+ data-toggle="modal" {{action hostLogPopup host target="controller"}}><span {{bindAttr class="host.bootStatusColor"}}>{{host.bootStatusForDisplay}}</span></a>
</td>
<td>
{{#if view.isRemovable}}<a class="btn btn-mini" {{action remove target="view"}}><i class="icon-trash"></i>
View
2  ambari-web/app/templates/wizard/step4.hbs
@@ -33,6 +33,7 @@
href="#" {{action selectMinimum target="controller"}} {{bindAttr class="isMinimum:selected:deselected"}}>minimum</a>
</span>
</th>
+ <th>Version</th>
<th>Description</th>
</tr>
</thead>
@@ -43,6 +44,7 @@
<td><label
class="checkbox">{{view Ember.Checkbox disabledBinding="isDisabled" checkedBinding="isSelected"}}{{displayName}}</label>
</td>
+ <td>{{version}}</td>
<td>{{description}}</td>
</tr>
{{/unless}}
View
2  ambari-web/app/templates/wizard/step8.hbs
@@ -46,5 +46,5 @@
</div>
<div class="btn-area">
<a class="btn pull-left" {{action back href="true"}}>&larr; Back</a>
- <a class="btn btn-success pull-right" {{action submit target="controller"}}>Deploy &rarr;</a>
+ <a class="btn btn-success pull-right" id="spinner" {{bindAttr disabled="controller.isSubmitDisabled"}} {{action submit target="controller"}}>Deploy &rarr;</a>
</div>
View
11 ambari-web/app/utils/graph.js
@@ -182,9 +182,18 @@ module.exports = {
return y / 1000 + 's'
},
formatter:function (series, x, y, formattedX, formattedY, d) {
+ var bytesFormatter = function(y) {
+ if (y >= 1125899906842624) { return Math.floor(10 * y / 1125899906842624)/10 + " PB" }
+ else if (y >= 1099511627776){ return Math.floor(10 * y / 1099511627776)/10 + " TB" }
+ else if (y >= 1073741824) { return Math.floor(10 * y / 1073741824)/10 + " GB" }
+ else if (y >= 1048576) { return Math.floor(10 * y / 1048576)/10 + " MB" }
+ else if (y >= 1024) { return Math.floor(10 * y / 1024)/10 + " KB" }
+ else { return y + " B"}
+ };
var swatch = '<span class="detail_swatch" style="background-color: ' + series.color + '"></span>';
return swatch + (d.label? d.label: d.name) +
- '<br>Run-time: ' + formattedY + '<br>Wait-time: ' + formattedX;
+ '<br>Run-time: ' + formattedY + '<br>Wait-time: ' + formattedX +
+ '<br>I/O: ' + bytesFormatter(d.IO) + '<br>Status: ' + d.status;
}
});
View
29 ambari-web/app/views/common/chart/linear_time.js
@@ -84,6 +84,8 @@ App.ChartLinearTimeView = Ember.View.extend({
_popupGraph: null,
+ _seriesProperties: null,
+
popupSuffix: '-popup',
isPopup: false,
@@ -314,7 +316,8 @@ App.ChartLinearTimeView = Ember.View.extend({
var palette = new Rickshaw.Color.Palette({
scheme: this._paletteScheme
});
- seriesData.forEach(function (series) {
+ var self = this;
+ seriesData.forEach(function (series, index) {
series.color = /*this.colorForSeries(series) ||*/ palette.color();
series.stroke = 'rgba(0,0,0,0.3)';
if (isPopup) {
@@ -424,12 +427,32 @@ App.ChartLinearTimeView = Ember.View.extend({
}
if (isPopup) {
+ var self = this;
+ // In popup save selected metrics and show only them after data update
+ _graph.series.forEach(function(series, index) {
+ if (self.get('_seriesProperties') !== null && self.get('_seriesProperties')[index] !== null) {
+ if(self.get('_seriesProperties')[self.get('_seriesProperties').length - index - 1].length > 1) {
+ $('#'+self.get('id')+'-container'+self.get('popupSuffix')+' a.action:eq('+(self.get('_seriesProperties').length - index - 1)+')').parent('li').addClass('disabled');
+ series.disable();
+ }
+ }
+ });
+ _graph.update();
+
+ $('#'+self.get('id')+'-container'+self.get('popupSuffix')+' a.action').click(function() {
+ var series = new Array();
+ $('#'+self.get('id')+'-container'+self.get('popupSuffix')+' a.action').each(function(index, v) {
+ series[index] = v.parentNode.classList;
+ });
+ self.set('_seriesProperties', series);
+ });
+
+
this.set('_popupGraph', _graph);
}
else {
this.set('_graph', _graph);
}
-
this.set('isPopup', false);
},
@@ -450,7 +473,7 @@ App.ChartLinearTimeView = Ember.View.extend({
'<div class="modal-body">',
'{{#if bodyClass}}{{view bodyClass}}',
'{{else}}'+
- '<div id="'+this.get('id')+'-container'+this.get('popupSuffix')+'" class="chart-container">'+
+ '<div id="'+this.get('id')+'-container'+this.get('popupSuffix')+'" class="chart-container chart-container'+this.get('popupSuffix')+'">'+
'<div id="'+this.get('id')+'-yaxis'+this.get('popupSuffix')+'" class="'+this.get('id')+'-yaxis chart-y-axis"></div>'+
'<div id="'+this.get('id')+'-xaxis'+this.get('popupSuffix')+'" class="'+this.get('id')+'-xaxis chart-x-axis"></div>'+
'<div id="'+this.get('id')+'-legend'+this.get('popupSuffix')+'" class="'+this.get('id')+'-legend chart-legend"></div>'+
View
1  ambari-web/app/views/main/admin/user/create.js
@@ -25,6 +25,7 @@ App.MainAdminUserCreateView = Em.View.extend({
var parent_controller=this.get("controller").controllers.mainAdminUserController;
var form = this.get("userForm");
if(form.isValid()) {
+ form.getField("userName").set('value', form.getValues().userName.toLowerCase());
if(form.getValues().admin === "" || form.getValues().admin == true) {
form.getField("roles").set("value","admin,user");
form.getField("admin").set("value","true");
View
2  ambari-web/app/views/main/dashboard.js
@@ -78,7 +78,7 @@ App.MainDashboardView = Em.View.extend({
}
this.get('content').pushObject(Em.Object.create({
viewName: vName,
- model: item2
+ model: item2 || item
}))
}, this);
},
View
4 ambari-web/app/views/main/dashboard/service.js
@@ -88,7 +88,7 @@ App.MainDashboardServiceView = Em.View.extend({
criticalAlertsCount: function () {
var alerts = App.router.get('clusterController.alerts');
- return alerts.filterProperty('serviceType', this.get('service.id')).filterProperty('status', '1').length;
- }.property('service.alerts')
+ return alerts.filterProperty('serviceType', this.get('service.id')).filterProperty('isOk', false).length;
+ }.property('App.router.clusterController.alerts')
});
View
3  ambari-web/app/views/main/dashboard/service/hbase.js
@@ -58,7 +58,10 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
return App.Component.find().findProperty('componentName', 'HBASE_REGIONSERVER');
}.property('components'),
+ isCollapsed: false,
+
toggleInfoView: function() {
$('#hbase-info').toggle('blind', 200);
+ this.set('isCollapsed', !this.isCollapsed);
}
});
View
3  ambari-web/app/views/main/dashboard/service/hdfs.js
@@ -79,7 +79,10 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
return App.Component.find().findProperty('componentName', 'DATANODE');
}.property('+'),
+ isCollapsed: false,
+
toggleInfoView: function() {
$('#hdfs-info').toggle('blind', 200);
+ this.set('isCollapsed', !this.isCollapsed);
}
});
View
3  ambari-web/app/views/main/dashboard/service/mapreduce.js
@@ -107,7 +107,10 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({
return App.Component.find().findProperty('componentName', 'TASKTRACKER');
}.property('components'),
+ isCollapsed: false,
+
toggleInfoView: function() {
$('#mapreduce-info').toggle('blind', 200);
+ this.set('isCollapsed', !this.isCollapsed);
}
});
View
11 ambari-web/app/views/main/service/info/summary.js
@@ -28,7 +28,8 @@ App.MainServiceInfoSummaryView = Em.View.extend({
hbase:false,
zookeeper:false,
oozie:false,
- hive:false
+ hive:false,
+ ganglia:false
},
data:{
@@ -38,6 +39,14 @@ App.MainServiceInfoSummaryView = Em.View.extend({
"user":"hive"
}
},
+ gangliaServer:function(){
+ var tmp=this.get('controller.content');
+ if(tmp.get("id") == "GANGLIA"){
+ return tmp.get("components").objectAt(0).get("host").get("id");
+ }else{
+ return "";
+ }
+ }.property('controller.content'),
service:function () {
var svc = this.get('controller.content');
var svcName = svc.get('serviceName');
View
2  ambari-web/app/views/main/service/menu.js
@@ -66,7 +66,7 @@ App.MainServiceMenuView = Em.CollectionView.extend({
var allAlerts = App.router.get('clusterController.alerts');
var serviceId = this.get('content.serviceName');
if (serviceId) {
- return allAlerts.filterProperty('serviceType', serviceId).length;
+ return allAlerts.filterProperty('serviceType', serviceId).filterProperty('isOk', false).length;
}
return 0;
}.property('App.router.clusterController.alerts'),
View
7 ambari-web/app/views/wizard/step1_view.js
@@ -21,6 +21,7 @@ var App = require('app');
App.WizardStep1View = Em.View.extend({
+ tagName: "form",
templateName: require('templates/wizard/step1'),
didInsertElement: function () {
@@ -31,6 +32,10 @@ App.WizardStep1View = Em.View.extend({
onError: function () {
return this.get('controller.clusterNameError') !== '';
- }.property('controller.clusterNameError'