Changeset 1814


Ignore:
Timestamp:
12/19/19 17:18:39 (4 years ago)
Author:
yushan
Message:

trunk : update on html rendering

Location:
XIOS/trunk/xios_test_suite/HTML
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/xios_test_suite/HTML/generate_compile_table.js

    r1809 r1814  
    5050  // Generate select list for compile table 
    5151 
    52   var sel = document.getElementById("compile_revision"); 
    53   for (var i=0; i<revision_list.length; i++) 
     52  var sel = document.getElementById("revision"); 
     53 
     54  var sel_options = sel.children 
     55   
     56  var new_options=[] 
     57  for(var i=0; i<sel_options.length-1; i++) 
     58  { 
     59    new_options[i] = sel_options[i+1].value 
     60  } 
     61   
     62  for(var i=0; i<revision_list.length; i++) 
     63  { 
     64    if (!new_options.includes(revision_list[i])) 
     65    { 
     66      new_options.push(revision_list[i]) 
     67    } 
     68  } 
     69   
     70  new_options.sort(function(a, b){return b-a}) 
     71   
     72  while (sel.lastChild && sel.children.length>1) { 
     73    sel.removeChild(sel.lastChild); 
     74  } 
     75 
     76  for(var i=0; i<new_options.length; i++) 
    5477  { 
    5578    var opt = document.createElement('option'); 
    56     opt.appendChild( document.createTextNode(revision_list[i]) ); 
    57     opt.value = revision_list[i];  
    58     sel.appendChild(opt);  
     79    opt.appendChild( document.createTextNode(new_options[i])); 
     80    opt.value = new_options[i];  
     81    sel.appendChild(opt); 
    5982  } 
    6083   
     
    81104  } 
    82105 
     106  var emptyRow = document.createElement("tr") 
     107  emptyRow.setAttribute("id", "empty_compile_row") 
     108  emptyRow.style.display="none" 
     109  table.appendChild(emptyRow) 
     110   
     111  var myCell = document.createElement("TD"); 
     112  myCell.setAttribute("id", "empty_compile_row_revision") 
     113  myCell.style.fontWeight="bold" 
     114  emptyRow.appendChild(myCell) 
     115 
     116  for (var machine_index=0; machine_index<machine_list.length; machine_index++) 
     117  { 
     118    var myCell = document.createElement("TD"); 
     119    myCell.innerHTML="No Compile Information" 
     120    myCell.style.color="white" 
     121    emptyRow.appendChild(myCell) 
     122  } 
     123 
    83124  for (var i=0; i<revision_list.length; i++) 
    84125  { 
     
    88129    myRow.setAttribute("id", "compile_table_"+revision); 
    89130    myRow.setAttribute("class", "compile_table_row"); 
     131    table.appendChild(myRow) 
    90132     
    91133    var myCell = document.createElement("TD"); 
     
    101143      myRow.appendChild(myCell) 
    102144    }         
    103     table.appendChild(myRow) 
    104145 
    105146  } 
     
    152193 
    153194    mySubTable = document.createElement("table") 
     195    mySubTable.setAttribute("class", "compile_sub_table") 
    154196    myTD.appendChild(mySubTable) 
    155197 
  • XIOS/trunk/xios_test_suite/HTML/generate_test_table.js

    r1809 r1814  
    11var dict = {"-1": "&#10060;", "0": "&#10062;", "1": "&#9989;"} 
    2  
    3 // var bg_color = ["#84c5ff", "#96cdff", "#a1d3ff", "#b3dafd", "#c2e1fd"] 
    42 
    53function generateTestTable() 
     
    5048 
    5149  revision_list.sort(function(a, b){return b-a}); 
    52    
    53    
    54   // Generate select list for compile table 
    55  
    56   var sel = document.getElementById("test_revision"); 
    57   for (var i=0; i<revision_list.length; i++) 
     50 
     51  // Generate select list for test table 
     52 
     53  var sel = document.getElementById("revision"); 
     54 
     55  var sel_options = sel.children 
     56   
     57  var new_options=[] 
     58  for(var i=0; i<sel_options.length-1; i++) 
     59  { 
     60    new_options[i] = sel_options[i+1].value 
     61  } 
     62   
     63  for(var i=0; i<revision_list.length; i++) 
     64  { 
     65    if (!new_options.includes(revision_list[i])) 
     66    { 
     67      new_options.push(revision_list[i]) 
     68    } 
     69  } 
     70   
     71  new_options.sort(function(a, b){return b-a}) 
     72   
     73  while (sel.lastChild && sel.children.length>1) { 
     74    sel.removeChild(sel.lastChild); 
     75  } 
     76 
     77  for(var i=0; i<new_options.length; i++) 
    5878  { 
    5979    var opt = document.createElement('option'); 
    60     opt.appendChild( document.createTextNode(revision_list[i]) ); 
    61     opt.value = revision_list[i];  
    62     sel.appendChild(opt);  
    63   } 
    64    
    65   // Generate content of compile table 
     80    opt.appendChild( document.createTextNode(new_options[i])); 
     81    opt.value = new_options[i];  
     82    sel.appendChild(opt); 
     83  } 
     84   
     85 
     86 
     87   
     88  // Generate content of test table 
    6689   
    6790  var table = document.getElementById("test_table") 
     
    85108  } 
    86109 
     110  var emptyRow = document.createElement("tr") 
     111  emptyRow.setAttribute("id", "empty_test_row") 
     112  emptyRow.style.display="none" 
     113  table.appendChild(emptyRow) 
     114   
     115  var myCell = document.createElement("TD"); 
     116  myCell.setAttribute("id", "empty_test_row_revision") 
     117  myCell.style.fontWeight="bold" 
     118  emptyRow.appendChild(myCell) 
     119 
     120  for (var machine_index=0; machine_index<machine_list.length; machine_index++) 
     121  { 
     122    var myCell = document.createElement("TD"); 
     123    myCell.innerHTML="No Test Information" 
     124    myCell.style.color="white" 
     125    emptyRow.appendChild(myCell) 
     126  } 
     127 
     128 
    87129  for (var i=0; i<revision_list.length; i++) 
    88130  { 
     
    92134    myRow.setAttribute("id", "test_table_"+revision); 
    93135    myRow.setAttribute("class", "test_table_row"); 
     136    table.appendChild(myRow) 
    94137     
    95138    var myCell = document.createElement("TD"); 
     
    106149      myRow.appendChild(myCell) 
    107150    }         
    108     table.appendChild(myRow) 
    109151  } 
    110152 
     
    128170      if (!has_test_info) 
    129171      { 
    130         console.log("revision ",revision, "machine ",machine," has no test information") 
    131172        var myTD = document.getElementById("test_table_"+revision+"_"+machine); 
    132173        myTD.innerHTML = "No Test Information" 
     
    170211  myCell_3.setAttribute("id", "test_sub_table_"+revision+"_"+machine+"_"+build_dir+"_dropdown") 
    171212  myCell_4 = document.createElement("a") 
    172   myCell_4.innerHTML = ("show plein report") 
    173   myCell_4.onclick = function() {show_plein_report(machine, revision, build_dir)} 
     213  myCell_4.innerHTML = ("show plain report") 
     214  myCell_4.onclick = function() {show_plain_report(machine, revision, build_dir)} 
    174215  myCell_5 = document.createElement("a") 
    175216  myCell_5.innerHTML = ("show xios info") 
     
    428469} 
    429470 
    430 // function build_level_toggle(classname) 
    431 // { 
    432 //   var myCells = document.getElementsByClassName(classname) 
    433 //   for (var i=0; i<myCells.length; i++) 
    434 //   { 
    435 //     var mySubCells = document.getElementsByClassName(myCells[i].id) 
    436 //     if (myCells[i].style.display=="table-row") 
    437 //     { 
    438 //       myCells[i].style.display="none"  
    439 //       for(var j=0; j<mySubCells.length; j++) 
    440 //       { 
    441 //         mySubCells[j].style.display="none" 
    442 //         var mySubSubCells = document.getElementsByClassName(mySubCells[j].id) 
    443 //         for(var k=0; k<mySubSubCells.length; k++) 
    444 //         { 
    445 //           mySubSubCells[k].style.display="none" 
    446 //         } 
    447 //       } 
    448 //     } 
    449 //     else 
    450 //     { 
    451 //       myCells[i].style.display="table-row" 
    452 //     } 
    453 //   } 
    454 // } 
    455  
    456 // function algo_level_toggle(classname) 
    457 // { 
    458 //   var myCells = document.getElementsByClassName(classname) 
    459 //   for (var i=0; i<myCells.length; i++) 
    460 //   { 
    461 //     var mySubCells = document.getElementsByClassName(myCells[i].id) 
    462 //     if (myCells[i].style.display=="table-row") 
    463 //     { 
    464 //       myCells[i].style.display="none"  
    465 //       for(var j=0; j<mySubCells.length; j++) 
    466 //       { 
    467 //         mySubCells[j].style.display="none" 
    468 //       } 
    469 //     } 
    470 //     else 
    471 //     { 
    472 //       myCells[i].style.display="table-row" 
    473 //     } 
    474 //   } 
    475 // } 
    476  
    477 // function config_level_toggle(classname) 
    478 // { 
    479 //   var myCells = document.getElementsByClassName(classname) 
    480 //   for (var i=0; i<myCells.length; i++) 
    481 //   { 
    482 //     if (myCells[i].style.display=="table-row") 
    483 //     { 
    484 //       myCells[i].style.display="none"  
    485 //     } 
    486 //     else 
    487 //     { 
    488 //       myCells[i].style.display="table-row" 
    489 //     } 
    490 //   } 
    491 // } 
  • XIOS/trunk/xios_test_suite/HTML/xios-style.css

    r1809 r1814  
    1313{ 
    1414    clear: both; 
    15     border:2px solid blue; 
    1615    margin-top:50px; 
    1716    vertical-align: top; 
     
    2322} 
    2423 
    25 strong 
     24caption 
    2625{ 
    27     background-color:red;/* Fond rouge */ 
    28     color:yellow;/* Texte de couleur jaune */ 
     26    font-size: 1.4em; 
     27    font-weight: bold; 
     28    caption-side: top; 
     29    margin-bottom: 20px; 
     30    text-align: left; 
    2931} 
    30  
    31  
    32 em 
    33 { 
    34     font-weight: bold; 
    35     font-size: 1.2em; 
    36     text-align: right; 
    37 } 
    38  
    3932 
    4033 
     
    5144 
    5245 
    53 td 
    54 { 
    55     border: solid 1px white; 
    56 } 
    57  
    5846h1, h2 
    5947{ 
    60     text-align: center; 
     48    text-align: left; 
    6149} 
    6250 
     
    9886} 
    9987 
    100 .showit  
    101 { 
    102     display: block; 
    103 } 
    104    
    10588 
    10689.compile_table 
     
    10992    margin-bottom: 30px; 
    11093    margin-top: 30px; 
     94    border-collapse: collapse; 
    11195} 
    11296 
     
    11599    margin-left: 20px; 
    116100    margin-bottom: 10px; 
    117     border: solid 1px white; 
     101    border: solid 2px white; 
    118102    min-width: 150px; 
    119103    text-align: center; 
     104} 
     105 
     106.compile_sub_table td 
     107{ 
     108    border: solid 1px white; 
     109} 
     110 
     111.compile_sub_table 
     112{ 
     113    border-collapse: collapse; 
     114    margin-top: 10px; 
     115    margin-bottom: 10px; 
     116    margin-left: 10px; 
     117    margin-right: 10px; 
     118 
    120119} 
    121120 
     
    125124    margin-bottom: 30px; 
    126125    margin-top: 30px; 
     126    border-collapse: collapse; 
    127127} 
    128128 
     
    132132    margin-bottom: 10px; 
    133133    border: solid 2px white; 
    134     /* min-width: 150px; */ 
    135134    text-align: center; 
    136135} 
    137136 
     137 
    138138.test_sub_table 
    139139{ 
    140     /* margin-left: 10px; */ 
     140    border-collapse: collapse; 
    141141    margin-bottom: 10px; 
    142142    margin-top: 10px; 
     143    margin-left: 10px; 
     144    margin-right: 10px; 
    143145} 
    144146 
    145147.test_sub_table td 
    146148{ 
    147     /* margin-left: 20px; 
    148     margin-bottom: 10px; */ 
    149149    border: solid 1px white; 
    150     /* min-width: 150px; */ 
    151150    text-align: left; 
    152151} 
     
    174173 
    175174 
    176 .split  
    177 { 
    178     height: 100%; 
    179     width: 50%; 
    180     position: absolute; 
    181 } 
    182    
    183 /* Control the left side */ 
    184 .left  
    185 { 
    186     left: 0; 
    187 } 
    188    
    189 /* Control the right side */ 
    190 .right  
    191 { 
    192     right: 0; 
    193 } 
    194175   
    195176.compile_table_row.hide 
     
    200181.compile_table_row.show 
    201182{ 
    202     display: ""; 
     183    display: "table-row"; 
    203184} 
    204185 
     
    210191.test_table_row.show 
    211192{ 
    212     display: ""; 
     193    display: "table-row"; 
    213194} 
    214    
    215 .table_jz 
    216 { 
    217     border: solid 0.2px black; 
    218     margin: 20px; 
    219 } 
    220  
    221 .table_jz.hide 
    222 { 
    223     display: none; 
    224 } 
    225  
    226 .table_jz.show 
    227 { 
    228     display: ""; 
    229 } 
    230    
    231  
    232 .table_jz td 
    233 { 
    234     border: solid 0.1px white; 
    235 } 
    236  
    237 .table_irene 
    238 { 
    239     border: solid 0.2px black; 
    240     margin: 20px; 
    241 } 
    242    
    243 .table_irene.hide 
    244 { 
    245     display: none; 
    246 } 
    247  
    248 .table_irene.show 
    249 { 
    250     display: ""; 
    251 } 
    252  
    253 .table_irene td 
    254 { 
    255     border: solid 0.1px white; 
    256 } 
  • XIOS/trunk/xios_test_suite/HTML/xios_report.html

    r1809 r1814  
    55        <link rel="stylesheet" href="xios-style.css"/> 
    66        <title>XIOS Unit Tests Report - Le Site Web</title> 
    7         <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
    87         
    98        <script src="generate_compile_table.js" type="text/javascript"></script> 
     
    1514        <script src="https://forge.ipsl.jussieu.fr/ioserver/chrome/site/XIOS_TEST_SUITE/compile_jeanzay_info.js" type="text/javascript"></script> 
    1615        <script src="https://forge.ipsl.jussieu.fr/ioserver/chrome/site/XIOS_TEST_SUITE/test_jeanzay_info.js" type="text/javascript"></script> 
     16 
    1717    </head> 
    1818 
     
    2121        <header> 
    2222            <h1>XIOS Unit Tests Report Web Page</h1> 
    23             <h2>(still under construction ... ...)</h2> 
     23            <!-- <h2>(still under construction ... ...)</h2> --> 
    2424        </header> 
    2525 
    2626        <nav> 
    27             <div id="navborder"> 
    28                 <p id="xiosinfo">Some useful links:</p> 
     27            <div> 
     28                <!-- <p id="xiosinfo">Some useful links:</p> --> 
    2929                <ul> 
    3030                    <li><a href="https://forge.ipsl.jussieu.fr/ioserver/wiki" target="_blank">XIOS wiki page</a></li> 
    31                     <li><a href="graph.html" target="_blank">Workflow Graph</a></li> 
     31                    <li><a href="graph.html" target="_blank">Workflow Graph Visualizer</a></li> 
    3232                </ul>  
    3333            </div>         
     
    3838        <section> 
    3939 
    40             <h2>Results of unit tests</h2> 
     40            <!-- <h2>Results of unit tests</h2> --> 
    4141 
    4242            <form method="post" style="margin-left: 25px;"> 
    4343 
    44                 <p><label for="Build revision">Choose a revision number to show compile information : </label> 
    45                     <select name="revision" id="compile_revision"> 
     44                <p><label for="Build revision">Choose a revision number to show compile and test results : </label> 
     45                    <select name="revision" id="revision"> 
    4646                        <option value="0" selected>All available revisions ...</option> 
    4747                    </select> 
    4848                </p> 
    4949 
    50                 <p><label for="Test revision">Choose a revision number to show test results : </label> 
    51                     <select name="test_revision" id="test_revision"> 
    52                         <option value="0" selected>All available revisions ...</option> 
    53                     </select> 
    54                 </p> 
    55  
    56                  
    5750            </form> 
    5851 
     
    6659 
    6760            <div> 
    68                 <table id="compile_table" style="margin: 50px; border:solid 0.2px; "> 
     61                <table id="compile_table" style="margin: 50px;"> 
     62                    <caption>Table of XIOS Compile status</caption> 
    6963                    <tr style="font-weight: bold;" id="compile_table_row0"></tr> 
    7064                </table> 
     
    7266 
    7367 
    74             <div> 
    75                 <table id="test_table" style="margin: 50px; border:solid 0.2px; "> 
     68            <div style="margin-top: 100px;"> 
     69                <table id="test_table" style="margin: 50px;"> 
     70                    <caption>Table of XIOS unit tests results</caption> 
    7671                    <tr style="font-weight: bold;" id="test_table_row0"></tr> 
    7772                </table> 
    7873            </div> 
    7974 
    80  
    81             <!-- <div class="split left"> 
    82                 <div class="centered" id="div_table_jz"> 
    83                 </div> 
    84             </div> 
    85                    
    86             <div class="split right"> 
    87                 <div class="centered" id="div_table_irene"> 
    88                 </div> 
    89             </div>  --> 
    9075 
    9176        </section> 
     
    10186  
    10287<script> 
    103     // global variables for machine, def file location, and plein report prefix  
    104     var machine_list=['Jean-Zay', 'Irene', 'Other']; 
    105     var location_list=["../Jean-Zay/", "../Irene/", "../Other"]; 
    106     var plein_report_prefix_list=["jz_plein_report_", "irene_plein_report_", "other_plein_report_"]; 
    10788 
    10889    var params = "scrollbars=yes,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=600,height=300,left=100,top=100"; 
     
    139120 
    140121 
    141     function show_plein_report(machine, revision, build_dir) 
     122    function show_plain_report(machine, revision, build_dir) 
    142123    { 
    143124        var info_list = eval("test_"+machine+"_"+revision+"_"+build_dir.replace("build_","")) 
     
    179160<script> 
    180161 
    181 $("#compile_revision").change(function() { 
    182  
    183     if(this.value == 0) 
    184     { 
    185         var ans = document.getElementsByClassName('compile_table_row') 
    186         for (var i = 0; i < ans.length; i++) 
    187         { 
    188             cell = ans[i] 
    189             cell.classList.remove('hide') 
    190             cell.classList.add('show') 
    191         } 
    192     } 
    193      
    194     else 
    195     { 
    196         var ans = document.getElementsByClassName('compile_table_row') 
    197         for (var i = 0; i < ans.length; i++) 
    198         { 
    199             cell = ans[i] 
    200             cell.classList.remove('show') 
    201             cell.classList.add('hide') 
    202         } 
    203  
    204         var ans = document.getElementById('compile_table_'+this.value) 
    205         if(ans) 
    206         { 
    207             ans.classList.remove('hide') 
    208             ans.classList.add('show') 
    209         }   
    210     } 
    211 }); 
    212   
    213 </script> 
    214  
    215  
    216 <script> 
    217  
    218     $("#test_revision").change(function() { 
    219      
     162    document.getElementById("revision").addEventListener("change", myFunction); 
     163     
     164    function myFunction()  
     165    { 
    220166        if(this.value == 0) 
    221167        { 
    222             var ans = document.getElementsByClassName('test_table_row') 
     168            // compile part ... 
     169 
     170            var ans = document.getElementsByClassName('compile_table_row') 
    223171            for (var i = 0; i < ans.length; i++) 
    224172            { 
     
    227175                cell.classList.add('show') 
    228176            } 
     177            document.getElementById("empty_compile_row").style.display="none" 
     178 
     179            // test part ... 
     180 
     181            var ans = document.getElementsByClassName('test_table_row') 
     182            for (var i = 0; i < ans.length; i++) 
     183            { 
     184                cell = ans[i] 
     185                cell.classList.remove('hide') 
     186                cell.classList.add('show') 
     187            } 
     188            document.getElementById("empty_test_row").style.display="none" 
    229189        } 
    230190         
    231191        else 
    232192        { 
    233             var ans = document.getElementsByClassName('test_table_row') 
     193            // compile part ... 
     194 
     195            var ans = document.getElementsByClassName('compile_table_row') 
    234196            for (var i = 0; i < ans.length; i++) 
    235197            { 
     
    238200                cell.classList.add('hide') 
    239201            } 
    240      
     202            document.getElementById("empty_compile_row").style.display="none" 
     203 
     204            var ans = document.getElementById('compile_table_'+this.value) 
     205            if(ans) 
     206            { 
     207                ans.classList.remove('hide') 
     208                ans.classList.add('show') 
     209            }  
     210            else 
     211            { 
     212                document.getElementById("empty_compile_row_revision").innerHTML=this.value 
     213                document.getElementById("empty_compile_row").style.display="table-row" 
     214            }  
     215 
     216             
     217            // test part ... 
     218             
     219            var ans = document.getElementsByClassName('test_table_row') 
     220            for (var i = 0; i < ans.length; i++) 
     221            { 
     222                cell = ans[i] 
     223                cell.classList.remove('show') 
     224                cell.classList.add('hide') 
     225            } 
     226            document.getElementById("empty_test_row").style.display="none" 
     227             
    241228            var ans = document.getElementById('test_table_'+this.value) 
    242229            if(ans) 
     
    244231                ans.classList.remove('hide') 
    245232                ans.classList.add('show') 
    246             }   
    247         } 
    248     }); 
    249       
    250     </script> 
     233            }  
     234            else 
     235            { 
     236                document.getElementById("empty_test_row_revision").innerHTML=this.value 
     237                document.getElementById("empty_test_row").style.display="table-row" 
     238            }  
     239        } 
     240    } 
     241</script> 
     242 
    251243 
    252244<script> 
     245 
    253246    function level0_toggle(machine, my_revision) { 
    254247        var level1_ans = document.getElementsByClassName('table_'+machine+'_'+my_revision+"_build_level") 
Note: See TracChangeset for help on using the changeset viewer.