This is an automated email from the ASF dual-hosted git repository. vsairam pushed a commit to branch AMBARI-25190-trunk in repository https://gitbox.apache.org/repos/asf/ambari.git
commit 4a2ea5b4dfac8009ea4f0bcbddb84abbf961f0a5 Author: Venkata Sairam <venkatasairam.la...@gmail.com> AuthorDate: Thu Aug 16 17:34:13 2018 +0530 wfm spark name node appending --- .../main/resources/ui/app/components/spark-action.js | 18 ++++++++++++++++++ .../src/main/resources/ui/app/styles/app.less | 3 +++ .../ui/app/templates/components/spark-action.hbs | 7 +++++++ 3 files changed, 28 insertions(+) diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/spark-action.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/spark-action.js index 1a778c4..513b77c 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/spark-action.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/spark-action.js @@ -54,6 +54,7 @@ export default Ember.Component.extend(Validations,{ this.set('isJar', this.get('actionModel.jar') && this.get('actionModel.jar').endsWith('.jar')); this.sendAction('register','sparkAction', this); }.on('init'), + appendNameNode: false, initialize : function(){ this.on('fileSelected',function(fileName){ this.set(this.get('filePathModel'), fileName); @@ -105,6 +106,20 @@ export default Ember.Component.extend(Validations,{ this.$('#collapseOne').collapse('show'); } }.on('didUpdate'), + validateJarPathAndAppend() { + let nameNode = this.get('actionModel.nameNode'), jar = this.get('actionModel.jar'); + if(!jar) { + return; + } + this.toggleProperty('appendNameNode'); + if(!jar.startsWith('${nameNode}') && this.get('appendNameNode')) { + this.set('actionModel.jar', `${nameNode}${jar}`); + } else if(jar.startsWith('${nameNode}') && this.get('appendNameNode')) { + this.set('actionModel.jar', `${jar}`); + } else { + this.set('actionModel.jar', jar.replace('${nameNode}', '')); + } + }, actions : { openFileBrowser(model, context){ if(undefined === context){ @@ -116,6 +131,9 @@ export default Ember.Component.extend(Validations,{ register (name, context){ this.sendAction('register',name , context); }, + appendNamenode() { + this.validateJarPathAndAppend(); + }, onMasterChange (elt){ var value = this.$(elt).val(); if(value !== 'other'){ diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less index 9a35aca..95480d9 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less +++ b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less @@ -1824,4 +1824,7 @@ input:invalid { .note-info { position: relative; top: 10px; +} +.spark-namenode { + top: 15px; } \ No newline at end of file diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/spark-action.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/spark-action.hbs index c8f14d3..bebe3d3 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/spark-action.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/spark-action.hbs @@ -49,6 +49,13 @@ </div> {{/if}} <div class="form-group"> + <label for="inputEmail" class="control-label col-xs-2">Append master<span class="requiredField"> *</span></label> + <div class="col-xs-2 spark-namenode"> + <input type="checkbox" name="master" checked={{appendNameNode}} value="other" onchange={{action "appendNamenode" value="target"}}> + </div> + </div> + + <div class="form-group"> <label for="inputEmail" class="control-label col-xs-2">Runs On<span class="requiredField"> *</span></label> {{#each mastersList as |master|}} <div class="col-xs-2">