azkaban-aplcache

Details

diff --git a/src/java/azkaban/webapp/servlet/velocity/flowpage.vm b/src/java/azkaban/webapp/servlet/velocity/flowpage.vm
index c523aea..0394da9 100644
--- a/src/java/azkaban/webapp/servlet/velocity/flowpage.vm
+++ b/src/java/azkaban/webapp/servlet/velocity/flowpage.vm
@@ -149,7 +149,7 @@
           <div class="col-xs-12">
             <div class="callout callout-info">
               <h4>Analyze last run</h4>
-              <p>Analyze the last run for aggregate performance statistics. <strong>Note:</strong> this may take a few minutes, especially if your flow is large.</p>
+              <p>Analyze the last run for aggregate performance statistics. Note: this may take a few minutes, especially if your flow is large.</p>
               <p>
                 <button type="button" id="analyze-btn" class="btn btn-primary">Analyze</button>
               </p>
diff --git a/src/tl/flowsummary.tl b/src/tl/flowsummary.tl
index e4f525f..82627d6 100644
--- a/src/tl/flowsummary.tl
+++ b/src/tl/flowsummary.tl
@@ -14,7 +14,7 @@
           </table>
         </div>
       </div>
-			
+
       <div class="row">
         <div class="col-xs-12">
           <h3>
@@ -46,12 +46,12 @@
                 <td class="property-key">SLA</td>
                 <td class="property-value-half">
                 {?schedule.slaOptions}
-                  true 
-                {:else} 
-                  false 
+                  true
+                {:else}
+                  false
                 {/schedule.slaOptions}
                   <div class="pull-right">
-                    <button type="button" id="addSlaBtn" class="btn btn-xs btn-primary" onclick="slaView.initFromSched({schedule.scheduleId}, '{flowName}')" >Set SLA</button>
+                    <button type="button" id="addSlaBtn" class="btn btn-xs btn-primary" onclick="slaView.initFromSched({schedule.scheduleId}, '{flowName}')" >View/Set SLA</button>
                   </div>
                 </td>
               </tr>
diff --git a/src/web/js/azkaban/view/flow.js b/src/web/js/azkaban/view/flow.js
index 95aba17..6ed8d89 100644
--- a/src/web/js/azkaban/view/flow.js
+++ b/src/web/js/azkaban/view/flow.js
@@ -327,9 +327,34 @@ azkaban.SummaryView = Backbone.View.extend({
 			'flowId': flowId
 		};
 		var model = this.model;
+    var view = this;
 		var successHandler = function(data) {
 			model.set({'schedule': data.schedule});
 			model.trigger('render');
+      view.fetchSla();
+		};
+		$.get(requestURL, requestData, successHandler, 'json');
+	},
+
+  fetchSla: function() {
+    var schedule = this.model.get('schedule');
+    if (schedule == null || schedule.scheduleId == null) {
+      return;
+    }
+
+		var requestURL = contextURL + "/schedule"
+		var requestData = {
+			"scheduleId": schedule.scheduleId,
+			"ajax": "slaInfo"
+		};
+		var model = this.model;
+		var successHandler = function(data) {
+      if (data == null || data.settings == null || data.settings.length == 0) {
+        return;
+      }
+      schedule.slaOptions = true;
+      model.set({'schedule': schedule});
+			model.trigger('render');
 		};
 		$.get(requestURL, requestData, successHandler, 'json');
 	},