public Report(Job j) { _job = j; _linkPage = "http://Z3-1/Nightly/Default.aspx"; _alerts = new Alerts(_job, _linkPage); _images.Add("ok", "ok.png"); _images.Add("warning", "warning.png"); _images.Add("critical", "critical.png"); }
public void buildCategoryPanels() { string limit_str = Request.Params.Get("limit"); if (limit_str != null) _listLimit = Convert.ToUInt32(limit_str); string category = Request.Params.Get("cat"); if (category == null) category = ""; string jobid = Request.Params.Get("job"); phTop.Controls.Add(MakeDaySelectPanel()); #if false // old stuff //if (category == null) //{ // // build overview. // buildCategoryPanel("OVERALL", "", "OVERALL", false, true, true, true, // "A summary of the results across categories.", // "All is well in this everywhere!"); // bool isOdd = false; // Dictionary<string, CategoryStatistics>.Enumerator e = timeline.Categories.GetEnumerator(); // while (e.MoveNext()) // { // buildCategoryPanel(e.Current.Key, e.Current.Key, e.Current.Key, true, isOdd, true, false, // "", // "All is well in this category."); // isOdd = !isOdd; // } //} //else #endif if (jobid == null || jobid == "") { if (category == "" || timeline.Categories.ContainsKey(category)) { Alerts alerts = new Alerts(timeline.LastJob, Request.FilePath); string alliswelltext = (category == "") ? "All is well everywhere!" : "All is well in this category."; buildCategoryPanel(category != "" ? category : "OVERALL", category, category, false, true, false, true, "", alerts); buildJobPanel(timeline.LastJob, alerts, category, alliswelltext); } else { Label l = new Label(); l.Text = "Category not found: " + category; phMain.Controls.Add(l); } } else { try { uint jid = Convert.ToUInt32(jobid); Job j = new Job(config.datadir, jid, true); if (category == "" || timeline.Categories.ContainsKey(category)) { Alerts alerts = new Alerts(j, Request.FilePath); string alliswelltext = (category == "") ? "All is well everywhere!" : "All is well in this category."; buildJobPanel(j, alerts, category, alliswelltext); } else { Label l = new Label(); l.Text = "Category not found: " + category; phMain.Controls.Add(l); } } catch (FileNotFoundException ex) { Label l = new Label(); l.Text = "Error: There is no job #" + jobid + " (" + ex.Message + ")."; phMain.Controls.Add(l); } } phMain.Controls.Add(buildFooter(category)); }
TabPanel buildSummaryTab(string category, string alliswelltext, Alerts alerts) { TabPanel tabSummary = new TabPanel(); string toolTip = "This tab lists all alerts."; if (category == "") { int total = 0; AlertLevel al = AlertLevel.None; foreach (KeyValuePair<string, CategoryStatistics> kvp in timeline.Categories) { string cat = kvp.Key; AlertSet catAlerts = alerts[cat]; total += catAlerts.Count; if ((al == AlertLevel.None && catAlerts.Level != al) || (al == AlertLevel.Warning && catAlerts.Level == AlertLevel.Critical)) al = catAlerts.Level; if (catAlerts.Count > 0) { Label l = new Label(); l.Text = string.Format("Alerts in <a href='" + selfLink(cat) + "' style='text-decoration:none;'>{0}</a>:", cat); tabSummary.Controls.Add(l); tabSummary.Controls.Add(buildAlertMessages(catAlerts, "")); } } TabHeaderTemplate htm = new TabHeaderTemplate(al, "Alerts", toolTip); if (total > 0) htm._title += " (" + total + ")"; tabSummary.HeaderTemplate = htm; tabSummary.ContentTemplate = new TabContentTemplate(new List<string>()); if (total == 0) { Label l = new Label(); l.Text = alliswelltext; l.ForeColor = Color.Green; tabSummary.Controls.Add(l); } } else { AlertSet catAlerts = alerts[category]; TabHeaderTemplate htm = new TabHeaderTemplate(catAlerts.Level, "Alerts", toolTip); if (catAlerts.Count > 0) htm._title += " (" + catAlerts.Count + ")"; tabSummary.HeaderTemplate = htm; tabSummary.ContentTemplate = new TabContentTemplate(new List<string>()); tabSummary.Controls.Add(buildAlertMessages(catAlerts, alliswelltext)); } return tabSummary; }
public void buildCategoryPanel(string title, string category, string tag, bool collapsed, bool isOdd, bool collapsible, bool titleBold, string summaryText, Alerts alerts) { Panel p = new Panel(); p.ID = "Panel_" + tag + "_Header"; p.CssClass = "collapsePanelHeader"; p.Height = 30; if (isOdd) p.BackColor = ColorTranslator.FromHtml("#88EEBB"); else p.BackColor = ColorTranslator.FromHtml("#EEEEEE"); Panel p1 = new Panel(); p1.Style["padding"] = "5px"; p1.Style["cursor"] = "pointer"; p1.Style["vertical-align"] = "middle"; if (collapsible) { ImageButton ib = new ImageButton(); ib.Style["float"] = "left"; ib.ID = "I_" + tag; ib.ImageUrl = "~/img/expand_blue.jpg"; ib.AlternateText = "(...)"; p1.Controls.Add(ib); Label l2 = new Label(); l2.ID = "L_" + tag; l2.Style["float"] = "left"; l2.Style["margin-left"] = "5px"; p1.Controls.Add(l2); } else { System.Web.UI.WebControls.Image ib = new System.Web.UI.WebControls.Image(); ib.Style["float"] = "left"; ib.ImageUrl = "~/img/lookingglass.png"; p1.Controls.Add(ib); } Label l1 = new Label(); l1.Style["float"] = "left"; l1.Style["margin-left"] = "5px"; l1.ForeColor = Color.Black; l1.Text = title; l1.Font.Bold = titleBold; p1.Controls.Add(l1); System.Web.UI.WebControls.Image ai = buildAlertImage(alerts[category].Level); ai.Style["float"] = "right"; p1.Controls.Add(ai); p.Controls.Add(p1); phMain.Controls.Add(p); p = new Panel(); p.ID = "Panel_" + tag + "_Content"; p.CssClass = "collapsePanel"; p.Height = 0; Table t = new Table(); t.Style["border-width"] = "0px"; TableRow r = new TableRow(); TableCell tc = new TableCell(); Label tl = new Label(); tl.Text = summaryText; tc.Controls.Add(tl); r.Cells.Add(tc); t.Rows.Add(r); r = new TableRow(); tc = new TableCell(); tc.Controls.Add(buildChart(category)); r.Cells.Add(tc); t.Rows.Add(r); //r = new TableRow(); //tc = new TableCell(); //tc.Style["padding"] = "0px"; //ChartArea pchart = buildPerformanceChart(category, 900); //tc.Controls.Add(pchart); //r.Cells.Add(tc); //t.Rows.Add(r); p.Controls.Add(t); phMain.Controls.Add(p); Panel space = new Panel(); space.Height = 15; phMain.Controls.Add(space); CollapsiblePanelExtender cep = new CollapsiblePanelExtender(); cep.ID = tag + "_CPE"; cep.TargetControlID = "Panel_" + tag + "_Content"; cep.SuppressPostBack = true; cep.Collapsed = collapsible && collapsed; if (collapsible) { cep.ExpandControlID = "Panel_" + tag + "_Header"; cep.CollapseControlID = "Panel_" + tag + "_Header"; cep.TextLabelID = "L_" + tag; cep.ImageControlID = "I_" + tag; cep.ExpandedImage = "~/img/collapse_blue.jpg"; cep.CollapsedImage = "~/img/expand_blue.jpg"; cep.CollapsedText = "[+]"; cep.ExpandedText = "[-]"; } phMain.Controls.Add(cep); }
void buildJobPanel(Job j, Alerts alerts, string category, string alliswelltext) { AlertSet catAlerts = alerts[category]; TabContainer tc = new TabContainer(); tc.Height = 200; tc.ScrollBars = ScrollBars.Vertical; TabPanel tabSummary = buildSummaryTab(category, alliswelltext, alerts); TabPanel tabStats = new TabPanel(); tabStats.HeaderTemplate = new TabHeaderTemplate(AlertLevel.None, "Statistics", "Statistical information about the job."); tabStats.ContentTemplate = new TabContentTemplate(new List<string>()); tabStats.Controls.Add(buildStatistics(j, category)); tc.Tabs.Add(tabSummary); tc.Tabs.Add(tabStats); tc.Tabs.Add(buildListTab("Errors", AlertLevel.Warning, j.Errors[category], "A benchmark is classified as erroneous when its return value is non-zero (except for memory outs).")); tc.Tabs.Add(buildListTab("Bugs", AlertLevel.Critical, j.Bugs[category], "A benchmark is classified as buggy when its result does not agree with its annotation.")); tc.Tabs.Add(buildListTab("Underperformers", AlertLevel.None, j.Underperformers[category], "A benchmark underperforms when it has SAT/UNSAT annotations and some of them were not achieved.")); tc.Tabs.Add(buildListTab("Dippers", AlertLevel.None, j.Dippers[category], "A benchmark is classified as a dipper when it takes more than 10x more time than in a reference job (usually the previous).")); phMain.Controls.Add(tc); }