瀏覽代碼

HUE-1656 [oozie] Add 2 new SLA fields

Romain Rigaux 12 年之前
父節點
當前提交
dd09000d99

+ 2 - 2
apps/oozie/src/oozie/models.py

@@ -68,8 +68,8 @@ DEFAULT_SLA = [
     {'key': 'max-duration', 'value': ''},
     {'key': 'alert-events', 'value': ''},
     {'key': 'alert-contact', 'value': ''},
-    #{'key': 'notification-msg', 'value': ''},
-    #{'key': 'alert-contact', 'value': ''},
+    {'key': 'notification-msg', 'value': ''},
+    {'key': 'upstream-apps', 'value': ''},
 ]
 
 class JobManager(models.Manager):

+ 3 - 1
apps/oozie/src/oozie/templates/editor/edit_coordinator.mako

@@ -764,10 +764,12 @@ ${ layout.menubar(section='coordinators') }
 
       $("a[rel='tooltip']").tooltip();
     });
+    
+    ${ utils.slaGlobal() } 
+   
   </script>
 % endif
 
 ${ utils.decorate_datetime_fields() }
-${ utils.slaGlobal() }
 
 ${ commonfooter(messages) | n,unicode }

+ 3 - 1
apps/oozie/src/oozie/templates/editor/edit_workflow.mako

@@ -1045,10 +1045,12 @@ function checkModelDirtiness() {
   }
 }
 
+${ utils.slaGlobal() }
+
 </script>
 
 ${ utils.path_chooser_libs(True) }
-${ utils.slaGlobal() }
+
 
 <script>
   $(document).ready(function(){

+ 6 - 4
apps/oozie/src/oozie/templates/utils.inc.mako

@@ -280,7 +280,7 @@
 
 ## Would be nice include it in slaForm() somehow
 <%def name="slaGlobal()">
-<script type="text/javascript" charset="utf-8">
+
   function getSLAText(key) {
     return {
        'enabled': {'niceName': '${ _("Enabled") }', 'placeHolder': ''},
@@ -289,10 +289,12 @@
        'should-end': {'niceName': '${ _("Should end") } *', 'placeHolder': '${"$"}{30 * MINUTES}'},
        'max-duration': {'niceName': '${ _("Max duration") }', 'placeHolder': '${"$"}{30 * MINUTES}'},
        'alert-events': {'niceName': '${ _("Alert events") }', 'placeHolder': 'start_miss,end_miss,duration_miss'},
-       'alert-contact': {'niceName': '${ _("Alert contact") }', 'placeHolder': 'joe@example.com,bob@example.com'} 
-    }[key]
+       'alert-contact': {'niceName': '${ _("Alert contact") }', 'placeHolder': 'joe@example.com,bob@example.com'},
+       'notification-msg': {'niceName': '${ _("Notification message") }', 'placeHolder': 'My Job has encountered an SLA event!'},
+       'upstream-apps': {'niceName': '${ _("Upstream apps") }', 'placeHolder': 'dependent-app-1, dependent-app-2'}
+    }[key];
   };
-</script>
+
 </%def>
 
 

+ 3 - 1
apps/oozie/static/js/workflow.models.js

@@ -26,7 +26,9 @@ var DEFAULT_SLA = [
     {'key': 'should-end', 'value': ''},
     {'key': 'max-duration', 'value': ''},
     {'key': 'alert-events', 'value': ''},
-    {'key': 'alert-contact', 'value': ''}
+    {'key': 'alert-contact', 'value': ''},
+    {'key': 'notification-msg', 'value': ''},
+    {'key': 'upstream-apps', 'value': ''}
 ];
 
 function getDefaultSla() {