[llvm-commits] [zorg] r132159 - in /zorg/trunk/lnt/lnt/server/ui: static/order_aggregate_ui.css static/order_aggregate_ui.js templates/simple_order_aggregate_report.html views.py

Daniel Dunbar daniel at zuster.org
Thu May 26 15:01:04 PDT 2011


Author: ddunbar
Date: Thu May 26 17:01:04 2011
New Revision: 132159

URL: http://llvm.org/viewvc/llvm-project?rev=132159&view=rev
Log:
LNT/Order UI: Add UI for adding new graphs and plot items.

Added:
    zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.css
Modified:
    zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.js
    zorg/trunk/lnt/lnt/server/ui/templates/simple_order_aggregate_report.html
    zorg/trunk/lnt/lnt/server/ui/views.py

Added: zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.css
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.css?rev=132159&view=auto
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.css (added)
+++ zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.css Thu May 26 17:01:04 2011
@@ -0,0 +1,46 @@
+/* Custom CSS For the Order Aggregate UI */
+
+/* Graph Widget */
+
+.oar-graph-widget {
+    border: 2px solid #dddddd;
+    padding: 3px;
+    width: 820px;
+    height: 310px;
+}
+
+.oar-graph-element {
+    width: 400px;
+    height: 300px;
+    float: left;
+}
+
+.oar-graph-options {
+    border: 2px solid #eeeeee;
+    width: 400px;
+    height: 300px;
+    float: right;
+    display: inline;
+    overflow: auto;
+}
+
+.oar-graph-options-header {
+    border: 1px solid #000000;
+    background: #cccccc;
+    margin: 1px;
+}
+
+/* Plot Widget */
+
+.oar-plot-item-widget {
+    border: 1px solid #dddddd;
+    padding: 1px;
+    margin: 2px;
+    background: #f3f3f3;
+}
+
+.oar-plot-item-header {
+    border: 1px solid #000000;
+    background: #dddddd;
+    margin: 1px;
+}

Modified: zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.js
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.js?rev=132159&r1=132158&r2=132159&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.js (original)
+++ zorg/trunk/lnt/lnt/server/ui/static/order_aggregate_ui.js Thu May 26 17:01:04 2011
@@ -24,15 +24,22 @@
 PlotItem.prototype.init = function(parent) {
     var graph = this.graph;
 
-    this.widget = $('<div class="oar_plot_item_widget"></div>');
-    this.widget.prependTo(parent);
+    this.widget = $('<div class="oar-plot-item-widget"></div>');
+    this.widget.appendTo(parent);
+
+    // Add the plot item header with the plot name.
+    var header = $('<div class="oar-plot-item-header"></div>');
+    header.appendTo(this.widget);
+    header.append("Name:");
+    this.plot_name = $('<input type="text" value="Plot">');
+    this.plot_name.appendTo(header);
+    this.plot_name.change(function() { graph.update_plots(); });
 
     // Test type selector.
     this.widget.append("Test Type:");
-    this.test_type_select = $("<select></select>");
+    this.test_type_select = $("<select multiple></select>");
     this.test_type_select.change(function() { graph.update_plots(); });
     this.test_type_select.appendTo(this.widget);
-    this.test_type_select.append("<option>All</option>");
     for (var i in this.oar.data.test_subsets) {
         this.test_type_select.append("<option>" + i + "</option>");
     }
@@ -59,9 +66,10 @@
     var selected = this.test_type_select[0].selectedIndex;
     var index = 0;
     for (var i in this.oar.data.test_subsets) {
-        index += 1;
-        if (selected == -1 || selected == 0 || selected == index)
+        var option = this.test_type_select[0].options[index];
+        if (option.selected || selected == -1)
             subsets_to_plot.push(i);
+        index += 1;
     }
 
     // Create this list of machines to aggregate over.
@@ -73,7 +81,7 @@
         }
     }
 
-    return { 'label' : "Plot",
+    return { 'label' : this.plot_name[0].value,
              'subsets_to_plot' : subsets_to_plot,
              'machine_indices_to_plot' : machine_indices_to_plot };
 }
@@ -88,17 +96,31 @@
 }
 
 AggregateGraphWidget.prototype.init = function(parent) {
-    this.widget = $('<div class="oar_graph_widget"></div>');
+    var agw = this;
+
+    this.widget = $('<div class="oar-graph-widget"></div>');
     this.widget.appendTo(parent);
 
     // Create the graph element.
-    this.graph_elt = $('<div style="width:400px;height:300px;"></div>');
+    this.graph_elt = $('<div class="oar-graph-element"></div>');
     this.graph_elt.appendTo(this.widget);
 
     // Create the options UI container element.
-    this.options_elt = $('<div></div>');
+    this.options_elt = $('<div class="oar-graph-options"></div>');
     this.options_elt.appendTo(this.widget);
 
+    // Add the global options.
+    var options_header = $('<div class="oar-graph-options-header"></div>');
+    options_header.appendTo(this.options_elt);
+
+    // Add a button for adding a plot item.
+    var add_plot_button = $('<input type="button" value="Add Plot">');
+    add_plot_button.appendTo(options_header);
+    add_plot_button.click(function () {
+        agw.plot_items.push(new PlotItem(agw).init(agw.options_elt));
+        agw.update_plots();
+    });
+
     // Add the default plot items.
     this.plot_items.push(new PlotItem(this).init(this.options_elt));
 
@@ -196,6 +218,15 @@
     // Initialize the UI  container.
     this.ui_elt = $("#" + this.ui_elt_name);
 
+    // Add a button for adding a graph.
+    var oar = this;
+    var add_graph_button = $('<input type="button" value="Add Graph">');
+    add_graph_button.appendTo(this.ui_elt);
+    add_graph_button.click(function () {
+        oar.graphs.push(new AggregateGraphWidget(oar).init(oar.ui_elt));
+        oar.update_graphs();
+    });
+
     // Add the default graph widget.
     this.graphs.push(new AggregateGraphWidget(this).init(this.ui_elt));
 

Modified: zorg/trunk/lnt/lnt/server/ui/templates/simple_order_aggregate_report.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/templates/simple_order_aggregate_report.html?rev=132159&r1=132158&r2=132159&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/templates/simple_order_aggregate_report.html (original)
+++ zorg/trunk/lnt/lnt/server/ui/templates/simple_order_aggregate_report.html Thu May 26 17:01:04 2011
@@ -9,6 +9,8 @@
 {% block title %}Order Aggregate Report{% endblock %}
 
 {% block head %}
+  <link rel="stylesheet" type="text/css"
+        href="/static/order_aggregate_ui.css">
   <script src="/static/jquery/1.5/jquery.js"></script>
   <script src="/static/flot/jquery.flot.js"></script>
   <script src="/static/order_aggregate_ui.js"></script>

Modified: zorg/trunk/lnt/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/views.py?rev=132159&r1=132158&r2=132159&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/views.py (original)
+++ zorg/trunk/lnt/lnt/server/ui/views.py Thu May 26 17:01:04 2011
@@ -532,8 +532,6 @@
         for run in runs_by_machine_and_order.get((machine_id,order), []):
             status_samples.extend(aggregate_samples.get(
                     (run.id, status_test_id), []))
-            if status_samples:
-                print test_name,status_samples
             samples.extend(aggregate_samples.get(
                     (run.id, test_id), []))
 





More information about the llvm-commits mailing list