Salome HOME
add history in job reports
[tools/sat.git] / src / xsl / jobs_board_report.xsl
index aaaf6887c15ba34afc7d607ddaab7dfc915859a9..aae3b77e17868154841840742b0134c53e072305 100644 (file)
     .label        { font-weight: bold; }
 
     <!-- styles for links in matrix -->
-    .OK2          { color:#00AA00; }
-    .KO2          { color:#FF0000; }
-    .KF2          { color:#FF8000; }
-    .NA2          { color:#BBBBBB; }
-    .TO2          { color:GoldenRod; }
+    .OK2          { color:#00AA00; font-weight: normal;}
+    .KO2          { color:#FF0000; font-weight: normal;}
+    .KF2          { color:#FF8000; font-weight: normal;}
+    .NA2          { color:#BBBBBB; font-weight: normal;}
+    .TO2          { color:GoldenRod; font-weight: normal;}
     .RUNNING2     { color:LightSeaGreen; font-weight: bold; }
     .OK2day       { color:#00AA00; font-weight: bold; }
     .KO2day       { color:#FF0000; font-weight: bold; }
@@ -79,7 +79,7 @@
 </style>
 
 <xsl:if test="//JobsReport/infos/@JobsCommandStatus='running'">
-  <meta http-equiv="refresh" content="1"></meta>
+  <meta http-equiv="refresh" content="10"></meta>
 </xsl:if>
 
 <script language="JavaScript"><![CDATA[
        </tr>
     </table>
 
-    Legend :
-    <table class="legend">
-       <tr><td>job</td><td>result</td></tr>
-       <tr><td> <xsl:attribute name="class">OK2day</xsl:attribute>success today</td><td> <xsl:attribute name="class">OK2day</xsl:attribute>success today</td></tr>
-       <tr><td> <xsl:attribute name="class">OK2</xsl:attribute>success not today</td><td> <xsl:attribute name="class">OK2</xsl:attribute>success not today</td></tr>
-       <tr><td> <xsl:attribute name="class">KO2day</xsl:attribute>fail today</td><td> <xsl:attribute name="class">KO2day</xsl:attribute>fail today</td></tr>
-       <tr><td> <xsl:attribute name="class">KO2</xsl:attribute>fail not today</td><td> <xsl:attribute name="class">KO2</xsl:attribute>fail not today</td></tr>
-       <tr><td> <xsl:attribute name="class">TO2day</xsl:attribute>timeout today</td><td> <xsl:attribute name="class">KF2day</xsl:attribute>known failure today</td></tr>
-       <tr><td> <xsl:attribute name="class">RUNNING2</xsl:attribute>running</td><td> <xsl:attribute name="class">KF2</xsl:attribute>known failure not today</td></tr>
-       <tr><td> <xsl:attribute name="class">NA2day</xsl:attribute>To be launched</td></tr>
-       <tr><td> <xsl:attribute name="class">NA2</xsl:attribute>Not today</td></tr>
-    </table>
-    
+    <a href="#">
+       <xsl:attribute name="onclick">javascript:Toggle('legend')</xsl:attribute>
+       <xsl:attribute name="title">legend</xsl:attribute>
+       legend
+    </a>
     <br/>
-
+    <br/>
+    
     <div id="matrix">
     <table class="summary">
       <!-- header -->
       <tr bgcolor="#9acd32">
       <th></th>
       <xsl:for-each select="//JobsReport/applications/application">
-        <xsl:sort select="@name" />
+        <!--<xsl:sort select="@name" />-->
        <th><xsl:value-of select="@name" /></th>
       </xsl:for-each>
       </tr>
        <td align="center"><xsl:value-of select="$curr_distname" /></td>
        <!-- for all jobs -->
        <xsl:for-each select="//JobsReport/applications/application">
-         <xsl:sort select="@name" />
+         <!--<xsl:sort select="@name" />-->
          <xsl:variable name="curr_appli" select="@name" />
          <td align="center" class="small">
              <!-- get the job for current host and current appli -->
              <xsl:for-each select="//JobsReport/jobs/job">
+             
                  <xsl:sort select="@name" />
+                 
                  <xsl:if test="application/.=$curr_appli and distribution/.=$curr_distname and board/.=//JobsReport/board/.">
+                     <!-- Change background color if it is an extra job (not defined in the input csv files) -->
+                     <xsl:if test="extra_job/.='yes'">
+                         <xsl:attribute name="bgcolor">FFCCCC</xsl:attribute>
+                     </xsl:if>
+                     <!-- Get job status and put a link -->
                      <xsl:choose>
                            <xsl:when test="state/.='SSH connection KO' or state/.='Cancelled'">
                              <a href="#">
                                    <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
                                    <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
                                    <xsl:attribute name="class">OK2day</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
+                                   job
                              </a>
                            </xsl:when>
                            <xsl:when test="contains(state/., 'Timeout')">
                                    <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
                                    <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
                                    <xsl:attribute name="class">TO2day</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
+                                   job
                              </a>
                            </xsl:when>
                            <xsl:when test="state/.='Not today'">
                      </xsl:choose>
                      <!--<xsl:value-of select="state/." />-->
                      <xsl:if test="not(remote_log_file_path/.='nothing') and state/.!='Not today'">
-                            : 
+                            - 
                            <a>
                                <xsl:attribute name="title">remote log</xsl:attribute>
                                <xsl:attribute name="href"><xsl:value-of select="remote_log_file_path/."/></xsl:attribute>
                                <xsl:if test="res/.='0'">
                                   <xsl:attribute name="class">OK2day</xsl:attribute>
                                </xsl:if>
-                               <xsl:if test="res/.='1'">
+                               <xsl:if test="res/.!='0'">
                                   <xsl:attribute name="class">KO2day</xsl:attribute>
                                </xsl:if>
-                               <xsl:value-of select="host/."/>/<xsl:value-of select="port/."/>
+                               <xsl:value-of select="host/."/>
+                               <xsl:if test="port/.!='22'">
+                                / <xsl:value-of select="port/."/>
+                               </xsl:if>
                            </a>
                      </xsl:if> 
                      <br/>
-                 </xsl:if> 
+                     
+
+                 </xsl:if>
                  
              </xsl:for-each>
+             
+             <!-- get the missing jobs -->
+             <xsl:for-each select="//JobsReport/missing_jobs/job">    
+                   <xsl:if test="@distribution=$curr_distname and @application=$curr_appli">
+                       <xsl:attribute name="bgcolor">FFCCCC</xsl:attribute>
+                   </xsl:if>
+             </xsl:for-each>
+             
          </td>
        </xsl:for-each>
        </tr>
     </xsl:choose>
     </h3>
     </div>
+    <span class="note">input file: <xsl:value-of select="//JobsReport/@input_file" /></span>
 
-    
     <!-- Loop over the jobs in order to find what job was called in the link "onclick". Display information about that job -->
     <xsl:for-each select="//JobsReport/jobs/job">
       <xsl:variable name="curr_job_name" select="@name" />
                  <br/>
                  <h4>User : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/user"/>
                  <br/>
+                 <!-- Display history -->
+                 <h4>History : </h4>
+                 <br/>
+                 <xsl:for-each select="//JobsReport/jobs/job[@name=$curr_job_name]/history/link">
+                   <h4>
+                     <a>
+                       <xsl:attribute name="title">remote log</xsl:attribute>
+                       <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
+                       <xsl:if test="@res='0'">
+                           <xsl:attribute name="class">OK2</xsl:attribute>
+                       </xsl:if>
+                       <xsl:if test="@res!='0'">
+                           <xsl:attribute name="class">KO2</xsl:attribute>
+                       </xsl:if>
+                       <xsl:value-of select="@date"/>
+                     </a>
+                   </h4>
+                   <br/>
+                 </xsl:for-each>
                  <h4>salomeTools path : </h4><xsl:value-of select="//JobsReport/jobs/job[@name=$curr_job_name]/sat_path"/>
                  <br/>
                  <h4>After : </h4>
       </div>
     </xsl:for-each>
 
+    <div style="display:none"><xsl:attribute name="id">legend</xsl:attribute>
+      <td border="0"> 
+           <tr><td>job</td><td>result</td></tr>
+           <tr><td> <xsl:attribute name="class">OK2day</xsl:attribute>success today</td><td> <xsl:attribute name="class">OK2day</xsl:attribute>success today</td></tr>
+           <tr><td> <xsl:attribute name="class">OK2</xsl:attribute>success not today</td><td> <xsl:attribute name="class">OK2</xsl:attribute>success not today</td></tr>
+           <tr><td> <xsl:attribute name="class">KO2day</xsl:attribute>fail today</td><td> <xsl:attribute name="class">KO2day</xsl:attribute>fail today</td></tr>
+           <tr><td> <xsl:attribute name="class">KO2</xsl:attribute>fail not today</td><td> <xsl:attribute name="class">KO2</xsl:attribute>fail not today</td></tr>
+           <tr><td> <xsl:attribute name="class">TO2day</xsl:attribute>timeout today</td><td> <xsl:attribute name="class">KF2day</xsl:attribute>known failure today</td></tr>
+           <tr><td> <xsl:attribute name="class">RUNNING2</xsl:attribute>running</td><td> <xsl:attribute name="class">KF2</xsl:attribute>known failure not today</td></tr>
+           <tr><td> <xsl:attribute name="class">NA2day</xsl:attribute>To be launched</td></tr>
+           <tr><td> <xsl:attribute name="class">NA2</xsl:attribute>Not today</td></tr>
+           <tr>Missing job: <td> <xsl:attribute name="bgcolor">FFCCCC</xsl:attribute> </td></tr>
+           <tr>Extra job: <td> <xsl:attribute name="bgcolor">FFCCCC</xsl:attribute> Job name </td></tr>
+       </td>
+    </div>
+    
 </body>
 
 </html>