瀏覽代碼

Revert "AMBARI-3632. Need ability to remove hbase master (xiwang)"

This reverts commit 0dba52dfc703f44b440945edfd9d2d62f2303735.
Srimanth Gunturi 11 年之前
父節點
當前提交
621079d13d

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

@@ -156,60 +156,10 @@ App.MainHostDetailsController = Em.Controller.extend({
       } else {
         App.router.get('clusterController').loadUpdatedStatusDelayed(500);
       }
-      if (App.router.get('mainAdminUserSettingsController').loadShowBgChecked()) {
-        App.router.get('backgroundOperationsController').showPopup();
-      }
+      App.router.get('backgroundOperationsController').showPopup();
     });
   },
 
-  /**
-   * send command to server to delete selected host component
-   *
-   */
-  deleteComponent: function (event) {
-    var self = this;
-    var component = event.context;
-    var componentName = component.get('componentName').toUpperCase().toString();
-    var displayName = component.get('displayName');
-    var numberOfComponents = 0;
-    var isLastComponent = false;
-    var allComponents = component.get('service.hostComponents');
-    allComponents.forEach(function(component) {
-      if (component.get('componentName') == componentName) numberOfComponents++;
-      if (numberOfComponents > 1) return;
-    });
-    if (numberOfComponents == 1) {
-      isLastComponent = true;
-    }
-    App.ModalPopup.show({
-      header: Em.I18n.t('popup.confirmation.commonHeader'),
-      bodyClass: Ember.View.extend({
-        templateName: require('templates/main/host/details/deleteComponentPopup')
-      }),
-      enablePrimary: false,
-      lastComponent: function() {
-        if (isLastComponent) {
-          this.set('enablePrimary',false);
-          return true;
-        } else {
-          this.set('enablePrimary',true);
-          return false;
-        }
-      }.property(),
-      lastComponentError:  Em.View.extend({
-        template: Ember.Handlebars.compile(Em.I18n.t('hosts.host.deleteComponent.popup.warning').format(displayName))
-      }),
-      deleteComponentMsg: function() {
-        return Em.I18n.t('hosts.host.deleteComponent.popup.msg').format(displayName);
-      }.property(),
-      onPrimary: function () {
-        if (!this.get('enablePrimary')) return;
-        self._doDeleteHostComponent(component);
-        this.hide();
-      },
-    });
-
-  },
   /**
    * Deletes the given host component, or all host components.
    * 
@@ -396,7 +346,7 @@ App.MainHostDetailsController = Em.Controller.extend({
         onPrimary: function () {
           this.hide();
           if (component.get('componentName') === 'CLIENTS') {
-            // Clients component has many sub-components which
+            // Clients component has many sub-components which 
             // need to be installed.
             var scs = component.get('subComponentNames');
             scs.forEach(function (sc) {

+ 0 - 2
ambari-web/app/messages.js

@@ -1276,8 +1276,6 @@ Em.I18n.translations = {
   'host.host.componentFilter.master':'Master Components',
   'host.host.componentFilter.slave':'Slave Components',
   'host.host.componentFilter.client':'Client Components',
-  'hosts.host.deleteComponent.popup.msg':'Are you sure you want to delete {0}?',
-  'hosts.host.deleteComponent.popup.warning':'<b>WARNING!</b> Delete the last <i>{0}</i> component in the cluster?</br>Deleting the last component in the cluster could result in permanent loss of service data.',
   'hosts.host.installComponent.msg':'Are you sure you want to install {0}?',
   'hosts.host.addComponent.msg':'Are you sure you want to add {0}?',
   'hosts.host.addComponent.note':'Note: After this component is installed, go to Services -> Nagios to restart the Nagios service.  This is required for the alerts and notifications to work properly.',

+ 0 - 10
ambari-web/app/styles/application.less

@@ -3016,16 +3016,6 @@ table.graphs {
       font-style: italic;
     }
   }
-
-  .host-components {
-    .dropdown-menu {
-      .disabled {
-        pointer-events: none;
-        color: #808080;
-        cursor: default;
-      }
-    }
-  }
 }
 
 .background-operations {

+ 5 - 12
ambari-web/app/templates/main/host/summary.hbs

@@ -69,11 +69,11 @@
                   <span class="caret pull-right"></span>
                 </a>
                 <ul class="dropdown-menu">
-                  <li>
-                    <div class="component-text-status">
-                      {{view.componentTextStatus}}
-                    </div>
-                  </li>
+                   <li>
+                      <div class="component-text-status">
+                       {{view.componentTextStatus}}
+                      </div>
+                    </li>
                   {{#if view.isDataNode}}
                     {{#if view.isDataNodeDecommissionAvailable}}
                       <li {{bindAttr class="view.noActionAvailable"}}>
@@ -90,13 +90,6 @@
                       </li>
                     {{/if}}
                   {{/if}}
-                  {{#if view.isHBaseMaster}}
-                    <li {{bindAttr class="view.isDeleteHBaseMasterDisabled:disabled"}}>
-                      <a href="javascript:void(null)" data-toggle="modal" {{action "deleteComponent" view.content target="controller"}}>
-                        {{t common.delete}}
-                      </a>
-                    </li>
-                  {{/if}}
                   {{#unless view.isInstalling}}
                     {{#if view.isStart}}
                       <li {{bindAttr class=" view.isDecommissioning:hidden view.noActionAvailable"}}>

+ 1 - 12
ambari-web/app/views/main/host/summary.js

@@ -425,18 +425,7 @@ App.MainHostSummaryView = Em.View.extend({
       var decommissionHostNames = this.get('decommissionDataNodeHostNames');
       var hostName = App.router.get('mainHostDetailsController.content.hostName');
       return decommissionHostNames != null && decommissionHostNames.contains(hostName);
-    }.property('App.router.mainHostDetailsController.content', 'decommissionDataNodeHostNames'),
-
-    /**
-     * Shows whether we need to show Delete button
-     */
-    isHBaseMaster: function () {
-      return this.get('content.componentName') === 'HBASE_MASTER';
-    }.property('content'),
-    isDeleteHBaseMasterDisabled: function () {
-      return !(this.get('workStatus') == App.HostComponentStatus.stopped || this.get('workStatus') == App.HostComponentStatus.unknown ||
-        this.get('workStatus') == App.HostComponentStatus.install_failed || this.get('workStatus') == App.HostComponentStatus.upgrade_failed);
-    }.property('workStatus'),
+    }.property('App.router.mainHostDetailsController.content', 'decommissionDataNodeHostNames')
 
   }),
   timeSinceHeartBeat: function () {