Browse Source

Merge pull request #845 from wangkx/gh-743c

Fix gh-843 Thor Usage Graph show NaN%

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 13 năm trước cách đây
mục cha
commit
681addcee6

+ 14 - 13
esp/eclwatch/ws_XSLT/jobs_search.xslt

@@ -189,20 +189,21 @@
                     endDate=dt;
                 }
                 var src='';
-                //if (getGraph > 2)
-                //  src='/WsWorkunits/JobList?Cluster=';                
-                //else if (getGraph > 1)
-                //  src='/WsWorkunits/WUClusterJobSummaryXLS?Cluster=';
-                //else
-                //  src='/WsWorkunits/JobList?Type=Multi;Cluster=';
                 if (getGraph > 1)
-                    src='/WsWorkunits/JobQueue?Cluster=';                
-                else if (getGraph > 0)
-                    src='/WsWorkunits/JobList?Cluster=';                
+                {
+                    src='/WsWorkunits/JobQueue?Cluster=';
+                    var select=document.getElementById('TargetCluster');
+                    src+=select.value;
+                }
                 else
-                    src='/WsWorkunits/WUClusterJobSummaryXLS?Cluster=';
-                var select=document.getElementById('Cluster');
-                if(select.selectedIndex>=0) src+=select.options[select.selectedIndex].text;
+                {
+                    if (getGraph > 0)
+                        src='/WsWorkunits/JobList?Cluster=';
+                    else
+                        src='/WsWorkunits/WUClusterJobSummaryXLS?Cluster=';
+                    var select=document.getElementById('Cluster');
+                    if(select.selectedIndex>=0) src+=select.options[select.selectedIndex].text;
+                }
                 if(startDate) src+='&StartDate='+startDate;
                 if(endDate) src+='&EndDate='+endDate;
                 src+='&ShowAll=1';
@@ -215,7 +216,6 @@
                     reload_graph(src);
                 else
                     document.location.href=src;
-        
               return false;
          }
 
@@ -236,6 +236,7 @@
     <body class="yui-skin-sam" onload="nof5();onLoad()">
          Display workunits:<br/><br/>
          <form onsubmit="return submit_list()">
+         <input type="hidden" id="TargetCluster" name="TargetCluster" value="{TargetCluster}"/>
          <table>
             <tr>
                 <td>Cluster</td>

+ 11 - 8
esp/services/ws_workunits/ws_workunitsAuditLogs.cpp

@@ -970,10 +970,11 @@ void streamJobListResponse(IEspContext &context, const char *cluster, const char
         appendQuoted(sb, job->getFinishedDate());
         appendQuoted(sb, job->getCluster());
         appendQuoted(sb, job->getState());
-        appendQuoted(sb, showall ? "1" : "0");
-        appendQuoted(sb, bbtime);
-        appendQuoted(sb, betime);
-        sb.append(")\r\n");
+        if (showall)
+            sb.append(",\'\',\'1\'");
+        else
+            sb.append(",\'\',\'0\'");
+        sb.append(',').append(bbtime).append(',').append(betime).append(")\r\n");
         if(++count>=50)
         {
             sb.append("</script>\r\n");
@@ -1014,10 +1015,12 @@ void streamJobListResponse(IEspContext &context, const char *cluster, const char
             appendQuoted(sb, finished.str());
             appendQuoted(sb, unfinishedClusters.item(idx3));
             appendQuoted(sb, "not finished");
-            appendQuoted(sb, showall ? "1" : "0");
-            appendQuoted(sb, bbtime);
-            appendQuoted(sb, betime);
-            sb.append(")\r\n");
+            if (showall)
+                sb.append(",\'\',\'1\'");
+            else
+                sb.append(",\'\',\'0\'");
+            sb.append(',').append(bbtime).append(',').append(betime).append(")\r\n");
+
             if(++count>=50)
             {
                 sb.append("</script>\r\n");

+ 1 - 0
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -3097,6 +3097,7 @@ int CWsWorkunitsSoapBindingEx::onGetForm(IEspContext &context, CHttpRequest* req
                         xml.append("<Cluster").append('>').append(thorInstances.item(i)).append("</Cluster>");
                     }
                 }
+                xml.append("<TargetCluster>").append(cluster).append("</TargetCluster>");
                 xml.append("</WUJobList>");
                 xslt.append(getCFD()).append("./smc_xslt/jobs_search.xslt");
                 response->addHeader("Expires", "0");