瀏覽代碼

[jobsub] Fix checkboxes and add capture output

Abraham Elmahrek 12 年之前
父節點
當前提交
de29acf

+ 7 - 0
apps/jobsub/src/jobsub/templates/designs.mako

@@ -273,6 +273,13 @@ $(document).ready(function() {
         name: 'is_shared'
       }
     },
+    capture_output: {
+      name: "${ _('Capture output') }",
+      popover: "${ _('Capture the output of this job.') }",
+      js: {
+        name: 'capture_output'
+      }
+    },
     parameters: {
       title: "${ _('Oozie parameters') }",
       name: "${ _('Name') }",

+ 4 - 1
apps/jobsub/src/jobsub/views.py

@@ -162,7 +162,10 @@ def _save_design(design_id, data):
   node = workflow.start.get_child('to').get_full_node()
   node_id = node.id
   for key in data:
-    setattr(node, key, data[key])
+    if key in ('is_shared', 'capture_output', 'propagate_configuration'):
+      setattr(node, key, str(data[key]).lower() == 'true')
+    else:
+      setattr(node, key, data[key])
   node.id = node_id
   node.pk = node_id
   node.save()

+ 1 - 0
apps/jobsub/static/js/jobsub.templates.js

@@ -56,6 +56,7 @@ var Templates = (function($, ko) {
         params: 'static/templates/widgets/params.html',
         arguments_envvars: 'static/templates/widgets/params.html',
         params_arguments: 'static/templates/widgets/params.html',
+        capture_output: 'static/templates/widgets/checkbox.html'
       }
     }, options);
 

+ 4 - 0
apps/jobsub/static/templates/actions/shell.html

@@ -68,6 +68,10 @@
       {{#archives}}
         {{>archives}}
       {{/archives}}
+
+      {{#capture_output}}
+        {{>capture_output}}
+      {{/capture_output}}
     </fieldset>
     <div class="form-actions">
       <button data-bind="click: {{ save.func }}" class="btn btn-primary">{{ save.name }}</button>

+ 4 - 0
apps/jobsub/static/templates/actions/ssh.html

@@ -68,6 +68,10 @@
       {{#params}}
         {{>params}}
       {{/params}}
+
+      {{#capture_output}}
+        {{>capture_output}}
+      {{/capture_output}}
     </fieldset>
     <div class="form-actions">
       <button data-bind="click: {{ save.func }}" class="btn btn-primary">{{ save.name }}</button>