Manage JournalNode Wizard: Link Add/Delete operation for JournalNode to the wizard (rzang)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8281cc14 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8281cc14 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8281cc14 Branch: refs/heads/branch-feature-AMBARI-18634 Commit: 8281cc140b50445c596d48e39edd8d759e4677ac Parents: 12a6036 Author: Richard Zang <[email protected]> Authored: Tue Nov 8 11:30:02 2016 -0800 Committer: Richard Zang <[email protected]> Committed: Tue Nov 8 11:35:36 2016 -0800 ---------------------------------------------------------------------- ambari-web/app/config.js | 2 +- ambari-web/app/controllers/main/host/details.js | 20 ++++++++++++++++---- ambari-web/app/messages.js | 2 ++ .../app/models/stack_service_component.js | 4 +++- .../main/host/details/deleteComponentPopup.hbs | 3 +++ .../main/host/details/host_component_view.js | 6 +++++- 6 files changed, 30 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/8281cc14/ambari-web/app/config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js index 03357ed..8886f49 100644 --- a/ambari-web/app/config.js +++ b/ambari-web/app/config.js @@ -88,7 +88,7 @@ App.supports = { addingNewRepository: false, kerberosStackAdvisor: true, logCountVizualization: false, - manageJournalNode: false + manageJournalNode: true }; if (App.enableExperimental) { http://git-wip-us.apache.org/repos/asf/ambari/blob/8281cc14/ambari-web/app/controllers/main/host/details.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js index 6851cbd..ec9a73f 100644 --- a/ambari-web/app/controllers/main/host/details.js +++ b/ambari-web/app/controllers/main/host/details.js @@ -317,7 +317,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow var isLastComponent = (this.getTotalComponent(component) === 1); return App.ModalPopup.show({ header: Em.I18n.t('popup.confirmation.commonHeader'), - primary: Em.I18n.t('hosts.host.deleteComponent.popup.confirm'), + primary: componentName == 'JOURNALNODE'? Em.I18n.t('ok') : Em.I18n.t('hosts.host.deleteComponent.popup.confirm'), bodyClass: Em.View.extend({ templateName: require('templates/main/host/details/deleteComponentPopup') }), @@ -326,6 +326,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow isNimbus: componentName == 'NIMBUS', isRangerKMSServer: componentName == 'RANGER_KMS_SERVER', isZkServer: componentName == 'ZOOKEEPER_SERVER', + isJournalNode: componentName == 'JOURNALNODE', deleteHiveMetastoreMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteHiveMetastore'), deleteWebHCatServerMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteWebHCatServer'), @@ -334,6 +335,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow lastComponentError: Em.I18n.t('hosts.host.deleteComponent.popup.warning').format(displayName), deleteComponentMsg: Em.I18n.t('hosts.host.deleteComponent.popup.msg1').format(displayName), deleteZkServerMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteZooKeeperServer'), + deleteJournalNodeMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteJournalNodeMsg'), isChecked: false, disablePrimary: Em.computed.not('isChecked'), @@ -344,10 +346,15 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow onPrimary: function () { var popup = this; - self._doDeleteHostComponent(component, function () { - self.set('redrawComponents', true); + if (componentName == 'JOURNALNODE') { popup.hide(); - }); + App.router.transitionTo('main.services.manageJournalNode'); + } else { + self._doDeleteHostComponent(component, function () { + self.set('redrawComponents', true); + popup.hide(); + }); + } } }); }, @@ -598,6 +605,11 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow self.loadConfigs("loadRangerConfigs"); }, Em.I18n.t('hosts.host.addComponent.' + componentName) + manualKerberosWarning); break; + case 'JOURNALNODE': + returnFunc = App.showConfirmationPopup(function () { + App.router.transitionTo('main.services.manageJournalNode'); + }, Em.I18n.t('hosts.host.addComponent.' + componentName) + manualKerberosWarning); + break; default: returnFunc = this.addClientComponent(component, isManualKerberos); } http://git-wip-us.apache.org/repos/asf/ambari/blob/8281cc14/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 1f113c8..e707576 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -2643,6 +2643,7 @@ Em.I18n.translations = { 'hosts.host.deleteComponent.popup.msg1':'Are you sure you want to delete {0}?', 'hosts.host.deleteComponent.popup.deleteZooKeeperServer':'Deleting <i>ZooKeeper Server</i> may reconfigure such properties:<ul><li>zookeeper.connect</li><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li><li>hive.zookeeper.quorum</li><li>hive.cluster.delegation.token.store.zookeeper.connectString</li><li>storm.zookeeper.servers</li><li>instance.zookeeper.host</li></ul>', 'hosts.host.deleteComponent.popup.deleteRangerKMSServer': 'Deleting <i>Ranger KMS Server</i> may reconfigure such properties:<ul><li>hadoop.security.key.provider.path</li><li>dfs.encryption.key.provider.uri</li>', + 'hosts.host.deleteComponent.popup.deleteJournalNodeMsg': 'You are about to open <i>Manage Journal Node Wizard</i>. Are you sure?', '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.deleteComponent.popup.confirm':'Confirm Delete', 'hosts.host.installComponent.popup.confirm':'Confirm Install', @@ -2678,6 +2679,7 @@ Em.I18n.translations = { 'hosts.host.decommissioning':'Decommissioning', 'hosts.host.addComponent.HIVE_METASTORE':'Adding <i>Hive Metastore</i> will reconfigure such properties:<ul><li>hive.metastore.uris</li><li>templeton.hive.properties</li></ul>', 'hosts.host.addComponent.WEBHCAT_SERVER':'You are about to add <i>WebHCat Server</i>. Are you sure?', + 'hosts.host.addComponent.JOURNALNODE': 'You are about to open <i>Manage Journal Node Wizard</i>. Are you sure?', 'hosts.host.deleteComponent.popup.deleteHiveMetastore':'Deleting <i>Hive Metastore</i> will reconfigure such properties:<ul><li>hive.metastore.uris</li><li>templeton.hive.properties</li></ul>', 'hosts.host.deleteComponent.popup.deleteWebHCatServer':'You are about to delete <i>WebHCat Server</i>. Are you sure?', 'hosts.host.configs.save.note': 'This configuration is created by ambari while installing/deleting {0} component on a host', http://git-wip-us.apache.org/repos/asf/ambari/blob/8281cc14/ambari-web/app/models/stack_service_component.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js index 17c2aa1..eb6f2db 100644 --- a/ambari-web/app/models/stack_service_component.js +++ b/ambari-web/app/models/stack_service_component.js @@ -97,7 +97,9 @@ App.StackServiceComponent = DS.Model.extend({ /** @property {Boolean} isAddableToHost - component can be added on host details page **/ isAddableToHost: function() { - return this.get('isMasterAddableInstallerWizard') || ((this.get('isNotAddableOnlyInInstall') || this.get('isSlave') || this.get('isClient')) && !this.get('isHAComponentOnly')); + return this.get('isMasterAddableInstallerWizard') + || ((this.get('isNotAddableOnlyInInstall') || this.get('isSlave') || this.get('isClient')) + && (!this.get('isHAComponentOnly') || (App.get('isHaEnabled') && this.get('componentName') == 'JOURNALNODE'))); }.property('componentName'), /** @property {Boolean} isDeletable - component supports delete action **/ http://git-wip-us.apache.org/repos/asf/ambari/blob/8281cc14/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs b/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs index 0a86aaf..14a585d 100644 --- a/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs +++ b/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs @@ -38,3 +38,6 @@ {{#if isRangerKMSServer}} <div class='alert alert-warning'>{{{deleteRangerKMSServereMsg}}}</div> {{/if}} +{{#if isJournalNode}} + <div class='alert alert-warning'>{{{deleteJournalNodeMsg}}}</div> +{{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/8281cc14/ambari-web/app/views/main/host/details/host_component_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/details/host_component_view.js b/ambari-web/app/views/main/host/details/host_component_view.js index b61f8d4..b5ea711 100644 --- a/ambari-web/app/views/main/host/details/host_component_view.js +++ b/ambari-web/app/views/main/host/details/host_component_view.js @@ -199,7 +199,11 @@ App.HostComponentView = Em.View.extend({ return false; else return true; - } + } + if (this.get('hostComponent.componentName') == 'JOURNALNODE') { + var count_JN = App.HostComponent.find().filterProperty('componentName', 'JOURNALNODE').get('length'); + return count_JN <= 3; // TODO get 3 from stack + } return (installedCount <= stackComponentCount) || ![App.HostComponentStatus.stopped, App.HostComponentStatus.unknown, App.HostComponentStatus.install_failed, App.HostComponentStatus.upgrade_failed, App.HostComponentStatus.init].contains(this.get('workStatus')); }.property('workStatus'),
