瀏覽代碼

HUE-1000 [oozie] Ajax refresh of the running workflows and coordinators in the dashboard

Fixed http 500 when window.location.hash is set
Enrico Berti 12 年之前
父節點
當前提交
852cd1966a

+ 7 - 2
apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinators.mako

@@ -228,6 +228,11 @@ ${layout.menubar(section='dashboard')}
       drawTable();
     });
 
+    var hash = window.location.hash;
+    if (hash != "" && hash.indexOf("=") > -1) {
+      $("a.btn-date[data-value='" + hash.split("=")[1] + "']").click();
+    }
+
     function drawTable() {
       runningTable.fnDraw();
       completedTable.fnDraw();
@@ -293,7 +298,7 @@ ${layout.menubar(section='dashboard')}
     var numRunning = 0;
 
     function refreshRunning() {
-      $.getJSON(window.location.href + "?format=json&type=running", function (data) {
+      $.getJSON(window.location.pathname + "?format=json&type=running", function (data) {
         if (data) {
           var nNodes = runningTable.fnGetNodes();
 
@@ -358,7 +363,7 @@ ${layout.menubar(section='dashboard')}
     }
 
     function refreshCompleted() {
-      $.getJSON(window.location.href + "?format=json&type=completed", function (data) {
+      $.getJSON(window.location.pathname + "?format=json&type=completed", function (data) {
         completedTable.fnClearTable();
         $(data).each(function (iWf, item) {
           var coord = new Coordinator(item);

+ 7 - 2
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflows.mako

@@ -226,6 +226,11 @@ ${ layout.menubar(section='dashboard') }
       drawTable();
     });
 
+    var hash = window.location.hash;
+    if (hash != "" && hash.indexOf("=") > -1) {
+      $("a.btn-date[data-value='" + hash.split("=")[1] + "']").click();
+    }
+
     function drawTable() {
       runningTable.fnDraw();
       completedTable.fnDraw();
@@ -291,7 +296,7 @@ ${ layout.menubar(section='dashboard') }
     var numRunning = 0;
 
     function refreshRunning() {
-      $.getJSON(window.location.href + "?format=json&type=running", function (data) {
+      $.getJSON(window.location.pathname + "?format=json&type=running", function (data) {
         if (data) {
           var nNodes = runningTable.fnGetNodes();
 
@@ -355,7 +360,7 @@ ${ layout.menubar(section='dashboard') }
     }
 
     function refreshCompleted() {
-      $.getJSON(window.location.href + "?format=json&type=completed", function (data) {
+      $.getJSON(window.location.pathname + "?format=json&type=completed", function (data) {
         completedTable.fnClearTable();
         $(data).each(function (iWf, item) {
           var wf = new Workflow(item);