Updated Branches: refs/heads/trunk 157ad266a -> 799ff9165
AMBARI-2756. NameNode HA Wizard: Admin > High Availability page and wizard skeleton with basic routing. (Aleksandr Kovalenko via yusaku) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/799ff916 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/799ff916 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/799ff916 Branch: refs/heads/trunk Commit: 799ff9165295372af7d916179f567d0386053634 Parents: 157ad26 Author: Yusaku Sako <[email protected]> Authored: Tue Jul 30 13:31:32 2013 -0700 Committer: Yusaku Sako <[email protected]> Committed: Tue Jul 30 13:31:32 2013 -0700 ---------------------------------------------------------------------- ambari-web/app/config.js | 3 +- ambari-web/app/controllers.js | 6 + .../admin/highAvailability/step1_controller.js | 22 ++++ .../admin/highAvailability/step2_controller.js | 22 ++++ .../admin/highAvailability/step3_controller.js | 22 ++++ .../admin/highAvailability/step4_controller.js | 22 ++++ .../admin/highAvailability/wizard_controller.js | 79 ++++++++++++ .../main/admin/highAvailability_controller.js | 27 ++++ ambari-web/app/messages.js | 10 ++ .../app/routes/high_availability_routes.js | 126 +++++++++++++++++++ ambari-web/app/routes/main.js | 9 ++ .../templates/main/admin/highAvailability.hbs | 30 +++++ .../main/admin/highAvailability/step1.hbs | 22 ++++ .../main/admin/highAvailability/step2.hbs | 22 ++++ .../main/admin/highAvailability/step3.hbs | 22 ++++ .../main/admin/highAvailability/step4.hbs | 22 ++++ .../main/admin/highAvailability/wizard.hbs | 41 ++++++ ambari-web/app/utils/db.js | 3 +- ambari-web/app/views.js | 6 + ambari-web/app/views/main/admin.js | 7 ++ .../main/admin/highAvailability/step1_view.js | 26 ++++ .../main/admin/highAvailability/step2_view.js | 26 ++++ .../main/admin/highAvailability/step3_view.js | 26 ++++ .../main/admin/highAvailability/step4_view.js | 26 ++++ .../main/admin/highAvailability/wizard_view.js | 46 +++++++ .../views/main/admin/highAvailability_view.js | 26 ++++ 26 files changed, 697 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js index b96b08d..5fbcf97 100644 --- a/ambari-web/app/config.js +++ b/ambari-web/app/config.js @@ -56,7 +56,8 @@ App.supports = { customizeSmokeTestUser: true, hue: false, ldapGroupMapping: false, - localRepositories: false + localRepositories: false, + highAvailability: false }; if (App.enableExperimental) { http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/controllers.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js index b0a02b7..5cb8dea 100644 --- a/ambari-web/app/controllers.js +++ b/ambari-web/app/controllers.js @@ -26,6 +26,12 @@ require('controllers/installer'); require('controllers/global/background_operations_controller'); require('controllers/main'); require('controllers/main/admin'); +require('controllers/main/admin/highAvailability_controller'); +require('controllers/main/admin/highAvailability/wizard_controller'); +require('controllers/main/admin/highAvailability/step1_controller'); +require('controllers/main/admin/highAvailability/step2_controller'); +require('controllers/main/admin/highAvailability/step3_controller'); +require('controllers/main/admin/highAvailability/step4_controller'); require('controllers/main/admin/cluster'); require('controllers/main/admin/stack_upgrade_controller'); require('controllers/main/admin/user'); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/controllers/main/admin/highAvailability/step1_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/step1_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/step1_controller.js new file mode 100644 index 0000000..72697e5 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/highAvailability/step1_controller.js @@ -0,0 +1,22 @@ +/** + * 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.HighAvailabilityWizardStep1Controller = Em.Controller.extend(); + http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/controllers/main/admin/highAvailability/step2_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/step2_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/step2_controller.js new file mode 100644 index 0000000..fcc0c14 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/highAvailability/step2_controller.js @@ -0,0 +1,22 @@ +/** + * 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.HighAvailabilityWizardStep2Controller = Em.Controller.extend(); + http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/controllers/main/admin/highAvailability/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/step3_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/step3_controller.js new file mode 100644 index 0000000..7e59574 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/highAvailability/step3_controller.js @@ -0,0 +1,22 @@ +/** + * 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.HighAvailabilityWizardStep3Controller = Em.Controller.extend(); + http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/controllers/main/admin/highAvailability/step4_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/step4_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/step4_controller.js new file mode 100644 index 0000000..48dbc75 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/highAvailability/step4_controller.js @@ -0,0 +1,22 @@ +/** + * 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.HighAvailabilityWizardStep4Controller = Em.Controller.extend(); + http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js new file mode 100644 index 0000000..b9afa6d --- /dev/null +++ b/ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js @@ -0,0 +1,79 @@ +/** + * 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.HighAvailabilityWizardController = App.WizardController.extend({ + + name: 'highAvailabilityWizardController', + + totalSteps: 4, + + /** + * Used for hiding back button in wizard + */ + hideBackButton: true, + + content: Em.Object.create({ + controllerName: 'highAvailabilityWizardController' + }), + + /** + * return new object extended from clusterStatusTemplate + * @return Object + */ + getCluster: function(){ + return jQuery.extend({}, this.get('clusterStatusTemplate'), {name: App.router.getClusterName()}); + }, + + /** + * Load data for all steps until <code>current step</code> + */ + loadAllPriorSteps: function () { + var step = this.get('currentStep'); + switch (step) { + case '4': + case '3': + case '2': + case '1': + this.load('cluster'); + } + }, + + /** + * Remove all loaded data. + * Created as copy for App.router.clearAllSteps + */ + clearAllSteps: function () { + this.clearInstallOptions(); + // clear temporary information stored during the install + this.set('content.cluster', this.getCluster()); + }, + + /** + * Clear all temporary data + */ + finish: function () { + this.setCurrentStep('1'); + this.clearAllSteps(); + this.clearStorageData(); + App.router.get('updateController').updateAll(); + } + +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/controllers/main/admin/highAvailability_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability_controller.js b/ambari-web/app/controllers/main/admin/highAvailability_controller.js new file mode 100644 index 0000000..50ec0ca --- /dev/null +++ b/ambari-web/app/controllers/main/admin/highAvailability_controller.js @@ -0,0 +1,27 @@ +/** + * 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.MainAdminHighAvailabilityController = Em.Controller.extend({ + name:'mainAdminHighAvailabilityController', + + enableHighAvailability: function () { + App.router.transitionTo('enableHighAvailability'); + } +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 38844ab..9f7471c 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -632,6 +632,16 @@ Em.I18n.translations = { 'admin.authentication.form.test.success':'The configuration passes the test', 'admin.authentication.form.test.fail':'The configuration fails the test', + 'admin.highAvailability':' High Availability', + 'admin.highAvailability.button.enable':'Enable NameNode HA', + 'admin.highAvailability.disabled':'NameNode HA is disabled', + 'admin.highAvailability.enabled':'NameNode HA is enabled', + 'admin.highAvailability.wizard.header':'Enable NameNode HA Wizard', + 'admin.highAvailability.wizard.step1.header':'Get Started', + 'admin.highAvailability.wizard.step2.header':'Select Hosts', + 'admin.highAvailability.wizard.step3.header':'Review', + 'admin.highAvailability.wizard.step4.header':'Apply', + 'admin.security.title':'Kerberos Security has not been enabled on this cluster.', 'admin.security.enabled': 'Kerberos security is enabled on the cluster', 'admin.security.disabled': 'Kerberos security is disabled on the cluster', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/routes/high_availability_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/high_availability_routes.js b/ambari-web/app/routes/high_availability_routes.js new file mode 100644 index 0000000..59dfa93 --- /dev/null +++ b/ambari-web/app/routes/high_availability_routes.js @@ -0,0 +1,126 @@ +/** + * 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. + */ + +module.exports = Em.Route.extend({ + route: '/highAvailability/enable', + + enter: function (router) { + Em.run.next(function () { + var highAvailabilityWizardController = router.get('highAvailabilityWizardController'); + App.router.get('updateController').set('isWorking', false); + App.ModalPopup.show({ + classNames: ['full-width-modal'], + header: Em.I18n.t('admin.highAvailability.wizard.header'), + bodyClass: App.HighAvailabilityWizardView.extend({ + controller: highAvailabilityWizardController + }), + primary: Em.I18n.t('form.cancel'), + showFooter: false, + secondary: null, + + onClose: function () { + this.hide(); + App.router.get('updateController').set('isWorking', true); + App.router.transitionTo('main.admin.adminHighAvailability') + }, + didInsertElement: function () { + this.fitHeight(); + } + }); + router.transitionTo('step1'); + }); + }, + + step1: Em.Route.extend({ + route: '/step1', + connectOutlets: function (router) { + var controller = router.get('highAvailabilityWizardController'); + controller.setCurrentStep('1'); + controller.dataLoading().done(function () { + controller.loadAllPriorSteps(); + controller.connectOutlet('highAvailabilityWizardStep1'); + }) + }, + next: function (router) { + router.transitionTo('step2'); + } + }), + + step2: Em.Route.extend({ + route: '/step2', + connectOutlets: function (router) { + var controller = router.get('highAvailabilityWizardController'); + controller.setCurrentStep('2'); + controller.dataLoading().done(function () { + controller.loadAllPriorSteps(); + controller.connectOutlet('highAvailabilityWizardStep2'); + }) + }, + next: function (router) { + router.transitionTo('step3'); + }, + back: function (router) { + router.transitionTo('step1'); + } + }), + + step3: Em.Route.extend({ + route: '/step3', + connectOutlets: function (router) { + var controller = router.get('highAvailabilityWizardController'); + controller.setCurrentStep('3'); + controller.dataLoading().done(function () { + controller.loadAllPriorSteps(); + controller.connectOutlet('highAvailabilityWizardStep3'); + }) + }, + next: function (router) { + router.transitionTo('step4'); + }, + back: function (router) { + router.transitionTo('step2'); + } + }), + + step4: Em.Route.extend({ + route: '/step4', + connectOutlets: function (router) { + var controller = router.get('highAvailabilityWizardController'); + controller.setCurrentStep('4'); + controller.dataLoading().done(function () { + controller.loadAllPriorSteps(); + controller.connectOutlet('highAvailabilityWizardStep4'); + }) + }, + back: function (router) { + router.transitionTo('step3'); + }, + complete: function (router, context) { + $(context.currentTarget).parents("#modal").find(".close").trigger('click'); + router.transitionTo('main.admin.adminHighAvailability'); + } + }), + + gotoStep1: Em.Router.transitionTo('step1'), + + gotoStep2: Em.Router.transitionTo('step2'), + + gotoStep3: Em.Router.transitionTo('step3'), + + gotoStep4: Em.Router.transitionTo('step4') +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/routes/main.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index c911b30..309e7d6 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -647,6 +647,15 @@ module.exports = Em.Route.extend({ } }), + adminHighAvailability: Em.Route.extend({ + route: '/highAvailability', + connectOutlets: function (router) { + router.set('mainAdminController.category', "highAvailability"); + router.get('mainAdminController').connectOutlet('mainAdminHighAvailability'); + } + }), + + enableHighAvailability: require('routes/high_availability_routes'), adminSecurity: Em.Route.extend({ route: '/security', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/templates/main/admin/highAvailability.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability.hbs b/ambari-web/app/templates/main/admin/highAvailability.hbs new file mode 100644 index 0000000..e9199c3 --- /dev/null +++ b/ambari-web/app/templates/main/admin/highAvailability.hbs @@ -0,0 +1,30 @@ +{{! +* 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> + {{#if view.isHighAvailabilityEnabled}} + <p class="text-success"> + {{t admin.highAvailability.enabled}} + </p> + {{else}} + <p class="muted"> + {{t admin.highAvailability.disabled}} + <a class="btn btn-padding btn-success" {{action enableHighAvailability target="controller"}}>{{t admin.highAvailability.button.enable}}</a> + </p> + {{/if}} +</div> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/templates/main/admin/highAvailability/step1.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability/step1.hbs b/ambari-web/app/templates/main/admin/highAvailability/step1.hbs new file mode 100644 index 0000000..def086c --- /dev/null +++ b/ambari-web/app/templates/main/admin/highAvailability/step1.hbs @@ -0,0 +1,22 @@ +{{! +* 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. +}} + +<h2>{{t admin.highAvailability.wizard.step1.header}}</h2> +<div class="btn-area"> + <a class="btn btn-success pull-right" {{action next}}>{{t common.next}} →</a> +</div> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/templates/main/admin/highAvailability/step2.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability/step2.hbs b/ambari-web/app/templates/main/admin/highAvailability/step2.hbs new file mode 100644 index 0000000..8c94c3a --- /dev/null +++ b/ambari-web/app/templates/main/admin/highAvailability/step2.hbs @@ -0,0 +1,22 @@ +{{! +* 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. +}} + +<h2>{{t admin.highAvailability.wizard.step2.header}}</h2> +<div class="btn-area"> + <a class="btn btn-success pull-right" {{action next}}>{{t common.next}} →</a> +</div> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/templates/main/admin/highAvailability/step3.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability/step3.hbs b/ambari-web/app/templates/main/admin/highAvailability/step3.hbs new file mode 100644 index 0000000..d640e68 --- /dev/null +++ b/ambari-web/app/templates/main/admin/highAvailability/step3.hbs @@ -0,0 +1,22 @@ +{{! +* 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. +}} + +<h2>{{t admin.highAvailability.wizard.step3.header}}</h2> +<div class="btn-area"> + <a class="btn btn-success pull-right" {{action next}}>{{t common.next}} →</a> +</div> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/templates/main/admin/highAvailability/step4.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability/step4.hbs b/ambari-web/app/templates/main/admin/highAvailability/step4.hbs new file mode 100644 index 0000000..e2558e4 --- /dev/null +++ b/ambari-web/app/templates/main/admin/highAvailability/step4.hbs @@ -0,0 +1,22 @@ +{{! +* 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. +}} + +<h2>{{t admin.highAvailability.wizard.step4.header}}</h2> +<div class="btn-area"> + <a class="btn btn-success pull-right" {{action complete}}>{{t common.complete}}</a> +</div> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs b/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs new file mode 100644 index 0000000..e5ad773 --- /dev/null +++ b/ambari-web/app/templates/main/admin/highAvailability/wizard.hbs @@ -0,0 +1,41 @@ +{{! +* 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 class="wizard"> + <div class="container"> + <div class="container-fluid"> + <div class="row-fluid"> + <div class="span3"> + <!--Sidebar content--> + <div class="well"> + <ul class="nav nav-pills nav-stacked"> + <li class="nav-header">{{t admin.highAvailability.wizard.header}}</li> + <li {{bindAttr class="isStep1:active view.isStep1Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep1 target="controller"}}>{{t admin.highAvailability.wizard.step1.header}}</a></li> + <li {{bindAttr class="isStep2:active view.isStep2Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep2 target="controller"}}>{{t admin.highAvailability.wizard.step2.header}}</a></li> + <li {{bindAttr class="isStep3:active view.isStep3Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep3 target="controller"}}>{{t admin.highAvailability.wizard.step3.header}}</a></li> + <li {{bindAttr class="isStep4:active view.isStep4Disabled:disabled"}}><a href="javascript:void(null);" {{action gotoStep4 target="controller"}}>{{t admin.highAvailability.wizard.step4.header}}</a></li> + </ul> + </div> + </div> + <div class="wizard-content well span9"> + {{outlet}} + </div> + </div> + </div> + </div> +</div> http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/utils/db.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js index 2f0c8fc..6579bfb 100644 --- a/ambari-web/app/utils/db.js +++ b/ambari-web/app/utils/db.js @@ -63,7 +63,8 @@ App.db.cleanUp = function () { 'AddService' : {}, 'StackUpgrade' : {}, 'ReassignMaster' : {}, - 'AddSecurity': {} + 'AddSecurity': {}, + 'HighAvailability': {} }; console.log("In cleanup./.."); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/views.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js index 45664c8..74af7a0 100644 --- a/ambari-web/app/views.js +++ b/ambari-web/app/views.js @@ -53,6 +53,12 @@ require('views/main/host/metrics/memory'); require('views/main/host/metrics/network'); require('views/main/host/metrics/processes'); require('views/main/admin'); +require('views/main/admin/highAvailability_view'); +require('views/main/admin/highAvailability/wizard_view'); +require('views/main/admin/highAvailability/step1_view'); +require('views/main/admin/highAvailability/step2_view'); +require('views/main/admin/highAvailability/step3_view'); +require('views/main/admin/highAvailability/step4_view'); require('views/main/admin/cluster'); require('views/main/admin/misc_view'); require('views/main/admin/stack_upgrade'); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/views/main/admin.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin.js b/ambari-web/app/views/main/admin.js index 4b9dbf6..0d6ec6c 100644 --- a/ambari-web/app/views/main/admin.js +++ b/ambari-web/app/views/main/admin.js @@ -27,6 +27,13 @@ App.MainAdminView = Em.View.extend({ url: 'adminUser', label: Em.I18n.t('common.users') }]; + if (App.get('isHadoop2Stack') && App.supports.highAvailability) { + items.push({ + name: 'highAvailability', + url: 'adminHighAvailability', + label: Em.I18n.t('admin.highAvailability') + }); + } if (App.supports.secureCluster) { items.push({ name: 'security', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/views/main/admin/highAvailability/step1_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/step1_view.js b/ambari-web/app/views/main/admin/highAvailability/step1_view.js new file mode 100644 index 0000000..e0a30d8 --- /dev/null +++ b/ambari-web/app/views/main/admin/highAvailability/step1_view.js @@ -0,0 +1,26 @@ +/** + * 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.HighAvailabilityWizardStep1View = Em.View.extend({ + + templateName: require('templates/main/admin/highAvailability/step1') + +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/views/main/admin/highAvailability/step2_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/step2_view.js b/ambari-web/app/views/main/admin/highAvailability/step2_view.js new file mode 100644 index 0000000..334f7de --- /dev/null +++ b/ambari-web/app/views/main/admin/highAvailability/step2_view.js @@ -0,0 +1,26 @@ +/** + * 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.HighAvailabilityWizardStep2View = Em.View.extend({ + + templateName: require('templates/main/admin/highAvailability/step2') + +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/views/main/admin/highAvailability/step3_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/step3_view.js b/ambari-web/app/views/main/admin/highAvailability/step3_view.js new file mode 100644 index 0000000..1f06988 --- /dev/null +++ b/ambari-web/app/views/main/admin/highAvailability/step3_view.js @@ -0,0 +1,26 @@ +/** + * 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.HighAvailabilityWizardStep3View = Em.View.extend({ + + templateName: require('templates/main/admin/highAvailability/step3') + +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/views/main/admin/highAvailability/step4_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/step4_view.js b/ambari-web/app/views/main/admin/highAvailability/step4_view.js new file mode 100644 index 0000000..8a23018 --- /dev/null +++ b/ambari-web/app/views/main/admin/highAvailability/step4_view.js @@ -0,0 +1,26 @@ +/** + * 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.HighAvailabilityWizardStep4View = Em.View.extend({ + + templateName: require('templates/main/admin/highAvailability/step4') + +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/views/main/admin/highAvailability/wizard_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability/wizard_view.js b/ambari-web/app/views/main/admin/highAvailability/wizard_view.js new file mode 100644 index 0000000..3b3b739 --- /dev/null +++ b/ambari-web/app/views/main/admin/highAvailability/wizard_view.js @@ -0,0 +1,46 @@ +/** + * 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.HighAvailabilityWizardView = Em.View.extend({ + + templateName: require('templates/main/admin/highAvailability/wizard'), + + isStep1Disabled: function () { + return this.isStepDisabled(1); + }.property('[email protected]').cacheable(), + + isStep2Disabled: function () { + return this.isStepDisabled(2); + }.property('[email protected]').cacheable(), + + isStep3Disabled: function () { + return this.isStepDisabled(3); + }.property('[email protected]').cacheable(), + + isStep4Disabled: function () { + return this.isStepDisabled(4); + }.property('[email protected]').cacheable(), + + isStepDisabled: function (index) { + return this.get('controller.isStepDisabled').findProperty('step', index).get('value'); + } + +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/799ff916/ambari-web/app/views/main/admin/highAvailability_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/highAvailability_view.js b/ambari-web/app/views/main/admin/highAvailability_view.js new file mode 100644 index 0000000..152b042 --- /dev/null +++ b/ambari-web/app/views/main/admin/highAvailability_view.js @@ -0,0 +1,26 @@ +/** + * 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.MainAdminHighAvailabilityView = Em.View.extend({ + templateName: require('templates/main/admin/highAvailability'), + + isHighAvailabilityEnabled: false //todo: real check + +});
