|
|
@@ -22,7 +22,7 @@
|
|
|
<%namespace name="utils" file="../utils.inc.mako" />
|
|
|
|
|
|
|
|
|
-<%def name="action_form(action_form, node_type, template=True)">
|
|
|
+<%def name="action_form_modal_template(action_form, node_type, template=True)">
|
|
|
% if template:
|
|
|
<script type="text/html" id="${node_type}EditTemplate">
|
|
|
% endif
|
|
|
@@ -35,251 +35,12 @@
|
|
|
|
|
|
<div class="modal-content">
|
|
|
<fieldset class="span12">
|
|
|
- % for field in action_form:
|
|
|
- % if field.html_name in ('name', 'description'):
|
|
|
- ${ utils.render_field_with_error_js(field, field.name, extra_attrs={'data-bind': 'disable: $root.context().read_only, value: %s' % field.name}) }
|
|
|
- % endif
|
|
|
- % endfor
|
|
|
-
|
|
|
- ${ utils.render_constant(_('Action type'), node_type) }
|
|
|
-
|
|
|
- <div class="control-group ">
|
|
|
- <label class="control-label">
|
|
|
- <a href="javascript:void(0);" id="advanced-btn" onclick="$('#node-advanced-container').toggle('hide')">
|
|
|
- <i class="icon-share-alt"></i> ${ _('Advanced') }</a>
|
|
|
- </label>
|
|
|
- <div class="controls"></div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div id="node-advanced-container" class="hide">
|
|
|
- <div class="control-group">
|
|
|
- <label class="control-label">${_('Error link to')}</label>
|
|
|
- <div class="controls">
|
|
|
- <div style="padding-top:4px">
|
|
|
- <select data-bind="options: $root.context().nodes,
|
|
|
- optionsText: function(item) {
|
|
|
- return (item.name()) ? item.name() : item.node_type() + '-' + item.id();
|
|
|
- },
|
|
|
- optionsValue: function(item) {
|
|
|
- return item.id();
|
|
|
- },
|
|
|
- value: $root.context().error_node"></select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <hr/>
|
|
|
-
|
|
|
- <div class="control-group">
|
|
|
- <label class="control-label"></label>
|
|
|
- <div class="controls">
|
|
|
- <p class="alert alert-info span7">
|
|
|
- % if node_type != 'fs':
|
|
|
- ${ _('All the paths are relative to the deployment directory. They can be absolute but this is not recommended.') }
|
|
|
- % else:
|
|
|
- ${ _('All the paths need to be absolute.') }
|
|
|
- % endif
|
|
|
- <br/>
|
|
|
- ${ _('You can parameterize values using case sensitive') } <code>${"${"}parameter}</code>.
|
|
|
- </p>
|
|
|
- % if node_type == 'ssh':
|
|
|
- <p class="alert alert-warn span5">
|
|
|
- ${ _('The SSH server requires passwordless login') }.
|
|
|
- </p>
|
|
|
- % endif
|
|
|
- % if node_type == 'java':
|
|
|
- % if get_oozie().security_enabled:
|
|
|
- <p class="alert alert-warn span5">
|
|
|
- ${ _('The delegation token needs to be propagated from the launcher job to the MR job') }.
|
|
|
- <a href="https://issues.apache.org/jira/browse/OOZIE-1172">OOZIE-1172</a>
|
|
|
- </p>
|
|
|
- % endif
|
|
|
- % endif
|
|
|
- % if node_type == 'email':
|
|
|
- <p class="alert alert-warn span5">
|
|
|
- ${ _('Requires some SMTP server configuration to be present (in oozie-site.xml)') }.
|
|
|
- </p>
|
|
|
- % endif
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- % for field in action_form:
|
|
|
- % if field.html_name not in ('name', 'description', 'node_type', 'job_xml'):
|
|
|
- % if field.html_name in ('capture_output', 'is_single', 'sub_workflow', 'propagate_configuration'):
|
|
|
- ${ utils.render_field_with_error_js(field, field.name, extra_attrs={'data-bind': 'disable: $root.context().read_only, checked: %s' % field.name}) }
|
|
|
- % else:
|
|
|
- ${ utils.render_field_with_error_js(field, field.name, extra_attrs={'data-bind': 'disable: $root.context().read_only, value: %s' % field.name}) }
|
|
|
- % endif
|
|
|
- % endif
|
|
|
- % endfor
|
|
|
-
|
|
|
- % if 'prepares' in action_form.fields:
|
|
|
- <%
|
|
|
- prepares_field(action_form['prepares'], {
|
|
|
- 'name': 'prepares',
|
|
|
- 'add': [
|
|
|
- {'label': _('Add delete'), 'method': 'addPrepareDelete'},
|
|
|
- {'label': _('Add mkdir'), 'method': 'addPrepareMkdir'},
|
|
|
- ],
|
|
|
- 'remove': '$parent.removePrepare.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'params' in action_form.fields:
|
|
|
- % if node_type == 'pig':
|
|
|
- <%
|
|
|
- params_field(action_form['params'], {
|
|
|
- 'name': 'params',
|
|
|
- 'add': [
|
|
|
- {'label': _('Add param'), 'method': 'addParam'},
|
|
|
- {'label': _('Add argument'), 'method': 'addArgument'},
|
|
|
- ],
|
|
|
- 'remove': '$parent.removeParam.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if node_type == 'shell':
|
|
|
- <%
|
|
|
- params_field(action_form['params'], {
|
|
|
- 'name': 'params',
|
|
|
- 'add': [
|
|
|
- {'label': _('Add argument'), 'method': 'addArgument'},
|
|
|
- {'label': _('Add env-var'), 'method': 'addEnvVar'},
|
|
|
- ],
|
|
|
- 'remove': '$parent.removeParam.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if node_type == 'hive':
|
|
|
- <%
|
|
|
- params_field(action_form['params'], {
|
|
|
- 'name': 'params',
|
|
|
- 'add': [
|
|
|
- {'label': _('Add param'), 'method': 'addParam'},
|
|
|
- ],
|
|
|
- 'remove': '$parent.removeParam.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if node_type == 'distcp':
|
|
|
- <%
|
|
|
- params_field(action_form['params'], {
|
|
|
- 'name': 'params',
|
|
|
- 'add': [
|
|
|
- {'label': _('Add argument'), 'method': 'addArgument'},
|
|
|
- ],
|
|
|
- 'remove': '$parent.removeParam.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if node_type in ('sqoop', 'ssh'):
|
|
|
- <%
|
|
|
- params_field(action_form['params'], {
|
|
|
- 'name': 'params',
|
|
|
- 'add': [
|
|
|
- {'label': _('Add arg'), 'method': 'addArg'},
|
|
|
- ],
|
|
|
- 'remove': '$parent.removeParam.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'job_properties' in action_form.fields:
|
|
|
- <%
|
|
|
- job_properties_field(action_form['job_properties'], {
|
|
|
- 'name': 'job_properties',
|
|
|
- 'add': 'addProperty',
|
|
|
- 'remove': '$parent.removeProperty.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'files' in action_form.fields:
|
|
|
- <%
|
|
|
- file_field(action_form['files'], {
|
|
|
- 'name': 'files',
|
|
|
- 'add': 'addFile',
|
|
|
- 'remove': '$parent.removeFile.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'archives' in action_form.fields:
|
|
|
- <%
|
|
|
- archives_field(action_form['archives'], {
|
|
|
- 'name': 'archives',
|
|
|
- 'add': 'addArchive',
|
|
|
- 'remove': '$parent.removeArchive.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'job_xml' in action_form.fields:
|
|
|
- ${ utils.render_field_with_error_js(action_form['job_xml'], action_form['job_xml'].name, extra_attrs={'data-bind': 'disable: $root.context().read_only, fileChooser: $data, value: %s' % action_form['job_xml'].name}) }
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'deletes' in action_form.fields:
|
|
|
- <%
|
|
|
- file_field(action_form['deletes'], {
|
|
|
- 'name': 'deletes',
|
|
|
- 'add': 'addDelete',
|
|
|
- 'remove': '$parent.removeDelete.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'mkdirs' in action_form.fields:
|
|
|
- <%
|
|
|
- file_field(action_form['mkdirs'], {
|
|
|
- 'name': 'mkdirs',
|
|
|
- 'add': 'addMkdir',
|
|
|
- 'remove': '$parent.removeMkdir.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'moves' in action_form.fields:
|
|
|
- <%
|
|
|
- move_field(action_form['moves'], {
|
|
|
- 'name': 'moves',
|
|
|
- 'add': 'addMove',
|
|
|
- 'remove': '$parent.removeMove.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'chmods' in action_form.fields:
|
|
|
- <%
|
|
|
- chmod_field(action_form['chmods'], {
|
|
|
- 'name': 'chmods',
|
|
|
- 'add': 'addChmod',
|
|
|
- 'remove': '$parent.removeChmod.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
- % if 'touchzs' in action_form.fields:
|
|
|
- <%
|
|
|
- file_field(action_form['touchzs'], {
|
|
|
- 'name': 'touchzs',
|
|
|
- 'add': 'addTouchz',
|
|
|
- 'remove': '$parent.removeTouchz.bind($parent)'
|
|
|
- })
|
|
|
- %>
|
|
|
- % endif
|
|
|
-
|
|
|
+ ${ action_form_fields(action_form, node_type) }
|
|
|
</fieldset>
|
|
|
</div>
|
|
|
|
|
|
<div class="modal-footer">
|
|
|
- <a class="btn cancelButton" href="javascript:void(0);">Cancel</a>
|
|
|
+ <a class="btn cancelButton" href="javascript:void(0);">${_('Cancel')}</a>
|
|
|
<button class="btn btn-primary doneButton disable-feedback" type="button" data-bind="visible: !$root.context().read_only">${ _('Done')}</button>
|
|
|
</div>
|
|
|
|
|
|
@@ -290,6 +51,255 @@
|
|
|
% endif
|
|
|
</%def>
|
|
|
|
|
|
+<%def name="action_form_fields(action_form, node_type, show_primary=True)">
|
|
|
+% if show_primary:
|
|
|
+ % for field in action_form:
|
|
|
+ % if field.html_name in ('name', 'description'):
|
|
|
+ ${ utils.render_field_with_error_js(field, field.name, extra_attrs={'data-bind': 'disable: $root.context().read_only, value: %s' % field.name}) }
|
|
|
+ % endif
|
|
|
+ % endfor
|
|
|
+
|
|
|
+ ${ utils.render_constant(_('Action type'), node_type) }
|
|
|
+
|
|
|
+ <!-- ko if: $root.context().nodes && $root.context().error_node -->
|
|
|
+ <div class="control-group ">
|
|
|
+ <label class="control-label">
|
|
|
+ <a href="javascript:void(0);" id="advanced-btn" onclick="$('#node-advanced-container').toggle('hide')">
|
|
|
+ <i class="icon-share-alt"></i> ${ _('Advanced') }</a>
|
|
|
+ </label>
|
|
|
+ <div class="controls"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="node-advanced-container" class="hide">
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label">${_('Error link to')}</label>
|
|
|
+ <div class="controls">
|
|
|
+ <div style="padding-top:4px">
|
|
|
+ <select data-bind="options: $root.context().nodes,
|
|
|
+ optionsText: function(item) {
|
|
|
+ return (item.name()) ? item.name() : item.node_type() + '-' + item.id();
|
|
|
+ },
|
|
|
+ optionsValue: function(item) {
|
|
|
+ return item.id();
|
|
|
+ },
|
|
|
+ value: $root.context().error_node"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- /ko -->
|
|
|
+% endif
|
|
|
+
|
|
|
+<hr/>
|
|
|
+
|
|
|
+<div class="control-group">
|
|
|
+ <label class="control-label"></label>
|
|
|
+ <div class="controls">
|
|
|
+ <p class="alert alert-info span7">
|
|
|
+ % if node_type != 'fs':
|
|
|
+ ${ _('All the paths are relative to the deployment directory. They can be absolute but this is not recommended.') }
|
|
|
+ % else:
|
|
|
+ ${ _('All the paths need to be absolute.') }
|
|
|
+ % endif
|
|
|
+ <br/>
|
|
|
+ ${ _('You can parameterize values using case sensitive') } <code>${"${"}parameter}</code>.
|
|
|
+ </p>
|
|
|
+ % if node_type == 'ssh':
|
|
|
+ <br style="clear: both" />
|
|
|
+ <p class="alert alert-warn span5">
|
|
|
+ ${ _('The SSH server requires passwordless login') }.
|
|
|
+ </p>
|
|
|
+ % endif
|
|
|
+ % if node_type == 'java':
|
|
|
+ % if get_oozie().security_enabled:
|
|
|
+ <br style="clear: both" />
|
|
|
+ <p class="alert alert-warn span5">
|
|
|
+ ${ _('The delegation token needs to be propagated from the launcher job to the MR job') }.
|
|
|
+ <a href="https://issues.apache.org/jira/browse/OOZIE-1172">OOZIE-1172</a>
|
|
|
+ </p>
|
|
|
+ % endif
|
|
|
+ % endif
|
|
|
+ % if node_type == 'email':
|
|
|
+ <br style="clear: both" />
|
|
|
+ <p class="alert alert-warn span5">
|
|
|
+ ${ _('Requires some SMTP server configuration to be present (in oozie-site.xml)') }.
|
|
|
+ </p>
|
|
|
+ % endif
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+% for field in action_form:
|
|
|
+ % if field.html_name not in ('name', 'description', 'node_type', 'job_xml'):
|
|
|
+ % if field.html_name in ('capture_output', 'is_single', 'sub_workflow', 'propagate_configuration'):
|
|
|
+ ${ utils.render_field_with_error_js(field, field.name, extra_attrs={'data-bind': 'disable: $root.context().read_only, checked: %s' % field.name}) }
|
|
|
+ % else:
|
|
|
+ ${ utils.render_field_with_error_js(field, field.name, extra_attrs={'data-bind': 'disable: $root.context().read_only, value: %s' % field.name}) }
|
|
|
+ % endif
|
|
|
+ % endif
|
|
|
+% endfor
|
|
|
+
|
|
|
+% if 'prepares' in action_form.fields:
|
|
|
+ <%
|
|
|
+ prepares_field(action_form['prepares'], {
|
|
|
+ 'name': 'prepares',
|
|
|
+ 'add': [
|
|
|
+ {'label': _('Add delete'), 'method': 'addPrepareDelete'},
|
|
|
+ {'label': _('Add mkdir'), 'method': 'addPrepareMkdir'},
|
|
|
+ ],
|
|
|
+ 'remove': '$parent.removePrepare.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'params' in action_form.fields:
|
|
|
+ % if node_type == 'pig':
|
|
|
+ <%
|
|
|
+ params_field(action_form['params'], {
|
|
|
+ 'name': 'params',
|
|
|
+ 'add': [
|
|
|
+ {'label': _('Add param'), 'method': 'addParam'},
|
|
|
+ {'label': _('Add argument'), 'method': 'addArgument'},
|
|
|
+ ],
|
|
|
+ 'remove': '$parent.removeParam.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+ % endif
|
|
|
+
|
|
|
+ % if node_type == 'shell':
|
|
|
+ <%
|
|
|
+ params_field(action_form['params'], {
|
|
|
+ 'name': 'params',
|
|
|
+ 'add': [
|
|
|
+ {'label': _('Add argument'), 'method': 'addArgument'},
|
|
|
+ {'label': _('Add env-var'), 'method': 'addEnvVar'},
|
|
|
+ ],
|
|
|
+ 'remove': '$parent.removeParam.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+ % endif
|
|
|
+
|
|
|
+ % if node_type == 'hive':
|
|
|
+ <%
|
|
|
+ params_field(action_form['params'], {
|
|
|
+ 'name': 'params',
|
|
|
+ 'add': [
|
|
|
+ {'label': _('Add param'), 'method': 'addParam'},
|
|
|
+ ],
|
|
|
+ 'remove': '$parent.removeParam.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+ % endif
|
|
|
+
|
|
|
+ % if node_type == 'distcp':
|
|
|
+ <%
|
|
|
+ params_field(action_form['params'], {
|
|
|
+ 'name': 'params',
|
|
|
+ 'add': [
|
|
|
+ {'label': _('Add argument'), 'method': 'addArgument'},
|
|
|
+ ],
|
|
|
+ 'remove': '$parent.removeParam.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+ % endif
|
|
|
+
|
|
|
+ % if node_type in ('sqoop', 'ssh'):
|
|
|
+ <%
|
|
|
+ params_field(action_form['params'], {
|
|
|
+ 'name': 'params',
|
|
|
+ 'add': [
|
|
|
+ {'label': _('Add arg'), 'method': 'addArg'},
|
|
|
+ ],
|
|
|
+ 'remove': '$parent.removeParam.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+ % endif
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'job_properties' in action_form.fields:
|
|
|
+ <%
|
|
|
+ job_properties_field(action_form['job_properties'], {
|
|
|
+ 'name': 'job_properties',
|
|
|
+ 'add': 'addProperty',
|
|
|
+ 'remove': '$parent.removeProperty.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'files' in action_form.fields:
|
|
|
+ <%
|
|
|
+ file_field(action_form['files'], {
|
|
|
+ 'name': 'files',
|
|
|
+ 'add': 'addFile',
|
|
|
+ 'remove': '$parent.removeFile.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'archives' in action_form.fields:
|
|
|
+ <%
|
|
|
+ archives_field(action_form['archives'], {
|
|
|
+ 'name': 'archives',
|
|
|
+ 'add': 'addArchive',
|
|
|
+ 'remove': '$parent.removeArchive.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'job_xml' in action_form.fields:
|
|
|
+ ${ utils.render_field_with_error_js(action_form['job_xml'], action_form['job_xml'].name, extra_attrs={'data-bind': 'disable: $root.context().read_only, fileChooser: $data, value: %s' % action_form['job_xml'].name}) }
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'deletes' in action_form.fields:
|
|
|
+ <%
|
|
|
+ file_field(action_form['deletes'], {
|
|
|
+ 'name': 'deletes',
|
|
|
+ 'add': 'addDelete',
|
|
|
+ 'remove': '$parent.removeDelete.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'mkdirs' in action_form.fields:
|
|
|
+ <%
|
|
|
+ file_field(action_form['mkdirs'], {
|
|
|
+ 'name': 'mkdirs',
|
|
|
+ 'add': 'addMkdir',
|
|
|
+ 'remove': '$parent.removeMkdir.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'moves' in action_form.fields:
|
|
|
+ <%
|
|
|
+ move_field(action_form['moves'], {
|
|
|
+ 'name': 'moves',
|
|
|
+ 'add': 'addMove',
|
|
|
+ 'remove': '$parent.removeMove.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'chmods' in action_form.fields:
|
|
|
+ <%
|
|
|
+ chmod_field(action_form['chmods'], {
|
|
|
+ 'name': 'chmods',
|
|
|
+ 'add': 'addChmod',
|
|
|
+ 'remove': '$parent.removeChmod.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+
|
|
|
+% if 'touchzs' in action_form.fields:
|
|
|
+ <%
|
|
|
+ file_field(action_form['touchzs'], {
|
|
|
+ 'name': 'touchzs',
|
|
|
+ 'add': 'addTouchz',
|
|
|
+ 'remove': '$parent.removeTouchz.bind($parent)'
|
|
|
+ })
|
|
|
+ %>
|
|
|
+% endif
|
|
|
+</%def>
|
|
|
+
|
|
|
<%def name="file_field(field, javascript_attrs={})">
|
|
|
<div class="control-group" rel="popover" data-original-title="${ field.label }" data-content="${ field.help_text }">
|
|
|
<label class="control-label">${ field.label }</label>
|