Parcourir la source

AMBARI-2756. NameNode HA Wizard: Admin > High Availability page and wizard skeleton with basic routing. (Aleksandr Kovalenko via yusaku)

Yusaku Sako il y a 12 ans
Parent
commit
799ff91652
26 fichiers modifiés avec 697 ajouts et 2 suppressions
  1. 2 1
      ambari-web/app/config.js
  2. 6 0
      ambari-web/app/controllers.js
  3. 22 0
      ambari-web/app/controllers/main/admin/highAvailability/step1_controller.js
  4. 22 0
      ambari-web/app/controllers/main/admin/highAvailability/step2_controller.js
  5. 22 0
      ambari-web/app/controllers/main/admin/highAvailability/step3_controller.js
  6. 22 0
      ambari-web/app/controllers/main/admin/highAvailability/step4_controller.js
  7. 79 0
      ambari-web/app/controllers/main/admin/highAvailability/wizard_controller.js
  8. 27 0
      ambari-web/app/controllers/main/admin/highAvailability_controller.js
  9. 10 0
      ambari-web/app/messages.js
  10. 126 0
      ambari-web/app/routes/high_availability_routes.js
  11. 9 0
      ambari-web/app/routes/main.js
  12. 30 0
      ambari-web/app/templates/main/admin/highAvailability.hbs
  13. 22 0
      ambari-web/app/templates/main/admin/highAvailability/step1.hbs
  14. 22 0
      ambari-web/app/templates/main/admin/highAvailability/step2.hbs
  15. 22 0
      ambari-web/app/templates/main/admin/highAvailability/step3.hbs
  16. 22 0
      ambari-web/app/templates/main/admin/highAvailability/step4.hbs
  17. 41 0
      ambari-web/app/templates/main/admin/highAvailability/wizard.hbs
  18. 2 1
      ambari-web/app/utils/db.js
  19. 6 0
      ambari-web/app/views.js
  20. 7 0
      ambari-web/app/views/main/admin.js
  21. 26 0
      ambari-web/app/views/main/admin/highAvailability/step1_view.js
  22. 26 0
      ambari-web/app/views/main/admin/highAvailability/step2_view.js
  23. 26 0
      ambari-web/app/views/main/admin/highAvailability/step3_view.js
  24. 26 0
      ambari-web/app/views/main/admin/highAvailability/step4_view.js
  25. 46 0
      ambari-web/app/views/main/admin/highAvailability/wizard_view.js
  26. 26 0
      ambari-web/app/views/main/admin/highAvailability_view.js

+ 2 - 1
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) {

+ 6 - 0
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');

+ 22 - 0
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();
+

+ 22 - 0
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();
+

+ 22 - 0
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();
+

+ 22 - 0
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();
+

+ 79 - 0
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();
+  }
+
+});

+ 27 - 0
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');
+  }
+});

+ 10 - 0
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',

+ 126 - 0
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')
+});

+ 9 - 0
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',

+ 30 - 0
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>

+ 22 - 0
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}} &rarr;</a>
+</div>

+ 22 - 0
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}} &rarr;</a>
+</div>

+ 22 - 0
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}} &rarr;</a>
+</div>

+ 22 - 0
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>

+ 41 - 0
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>

+ 2 - 1
ambari-web/app/utils/db.js

@@ -63,7 +63,8 @@ App.db.cleanUp = function () {
     'AddService' : {},
     'StackUpgrade' : {},
     'ReassignMaster' : {},
-    'AddSecurity': {}
+    'AddSecurity': {},
+    'HighAvailability': {}
 
   };
   console.log("In cleanup./..");

+ 6 - 0
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');

+ 7 - 0
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',

+ 26 - 0
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')
+
+});

+ 26 - 0
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')
+
+});

+ 26 - 0
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')
+
+});

+ 26 - 0
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')
+
+});

+ 46 - 0
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('controller.isStepDisabled.@each.value').cacheable(),
+
+  isStep2Disabled: function () {
+    return this.isStepDisabled(2);
+  }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+  isStep3Disabled: function () {
+    return this.isStepDisabled(3);
+  }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+  isStep4Disabled: function () {
+    return this.isStepDisabled(4);
+  }.property('controller.isStepDisabled.@each.value').cacheable(),
+
+  isStepDisabled: function (index) {
+    return this.get('controller.isStepDisabled').findProperty('step', index).get('value');
+  }
+
+});

+ 26 - 0
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
+
+});