Permalink
Browse files

AMBARI-1059. Refactor cluster management. (yusaku)

  • Loading branch information...
1 parent 67cc2e2 commit 26429c08a436ed8561e0e770bd9109352dcfbc29 Yusaku Sako committed Dec 9, 2012
Showing with 338 additions and 115 deletions.
  1. +67 −28 ambari-web/app/assets/data/hosts/hosts.json
  2. +15 −1 ambari-web/app/controllers/application.js
  3. +3 −7 ambari-web/app/controllers/installer.js
  4. +2 −1 ambari-web/app/controllers/main.js
  5. +9 −3 ambari-web/app/controllers/wizard/step3_controller.js
  6. +1 −1 ambari-web/app/controllers/wizard/step9_controller.js
  7. +14 −14 ambari-web/app/data/config_properties.js
  8. +2 −2 ambari-web/app/data/service_configs.js
  9. +2 −1 ambari-web/app/messages.js
  10. +3 −3 ambari-web/app/models/host.js
  11. +22 −3 ambari-web/app/routes/add_host_routes.js
  12. +21 −3 ambari-web/app/routes/add_service_routes.js
  13. +18 −17 ambari-web/app/styles/application.less
  14. +31 −0 ambari-web/app/styles/apps.less
  15. +11 −2 ambari-web/app/templates/application.hbs
  16. +1 −1 ambari-web/app/templates/main/background_operations_popup.hbs
  17. +1 −1 ambari-web/app/templates/main/host/add.hbs
  18. +2 −2 ambari-web/app/templates/main/host/details.hbs
  19. +1 −1 ambari-web/app/templates/main/service/add.hbs
  20. +6 −1 ambari-web/app/templates/main/service/info/configs.hbs
  21. +1 −1 ambari-web/app/templates/wizard/step3_host_log_popup.hbs
  22. +6 −1 ambari-web/app/templates/wizard/step7.hbs
  23. +15 −5 ambari-web/app/templates/wizard/step9HostTasksLogPopup.hbs
  24. +2 −2 ambari-web/app/utils/misc.js
  25. +9 −0 ambari-web/app/views/common/chart/linear_time.js
  26. +3 −3 ambari-web/app/views/main.js
  27. +9 −3 ambari-web/app/views/main/service/info/configs.js
  28. +9 −3 ambari-web/app/views/wizard/step7_view.js
  29. +52 −5 ambari-web/app/views/wizard/step9_view.js

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -21,6 +21,20 @@ var App = require('app');
App.ApplicationController = Em.Controller.extend({
- name: 'applicationController'
+ name: 'applicationController',
+ clusterName: function () {
+ var name = App.db.getClusterName();
+ if (name) {
+ return name.capitalize();
+ }
+ return 'My Cluster';
+ }.property(),
+ isClusterDataLoaded: function() {
+ return App.router.get('clusterController.isLoaded');
+ }.property('App.router.clusterController.isLoaded'),
+ init: function(){
+ this._super();
+ $('title').text('Ambari - ' + this.get('clusterName'));
+ }
});
@@ -527,19 +527,15 @@ App.InstallerController = App.WizardController.extend({
var data = [];
// loop through all the service components
- for (var i = 0 ; i < displayOrderConfig.length ; i++) {
- var entry = jsonData.services.filterProperty("name",displayOrderConfig[i].serviceName)[0];
-
- // dont show the service whose isHidden is true
- if ( displayOrderConfig[i].isHidden ) {
- continue;
- }
+ for (var i = 0; i < displayOrderConfig.length; i++) {
+ var entry = jsonData.services.findProperty("name", displayOrderConfig[i].serviceName);
var myService = Service.create({
serviceName: entry.name,
displayName: displayOrderConfig[i].displayName,
isDisabled: i === 0 ,
isSelected: true,
+ isHidden: displayOrderConfig[i].isHidden,
description: entry.comment,
version: entry.version
});
@@ -24,7 +24,8 @@ App.MainController = Em.Controller.extend({
clusterName: function () {
var name = App.db.getClusterName();
if (name) {
- return name.capitalize();
+ var displayName = name.length > 13 ? name.substr(0, 10) + "..." : name;
+ return displayName.capitalize();
}
return 'My Cluster';
}.property(),
@@ -271,7 +271,13 @@ App.WizardStep3Controller = Em.Controller.extend({
// keep polling until all hosts are registered
var allRegistered = true;
- hosts.forEach(function (_host) {
+ hosts.forEach(function (_host, index) {
+ // Change name of first host for test mode.
+ if (App.testMode === true) {
+ if (index == 0) {
+ _host.set('name', 'localhost.localdomain');
+ }
+ }
if (jsonData.items.someProperty('Hosts.host_name', _host.name)) {
if (_host.get('bootStatus') != 'REGISTERED') {
_host.set('bootStatus', 'REGISTERED');
@@ -398,7 +404,7 @@ App.WizardStep3Controller = Em.Controller.extend({
host: host,
didInsertElement: function () {
var self = this;
- var button = $(this.get('element')).find('#textTrigger');
+ var button = $(this.get('element')).find('.textTrigger');
button.click(function () {
if(self.get('isTextArea')){
$(this).text('click to highlight');
@@ -428,7 +434,7 @@ App.WizardStep3Controller = Em.Controller.extend({
element.select();
element.css('resize', 'none');
},
- disabled: true,
+ readOnly: true,
value: function(){
return this.get('content');
}.property('content')
@@ -211,7 +211,7 @@ App.WizardStep9Controller = Em.Controller.extend({
var method = 'PUT';
if (App.testMode) {
- debugger;
+ //debugger;
url = '/data/wizard/deploy/poll_6.json';
method = 'GET';
this.numPolls = 6;
@@ -617,7 +617,7 @@ module.exports =
"isVisible": true,
"filename": "core-site.xml",
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1057,7 +1057,7 @@ module.exports =
"displayType": "advanced",
"isVisible": false,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1069,7 +1069,7 @@ module.exports =
"displayType": "advanced",
"isVisible": false,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1638,7 +1638,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1650,7 +1650,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1662,7 +1662,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1674,7 +1674,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1686,7 +1686,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1698,7 +1698,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1710,7 +1710,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1746,7 +1746,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1782,7 +1782,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1794,7 +1794,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -1806,7 +1806,7 @@ module.exports =
"displayType": "user",
"isVisible": true,
"serviceName": "MISC",
- "category": "Users/Groups"
+ "category": "Users and Groups"
},
{
"id": "puppet var",
@@ -107,8 +107,8 @@ module.exports = [
serviceName: 'MISC',
displayName: 'Misc',
configCategories: [
- App.ServiceConfigCategory.create({ name: 'General'}),
- App.ServiceConfigCategory.create({ name: 'Users/Groups'})
+ // App.ServiceConfigCategory.create({ name: 'General'}),
+ App.ServiceConfigCategory.create({ name: 'Users and Groups'})
],
configs: configProperties.filterProperty('serviceName', 'MISC')
}
@@ -37,7 +37,8 @@ Em.I18n.translations = {
'services.zookeeper.description':'ZooKeeper desc',
'services.hbase.description':'Non-relational distributed database and centralized service for configuration management & synchronization',
- 'topnav.help.href':'http://incubator.apache.org/ambari/install.html',
+ 'topnav.logo.href':'http://incubator.apache.org/ambari/',
+ 'topnav.help.href':'https://cwiki.apache.org/confluence/display/AMBARI/Ambari',
'installer.header':'Cluster Install Wizard',
'installer.navigation.warning.header':'Navigation Warning',
@@ -59,9 +59,9 @@ App.Host = DS.Model.extend({
}.property('lastHeartBeatTime'),
loadAvg: function() {
- if (this.get('loadOne') != null) return this.get('loadOne');
- if (this.get('loadFive') != null) return this.get('loadFive');
- if (this.get('loadFifteen') != null) return this.get('loadFifteen');
+ if (this.get('loadOne') != null) return this.get('loadOne').toFixed(2);
+ if (this.get('loadFive') != null) return this.get('loadFive').toFixed(2);
+ if (this.get('loadFifteen') != null) return this.get('loadFifteen').toFixed(2);
}.property('loadOne', 'loadFive', 'loadFifteen'),
updateHostStatus: function(){
@@ -24,15 +24,33 @@ module.exports = Em.Route.extend({
Ember.run.next(function () {
var addHostController = router.get('addHostController');
+ App.ModalPopup.show({
+ classNames: ['full-width-modal'],
+ header:Em.I18n.t('hosts.add.header'),
+ bodyClass: App.AddHostView.extend({
+ controllerBinding: 'App.router.addHostController'
+ }),
+ primary:Em.I18n.t('form.cancel'),
+ secondary: null,
+
+ onPrimary:function () {
+ this.hide();
+ router.transitionTo('hosts.index');
+ },
+ onClose: function() {
+ this.hide();
+ router.transitionTo('hosts.index');
+ }
+ });
router.transitionTo('step' + addHostController.get('currentStep'));
});
},
- connectOutlets: function (router, context) {
+ /*connectOutlets: function (router, context) {
console.log('in /hosts/add:connectOutlets');
router.get('mainController').connectOutlet('addHost');
- },
+ },*/
step1: Em.Route.extend({
route: '/step1',
@@ -221,9 +239,10 @@ module.exports = Em.Route.extend({
if (true) { // this function will be moved to installerController where it will validate
var addHostController = router.get('addHostController');
addHostController.finish();
- router.transitionTo('hosts');
+ $(context.currentTarget).parents("#modal").find(".close").trigger('click');
} else {
console.log('cluster installation failure');
+ //$(context.currentTarget).parents("#modal").find(".close").trigger('click');
}
}
}),
@@ -24,6 +24,24 @@ module.exports = Em.Route.extend({
if (App.db.getUser().admin) {
Em.run.next(function () {
var addServiceController = router.get('addServiceController');
+ App.ModalPopup.show({
+ classNames: ['full-width-modal'],
+ header:Em.I18n.t('services.add.header'),
+ bodyClass: App.AddServiceView.extend({
+ controllerBinding: 'App.router.addServiceController'
+ }),
+ primary:Em.I18n.t('form.cancel'),
+ secondary: null,
+
+ onPrimary:function () {
+ this.hide();
+ App.router.transitionTo('main.services');
+ },
+ onClose: function() {
+ this.hide();
+ App.router.transitionTo('main.services')
+ }
+ });
router.transitionTo('step' + addServiceController.get('currentStep'));
});
} else {
@@ -34,10 +52,10 @@ module.exports = Em.Route.extend({
},
- connectOutlets: function (router) {
+ /*connectOutlets: function (router) {
console.log('in /service/add:connectOutlets');
router.get('mainController').connectOutlet('addService');
- },
+ },*/
step1: Em.Route.extend({
route: '/step1',
@@ -221,7 +239,7 @@ module.exports = Em.Route.extend({
complete: function (router, context) {
if (true) { // this function will be moved to installerController where it will validate
router.get('addServiceController').finish();
- router.transitionTo('services');
+ $(context.currentTarget).parents("#modal").find(".close").trigger('click');
}
}
}),
Oops, something went wrong.

0 comments on commit 26429c0

Please sign in to comment.