Francois Gouget : testbot: Show the VM configuration details when submitting a job.

Alexandre Julliard julliard at winehq.org
Tue Feb 27 10:46:18 CST 2018


Module: tools
Branch: master
Commit: 5a92f4bf051c2e416a2b72a28595887dc638755e
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=5a92f4bf051c2e416a2b72a28595887dc638755e

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Feb 27 02:44:33 2018 +0100

testbot: Show the VM configuration details when submitting a job.

The VMs are now shown in a table and their short description can be
expanded to show the full configuration. This can help select the right
set of VMs for the tests.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/web/Submit.pl       | 40 +++++++++++++++++++++++-----------------
 testbot/web/WineTestBot.css | 13 +++++++++++++
 2 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/testbot/web/Submit.pl b/testbot/web/Submit.pl
index 0e9aef3..875384e 100644
--- a/testbot/web/Submit.pl
+++ b/testbot/web/Submit.pl
@@ -230,7 +230,12 @@ sub GenerateFields($)
       {
         print "<div><input type='hidden' name='ShowAll' value='1'></div>\n";
       }
-  
+      print "<div class='CollectionBlock'><table>\n";
+      print "<thead><tr><th class='Record'></th>\n";
+      print "<th class='Record'>VM Name</th>\n";
+      print "<th class='Record'>Description</th>\n";
+      print "</th><tbody>\n";
+
       my $VMs = CreateVMs();
       if ($self->{FileType} eq "exe64" || $self->{FileType} eq "dll64")
       {
@@ -249,36 +254,37 @@ sub GenerateFields($)
       {
         $VMs->AddFilter("Role", ["base"]);
       }
+      my $Even = 1;
       my $SortedKeys = $VMs->SortKeysBySortOrder($VMs->GetKeys());
       foreach my $VMKey (@$SortedKeys)
       {
         my $VM = $VMs->GetItem($VMKey);
         my $FieldName = "vm_" . $self->CGI->escapeHTML($VMKey);
-        print "<div class='ItemProperty'><label>",
-              $self->CGI->escapeHTML($VM->Name);
-        if ($VM->Description)
-        {
-          print " (", $self->CGI->escapeHTML($VM->Description), ")";
-        }
-        my $Checked = 1;
-        if ($VM->Status eq 'offline')
-        {
-          print " [offline]";
-          $Checked = undef;
-        }
-        elsif ($VM->Status eq 'maintenance')
+        print "<tr class='", ($Even ? "even" : "odd"),
+            "'><td><input name='$FieldName' type='checkbox'";
+        $Even = !$Even;
+        my ($Checked, $Status) = (1, "");
+        if ($VM->Status =~ /^(offline|maintenance)$/)
         {
-          print " [maintenance]";
+          $Status = " [". $VM->Status ."]";
           $Checked = undef;
         }
-        print "</label><div class='ItemValue'><input type='checkbox' name='$FieldName'";
         if ($Checked and
             ($self->GetParam("Page") == 1 || $self->GetParam($FieldName)))
         {
           print " checked='checked'";
         }
-        print "/></div></div>\n";
+        print "/></td>\n";
+
+        print "<td>", $self->CGI->escapeHTML($VM->Name), "</td>\n";
+        print "<td><details><summary>",
+              $self->CGI->escapeHTML($VM->Description || $VM->Name),
+              "$Status</summary>",
+              $self->CGI->escapeHTML($VM->Details || "No details!"),
+              "</details></td>";
+        print "</tr>\n";
       }
+      print "</tbody></table>\n";
     }
     else
     {
diff --git a/testbot/web/WineTestBot.css b/testbot/web/WineTestBot.css
index 2ccce24..ebc622e 100644
--- a/testbot/web/WineTestBot.css
+++ b/testbot/web/WineTestBot.css
@@ -317,6 +317,19 @@ h2
   padding-bottom: 0.1em;
 }
 
+details
+{
+  font-style: italic;
+  color: #505050;
+}
+
+summary
+{
+  font-style: normal;
+  color: black;
+}
+
+
 pre
 {
   margin: 0;




More information about the wine-cvs mailing list