From 92b4f8ec18e8c152fcdfc0709c29b78ea4377d75 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 09:31:49 +0200 Subject: [PATCH 001/118] Update ProjectGridRow.cs --- .../WebDashboard/Dashboard/ProjectGridRow.cs | 201 +++++++----------- 1 file changed, 71 insertions(+), 130 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGridRow.cs b/project/WebDashboard/Dashboard/ProjectGridRow.cs index aeaa08aae..3c31f6c17 100644 --- a/project/WebDashboard/Dashboard/ProjectGridRow.cs +++ b/project/WebDashboard/Dashboard/ProjectGridRow.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Drawing; using ThoughtWorks.CruiseControl.Core.Reporting.Dashboard.Navigation; using ThoughtWorks.CruiseControl.Core.Util; @@ -13,6 +14,10 @@ public class ProjectGridRow private readonly IServerSpecifier serverSpecifier; private readonly string url; private readonly string parametersUrl; + private readonly string statistics; + private readonly List lastFiveData; + private readonly int queuePosition; + private Translations translations; public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, string url, string parametersUrl, Translations translations) @@ -23,168 +28,94 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, this.parametersUrl = parametersUrl; } - public string Name + public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, + string url, string parametersUrl, string statistics, List lastFiveData, int queuePosition, Translations translations) + : this(status, serverSpecifier, url, parametersUrl, translations) { - get { return status.Name; } + this.statistics = statistics; + this.lastFiveData = lastFiveData; + this.queuePosition = queuePosition; } - public string Description - { - get - { - if (String.IsNullOrEmpty(status.Description)) return ""; + public string Name { get { return status.Name; } private set; } - return status.Description; - } - } + public string ServerName { get { return serverSpecifier.ServerName; } private set; } + public string Category { get { return status.Category; } private set; } - public string ServerName - { - get { return serverSpecifier.ServerName; } - } + public string BuildStatus { get { return status.BuildStatus.ToString(); } private set; } - public string Category - { - get { return status.Category; } - } + public List LastFiveData { get { return lastFiveData; } private set; } - public string BuildStatus - { - get { return status.BuildStatus.ToString(); } - } + public string BuildStatusHtmlColor { get { return CalculateHtmlColor(status.BuildStatus); } private set; } - public string BuildStatusHtmlColor - { - get { return CalculateHtmlColor(status.BuildStatus); } - } + public string LastBuildDate { get { return DateUtil.FormatDate(status.LastBuildDate); } private set; } - public string LastBuildDate - { - get { return DateUtil.FormatDate(status.LastBuildDate); } - } + public string LastBuildLabel { get { return (status.LastBuildLabel != null ? status.LastBuildLabel : "no build available"); } private set; } - public string NextBuildTime - { - get - { - if (status.NextBuildTime == System.DateTime.MaxValue) - { - return "Force Build Only"; - } - else - { - return DateUtil.FormatDate(status.NextBuildTime); - } - } - } + public string Status { get { return status.Status.ToString(); } private set; } - public string LastBuildLabel - { - get { return (status.LastBuildLabel != null ? status.LastBuildLabel : "no build available"); } - } + public string Activity { get { return status.Activity.ToString(); } private set; } - public string Status - { - get { return status.Status.ToString(); } - } + public string CurrentMessage { get { return status.CurrentMessage; } private set; } - public string Activity - { - get { return status.Activity.ToString(); } - } + public string Breakers { get { return GetMessageText(Message.MessageKind.Breakers); } private set; } - public string CurrentMessage - { - get { return status.CurrentMessage; } - } + public string FailingTasks { get { return GetMessageText(Message.MessageKind.FailingTasks); } private set; } - public string Breakers - { - get - { - return GetMessageText(Message.MessageKind.Breakers); - } - } + public string Fixer { get { return GetMessageText(Message.MessageKind.Fixer); } private set; } - public string FailingTasks - { - get - { - return GetMessageText(Message.MessageKind.FailingTasks); - } - } + public string Url { get { return url; } private set; } - public string Fixer - { - get - { - return GetMessageText(Message.MessageKind.Fixer); - } - } + public string Queue { get { return status.Queue; } private set; } - public string Url - { - get { return url; } - } + public int QueuePriority { get { return status.QueuePriority; } private set; } + public int QueuePosition { get { return queuePosition; } private set; } - public string Queue - { - get { return status.Queue; } - } + public string StartStopButtonName { get { return (status.Status == ProjectIntegratorState.Running) ? "StopBuild" : "StartBuild"; } private set; } + public string StartStopButtonValue { get { return (status.Status == ProjectIntegratorState.Running) ? "Stop" : "Start"; } private set; } - public int QueuePriority - { - get { return status.QueuePriority; } - } + public string ForceAbortBuildButtonName { get { return (status.Activity != ProjectActivity.Building) ? "ForceBuild" : "AbortBuild"; } private set; } + public string ForceAbortBuildButtonValue { get { return (status.Activity != ProjectActivity.Building) ? "Force" : "Abort"; } private set; } - public string StartStopButtonName - { - get { return (status.Status == ProjectIntegratorState.Running) ? "StopBuild" : "StartBuild"; } - } + public bool AllowForceBuild { get { return serverSpecifier.AllowForceBuild && status.ShowForceBuildButton; } private set; } - public string StartStopButtonValue - { - get { return (status.Status == ProjectIntegratorState.Running) ? "Stop" : "Start"; } - } + public bool AllowStartStopBuild { get { return serverSpecifier.AllowStartStopBuild && status.ShowStartStopButton; } private set; } - public string ForceAbortBuildButtonName - { - get { return (status.Activity != ProjectActivity.Building) ? "ForceBuild" : "AbortBuild"; } - } + public string Statistics { get { return this.statistics; } private set; } - public string ForceAbortBuildButtonValue - { - get { return (status.Activity != ProjectActivity.Building) ? "Force" : "Abort"; } - } + public string ParametersUrl { get { return parametersUrl; } private set; } - public bool AllowForceBuild + public string Description { - get { return serverSpecifier.AllowForceBuild && status.ShowForceBuildButton; } - } + get + { + if (String.IsNullOrEmpty(status.Description)) return ""; - public bool AllowStartStopBuild - { - get { return serverSpecifier.AllowStartStopBuild && status.ShowStartStopButton; } + return status.Description; + } + + private set; } - private string CalculateHtmlColor(IntegrationStatus integrationStatus) + public string NextBuildTime { - if (integrationStatus == IntegrationStatus.Success) - { - return Color.Green.Name; - } - else if (integrationStatus == IntegrationStatus.Unknown) - { - return Color.Blue.Name; - } - else + get { - return Color.Red.Name; + if (status.NextBuildTime == System.DateTime.MaxValue) + { + return "Force Build Only"; + } + else + { + return DateUtil.FormatDate(status.NextBuildTime); + } } + + private set; } public string BuildStage @@ -202,14 +133,25 @@ public string BuildStage return CurrentBuildStage; } } + private set; } - public string ParametersUrl + private string CalculateHtmlColor(IntegrationStatus integrationStatus) { - get { return parametersUrl; } + if (integrationStatus == IntegrationStatus.Success) + { + return Color.Green.Name; + } + else if (integrationStatus == IntegrationStatus.Unknown) + { + return Color.Blue.Name; + } + else + { + return Color.Red.Name; + } } - private string GetMessageText(Message.MessageKind messageType) { foreach (Message m in status.Messages) @@ -220,7 +162,6 @@ private string GetMessageText(Message.MessageKind messageType) } } return string.Empty; - } } } From 5989589fceb955fb7a00ed292f83a4cf11c7ef84 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 09:33:11 +0200 Subject: [PATCH 002/118] Update Web.config --- project/WebDashboard/Web.config | 122 ++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 55 deletions(-) diff --git a/project/WebDashboard/Web.config b/project/WebDashboard/Web.config index 7b86acfbe..e93415183 100644 --- a/project/WebDashboard/Web.config +++ b/project/WebDashboard/Web.config @@ -1,63 +1,75 @@ - + - - - - - - - + + + + + + + + + + - The following attributes can be set on the tag. - - - - --> - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - \ No newline at end of file + + + + + + + + + From 97136d3d27386e74cab4cf6bb68c61a49ba783b2 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 09:33:26 +0200 Subject: [PATCH 003/118] Update Web.config --- project/WebDashboard/Web.config | 122 ++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 55 deletions(-) diff --git a/project/WebDashboard/Web.config b/project/WebDashboard/Web.config index 7b86acfbe..e93415183 100644 --- a/project/WebDashboard/Web.config +++ b/project/WebDashboard/Web.config @@ -1,63 +1,75 @@ - + - - - - - - - + + + + + + + + + + - The following attributes can be set on the tag. - - - - --> - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - \ No newline at end of file + + + + + + + + + From f2fb3bfec2b7b6856dd0aff205506c88c7ce45b1 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 09:34:38 +0200 Subject: [PATCH 004/118] Update ProjectGrid.cs --- project/WebDashboard/Dashboard/ProjectGrid.cs | 267 +++++++++++++----- 1 file changed, 200 insertions(+), 67 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGrid.cs b/project/WebDashboard/Dashboard/ProjectGrid.cs index 9e676b831..dfcc3a71a 100644 --- a/project/WebDashboard/Dashboard/ProjectGrid.cs +++ b/project/WebDashboard/Dashboard/ProjectGrid.cs @@ -1,84 +1,217 @@ +using System; +using System.Configuration; using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Xml.Linq; using System.Linq; +using System.Diagnostics; using ThoughtWorks.CruiseControl.Core.Reporting.Dashboard.Navigation; using ThoughtWorks.CruiseControl.Remote; using ThoughtWorks.CruiseControl.WebDashboard.Plugins.ProjectReport; using ThoughtWorks.CruiseControl.WebDashboard.Resources; using ThoughtWorks.CruiseControl.WebDashboard.ServerConnection; +using ThoughtWorks.CruiseControl.WebDashboard.Plugins.BuildReport; +using ThoughtWorks.CruiseControl.Core.Queues; namespace ThoughtWorks.CruiseControl.WebDashboard.Dashboard { public class ProjectGrid : IProjectGrid - { - public ProjectGridRow[] GenerateProjectGridRows(ProjectStatusOnServer[] statusList, string forceBuildActionName, - ProjectGridSortColumn sortColumn, bool sortIsAscending, string categoryFilter, - ICruiseUrlBuilder urlBuilder, Translations translations) - { - var rows = new List(); - foreach (ProjectStatusOnServer statusOnServer in statusList) - { - ProjectStatus status = statusOnServer.ProjectStatus; - IServerSpecifier serverSpecifier = statusOnServer.ServerSpecifier; - DefaultProjectSpecifier projectSpecifier = new DefaultProjectSpecifier(serverSpecifier, status.Name); - - if ((categoryFilter != string.Empty) && (categoryFilter != status.Category)) - continue; - - rows.Add( - new ProjectGridRow(status, - serverSpecifier, - urlBuilder.BuildProjectUrl(ProjectReportProjectPlugin.ACTION_NAME, projectSpecifier), - urlBuilder.BuildProjectUrl(ProjectParametersAction.ActionName, projectSpecifier), - translations)); - } - - return rows.OrderBy(a => a, GetComparer(sortColumn, sortIsAscending)).ToArray(); - } - - private IComparer GetComparer(ProjectGridSortColumn column, bool ascending) - { - return new ProjectGridRowComparer(column, ascending); - } - - private class ProjectGridRowComparer + { + public ProjectGridRow[] GenerateProjectGridRows(ProjectGridParameters parameters) + { + var rows = new List(); + var farmService = parameters.FarmService; + string disk = new AppSettingsReader().GetValue("disk", typeof(System.String)).ToString(); + string server = new AppSettingsReader().GetValue("framework", typeof(System.String)).ToString(); + + + foreach (ProjectStatusOnServer statusOnServer in parameters.StatusList) + { + ProjectStatus status = statusOnServer.ProjectStatus; + IServerSpecifier serverSpecifier = statusOnServer.ServerSpecifier; + DefaultProjectSpecifier projectSpecifier = new DefaultProjectSpecifier(serverSpecifier, status.Name); + + if ((parameters.CategoryFilter != string.Empty) && (parameters.CategoryFilter != status.Category)) + continue; + + string dir = disk + server + @"\"; + //string dir = @"c:\heartbeat\"; + string statistics = ""; + + if (Directory.Exists(dir)) + { + var file = String.Format(dir + @"{0}\ccnet\{1}\TestResults.html", serverSpecifier.ServerName, projectSpecifier.ProjectName); + try + { + statistics = File.ReadAllText(file); + } + catch (Exception e) + { + statistics = String.Format("", e.Message.Replace("-->", "- - >")); + } + } + + List lastFiveDataGridRows = getLastFiveDataGridRows(serverSpecifier, projectSpecifier, dir, farmService, status); + int queuePosition = getQueuePosition(status, projectSpecifier); + + rows.Add( + new ProjectGridRow(status, + serverSpecifier, + parameters.UrlBuilder.BuildProjectUrl(ProjectReportProjectPlugin.ACTION_NAME, projectSpecifier), + parameters.UrlBuilder.BuildProjectUrl(ProjectParametersAction.ActionName, projectSpecifier), + statistics, + lastFiveDataGridRows, + queuePosition, + parameters.Translation)); + } + + rows.Sort(GetComparer(parameters.SortColumn, parameters.SortIsAscending)); + return rows.ToArray(); + } + + private IComparer GetComparer(ProjectGridSortColumn column, bool ascending) + { + return new ProjectGridRowComparer(column, ascending); + } + + private class ProjectGridRowComparer : IComparer - { - private readonly ProjectGridSortColumn column; - private readonly bool ascending; + { + private readonly ProjectGridSortColumn column; + private readonly bool ascending; - public ProjectGridRowComparer(ProjectGridSortColumn column, bool ascending) - { - this.column = column; - this.ascending = ascending; - } + public ProjectGridRowComparer(ProjectGridSortColumn column, bool ascending) + { + this.column = column; + this.ascending = ascending; + } public int Compare(ProjectGridRow x, ProjectGridRow y) - { - if (column == ProjectGridSortColumn.Name) - { - return x.Name.CompareTo(y.Name)*(ascending ? 1 : -1); - } - else if (column == ProjectGridSortColumn.LastBuildDate) - { - return x.LastBuildDate.CompareTo(y.LastBuildDate)*(ascending ? 1 : -1); - } - else if (column == ProjectGridSortColumn.BuildStatus) - { - return x.BuildStatus.CompareTo(y.BuildStatus)*(ascending ? 1 : -1); - } - else if (column == ProjectGridSortColumn.ServerName) - { - return x.ServerName.CompareTo(y.ServerName)*(ascending ? 1 : -1); - } - else if (column == ProjectGridSortColumn.Category) + { + if (column == ProjectGridSortColumn.Name) + { + return x.Name.CompareTo(y.Name) * (ascending ? 1 : -1); + } + else if (column == ProjectGridSortColumn.LastBuildDate) + { + return x.LastBuildDate.CompareTo(y.LastBuildDate) * (ascending ? 1 : -1); + } + else if (column == ProjectGridSortColumn.BuildStatus) + { + return x.BuildStatus.CompareTo(y.BuildStatus) * (ascending ? 1 : -1); + } + else if (column == ProjectGridSortColumn.ServerName) + { + return x.ServerName.CompareTo(y.ServerName) * (ascending ? 1 : -1); + } + else if (column == ProjectGridSortColumn.Category) + { + return x.Category.CompareTo(y.Category) * (ascending ? 1 : -1); + } + else + { + return 0; + } + } + } + + private List getLastFiveDataGridRows(IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, string dir, IFarmService farmService, ProjectStatus status) + { + var lastFiveDataList = new List(); + IBuildSpecifier[] mostRecentBuildSpecifiers = farmService.GetMostRecentBuildSpecifiers(projectSpecifier, 5, BuildReportBuildPlugin.ACTION_NAME); + if (Directory.Exists(dir)) + { + foreach (IBuildSpecifier buildSpecifier in mostRecentBuildSpecifiers) + { + lastFiveDataList.Add(getBuildData(serverSpecifier, projectSpecifier, dir, status, buildSpecifier)); + } + } + return lastFiveDataList; + } + + private DataGridRow getBuildData(IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, string dir, ProjectStatus status, IBuildSpecifier buildSpecifier) + { + DataGridRow dataToReturn; + string localserver = new AppSettingsReader().GetValue("servername", typeof(System.String)).ToString(); + + var file = String.Format(dir + @"{0}\ccnet\{1}\Artifacts\buildlogs\{2}", localserver, projectSpecifier.ProjectName,buildSpecifier.BuildName); + try + { + var doc = XDocument.Load(file); + string lastStatus = ""; + string lastDate = ""; + string lastRunningTime = ""; + string lastLink = ""; + var tests = doc.Descendants("CCNetIntegrationStatus"); + foreach (var test in tests) + { + lastStatus = test.Value; + } + + var elemList = doc.Descendants("build"); + foreach (var node in elemList) + { + lastDate = (string)node.Attribute("date"); + + lastRunningTime = (string)node.Attribute("buildtime"); + if (status.BuildStatus.ToString() == "Success") + { + lastLink = String.Format("http://{0}/ccnet/server/{0}/project/{1}/build/{2}/ViewBuildReport.aspx", serverSpecifier.ServerName, projectSpecifier.ProjectName, buildSpecifier.BuildName); + } + else + { + lastLink = ""; + } + } + DataGridRow aux = new DataGridRow(lastStatus, lastDate, lastRunningTime, lastLink); + dataToReturn = aux; + } + catch (Exception e) + { + throw new System.ArgumentException("File not found or corrupted. Error: " + e, "Argument"); + } + return dataToReturn; + } + + private int getQueuePosition(ProjectStatus status, DefaultProjectSpecifier projectSpecifier) + { + if(status.Activity.ToString().Equals("Pending")) + { + return getPositionInQueueList(status, projectSpecifier); + } + else + { + return -1; + } + } + + private int getPositionInQueueList(ProjectStatus status, DefaultProjectSpecifier projectSpecifier) + { + int positionInQueue; + Debug.WriteLine("Queue Name from status:" + status.Queue); + QueueSnapshot queueSnapshot = new QueueSnapshot(status.Queue); + + //IntegrationQueue IQ = new IntegrationQueue(status.Queue); + //var test = IQ.GetQueuedIntegrations; + Debug.WriteLine("Queue Name:" + queueSnapshot.QueueName); + + Debug.WriteLine("Queue empty? " + queueSnapshot.IsEmpty); + List queueList = queueSnapshot.Requests; + Debug.WriteLine("Queue size:" + queueList.Count); + + int count = 1; //Position 0 would be the building project + foreach (QueuedRequestSnapshot queueRequestSnapshot in queueList) + { + Debug.WriteLine(count); + if (projectSpecifier.ProjectName == queueRequestSnapshot.ProjectName) { - return x.Category.CompareTo(y.Category)*(ascending ? 1 : -1); - } - else - { - return 0; - } - } - } - } + positionInQueue = count; + return positionInQueue; + } + count++; + } + return -1; + } + } } From c7c051ddad7dac4951fac6fa86d80487df08a936 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 09:36:20 +0200 Subject: [PATCH 005/118] Create DataGridRow.cs --- project/WebDashboard/Dashboard/DataGridRow.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 project/WebDashboard/Dashboard/DataGridRow.cs diff --git a/project/WebDashboard/Dashboard/DataGridRow.cs b/project/WebDashboard/Dashboard/DataGridRow.cs new file mode 100644 index 000000000..bec2d6c1c --- /dev/null +++ b/project/WebDashboard/Dashboard/DataGridRow.cs @@ -0,0 +1,32 @@ +using System; +using ThoughtWorks.CruiseControl.Core.Reporting.Dashboard.Navigation; +using ThoughtWorks.CruiseControl.Core.Util; +using ThoughtWorks.CruiseControl.Remote; +using ThoughtWorks.CruiseControl.WebDashboard.Resources; + +namespace ThoughtWorks.CruiseControl.WebDashboard.Dashboard +{ + public class DataGridRow + { + private readonly string buildStatus; + private readonly string date; + private readonly string runningTime; + private readonly string link; + + public DataGridRow(string buildStatus, string date, string runningTime, string link) + { + this.buildStatus = buildStatus; + this.date = date; + this.runningTime = runningTime; + this.link = link; + } + + public string BuildStatus { get { return buildStatus; } private set; } + + public string Date { get { return date; } private set; } + + public string RunningTime { get { return runningTime; } private set; } + + public string Link { get { return link; } private set; } + } +} From 7ff85d89ad2e759363508249117909558e2d129b Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 09:38:21 +0200 Subject: [PATCH 006/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 603 ++++++++++-------- 1 file changed, 348 insertions(+), 255 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 4bc32b3a0..033ef2859 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -1,265 +1,358 @@ - - - -
- - - - -
- -
-
+ + -#if ($forceBuildMessage.Length > 0) -

- - - $translations.Translate($forceBuildMessage) - - -

-#end + +
+ + + + +
+ +
+
+ + + #if ($forceBuildMessage.Length > 0) +

+ + + $translations.Translate($forceBuildMessage) + + +

+ #end -#set ($ProjectOKCounter = 0) -#set ($ProjectNOKCounter = 0) -#foreach ($projectGridRow in $projectGrid) - #if ($projectGridRow.BuildStatus == "Success") - #set ($ProjectOKCounter = $ProjectOKCounter + 1) - #else - #set ($ProjectNOKCounter = $ProjectNOKCounter + 1) - #end -#end -#set ($ProjectCounter = $ProjectOKCounter + $ProjectNOKCounter) -#if ($ProjectCounter == 0) - #set ($OKPercent = 50) - #set ($NOKPercent = 0) -#else - #set ($OKPercent = 50 * $ProjectOKCounter / $ProjectCounter) - #set ($NOKPercent = 50 - $OKPercent) -#end -#set ($OKPercentToolTip = $OKPercent * 2) + #set ($ProjectOKCounter = 0) + #set ($ProjectNOKCounter = 0) + #foreach ($projectGridRow in $projectGrid) + #if ($projectGridRow.BuildStatus == "Success") + #set ($ProjectOKCounter = $ProjectOKCounter + 1) + #else + #set ($ProjectNOKCounter = $ProjectNOKCounter + 1) + #end + #end + #set ($ProjectCounter = $ProjectOKCounter + $ProjectNOKCounter) + #if ($ProjectCounter == 0) + #set ($OKPercent = 50) + #set ($NOKPercent = 0) + #else + #set ($OKPercent = 50 * $ProjectOKCounter / $ProjectCounter) + #set ($NOKPercent = 50 - $OKPercent) + #end + #set ($OKPercentToolTip = $OKPercent * 2) -#if ($projectGrid.Length > 0) - - - #if ($barAtTop) - - - - #end - - #if ($wholeFarm) - - #end - - - - - - - - - - - - + #if ($projectGrid.Length > 0) +
- - - #if ($OKPercent == 50) - - #else - - - - - #end - -
-
$translations.Translate("Server")$translations.Translate("Admin")$translations.Translate("Project Name")$translations.Translate("Last Build Status")$translations.Translate("Last Build Time")$translations.Translate("Next Build Time")$translations.Translate("Last Build Label")$translations.Translate("CCNet Status")$translations.Translate("Activity")$translations.Translate("Messages")
+ + #if ($barAtTop) + + + + #end + + + + + + + + + + + + + + + + - #set ($RowId = 0) - #foreach ($projectGridRow in $projectGrid) - #set ($RowId = $RowId + 1) + #set ($RowId = 0) + #foreach ($projectGridRow in $projectGrid) + #set ($RowId = $RowId + 1) + #set($cont=0) + + + #set($add=$lastsFive.add("red")) + #set($add=$lastsFive.add("blue")) - - #if ($wholeFarm) - - #end - - - - - - - - - + + + + + #if ($projectGridRow.Breakers.Length == 0) + + - - #if ($projectGridRow.BuildStage.Length > 0) - - #if ($wholeFarm) - - #else - - #end - - #end - #end - - #if ($barAtBottom) - - - - - - #end -
+ + + #if ($OKPercent == 50) + + #else + + + + + #end + +
+
$translations.Translate("Project Name")$translations.Translate("Last 5 Builds")$translations.Translate("Statistics")$translations.Translate("Messages")$translations.Translate("Last Build Time")$translations.Translate("Running Time")$translations.Translate("Status")$translations.Translate("Queue Position(Priority)")$translations.Translate("Activity")$translations.Translate("Admin")
$projectGridRow.ServerName -
- - - - #if ($projectGridRow.allowForceBuild) - #if($projectGridRow.ForceAbortBuildButtonValue == "Force") - - #else - - #end - #end - #if ($projectGridRow.AllowStartStopBuild) - - #end - -
-
- $projectGridRow.Name - $translations.Translate($projectGridRow.BuildStatus)$projectGridRow.LastBuildDate$translations.Translate($projectGridRow.NextBuildTime)$translations.Translate($projectGridRow.LastBuildLabel)$translations.Translate($projectGridRow.Status)$translations.Translate($projectGridRow.Activity.ToString()) -
    - #if ($projectGridRow.Breakers.Length > 0) -
  • $translations.Translate("Breakers : {0}", $projectGridRow.Breakers)
  • - #end - #if ($projectGridRow.Fixer.Length > 0) -
  • $projectGridRow.Fixer
  • - #end - #if ($projectGridRow.FailingTasks.Length > 0) -
  • $translations.Translate("Failing Tasks : {0}", $projectGridRow.FailingTasks)
  • - #end -
-
+ $projectGridRow.Name + + #set($cont = 0) + #foreach($dataGridRow in $projectGridRow.LastFiveData) + #if ($dataGridRow.BuildStatus == "Failure" ) + #set($color = "red") + #set($span = "Failure: ") + #elseif ($dataGridRow.BuildStatus == "Exception" ) + #set($color = "orange") + #set($span = "Exception: ") + #elseif ($dataGridRow.BuildStatus == "Unknown" ) + #set($color = "blue") + #set($span = "Unknown: ") + #else + #set($color = "green") + #set($span = "Success: ") + #end + #set($date = $dataGridRow.Date) + #set($link = $dataGridRow.Link) + #set($runningTime = $dataGridRow.RunningTime) + + + + + + #set($cont = $cont + 1) + #end + $projectGridRow.Statistics + #else + + #end +
    + #if ($projectGridRow.Fixer.Length > 0) +
  • $projectGridRow.Fixer
  • + #end + #if (($projectGridRow.Breakers.Length > 0) && ($translations.Translate($projectGridRow.BuildStatus) == "Failure")) +
  • + $translations.Translate("Breakers :
    {0}",$projectGridRow.Breakers) +
  • + #end +
+
+ $projectGridRow.LastBuildDate +
$translations.FormatBuildStage($projectGridRow.BuildStage)$translations.FormatBuildStage($projectGridRow.BuildStage)
- - - #if ($OKPercent == 50) - - #else - - - - - #end - -
-
-#end + + $runningTime + + + $translations.Translate($projectGridRow.Status) + $projectGridRow.QueuePriority + + $translations.Translate($projectGridRow.Activity.ToString())($projectGridRow.QueuePriority) + #if($projectGridRow.Activity.ToString() == "Pending") + ($projectGridRow.QueuePosition) + #end + + +
+ + + + + #if ($projectGridRow.allowForceBuild) + #if($projectGridRow.ForceAbortBuildButtonValue == "Force") + + + + #else + + + + #end + #end + #if ($projectGridRow.AllowStartStopBuild) + #if ($projectGridRow.Status == "Running") + + + + #else + + + + #end + #if ($projectGridRow.Activity.ToString() == "Pending") + + + + + #end + #end + #if ($projectGridRow.BuildStatus != "Success") + + #end + +
+ + + #if ($projectGridRow.BuildStage.Length > 0) + + #if ($wholeFarm) + $translations.FormatBuildStage($projectGridRow.BuildStage) + #else + $translations.FormatBuildStage($projectGridRow.BuildStage) + #end + + #end + #end + + #if ($barAtBottom) + + + + + + #if ($OKPercent == 50) + + #else + + + + + #end + +
+ + + + #end + + #end -#if ($exceptions.Length > 0) -

- - $translations.Translate("There were exceptions connecting to the following servers"): - -

- - - - - - - #foreach ($exception in $exceptions) - - - - - - #end -
- - $translations.Translate("Server") - - - - $translations.Translate("Url") - - - - $translations.Translate("Message") - -
- $exception.ServerName - - $exception.Url - - $exception.Message -
-#end - + #if ($exceptions.Length > 0) +

+ + $translations.Translate("There were exceptions connecting to the following servers"): + +

+ + + + + + + #foreach ($exception in $exceptions) + + + + + + #end +
+ + $translations.Translate("Server") + + + + $translations.Translate("Url") + + + + $translations.Translate("Message") + +
+ $exception.ServerName + + $exception.Url + + $exception.Message +
+ #end + From f01fdee43ccf45c31006d75bc53462c9bbd1ad51 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 10:13:10 +0200 Subject: [PATCH 007/118] Update DataGridRow.cs Sets deleteds --- project/WebDashboard/Dashboard/DataGridRow.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/project/WebDashboard/Dashboard/DataGridRow.cs b/project/WebDashboard/Dashboard/DataGridRow.cs index bec2d6c1c..de6117e39 100644 --- a/project/WebDashboard/Dashboard/DataGridRow.cs +++ b/project/WebDashboard/Dashboard/DataGridRow.cs @@ -21,12 +21,12 @@ public DataGridRow(string buildStatus, string date, string runningTime, string l this.link = link; } - public string BuildStatus { get { return buildStatus; } private set; } + public string BuildStatus { get { return buildStatus; } } - public string Date { get { return date; } private set; } + public string Date { get { return date; } } - public string RunningTime { get { return runningTime; } private set; } + public string RunningTime { get { return runningTime; } } - public string Link { get { return link; } private set; } + public string Link { get { return link; } } } } From e8b19df205aedc0b1189b1bf02d2666e1f7ecf24 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 10:13:55 +0200 Subject: [PATCH 008/118] Update ProjectGridRow.cs Sets deleteds --- .../WebDashboard/Dashboard/ProjectGridRow.cs | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGridRow.cs b/project/WebDashboard/Dashboard/ProjectGridRow.cs index 3c31f6c17..06121e2a4 100644 --- a/project/WebDashboard/Dashboard/ProjectGridRow.cs +++ b/project/WebDashboard/Dashboard/ProjectGridRow.cs @@ -37,57 +37,57 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, this.queuePosition = queuePosition; } - public string Name { get { return status.Name; } private set; } + public string Name { get { return status.Name; } } - public string ServerName { get { return serverSpecifier.ServerName; } private set; } + public string ServerName { get { return serverSpecifier.ServerName; } } - public string Category { get { return status.Category; } private set; } + public string Category { get { return status.Category; } } - public string BuildStatus { get { return status.BuildStatus.ToString(); } private set; } + public string BuildStatus { get { return status.BuildStatus.ToString(); } } - public List LastFiveData { get { return lastFiveData; } private set; } + public List LastFiveData { get { return lastFiveData; } } - public string BuildStatusHtmlColor { get { return CalculateHtmlColor(status.BuildStatus); } private set; } + public string BuildStatusHtmlColor { get { return CalculateHtmlColor(status.BuildStatus); } } - public string LastBuildDate { get { return DateUtil.FormatDate(status.LastBuildDate); } private set; } + public string LastBuildDate { get { return DateUtil.FormatDate(status.LastBuildDate); } } - public string LastBuildLabel { get { return (status.LastBuildLabel != null ? status.LastBuildLabel : "no build available"); } private set; } + public string LastBuildLabel { get { return (status.LastBuildLabel != null ? status.LastBuildLabel : "no build available"); } } - public string Status { get { return status.Status.ToString(); } private set; } + public string Status { get { return status.Status.ToString(); } } - public string Activity { get { return status.Activity.ToString(); } private set; } + public string Activity { get { return status.Activity.ToString(); } } - public string CurrentMessage { get { return status.CurrentMessage; } private set; } + public string CurrentMessage { get { return status.CurrentMessage; } } - public string Breakers { get { return GetMessageText(Message.MessageKind.Breakers); } private set; } + public string Breakers { get { return GetMessageText(Message.MessageKind.Breakers); } } - public string FailingTasks { get { return GetMessageText(Message.MessageKind.FailingTasks); } private set; } + public string FailingTasks { get { return GetMessageText(Message.MessageKind.FailingTasks); } } - public string Fixer { get { return GetMessageText(Message.MessageKind.Fixer); } private set; } + public string Fixer { get { return GetMessageText(Message.MessageKind.Fixer); } } - public string Url { get { return url; } private set; } + public string Url { get { return url; } } - public string Queue { get { return status.Queue; } private set; } + public string Queue { get { return status.Queue; } } - public int QueuePriority { get { return status.QueuePriority; } private set; } + public int QueuePriority { get { return status.QueuePriority; } } - public int QueuePosition { get { return queuePosition; } private set; } + public int QueuePosition { get { return queuePosition; } } - public string StartStopButtonName { get { return (status.Status == ProjectIntegratorState.Running) ? "StopBuild" : "StartBuild"; } private set; } + public string StartStopButtonName { get { return (status.Status == ProjectIntegratorState.Running) ? "StopBuild" : "StartBuild"; } } - public string StartStopButtonValue { get { return (status.Status == ProjectIntegratorState.Running) ? "Stop" : "Start"; } private set; } + public string StartStopButtonValue { get { return (status.Status == ProjectIntegratorState.Running) ? "Stop" : "Start"; } } - public string ForceAbortBuildButtonName { get { return (status.Activity != ProjectActivity.Building) ? "ForceBuild" : "AbortBuild"; } private set; } + public string ForceAbortBuildButtonName { get { return (status.Activity != ProjectActivity.Building) ? "ForceBuild" : "AbortBuild"; } } - public string ForceAbortBuildButtonValue { get { return (status.Activity != ProjectActivity.Building) ? "Force" : "Abort"; } private set; } + public string ForceAbortBuildButtonValue { get { return (status.Activity != ProjectActivity.Building) ? "Force" : "Abort"; } } - public bool AllowForceBuild { get { return serverSpecifier.AllowForceBuild && status.ShowForceBuildButton; } private set; } + public bool AllowForceBuild { get { return serverSpecifier.AllowForceBuild && status.ShowForceBuildButton; } } - public bool AllowStartStopBuild { get { return serverSpecifier.AllowStartStopBuild && status.ShowStartStopButton; } private set; } + public bool AllowStartStopBuild { get { return serverSpecifier.AllowStartStopBuild && status.ShowStartStopButton; } } - public string Statistics { get { return this.statistics; } private set; } + public string Statistics { get { return this.statistics; } } - public string ParametersUrl { get { return parametersUrl; } private set; } + public string ParametersUrl { get { return parametersUrl; } } public string Description { @@ -97,8 +97,6 @@ public string Description return status.Description; } - - private set; } public string NextBuildTime @@ -114,8 +112,6 @@ public string NextBuildTime return DateUtil.FormatDate(status.NextBuildTime); } } - - private set; } public string BuildStage @@ -133,7 +129,6 @@ public string BuildStage return CurrentBuildStage; } } - private set; } private string CalculateHtmlColor(IntegrationStatus integrationStatus) From db631a228680f5ebabad060b93f46414816cde8c Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 14:40:37 +0200 Subject: [PATCH 009/118] Create ProjectGridParameters.cs --- .../Dashboard/ProjectGridParameters.cs | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 project/WebDashboard/Dashboard/ProjectGridParameters.cs diff --git a/project/WebDashboard/Dashboard/ProjectGridParameters.cs b/project/WebDashboard/Dashboard/ProjectGridParameters.cs new file mode 100644 index 000000000..0e89ae454 --- /dev/null +++ b/project/WebDashboard/Dashboard/ProjectGridParameters.cs @@ -0,0 +1,46 @@ +using System; +using ThoughtWorks.CruiseControl.Core.Reporting.Dashboard.Navigation; +using ThoughtWorks.CruiseControl.Core.Util; +using ThoughtWorks.CruiseControl.Remote; +using ThoughtWorks.CruiseControl.WebDashboard.Resources; +using ThoughtWorks.CruiseControl.WebDashboard.ServerConnection; + +namespace ThoughtWorks.CruiseControl.WebDashboard.Dashboard +{ + public class ProjectGridParameters + { + private readonly ProjectStatusOnServer[] statusList; + private readonly ProjectGridSortColumn sortColumn; + private readonly bool sortIsAscending; + private readonly string categoryFilter; + private readonly ICruiseUrlBuilder urlBuilder; + private readonly IFarmService farmService; + private readonly Translations translation; + + public ProjectGridParameters(ProjectStatusOnServer[] statusList, ProjectGridSortColumn sortColumn, bool sortIsAscending, string categoryFilter, + ICruiseUrlBuilder urlBuilder, IFarmService farmService, Translations translation) + { + this.statusList = statusList; + this.sortColumn = sortColumn; + this.sortIsAscending = sortIsAscending; + this.categoryFilter = categoryFilter; + this.urlBuilder = urlBuilder; + this.farmService = farmService; + this.translation = translation; + } + + public ProjectStatusOnServer[] StatusList { get { return statusList; } } + + public ProjectGridSortColumn SortColumn { get { return sortColumn; } } + + public bool SortIsAscending { get { return sortIsAscending; } } + + public string CategoryFilter { get { return categoryFilter; } } + + public ICruiseUrlBuilder UrlBuilder { get { return urlBuilder; } } + + public IFarmService FarmService { get { return farmService; } } + + public Translations Translation { get { return translation; } } + } +} From 0335e8e735a44aec876ca1e8fdceb8403040edfb Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 12 Apr 2016 14:40:58 +0200 Subject: [PATCH 010/118] Update VelocityProjectGridAction.cs --- .../Dashboard/VelocityProjectGridAction.cs | 98 +++++++++---------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs index 975b3cb04..9c5ff5169 100644 --- a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs +++ b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs @@ -2,6 +2,8 @@ using System.Collections; using System.Collections.Generic; using System.Web; +//using System.Web.Http; +using System.Diagnostics; using ThoughtWorks.CruiseControl.Core; using ThoughtWorks.CruiseControl.Core.Reporting.Dashboard.Navigation; using ThoughtWorks.CruiseControl.WebDashboard.IO; @@ -15,23 +17,23 @@ namespace ThoughtWorks.CruiseControl.WebDashboard.Dashboard // ToDo - Test! public class VelocityProjectGridAction : IProjectGridAction { - private readonly IFarmService farmService; - private IUrlBuilder urlBuilder; - private ICruiseUrlBuilder cruiseUrlBuilder; - private readonly IVelocityViewGenerator viewGenerator; - private readonly IProjectGrid projectGrid; - private readonly ISessionRetriever sessionRetriever; - private ProjectGridSortColumn sortColumn = ProjectGridSortColumn.Name; - private Translations translations; - - public VelocityProjectGridAction(IFarmService farmService, IVelocityViewGenerator viewGenerator, + private readonly IFarmService FarmService; + private IUrlBuilder UrlBuilder; + private ICruiseUrlBuilder CruiseUrlBuilder; + private readonly IVelocityViewGenerator ViewGenerator; + private readonly IProjectGrid ProjectGrid; + private readonly ISessionRetriever SessionRetriever; + private ProjectGridSortColumn SortColumn = ProjectGridSortColumn.Name; + private Translations translation; + + public VelocityProjectGridAction(IFarmService farmServices, IVelocityViewGenerator viewGenerator, IProjectGrid projectGrid, ISessionRetriever sessionRetriever) { - this.farmService = farmService; - this.viewGenerator = viewGenerator; - this.projectGrid = projectGrid; - this.sessionRetriever = sessionRetriever; + this.FarmService = farmServices; + this.ViewGenerator = viewGenerator; + this.ProjectGrid = projectGrid; + this.SessionRetriever = sessionRetriever; } #region Properties @@ -41,8 +43,8 @@ public VelocityProjectGridAction(IFarmService farmService, IVelocityViewGenerato /// public ProjectGridSortColumn DefaultSortColumn { - get { return sortColumn; } - set { sortColumn = value; } + get { return SortColumn; } + set { SortColumn = value; } } #endregion @@ -57,53 +59,49 @@ public ProjectGridSortColumn DefaultSortColumn public IResponse Execute(string actionName, ICruiseRequest request) { - return GenerateView(farmService.GetProjectStatusListAndCaptureExceptions(request.RetrieveSessionToken()), actionName, request, null); + return GenerateView(FarmService.GetProjectStatusListAndCaptureExceptions(request.RetrieveSessionToken()), actionName, request, null); } public IResponse Execute(string actionName, IServerSpecifier serverSpecifier, ICruiseRequest request) { //Added code so since defaultServerSpecifier only sets the name of the server - not the actual config var serverName = serverSpecifier.ServerName; - serverSpecifier = farmService.GetServerConfiguration(serverName); + serverSpecifier = FarmService.GetServerConfiguration(serverName); if (serverSpecifier == null) { throw new UnknownServerException(serverName); } else { - return GenerateView(farmService.GetProjectStatusListAndCaptureExceptions(serverSpecifier, request.RetrieveSessionToken()), actionName, request, serverSpecifier); + return GenerateView(FarmService.GetProjectStatusListAndCaptureExceptions(serverSpecifier, request.RetrieveSessionToken()), actionName, request, serverSpecifier); } } private HtmlFragmentResponse GenerateView(ProjectStatusListAndExceptions projectStatusListAndExceptions, string actionName, ICruiseRequest request, IServerSpecifier serverSpecifier) { - this.translations = Translations.RetrieveCurrent(); - cruiseUrlBuilder = request.UrlBuilder; - urlBuilder = request.UrlBuilder.InnerBuilder; + this.translation = Translations.RetrieveCurrent(); + bool sortReverse = SortAscending(request.Request); + string category = request.Request.GetText("Category"); + CruiseUrlBuilder = request.UrlBuilder; + UrlBuilder = request.UrlBuilder.InnerBuilder; + ProjectGridSortColumn sortColumn = GetSortColumn(request.Request); Hashtable velocityContext = new Hashtable(); velocityContext["forceBuildMessage"] = ForceBuildIfNecessary(request.Request); - velocityContext["parametersCall"] = new ServerLink(cruiseUrlBuilder, new DefaultServerSpecifier("null"), string.Empty, ProjectParametersAction.ActionName).Url; - + velocityContext["parametersCall"] = new ServerLink(CruiseUrlBuilder, new DefaultServerSpecifier("null"), string.Empty, ProjectParametersAction.ActionName).Url; velocityContext["wholeFarm"] = serverSpecifier == null ? true : false; - - string category = request.Request.GetText("Category"); velocityContext["showCategoryColumn"] = string.IsNullOrEmpty(category) ? true : false; - - ProjectGridSortColumn sortColumn = GetSortColumn(request.Request); - bool sortReverse = SortAscending(request.Request); - velocityContext["projectNameSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.Name, sortColumn, sortReverse); velocityContext["buildStatusSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.BuildStatus, sortColumn, sortReverse); velocityContext["lastBuildDateSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.LastBuildDate, sortColumn, sortReverse); velocityContext["serverNameSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.ServerName, sortColumn, sortReverse); velocityContext["projectCategorySortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.Category, sortColumn, sortReverse); + velocityContext["exceptions"] = projectStatusListAndExceptions.Exceptions; - ProjectGridRow[] projectGridRows = projectGrid.GenerateProjectGridRows(projectStatusListAndExceptions.StatusAndServerList, actionName, sortColumn, sortReverse, category, cruiseUrlBuilder, this.translations); - + ProjectGridParameters parameters = new ProjectGridParameters(projectStatusListAndExceptions.StatusAndServerList, sortColumn, sortReverse, category, CruiseUrlBuilder, FarmService, this.translation); + ProjectGridRow[] projectGridRows = ProjectGrid.GenerateProjectGridRows(parameters); velocityContext["projectGrid"] = projectGridRows; - velocityContext["exceptions"] = projectStatusListAndExceptions.Exceptions; - + Array categoryList = this.GenerateCategoryList(projectGridRows); velocityContext["categoryList"] = categoryList; velocityContext["barAtTop"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Top) || @@ -111,7 +109,7 @@ private HtmlFragmentResponse GenerateView(ProjectStatusListAndExceptions project velocityContext["barAtBottom"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Bottom) || (this.SuccessIndicatorBarLocation == IndicatorBarLocation.TopAndBottom); - return viewGenerator.GenerateView(@"ProjectGrid.vm", velocityContext); + return ViewGenerator.GenerateView(@"ProjectGrid.vm", velocityContext); } private Array GenerateCategoryList(ProjectGridRow[] projectGridRows) @@ -123,7 +121,7 @@ private Array GenerateCategoryList(ProjectGridRow[] projectGridRows) foreach (ProjectGridRow projectGridRow in projectGridRows) { string category = projectGridRow.Category; - System.Diagnostics.Debug.WriteLine(category); + //debug.WriteLine(category); if (!string.IsNullOrEmpty(category) && !categories.Contains(category)) categories.Add(category); @@ -147,7 +145,7 @@ private ProjectGridSortColumn GetSortColumn(IRequest request) string columnName = request.GetText("SortColumn"); if (string.IsNullOrEmpty(columnName)) { - return sortColumn; + return SortColumn; } else { @@ -171,11 +169,11 @@ private object GenerateSortLink(IServerSpecifier serverSpecifier, string action, } if (serverSpecifier == null) { - return urlBuilder.BuildUrl(action, queryString); + return UrlBuilder.BuildUrl(action, queryString); } else { - return cruiseUrlBuilder.BuildServerUrl(action, serverSpecifier, queryString); + return CruiseUrlBuilder.BuildServerUrl(action, serverSpecifier, queryString); } } @@ -183,9 +181,9 @@ private string ForceBuildIfNecessary(IRequest request) { // Attempt to find a session token string sessionToken = request.GetText("sessionToken"); - if (string.IsNullOrEmpty(sessionToken) && (sessionRetriever != null)) + if (string.IsNullOrEmpty(sessionToken) && (SessionRetriever != null)) { - sessionToken = sessionRetriever.RetrieveSessionToken(request); + sessionToken = SessionRetriever.RetrieveSessionToken(request); } Dictionary parameters = new Dictionary(); @@ -200,23 +198,23 @@ private string ForceBuildIfNecessary(IRequest request) // Make the actual call if (request.FindParameterStartingWith("StopBuild") != string.Empty) { - farmService.Stop(ProjectSpecifier(request), sessionToken); - return this.translations.Translate("Stopping project {0}", SelectedProject(request)); + FarmService.Stop(ProjectSpecifier(request), sessionToken); + return this.translation.Translate("Stopping project {0}", SelectedProject(request)); } else if (request.FindParameterStartingWith("StartBuild") != string.Empty) { - farmService.Start(ProjectSpecifier(request), sessionToken); - return this.translations.Translate("Starting project {0}", SelectedProject(request)); + FarmService.Start(ProjectSpecifier(request), sessionToken); + return this.translation.Translate("Starting project {0}", SelectedProject(request)); } else if (request.FindParameterStartingWith("ForceBuild") != string.Empty) { - farmService.ForceBuild(ProjectSpecifier(request), sessionToken, parameters); - return this.translations.Translate("Build successfully forced for {0}", SelectedProject(request)); + FarmService.ForceBuild(ProjectSpecifier(request), sessionToken, parameters); + return this.translation.Translate("Build successfully forced for {0}", SelectedProject(request)); } else if (request.FindParameterStartingWith("AbortBuild") != string.Empty) { - farmService.AbortBuild(ProjectSpecifier(request), sessionToken); - return this.translations.Translate("Abort successfully forced for {0}", SelectedProject(request)); + FarmService.AbortBuild(ProjectSpecifier(request), sessionToken); + return this.translation.Translate("Abort successfully forced for {0}", SelectedProject(request)); } else { @@ -227,7 +225,7 @@ private string ForceBuildIfNecessary(IRequest request) private DefaultProjectSpecifier ProjectSpecifier(IRequest request) { return new DefaultProjectSpecifier( - farmService.GetServerConfiguration(request.GetText("serverName")), SelectedProject(request)); + FarmService.GetServerConfiguration(request.GetText("serverName")), SelectedProject(request)); } private static string SelectedProject(IRequest request) From dd393aabc416ab51d992d0b47a15156f38f46773 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 13 Apr 2016 10:18:00 +0200 Subject: [PATCH 011/118] ProjectGrid: QueuePosition --- project/WebDashboard/Dashboard/ProjectGrid.cs | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGrid.cs b/project/WebDashboard/Dashboard/ProjectGrid.cs index dfcc3a71a..bdbfed9a3 100644 --- a/project/WebDashboard/Dashboard/ProjectGrid.cs +++ b/project/WebDashboard/Dashboard/ProjectGrid.cs @@ -5,7 +5,6 @@ using System.Xml; using System.Xml.Linq; using System.Linq; -using System.Diagnostics; using ThoughtWorks.CruiseControl.Core.Reporting.Dashboard.Navigation; using ThoughtWorks.CruiseControl.Remote; using ThoughtWorks.CruiseControl.WebDashboard.Plugins.ProjectReport; @@ -13,6 +12,9 @@ using ThoughtWorks.CruiseControl.WebDashboard.ServerConnection; using ThoughtWorks.CruiseControl.WebDashboard.Plugins.BuildReport; using ThoughtWorks.CruiseControl.Core.Queues; +using ThoughtWorks.CruiseControl.Core.Config; +using ThoughtWorks.CruiseControl.Core; +using ThoughtWorks.CruiseControl.WebDashboard.IO; namespace ThoughtWorks.CruiseControl.WebDashboard.Dashboard { @@ -24,7 +26,7 @@ public ProjectGridRow[] GenerateProjectGridRows(ProjectGridParameters parameters var farmService = parameters.FarmService; string disk = new AppSettingsReader().GetValue("disk", typeof(System.String)).ToString(); string server = new AppSettingsReader().GetValue("framework", typeof(System.String)).ToString(); - + foreach (ProjectStatusOnServer statusOnServer in parameters.StatusList) { @@ -36,7 +38,6 @@ public ProjectGridRow[] GenerateProjectGridRows(ProjectGridParameters parameters continue; string dir = disk + server + @"\"; - //string dir = @"c:\heartbeat\"; string statistics = ""; if (Directory.Exists(dir)) @@ -53,7 +54,7 @@ public ProjectGridRow[] GenerateProjectGridRows(ProjectGridParameters parameters } List lastFiveDataGridRows = getLastFiveDataGridRows(serverSpecifier, projectSpecifier, dir, farmService, status); - int queuePosition = getQueuePosition(status, projectSpecifier); + int queuePosition = getQueuePosition(status, serverSpecifier, projectSpecifier, farmService); rows.Add( new ProjectGridRow(status, @@ -157,7 +158,8 @@ private DataGridRow getBuildData(IServerSpecifier serverSpecifier, DefaultProjec lastRunningTime = (string)node.Attribute("buildtime"); if (status.BuildStatus.ToString() == "Success") { - lastLink = String.Format("http://{0}/ccnet/server/{0}/project/{1}/build/{2}/ViewBuildReport.aspx", serverSpecifier.ServerName, projectSpecifier.ProjectName, buildSpecifier.BuildName); + lastLink = String.Format("http://{0}/ccnet/server/{0}/project/{1}/build/{2}/ViewBuildReport.aspx", + serverSpecifier.ServerName, projectSpecifier.ProjectName, buildSpecifier.BuildName); } else { @@ -174,11 +176,11 @@ private DataGridRow getBuildData(IServerSpecifier serverSpecifier, DefaultProjec return dataToReturn; } - private int getQueuePosition(ProjectStatus status, DefaultProjectSpecifier projectSpecifier) + private int getQueuePosition(ProjectStatus status, IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, IFarmService farmService) { if(status.Activity.ToString().Equals("Pending")) { - return getPositionInQueueList(status, projectSpecifier); + return getPositionInQueueList(status, serverSpecifier, projectSpecifier, farmService); } else { @@ -186,30 +188,34 @@ private int getQueuePosition(ProjectStatus status, DefaultProjectSpecifier proje } } - private int getPositionInQueueList(ProjectStatus status, DefaultProjectSpecifier projectSpecifier) + private int getPositionInQueueList(ProjectStatus status, IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, IFarmService farmService) { - int positionInQueue; - Debug.WriteLine("Queue Name from status:" + status.Queue); - QueueSnapshot queueSnapshot = new QueueSnapshot(status.Queue); + CruiseServerSnapshotListAndExceptions snapshot = farmService.GetCruiseServerSnapshotListAndExceptions(serverSpecifier, ""); - //IntegrationQueue IQ = new IntegrationQueue(status.Queue); - //var test = IQ.GetQueuedIntegrations; - Debug.WriteLine("Queue Name:" + queueSnapshot.QueueName); + List queues = new List(); - Debug.WriteLine("Queue empty? " + queueSnapshot.IsEmpty); - List queueList = queueSnapshot.Requests; - Debug.WriteLine("Queue size:" + queueList.Count); + for (int snapshotLoop = 0; snapshotLoop < snapshot.Snapshots.Length; snapshotLoop++) + { + QueueSetSnapshot queueSnapshot = snapshot.Snapshots[snapshotLoop].QueueSetSnapshot; + for (int queueLoop = 0; queueLoop < queueSnapshot.Queues.Count; queueLoop++) + { + if(checkPositionQueue(queueLoop, queueSnapshot, projectSpecifier) > -1) + return checkPositionQueue(queueLoop, queueSnapshot, projectSpecifier); + } + } + return -1; + } - int count = 1; //Position 0 would be the building project - foreach (QueuedRequestSnapshot queueRequestSnapshot in queueList) + private int checkPositionQueue(int queueLoop, QueueSetSnapshot queueSnapshot, DefaultProjectSpecifier projectSpecifier) + { + int cont = 0; + foreach (QueuedRequestSnapshot queuedRequestedSnaphot in queueSnapshot.Queues[queueLoop].Requests) { - Debug.WriteLine(count); - if (projectSpecifier.ProjectName == queueRequestSnapshot.ProjectName) + if (queuedRequestedSnaphot.ProjectName == projectSpecifier.ProjectName) { - positionInQueue = count; - return positionInQueue; + return cont; } - count++; + cont++; } return -1; } From 0e5c2327e52c7d706f325adf2e3b42c6088a1f59 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 13 Apr 2016 10:19:59 +0200 Subject: [PATCH 012/118] Update cruisecontrol.css --- project/WebDashboard/cruisecontrol.css | 482 +++++++++++++++++++++++-- 1 file changed, 459 insertions(+), 23 deletions(-) diff --git a/project/WebDashboard/cruisecontrol.css b/project/WebDashboard/cruisecontrol.css index 9fa72c7dc..1d386bcb9 100644 --- a/project/WebDashboard/cruisecontrol.css +++ b/project/WebDashboard/cruisecontrol.css @@ -14,13 +14,22 @@ a:hover } .main-panel { - background-color: #2E8A2E; + background-color: #13336A; color:#000000; font-weight: bold; padding: 6px; - height: 60px; + height: 46px; } -.main-panel a { color:#FFCC00; } +.main-panel a { color: #FFF; + text-decoration: none; + margin: 0 5px; + font-size: 16px; + font-weight: normal;} + +.main-panel img { + margin-right: 20px; + margin-top: 5px;} + .main-panel a:hover { color:#ffffff; } .link { color:#000000; } @@ -35,7 +44,7 @@ a:hover .header-data-error { color:#000000; white-space:pre; } .section-table { margin-top:10px; } -.sectionheader { background-color:#2E8A2E; color:#FFFFFF; } +.sectionheader { background-color:#13336A; color:#FFFFFF; font-size: 14px; height: 20px; padding: 5px; } .section-data { font-size:9px; color:#000000; } .section-oddrow { background-color:#F0F7FF; } .section-evenrow { background-color:#FFFFFF; } @@ -44,6 +53,15 @@ a:hover .warning { color:#ff8000; } .error { color:#ff0000; } + +/* Admin */ +.ProjectGridHeader th:last-child{ + width:100px; + max-width:100px; +} +/*--- Admin ---*/ + + .RecentBuildsPanel { border-style: solid; border-width: 1px; @@ -53,7 +71,7 @@ a:hover .RecentBuildsPanel th { - background-color: #2E8A2E; + background-color: #13336A; text-align: center; font-weight: bold; padding: 3px; @@ -65,30 +83,41 @@ a:hover background-color: #ffffff; } +#parsedBreadcrumbs { + display:inline-block; + position:relative; + top:-2px; + left:-10px; +} + .breadcrumbs { - color: #ffffff; + color: #13336A; } .breadcrumbs a { - color: #ffffff; + color: #13336A; text-decoration: none; } .breadcrumbs a:hover { - color: #ffffff; + color: #13336A; text-decoration: underline; } .ProjectGridHeader { color: #ffffff; } + +.ProjectGridHeader th:hover { + background:#eaf7fd !important;} + .ProjectGridHeader a { color: #ffffff; text-decoration: none; } .ProjectGridHeader a:hover { - color:#99CC66; + color:#c4e8fd; } .SideBar a @@ -114,16 +143,19 @@ td>a.selected:hover { color:#2E8A2E; } .wholepage { margin:0; - padding:1em; } .TopControls { - background-color: #99CC66; - color: #ffffff; + background: #e3e6ec; + color: #13336A; font-weight: bold; } +.TopControls td { + padding-left: 15px; + padding-right: 30px;} + .Footer { color: #666666; @@ -166,33 +198,290 @@ td>a.selected:hover { color:#2E8A2E; } { background-color:#ffffff; } + + +.refreshStatus { + background: #fff; + border: solid 1px #ccc; + padding: 5px 10px; + color: #000; + line-height: 12px; + text-decoration:none; + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + cursor:pointer; + transition: all .2s linear; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -ms-transition: all .2s linear; + -o-transition: all .2s linear; +} + +.refreshStatus:hover { + background: #008bbe; + color:#fff; + border:solid 1px transparent; +} + +.legend{ + background: #fff; + text-align:left; + position:relative; + top: -20px; + margin-left:0.5em; + line-height:12px; + display:inline; + background: #fff; + text-decoration:none; + transition: all .2s linear; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -ms-transition: all .2s linear; + -o-transition: all .2s linear; + align:left; +} + +.legend span { + font-size: 13px; + height: 30px; + max-height: 30px; + width:100%; + text-align: left; + display:none; + padding:3px 5px; +} + +.legend:hover span{ + display:inline; +} + +.iconLegend{ + height:16px; + width:16px; + margin-top:-5px; + margin-bottom:-3px; + padding: 0px 5px; +} + +.nav--main { + background: #fff; + border: solid 1px #ccc; + text-align: center; + padding: 5px 0px; + color: #000; + display: inline-block; + width: 100%; + line-height: 12px; + border-radius: 3px; + text-decoration:none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + cursor:pointer; + transition: all .3s linear; + transition: all .2s linear; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -ms-transition: all .2s linear; + -o-transition: all .2s linear; +} + +.nav--main:hover { + background: #4aa241; + color:white; + border: solid 1px transparent; +} + +.nav--panel td { + text-align:center; + padding-bottom:10px;} + + +.force--task, .nav--button { + background: #fff; + border: solid 1px #ccc; + padding: 5px 10px; + color: #000; + line-height: 12px; + text-decoration:none; + display:inline-block; + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + cursor:pointer; + transition: all .3s linear; + transition: all .2s linear; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -ms-transition: all .2s linear; + -o-transition: all .2s linear; +} + +.force--task:hover, .nav--button:hover { + background: #008bbe; + color:#FFF; + border:solid 1px transparent; +} + + + +input.start--task { + background: #85a36b; + border: none; + padding: 5px 10px; + color: white; + line-height: 12px; + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + cursor:pointer; + transition: all .2s linear; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -ms-transition: all .2s linear; + -o-transition: all .2s linear; +} + +input.start--task:hover { + background: #55a50e; +} + +input.stop--task { + background: #ea9696; + border: none; + padding: 5px 10px; + color: white; + line-height: 12px; + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + cursor:pointer; + transition: all .2s linear; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -ms-transition: all .2s linear; + -o-transition: all .2s linear; +} + +input.stop--task:hover { + background: #ee4040; +} + +.action--iconSmall{ + padding: 5px 10px; +} + /* Projects grid */ .SortableGrid { border-collapse: collapse; width:100%; - border-left: solid 2px #2E8A2E; - border-right: solid 2px #2E8A2E; + border: solid 1px #ccc; background-color:#ffffff; + color: #000; + margin-left: 3px; } + +.SortableGrid a +{ + text-decoration: none; +} + +.SortableGrid tr { + transition: all .2s linear; + -webkit-transition: all .2s linear; + -moz-transition: all .2s linear; + -ms-transition: all .2s linear; + -o-transition: all .2s linear; +} + +.SortableGrid tr:hover:not(.emptyRow) { + + background: #eaf7fd;} + .SortableGrid td { - border-top: solid 2px #2E8A2E; - border-bottom: solid 2px #2E8A2E; - padding:3px; + border-top: solid 1px #ccc; + border-bottom: solid 1px #ccc; + padding:3px 0; text-align:center; } + .SortableGrid th { - border-top: solid 2px #2E8A2E; - background-color: #2E8A2E; - padding:3px; + border-top: solid 1px #ccc; + background-color: #f1f1f1; + padding: 10px; + color: #000; + font-weight: normal; + font-size: 12px; text-align:center; } + .SortableGrid .left { text-align:left; + padding-left:15px; +} + +.SortableGrid .left.project--name +{ + max-width:220px; + text-align:center; +} + +.SortableGrid .left.width--content +{ + max-width:220px; +} + +.SortableGrid .left.scroll--content +{ + overflow:hidden; + max-width:220px; +} + +.SortableGrid .left.scroll--content ul +{ + max-height:100px; + overflow-y:scroll; + padding:0; +} + +.SortableGrid .left.scroll--content ul li +{ + margin-bottom:10px; +} + +.SortableGrid .left.scroll--content ul li.content--fixer +{ + font-weight:bold; + color:blue; +} + +.SortableGrid .left.scroll--content ul li.content--task__fail +{ + color:red; } +.SortableGrid .left.scroll--content ul li.content--breaker +{ + color:red; +} + +.admin--icon{ + width:150px; +} + .SortableGrid .Black { font-weight:bold; @@ -203,16 +492,49 @@ td>a.selected:hover { color:#2E8A2E; } font-weight:bold; color:#FF0000; } -.SortableGrid .Green + +.SortableGrid .Red a { font-weight:bold; + color:#FF0000; +} + +.SortableGrid .Orange +{ + font-weight:bold; + color:#F88017; +} + +.SortableGrid .Orange a +{ + font-weight:bold; + color:#F88017; +} + +.SortableGrid .Green +{ + color:#008000; } + +.SortableGrid .Green a +{ + + color:#008000; +} + .SortableGrid .Blue { font-weight:bold; color:#0000FF; } + +.SortableGrid .Blue a +{ + font-weight:bold; + color:#0000FF; +} + #BuildPercentage { width:100%; @@ -253,7 +575,7 @@ td>a.selected:hover { color:#2E8A2E; } background-image: url(images/desc.gif); } .SortableGrid thead tr .headerSortDown, .SortableGrid thead tr .headerSortUp { - background-color: #99CC66; + background-color: #f1f1f1; } /* Project grid */ .statusStopped { color: #ff1111; font-weight: bold; } @@ -272,4 +594,118 @@ tr.buildStatus td font-style: italic; border: none; text-align: left; -} \ No newline at end of file +} + +#messages_header { + width: 15% +} + +.emptyRow { + background: #f1f1f1; +} + +.emptyRow td{ + padding: 0; + font-size: 10px; +} + +.big-separator { + height: 50px; + background: rgb(238, 238, 251) +} + + +/* MISC */ + +.u4-gradient { + width: 100%; + height: 3px; + background: #2a3c85; + /* Old browsers */ + /* IE9 SVG, needs conditional override of 'filter' to 'none' */ + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzJhM2M4NSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwJSIgc3RvcC1jb2xvcj0iIzUwM2Y5NiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjE4JSIgc3RvcC1jb2xvcj0iIzAzNTM5YiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjMyJSIgc3RvcC1jb2xvcj0iIzAwOWRiOSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjYwJSIgc3RvcC1jb2xvcj0iIzAwOWRiOSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9Ijc5JSIgc3RvcC1jb2xvcj0iIzMxYWQ1YiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNiNmQ1NDkiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); + background: -moz-linear-gradient(left, #2a3c85 0%, #503f96 10%, #03539b 18%, #009db9 32%, #009db9 60%, #31ad5b 79%, #b6d549 100%); + /* FF3.6+ */ + background: -webkit-gradient(linear, left top, right top, color-stop(0%, #2a3c85), color-stop(10%, #503f96), color-stop(18%, #03539b), color-stop(32%, #009db9), color-stop(60%, #009db9), color-stop(79%, #31ad5b), color-stop(100%, #b6d549)); + /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(left, #2a3c85 0%, #503f96 10%, #03539b 18%, #009db9 32%, #009db9 60%, #31ad5b 79%, #b6d549 100%); + /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(left, #2a3c85 0%, #503f96 10%, #03539b 18%, #009db9 32%, #009db9 60%, #31ad5b 79%, #b6d549 100%); + /* Opera 11.10+ */ + background: -ms-linear-gradient(left, #2a3c85 0%, #503f96 10%, #03539b 18%, #009db9 32%, #009db9 60%, #31ad5b 79%, #b6d549 100%); + /* IE10+ */ + background: linear-gradient(to right, #2a3c85 0%, #503f96 10%, #03539b 18%, #009db9 32%, #009db9 60%, #31ad5b 79%, #b6d549 100%); + /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a3c85', endColorstr='#b6d549',GradientType=1 ); + /* IE6-8 */ + background-size: 100% 3px; + background-position: bottom; + background-repeat: no-repeat; +} + + +/* ICONS */ +.icon0{ + height:20px; +} + +.icon1{ + height:18px; +} + +.icon2{ + height:16px; +} + +.icon3{ + height:14px; +} + +.icon4{ + height:12px; +} + +.ico { + + display: inline-block; + width: 20px; + height: 20px; + background-repeat: no-repeat; + background-size: contain; + transition: all .3s ease-in-out; + cursor:pointer; + -webkit-transition: all .3s ease-in-out; + -moz-transition: all .3s ease-in-out; + -ms-transition: all .3s ease-in-out; + -o-transition: all .3s ease-in-out; + } + +.ico:hover { + transform: scale(1.2); + -webkit-transform: scale(1.2); + -moz-transform: scale(1.2); + -ms-transform: scale(1.2); + -o-transform: scale(1.2); + } + +.ico.ico-mail { + background-image: url(images/mail.png); + margin-right:10px; +} + +.ico.ico-machines { + background-image: url(images/server.png); +} + +.ico.ico-info { + position: relative; + top: 4px; + transform:scale(1.3); + background-image: url(images/UNIT4info.png); +} + + + + + + From 4f492b0ab123a2db2a276fc2032b1e3eda3dc829 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 13 Apr 2016 10:21:08 +0200 Subject: [PATCH 013/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 77 +++++++++++-------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 033ef2859..c4bcaf751 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -1,26 +1,26 @@ + + #if ($forceBuildMessage.Length > 0)

@@ -124,7 +138,6 @@ $translations.Translate("Last Build Time") $translations.Translate("Running Time") $translations.Translate("Status") - $translations.Translate("Queue Position(Priority)") $translations.Translate("Activity") $translations.Translate("Admin") @@ -198,12 +211,19 @@ $translations.Translate($projectGridRow.Status) - $projectGridRow.QueuePriority - $translations.Translate($projectGridRow.Activity.ToString())($projectGridRow.QueuePriority) + + #if($projectGridRow.Activity.ToString() == "Pending") + + #else + + #end + $translations.Translate($projectGridRow.Activity.ToString()) (P$projectGridRow.QueuePriority) #if($projectGridRow.Activity.ToString() == "Pending") - ($projectGridRow.QueuePosition) + (Q$projectGridRow.QueuePosition) #end + +

#end #end - #if ($projectGridRow.BuildStatus != "Success") - - #end
From a62f3b98ca70b2b7db044d3c5c9f20ca43bc8156 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 13 Apr 2016 11:15:41 +0200 Subject: [PATCH 014/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 89 +++++++++---------- 1 file changed, 41 insertions(+), 48 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index c4bcaf751..659f3c24d 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -39,40 +39,7 @@ - - -
- Build state { - : Succes | - : Failure | - : Exception | - : Unknown } - / Actions { - : Start | - : Stop | - : Abort | - : Force run | - : Cancel pending } -
- - + #if ($forceBuildMessage.Length > 0)

@@ -86,6 +53,7 @@ #set ($ProjectOKCounter = 0) #set ($ProjectNOKCounter = 0) #foreach ($projectGridRow in $projectGrid) + #set($ProjectServer = $projectGridRow.ServerName) #if ($projectGridRow.BuildStatus == "Success") #set ($ProjectOKCounter = $ProjectOKCounter + 1) #else @@ -102,6 +70,40 @@ #end #set ($OKPercentToolTip = $OKPercent * 2) + #set($projectGrifRow = $projectGrid.get(0)) + +

+ Build state { + : Succes | + : Failure | + : Exception | + : Unknown } + / Actions { + : Start | + : Stop | + : Abort | + : Force run } +
+ + + #if ($projectGrid.Length > 0) @@ -178,7 +180,7 @@ #set($runningTime = $dataGridRow.RunningTime) - + #set($cont = $cont + 1) @@ -241,7 +243,7 @@ @@ -249,7 +251,7 @@ #end @@ -259,26 +261,17 @@ #else #end - #if ($projectGridRow.Activity.ToString() == "Pending") - - - - - #end #end From 9f8f369530504506a18bee4a181a893ccfb3f4de Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 13 Apr 2016 11:16:40 +0200 Subject: [PATCH 015/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 2 -- 1 file changed, 2 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 659f3c24d..2b924a16d 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -70,8 +70,6 @@ #end #set ($OKPercentToolTip = $OKPercent * 2) - #set($projectGrifRow = $projectGrid.get(0)) -
Build state { : Succes | From c9ab524a2b64c43cfc3de887a314edbae1340574 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 13 Apr 2016 15:10:43 +0200 Subject: [PATCH 016/118] Update cruisecontrol.css --- project/WebDashboard/cruisecontrol.css | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/project/WebDashboard/cruisecontrol.css b/project/WebDashboard/cruisecontrol.css index 1d386bcb9..486e46093 100644 --- a/project/WebDashboard/cruisecontrol.css +++ b/project/WebDashboard/cruisecontrol.css @@ -437,7 +437,7 @@ input.stop--task:hover { .SortableGrid .left.project--name { max-width:220px; - text-align:center; + text-align:left; } .SortableGrid .left.width--content @@ -703,9 +703,3 @@ tr.buildStatus td transform:scale(1.3); background-image: url(images/UNIT4info.png); } - - - - - - From 57a7cbffa1385a540e06ffa969ce0cae36895590 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 13 Apr 2016 16:26:42 +0200 Subject: [PATCH 017/118] Update ProjectGrid.cs --- project/WebDashboard/Dashboard/ProjectGrid.cs | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGrid.cs b/project/WebDashboard/Dashboard/ProjectGrid.cs index bdbfed9a3..2834bc4d9 100644 --- a/project/WebDashboard/Dashboard/ProjectGrid.cs +++ b/project/WebDashboard/Dashboard/ProjectGrid.cs @@ -182,40 +182,32 @@ private int getQueuePosition(ProjectStatus status, IServerSpecifier serverSpecif { return getPositionInQueueList(status, serverSpecifier, projectSpecifier, farmService); } - else - { - return -1; - } + return -1; } private int getPositionInQueueList(ProjectStatus status, IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, IFarmService farmService) { - CruiseServerSnapshotListAndExceptions snapshot = farmService.GetCruiseServerSnapshotListAndExceptions(serverSpecifier, ""); - + CruiseServerSnapshotListAndExceptions snapshot = farmService.GetCruiseServerSnapshotListAndExceptions(serverSpecifier, string.Empty); List queues = new List(); - for (int snapshotLoop = 0; snapshotLoop < snapshot.Snapshots.Length; snapshotLoop++) + foreach (CruiseServerSnapshot cruiseServerSnapshot in snapshot.Snapshots) { - QueueSetSnapshot queueSnapshot = snapshot.Snapshots[snapshotLoop].QueueSetSnapshot; - for (int queueLoop = 0; queueLoop < queueSnapshot.Queues.Count; queueLoop++) - { - if(checkPositionQueue(queueLoop, queueSnapshot, projectSpecifier) > -1) - return checkPositionQueue(queueLoop, queueSnapshot, projectSpecifier); + QueueSetSnapshot queueSnapshot = cruiseServerSnapshot.QueueSetSnapshot; + foreach (QueueSnapshot queueSnapshotItem in queueSnapshot.Queues) { + var index = checkPositionQueue(queueSnapshotItem, projectSpecifier); + if (index > -1) { return index; } } } return -1; } - - private int checkPositionQueue(int queueLoop, QueueSetSnapshot queueSnapshot, DefaultProjectSpecifier projectSpecifier) + private int checkPositionQueue(QueueSnapshot queueSnapshotItem, DefaultProjectSpecifier projectSpecifier) { - int cont = 0; - foreach (QueuedRequestSnapshot queuedRequestedSnaphot in queueSnapshot.Queues[queueLoop].Requests) + for (int i = 0; i Date: Wed, 13 Apr 2016 16:27:11 +0200 Subject: [PATCH 018/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 2b924a16d..74683d86c 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -82,25 +82,6 @@ : Abort | : Force run }
- - #if ($projectGrid.Length > 0)
@@ -207,7 +191,7 @@ From c77f6ea0c5b38c5c18058315916aa700504d6dd4 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 14 Apr 2016 15:26:41 +0200 Subject: [PATCH 019/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 74683d86c..9ca51cb5a 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -204,7 +204,11 @@ #end $translations.Translate($projectGridRow.Activity.ToString()) (P$projectGridRow.QueuePriority) #if($projectGridRow.Activity.ToString() == "Pending") - (Q$projectGridRow.QueuePosition) + #if($projectGridRow.QueuePosition < 10) + (Q0$projectGridRow.QueuePosition) + #else + (Q$projectGridRow.QueuePosition) + #end #end From 2519eb6d5625b0a9ed017f551800cfc67898732e Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 15 Apr 2016 12:13:20 +0200 Subject: [PATCH 020/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 71 +++++++++++-------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 9ca51cb5a..b46f6bda3 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -80,7 +80,8 @@ : Start | : Stop | : Abort | - : Force run } + : Force run | + : Cancel Pending } #if ($projectGrid.Length > 0) @@ -224,45 +225,53 @@ value="$projectGridRow.ServerName" /> - #if ($projectGridRow.allowForceBuild) - #if($projectGridRow.ForceAbortBuildButtonValue == "Force") - + #if ($projectGridRow.allowForceBuild) + #if($projectGridRow.ForceAbortBuildButtonValue == "Force") + - - #else - + + #else + + + + #end + #end + #if($projectGridRow.Activity.ToString() == "Pending") + - - #end - #end - #if ($projectGridRow.AllowStartStopBuild) - #if ($projectGridRow.Status == "Running") - - - - #else - - - - #end - #end + + #end + #if ($projectGridRow.AllowStartStopBuild) + #if ($projectGridRow.Status == "Running") + + + + #else + + + + #end + #end - - - + + + #if ($projectGridRow.BuildStage.Length > 0) #if ($wholeFarm) From eab632fdc4e5e737d856a73ae493bd5109869791 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 15 Apr 2016 12:14:27 +0200 Subject: [PATCH 021/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 8 -------- 1 file changed, 8 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index b46f6bda3..2ae52027b 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -243,14 +243,6 @@ #end #end - #if($projectGridRow.Activity.ToString() == "Pending") - - - - #end #if ($projectGridRow.AllowStartStopBuild) #if ($projectGridRow.Status == "Running") From 28eb4c2174b83ef403e8175ecfcd7dc261d26c49 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Mon, 18 Apr 2016 11:18:38 +0200 Subject: [PATCH 022/118] Update VelocityProjectGridAction.cs --- project/WebDashboard/Dashboard/VelocityProjectGridAction.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs index 9c5ff5169..a70429132 100644 --- a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs +++ b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs @@ -104,6 +104,7 @@ private HtmlFragmentResponse GenerateView(ProjectStatusListAndExceptions project Array categoryList = this.GenerateCategoryList(projectGridRows); velocityContext["categoryList"] = categoryList; + velocityContext["barAtTop"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Top) || (this.SuccessIndicatorBarLocation == IndicatorBarLocation.TopAndBottom); velocityContext["barAtBottom"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Bottom) || @@ -216,6 +217,11 @@ private string ForceBuildIfNecessary(IRequest request) FarmService.AbortBuild(ProjectSpecifier(request), sessionToken); return this.translation.Translate("Abort successfully forced for {0}", SelectedProject(request)); } + else if (request.FindParameterStartingWith("CancelPending") != string.Empty) + { + FarmService.CancelPendingRequest(ProjectSpecifier(request), sessionToken); + return this.translation.Translate("Cancel pending successfully forced for {0}", SelectedProject(request)); + } else { return string.Empty; From 45ba234b3777449b8b5e37b3870de0d1c6bd58a7 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Mon, 18 Apr 2016 11:20:05 +0200 Subject: [PATCH 023/118] Update IFarmService.cs --- project/WebDashboard/ServerConnection/IFarmService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project/WebDashboard/ServerConnection/IFarmService.cs b/project/WebDashboard/ServerConnection/IFarmService.cs index f9a3ba9ec..9e1f1248f 100644 --- a/project/WebDashboard/ServerConnection/IFarmService.cs +++ b/project/WebDashboard/ServerConnection/IFarmService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using ThoughtWorks.CruiseControl.Core.Reporting.Dashboard.Navigation; using ThoughtWorks.CruiseControl.Remote; using ThoughtWorks.CruiseControl.Remote.Parameters; @@ -18,6 +18,7 @@ public interface IFarmService void AbortBuild(IProjectSpecifier projectSpecifier, string sessionToken); void Start(IProjectSpecifier projectSpecifier, string sessionToken); void Stop(IProjectSpecifier projectSpecifier, string sessionToken); + void CancelPendingRequest(IProjectSpecifier projectSpecifier, string sessionToken); void ForceBuild(IProjectSpecifier projectSpecifier, string sessionToken, Dictionary parameters); ProjectStatusListAndExceptions GetProjectStatusListAndCaptureExceptions(string sessionToken); ProjectStatusListAndExceptions GetProjectStatusListAndCaptureExceptions(IServerSpecifier serverSpecifier, string sessionToken); From ecb46dd0fe8a1926fc840926587e22b2b38bc144 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Mon, 18 Apr 2016 11:20:43 +0200 Subject: [PATCH 024/118] Update ProjectGridRow.cs --- project/WebDashboard/Dashboard/ProjectGridRow.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project/WebDashboard/Dashboard/ProjectGridRow.cs b/project/WebDashboard/Dashboard/ProjectGridRow.cs index 06121e2a4..c1afb4bf8 100644 --- a/project/WebDashboard/Dashboard/ProjectGridRow.cs +++ b/project/WebDashboard/Dashboard/ProjectGridRow.cs @@ -17,7 +17,6 @@ public class ProjectGridRow private readonly string statistics; private readonly List lastFiveData; private readonly int queuePosition; - private Translations translations; public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, string url, string parametersUrl, Translations translations) @@ -81,6 +80,8 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, public string ForceAbortBuildButtonValue { get { return (status.Activity != ProjectActivity.Building) ? "Force" : "Abort"; } } + public string CancelPendingButtonName { get { return (status.Activity == ProjectActivity.Pending) ? "CancelPending" : ""; } } + public bool AllowForceBuild { get { return serverSpecifier.AllowForceBuild && status.ShowForceBuildButton; } } public bool AllowStartStopBuild { get { return serverSpecifier.AllowStartStopBuild && status.ShowStartStopButton; } } From a679fe0a96b0e33d7f3495e1621f6b0d2152b05c Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Mon, 18 Apr 2016 11:21:41 +0200 Subject: [PATCH 025/118] Update ProjectGridRow.cs --- project/WebDashboard/Dashboard/ProjectGridRow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/WebDashboard/Dashboard/ProjectGridRow.cs b/project/WebDashboard/Dashboard/ProjectGridRow.cs index c1afb4bf8..77d4f5204 100644 --- a/project/WebDashboard/Dashboard/ProjectGridRow.cs +++ b/project/WebDashboard/Dashboard/ProjectGridRow.cs @@ -80,7 +80,7 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, public string ForceAbortBuildButtonValue { get { return (status.Activity != ProjectActivity.Building) ? "Force" : "Abort"; } } - public string CancelPendingButtonName { get { return (status.Activity == ProjectActivity.Pending) ? "CancelPending" : ""; } } + public string CancelPendingButtonName { get { return (status.Activity == ProjectActivity.Pending) ? "CancelPending" : string.Empty;; } } public bool AllowForceBuild { get { return serverSpecifier.AllowForceBuild && status.ShowForceBuildButton; } } From c6543eefc95710315104a65b6c0de66f08304b5f Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Mon, 18 Apr 2016 11:22:17 +0200 Subject: [PATCH 026/118] Update ProjectGridRow.cs --- project/WebDashboard/Dashboard/ProjectGridRow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/WebDashboard/Dashboard/ProjectGridRow.cs b/project/WebDashboard/Dashboard/ProjectGridRow.cs index 77d4f5204..bd13118b6 100644 --- a/project/WebDashboard/Dashboard/ProjectGridRow.cs +++ b/project/WebDashboard/Dashboard/ProjectGridRow.cs @@ -80,7 +80,7 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, public string ForceAbortBuildButtonValue { get { return (status.Activity != ProjectActivity.Building) ? "Force" : "Abort"; } } - public string CancelPendingButtonName { get { return (status.Activity == ProjectActivity.Pending) ? "CancelPending" : string.Empty;; } } + public string CancelPendingButtonName { get { return (status.Activity == ProjectActivity.Pending) ? "CancelPending" : string.Empty; } } public bool AllowForceBuild { get { return serverSpecifier.AllowForceBuild && status.ShowForceBuildButton; } } From b2c057dcb6475dbf372ad997c9c37b41ba020126 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Mon, 18 Apr 2016 11:25:27 +0200 Subject: [PATCH 027/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 696 +++++++++--------- 1 file changed, 359 insertions(+), 337 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 2ae52027b..f718ea602 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -1,355 +1,377 @@ - - - - -
-
- $runningTime + $lastRunningTime $translations.Translate($projectGridRow.Status)
- - - -
- -
- - #if ($forceBuildMessage.Length > 0) -

- - - $translations.Translate($forceBuildMessage) - - -

- #end - #set ($ProjectOKCounter = 0) - #set ($ProjectNOKCounter = 0) - #foreach ($projectGridRow in $projectGrid) - #set($ProjectServer = $projectGridRow.ServerName) - #if ($projectGridRow.BuildStatus == "Success") - #set ($ProjectOKCounter = $ProjectOKCounter + 1) + + -
- Build state { - : Succes | - : Failure | - : Exception | - : Unknown } - / Actions { - : Start | - : Stop | - : Abort | - : Force run | - : Cancel Pending } -
- - #if ($projectGrid.Length > 0) - - - #if ($barAtTop) - - - - #end - - - - - - - - - - - - - - - + + +
- - - #if ($OKPercent == 50) - - #else - - - - - #end - -
-
$translations.Translate("Project Name")$translations.Translate("Last 5 Builds")$translations.Translate("Statistics")$translations.Translate("Messages")$translations.Translate("Last Build Time")$translations.Translate("Running Time")$translations.Translate("Status")$translations.Translate("Activity")$translations.Translate("Admin")
+ + + +
+ +
+ +#if ($forceBuildMessage.Length > 0) +

+ + + $translations.Translate($forceBuildMessage) + + +

+#end - #set ($RowId = 0) - #foreach ($projectGridRow in $projectGrid) - #set ($RowId = $RowId + 1) - #set($cont=0) - - - #set($add=$lastsFive.add("red")) - #set($add=$lastsFive.add("blue")) +#set ($ProjectOKCounter = 0) +#set ($ProjectNOKCounter = 0) +#foreach ($projectGridRow in $projectGrid) +#set($ProjectServer = $projectGridRow.ServerName) +#if ($projectGridRow.BuildStatus == "Success") +#set ($ProjectOKCounter = $ProjectOKCounter + 1) +#else +#set ($ProjectNOKCounter = $ProjectNOKCounter + 1) +#end +#end +#set ($ProjectCounter = $ProjectOKCounter + $ProjectNOKCounter) +#if ($ProjectCounter == 0) +#set ($OKPercent = 50) +#set ($NOKPercent = 0) +#else +#set ($OKPercent = 50 * $ProjectOKCounter / $ProjectCounter) +#set ($NOKPercent = 50 - $OKPercent) +#end +#set ($OKPercentToolTip = $OKPercent * 2) - -
$projectGridRow.Name - - - #set($cont = 0) - #foreach($dataGridRow in $projectGridRow.LastFiveData) - #if ($dataGridRow.BuildStatus == "Failure" ) - #set($color = "red") - #set($span = "Failure: ") - #elseif ($dataGridRow.BuildStatus == "Exception" ) - #set($color = "orange") - #set($span = "Exception: ") - #elseif ($dataGridRow.BuildStatus == "Unknown" ) - #set($color = "blue") - #set($span = "Unknown: ") - #else - #set($color = "green") - #set($span = "Success: ") - #end - #set($date = $dataGridRow.Date) - #set($link = $dataGridRow.Link) - #set($runningTime = $dataGridRow.RunningTime) - #if($cont == 0) - #set($lastRunningTime = $runningTime) - #end - - - +
+ Build state { + + : Succes | + + : Failure | + + : Exception | + + : Unknown + } + / Actions { + + + : Start | + + : Stop | + + : Abort | + + : Force run | + + : Cancel Pending } +
+ +#if ($projectGrid.Length > 0) + + + #if ($barAtTop) + + + + #end + + + + + + + + + + + + + + + + + #set ($RowId = 0) + #foreach ($projectGridRow in $projectGrid) + #set ($RowId = $RowId + 1) + #set($cont=0) + + + #set($add=$lastsFive.add("red")) + #set($add=$lastsFive.add("blue")) + + + - - - #if ($projectGridRow.Breakers.Length == 0) - + + + #if ($projectGridRow.Breakers.Length == 0) + - + #end + + + - - - - + + + - - - #if ($projectGridRow.BuildStage.Length > 0) - - #if ($wholeFarm) - - #else - - #end - - #end - #end - - #if ($barAtBottom) - - - - - - #end -
+ + + #if ($OKPercent == 50) + + #else + + + + + #end + +
+
$translations.Translate("Project Name")$translations.Translate("Last 5 Builds")$translations.Translate("Statistics")$translations.Translate("Messages")$translations.Translate("Last Build Time")$translations.Translate("Running Time")$translations.Translate("Status")$translations.Translate("Activity")$translations.Translate("Admin")
+ $projectGridRow.Name + + #set($cont = 0) + #foreach($dataGridRow in $projectGridRow.LastFiveData) + #if ($dataGridRow.BuildStatus == "Failure" ) + #set($color = "red") + #set($span = "Failure: ") + #elseif ($dataGridRow.BuildStatus == "Exception" ) + #set($color = "orange") + #set($span = "Exception: ") + #elseif ($dataGridRow.BuildStatus == "Unknown" ) + #set($color = "blue") + #set($span = "Unknown: ") + #else + #set($color = "green") + #set($span = "Success: ") + #end + #set($date = $dataGridRow.Date) + #set($link = $dataGridRow.Link) + #set($runningTime = $dataGridRow.RunningTime) + #if($cont == 0) + #set($lastRunningTime = $runningTime) + #end + + + - - #set($cont = $cont + 1) - #end - $projectGridRow.Statistics - #else - - #end -
    - #if ($projectGridRow.Fixer.Length > 0) -
  • $projectGridRow.Fixer
  • - #end - #if (($projectGridRow.Breakers.Length > 0) && ($translations.Translate($projectGridRow.BuildStatus) == "Failure")) -
  • - $translations.Translate("Breakers :
    {0}",$projectGridRow.Breakers) + + #set($cont = $cont + 1) + #end +
$projectGridRow.Statistics + #else + + #end +
    + #if ($projectGridRow.Fixer.Length > 0) +
  • $projectGridRow.Fixer
  • + #end + #if (($projectGridRow.Breakers.Length > 0) && ($translations.Translate($projectGridRow.BuildStatus) == "Failure")) +
  • + $translations.Translate("Breakers :
    {0}",$projectGridRow.Breakers)
  • - #end -
-
- $projectGridRow.LastBuildDate - + $projectGridRow.LastBuildDate + - $lastRunningTime - $translations.Translate($projectGridRow.Status) - - #if($projectGridRow.Activity.ToString() == "Pending") - - #else - - #end - $translations.Translate($projectGridRow.Activity.ToString()) (P$projectGridRow.QueuePriority) - #if($projectGridRow.Activity.ToString() == "Pending") - #if($projectGridRow.QueuePosition < 10) + + $lastRunningTime + $translations.Translate($projectGridRow.Status) + + #if($projectGridRow.Activity.ToString() == "Pending") + + #else + + #end + $translations.Translate($projectGridRow.Activity.ToString()) (P$projectGridRow.QueuePriority) + #if($projectGridRow.Activity.ToString() == "Pending") + #if($projectGridRow.QueuePosition < 10) (Q0$projectGridRow.QueuePosition) #else (Q$projectGridRow.QueuePosition) #end #end - - - -
- - - - - #if ($projectGridRow.allowForceBuild) - #if($projectGridRow.ForceAbortBuildButtonValue == "Force") - - - - #else - - - - #end - #end - #if ($projectGridRow.AllowStartStopBuild) - #if ($projectGridRow.Status == "Running") - - - - #else - - - - #end - #end - -
-
$translations.FormatBuildStage($projectGridRow.BuildStage)$translations.FormatBuildStage($projectGridRow.BuildStage)
- - - #if ($OKPercent == 50) - - #else - - - - - #end - -
-
- #end +
+ + +
+ + + + + #if ($projectGridRow.allowForceBuild) + #if($projectGridRow.ForceAbortBuildButtonValue == "Force") + + + + #else + + + + #end + #end + #if($projectGridRow.Activity.ToString() == "Pending") + + + + #end + #if ($projectGridRow.AllowStartStopBuild) + #if ($projectGridRow.Status == "Running") + + + + #else + + + + #end + #end + +
+ + + #if ($projectGridRow.BuildStage.Length > 0) + + #if ($wholeFarm) + $translations.FormatBuildStage($projectGridRow.BuildStage) + #else + $translations.FormatBuildStage($projectGridRow.BuildStage) + #end + + #end + #end + + #if ($barAtBottom) + + + + + + #if ($OKPercent == 50) + + #else + + + + + #end + +
+ + + + #end + +#end + + $translations.Translate($forceBuildMessage) + - #if ($exceptions.Length > 0) -

- - $translations.Translate("There were exceptions connecting to the following servers"): - -

- - - - - - - #foreach ($exception in $exceptions) - - - - - - #end -
- - $translations.Translate("Server") - - - - $translations.Translate("Url") - - - - $translations.Translate("Message") - -
- $exception.ServerName - - $exception.Url - - $exception.Message -
- #end - +#if ($exceptions.Length > 0) +

+ + $translations.Translate("There were exceptions connecting to the following servers"): + +

+ + + + + + + #foreach ($exception in $exceptions) + + + + + + #end +
+ + $translations.Translate("Server") + + + + $translations.Translate("Url") + + + + $translations.Translate("Message") + +
+ $exception.ServerName + + $exception.Url + + $exception.Message +
+#end + From 6f509f85fbcf64c489e308d9f1d6bda73e82e829 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Mon, 18 Apr 2016 11:34:55 +0200 Subject: [PATCH 028/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index f718ea602..3f80bbbac 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -258,7 +258,7 @@ #if($projectGridRow.Activity.ToString() == "Pending") From 54adf9f1be28fd5ade9ff76a1db64af9571f303d Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 27 Apr 2016 10:41:10 +0200 Subject: [PATCH 029/118] Update ProjectGrid.cs Now it read the running time from the external file. If the external file no exists or is empty, it will read it from the last build. (Independent of the last5build) --- project/WebDashboard/Dashboard/ProjectGrid.cs | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGrid.cs b/project/WebDashboard/Dashboard/ProjectGrid.cs index 2834bc4d9..423fe3ea0 100644 --- a/project/WebDashboard/Dashboard/ProjectGrid.cs +++ b/project/WebDashboard/Dashboard/ProjectGrid.cs @@ -39,32 +39,42 @@ public ProjectGridRow[] GenerateProjectGridRows(ProjectGridParameters parameters string dir = disk + server + @"\"; string statistics = ""; + string runningTime = String.Empty; if (Directory.Exists(dir)) { var file = String.Format(dir + @"{0}\ccnet\{1}\TestResults.html", serverSpecifier.ServerName, projectSpecifier.ProjectName); + var fileRunningTime = String.Format(dir + @"{0}\ccnet\{1}\RunningTime.html", serverSpecifier.ServerName, projectSpecifier.ProjectName); try { - statistics = File.ReadAllText(file); + if(File.Exists(file)) + statistics = File.ReadAllText(file); + + if (File.Exists(fileRunningTime)) + runningTime = File.ReadAllText(fileRunningTime); + + if (!File.Exists(fileRunningTime) || runningTime.Length < 1) + runningTime = readRunningTimeIfFileEmpty(farmService, projectSpecifier, serverSpecifier, dir); } catch (Exception e) { statistics = String.Format("", e.Message.Replace("-->", "- - >")); + runningTime = String.Format("", e.Message.Replace("-->", "- - >")); } } List lastFiveDataGridRows = getLastFiveDataGridRows(serverSpecifier, projectSpecifier, dir, farmService, status); int queuePosition = getQueuePosition(status, serverSpecifier, projectSpecifier, farmService); - - rows.Add( - new ProjectGridRow(status, + ProjectGridRow test = new ProjectGridRow(status, serverSpecifier, parameters.UrlBuilder.BuildProjectUrl(ProjectReportProjectPlugin.ACTION_NAME, projectSpecifier), parameters.UrlBuilder.BuildProjectUrl(ProjectParametersAction.ActionName, projectSpecifier), statistics, + runningTime, lastFiveDataGridRows, queuePosition, - parameters.Translation)); + parameters.Translation); + rows.Add(test); } rows.Sort(GetComparer(parameters.SortColumn, parameters.SortIsAscending)); @@ -117,6 +127,19 @@ public int Compare(ProjectGridRow x, ProjectGridRow y) } } + private string readRunningTimeIfFileEmpty(IFarmService farmService, DefaultProjectSpecifier projectSpecifier, IServerSpecifier serverSpecifier, string dir) + { + IBuildSpecifier[] mostRecentBuildSpecifiers = farmService.GetMostRecentBuildSpecifiers(projectSpecifier, 1, BuildReportBuildPlugin.ACTION_NAME); + var buildFile = String.Format(dir + @"{0}\ccnet\{1}\Artifacts\buildlogs\{2}", serverSpecifier.ServerName, projectSpecifier.ProjectName, mostRecentBuildSpecifiers[0].BuildName); + var doc = XDocument.Load(buildFile); + IEnumerable elemList = doc.Descendants("build"); + foreach (var node in elemList) + { + return (string)node.Attribute("buildtime"); + } + return String.Empty; + } + private List getLastFiveDataGridRows(IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, string dir, IFarmService farmService, ProjectStatus status) { var lastFiveDataList = new List(); @@ -156,7 +179,7 @@ private DataGridRow getBuildData(IServerSpecifier serverSpecifier, DefaultProjec lastDate = (string)node.Attribute("date"); lastRunningTime = (string)node.Attribute("buildtime"); - if (status.BuildStatus.ToString() == "Success") + if (status.BuildStatus.ToString() != "Unknown") { lastLink = String.Format("http://{0}/ccnet/server/{0}/project/{1}/build/{2}/ViewBuildReport.aspx", serverSpecifier.ServerName, projectSpecifier.ProjectName, buildSpecifier.BuildName); @@ -200,6 +223,7 @@ private int getPositionInQueueList(ProjectStatus status, IServerSpecifier server } return -1; } + private int checkPositionQueue(QueueSnapshot queueSnapshotItem, DefaultProjectSpecifier projectSpecifier) { for (int i = 0; i Date: Wed, 27 Apr 2016 10:41:29 +0200 Subject: [PATCH 030/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 722 +++++++++--------- 1 file changed, 360 insertions(+), 362 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 3f80bbbac..2b640af72 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -1,377 +1,375 @@ - - - - -
- - - - -
- -
-
-#if ($forceBuildMessage.Length > 0) -

- - - $translations.Translate($forceBuildMessage) - - -

-#end - -#set ($ProjectOKCounter = 0) -#set ($ProjectNOKCounter = 0) -#foreach ($projectGridRow in $projectGrid) -#set($ProjectServer = $projectGridRow.ServerName) -#if ($projectGridRow.BuildStatus == "Success") -#set ($ProjectOKCounter = $ProjectOKCounter + 1) -#else -#set ($ProjectNOKCounter = $ProjectNOKCounter + 1) -#end -#end -#set ($ProjectCounter = $ProjectOKCounter + $ProjectNOKCounter) -#if ($ProjectCounter == 0) -#set ($OKPercent = 50) -#set ($NOKPercent = 0) -#else -#set ($OKPercent = 50 * $ProjectOKCounter / $ProjectCounter) -#set ($NOKPercent = 50 - $OKPercent) -#end -#set ($OKPercentToolTip = $OKPercent * 2) - -
- Build state { - - : Succes | - - : Failure | - - : Exception | - - : Unknown - } - / Actions { - - - : Start | - - : Stop | - - : Abort | - - : Force run | - - : Cancel Pending } -
+ + -#if ($projectGrid.Length > 0) - - - #if ($barAtTop) - - - - #end + + + +
- - - #if ($OKPercent == 50) - - #else - - - - - #end - -
-
+ + + +
+ +
+ - - $translations.Translate("Project Name") - $translations.Translate("Last 5 Builds") - $translations.Translate("Statistics") - $translations.Translate("Messages") - $translations.Translate("Last Build Time") - $translations.Translate("Running Time") - $translations.Translate("Status") - $translations.Translate("Activity") - $translations.Translate("Admin") - - - - + #set ($ProjectOKCounter = 0) + #set ($ProjectNOKCounter = 0) + #foreach ($projectGridRow in $projectGrid) + #set($ProjectServer = $projectGridRow.ServerName) + #if ($projectGridRow.BuildStatus == "Success") + #set ($ProjectOKCounter = $ProjectOKCounter + 1) + #else + #set ($ProjectNOKCounter = $ProjectNOKCounter + 1) + #end + #end + #set ($ProjectCounter = $ProjectOKCounter + $ProjectNOKCounter) + #if ($ProjectCounter == 0) + #set ($OKPercent = 50) + #set ($NOKPercent = 0) + #else + #set ($OKPercent = 50 * $ProjectOKCounter / $ProjectCounter) + #set ($NOKPercent = 50 - $OKPercent) + #end + #set ($OKPercentToolTip = $OKPercent * 2) - #set ($RowId = 0) - #foreach ($projectGridRow in $projectGrid) - #set ($RowId = $RowId + 1) - #set($cont=0) +
+ Build state { + + : Succes | + + : Failure | + + : Exception | + + : Unknown + } + / Actions { + + + : Start | + + : Stop | + + : Abort | + + : Force run | + + : Cancel Pending } +
- - #set($add=$lastsFive.add("red")) - #set($add=$lastsFive.add("blue")) + #if ($forceBuildMessage.Length > 0) +

+ + + $forceBuildMessage + + +

+ + #end - -
$projectGridRow.Name - - - #set($cont = 0) - #foreach($dataGridRow in $projectGridRow.LastFiveData) - #if ($dataGridRow.BuildStatus == "Failure" ) - #set($color = "red") - #set($span = "Failure: ") - #elseif ($dataGridRow.BuildStatus == "Exception" ) - #set($color = "orange") - #set($span = "Exception: ") - #elseif ($dataGridRow.BuildStatus == "Unknown" ) - #set($color = "blue") - #set($span = "Unknown: ") - #else - #set($color = "green") - #set($span = "Success: ") - #end - #set($date = $dataGridRow.Date) - #set($link = $dataGridRow.Link) - #set($runningTime = $dataGridRow.RunningTime) - #if($cont == 0) - #set($lastRunningTime = $runningTime) - #end - - - - - - #set($cont = $cont + 1) - #end - + #if ($projectGrid.Length > 0) + + + #if ($barAtTop) + + + + #end - - #if ($projectGridRow.Breakers.Length == 0) - - + + + + + + + + + + + + - + + #set ($RowId = 0) + #foreach ($projectGridRow in $projectGrid) + #set ($RowId = $RowId + 1) + #set($cont=0) - - + + - #if($projectGridRow.Activity.ToString() == "Pending") - - #else - - #end - $translations.Translate($projectGridRow.Activity.ToString()) (P$projectGridRow.QueuePriority) - #if($projectGridRow.Activity.ToString() == "Pending") - #if($projectGridRow.QueuePosition < 10) - (Q0$projectGridRow.QueuePosition) - #else - (Q$projectGridRow.QueuePosition) + + #if ($projectGridRow.Breakers.Length == 0) + + - - - - #if ($projectGridRow.BuildStage.Length > 0) - - #if ($wholeFarm) - - #else - - #end - - #end - #end - - #if ($barAtBottom) - - - - - - #end -
+ + + #if ($OKPercent == 50) + + #else + + + + + #end + +
+
$projectGridRow.Statistics - #else - - #end -
    - #if ($projectGridRow.Fixer.Length > 0) -
  • $projectGridRow.Fixer
  • - #end - #if (($projectGridRow.Breakers.Length > 0) && ($translations.Translate($projectGridRow.BuildStatus) == "Failure")) -
  • - $translations.Translate("Breakers :
    {0}",$projectGridRow.Breakers) -
  • - #end -
-
- $projectGridRow.LastBuildDate -
$translations.Translate("Project Name")$translations.Translate("Last 5 Builds")$translations.Translate("Statistics")$translations.Translate("Messages")$translations.Translate("Last Build Time")$translations.Translate("Running Time")$translations.Translate("Status")$translations.Translate("Activity")$translations.Translate("Admin")
- $lastRunningTime -
$translations.Translate($projectGridRow.Status) +
+ $projectGridRow.Name + + #set($cont = 0) + #foreach($dataGridRow in $projectGridRow.LastFiveData) + #if ($dataGridRow.BuildStatus == "Failure" ) + #set($color = "red") + #set($span = "Failure: ") + #elseif ($dataGridRow.BuildStatus == "Exception" ) + #set($color = "orange") + #set($span = "Exception: ") + #elseif ($dataGridRow.BuildStatus == "Unknown" ) + #set($color = "blue") + #set($span = "Unknown: ") + #else + #set($color = "green") + #set($span = "Success: ") + #end + #set($date = $dataGridRow.Date) + #set($link = $dataGridRow.Link) + #set($runningTime = $dataGridRow.RunningTime) + #if($cont == 0) + #set($lastRunningTime = $runningTime) + #set($lastBuildDate = $date) + #end + + + + + + #set($cont = $cont + 1) + #end + $projectGridRow.Statistics + #else + + #end +
    + #if ($projectGridRow.Fixer.Length > 0) +
  • $projectGridRow.Fixer
  • #end - #end - + #if (($projectGridRow.Breakers.Length > 0) && ($translations.Translate($projectGridRow.BuildStatus) == "Failure")) +
  • + $translations.Translate("Breakers :
    {0}",$projectGridRow.Breakers) +
  • + #end +
+
+ $projectGridRow.LastBuildDate + -
- - - - - #if ($projectGridRow.allowForceBuild) - #if($projectGridRow.ForceAbortBuildButtonValue == "Force") - - - - #else - - - - #end - #end - #if($projectGridRow.Activity.ToString() == "Pending") - - - - #end - #if ($projectGridRow.AllowStartStopBuild) - #if ($projectGridRow.Status == "Running") - - - - #else - - - - #end - #end - -
-
$translations.FormatBuildStage($projectGridRow.BuildStage)$translations.FormatBuildStage($projectGridRow.BuildStage)
- - - #if ($OKPercent == 50) - - #else - - - - - #end - -
-
-#end - - $translations.Translate($forceBuildMessage) - + + $projectGridRow.RunningTime + + $translations.Translate($projectGridRow.Status) + + #if($projectGridRow.Activity.ToString() == "Pending") + + #else + + #end + $translations.Translate($projectGridRow.Activity.ToString()) (P$projectGridRow.QueuePriority) + #if($projectGridRow.Activity.ToString() == "Pending") + #if($projectGridRow.QueuePosition < 10) + (Q0$projectGridRow.QueuePosition) + #else + (Q$projectGridRow.QueuePosition) + #end + #end + + + +
+ + + + + #if ($projectGridRow.allowForceBuild) + #if($projectGridRow.ForceAbortBuildButtonValue == "Force") + + + + #else + + + + #end + #end + #if($projectGridRow.Activity.ToString() == "Pending") + + + + #end + #if ($projectGridRow.AllowStartStopBuild) + #if ($projectGridRow.Status == "Running") + + + + #else + + + + #end + #end + +
+ + + #if ($projectGridRow.BuildStage.Length > 0) + + #if ($wholeFarm) + $translations.FormatBuildStage($projectGridRow.BuildStage) + #else + $translations.FormatBuildStage($projectGridRow.BuildStage) + #end + + #end + #end + + #if ($barAtBottom) + + + + + + #if ($OKPercent == 50) + + #else + + + + + #end + +
+ + + + #end + + #end -#if ($exceptions.Length > 0) -

- - $translations.Translate("There were exceptions connecting to the following servers"): - -

- - - - - - - #foreach ($exception in $exceptions) - - - - - - #end -
- - $translations.Translate("Server") - - - - $translations.Translate("Url") - - - - $translations.Translate("Message") - -
- $exception.ServerName - - $exception.Url - - $exception.Message -
-#end - + #if ($exceptions.Length > 0) +

+ + $translations.Translate("There were exceptions connecting to the following servers"): + +

+ + + + + + + #foreach ($exception in $exceptions) + + + + + + #end +
+ + $translations.Translate("Server") + + + + $translations.Translate("Url") + + + + $translations.Translate("Message") + +
+ $exception.ServerName + + $exception.Url + + $exception.Message +
+ #end + From 038f314c3ee2151cdd1a71d65c93321d86b0fcfe Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Wed, 27 Apr 2016 10:42:40 +0200 Subject: [PATCH 031/118] Update ProjectGridRow.cs Added the running time as a string --- project/WebDashboard/Dashboard/ProjectGridRow.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGridRow.cs b/project/WebDashboard/Dashboard/ProjectGridRow.cs index bd13118b6..6a838377d 100644 --- a/project/WebDashboard/Dashboard/ProjectGridRow.cs +++ b/project/WebDashboard/Dashboard/ProjectGridRow.cs @@ -15,6 +15,7 @@ public class ProjectGridRow private readonly string url; private readonly string parametersUrl; private readonly string statistics; + private readonly string runningTime; private readonly List lastFiveData; private readonly int queuePosition; @@ -28,10 +29,11 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, } public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, - string url, string parametersUrl, string statistics, List lastFiveData, int queuePosition, Translations translations) + string url, string parametersUrl, string statistics, string runningTime, List lastFiveData, int queuePosition, Translations translations) : this(status, serverSpecifier, url, parametersUrl, translations) { this.statistics = statistics; + this.runningTime = runningTime; this.lastFiveData = lastFiveData; this.queuePosition = queuePosition; } @@ -80,7 +82,7 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, public string ForceAbortBuildButtonValue { get { return (status.Activity != ProjectActivity.Building) ? "Force" : "Abort"; } } - public string CancelPendingButtonName { get { return (status.Activity == ProjectActivity.Pending) ? "CancelPending" : string.Empty; } } + public string CancelPendingButtonName { get { return (status.Activity == ProjectActivity.Pending) ? "CancelPending" : string.Empty; } } public bool AllowForceBuild { get { return serverSpecifier.AllowForceBuild && status.ShowForceBuildButton; } } @@ -88,6 +90,8 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, public string Statistics { get { return this.statistics; } } + public string RunningTime { get { return this.runningTime; } } + public string ParametersUrl { get { return parametersUrl; } } public string Description From 6e07eb09ece98cbef98b34908440410bc07fd505 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 28 Apr 2016 16:36:09 +0200 Subject: [PATCH 032/118] Update ProjectGrid.cs Now it doesn't need to read the xml files to get the data, as it can be obtained from the file name --- project/WebDashboard/Dashboard/ProjectGrid.cs | 50 +++++-------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGrid.cs b/project/WebDashboard/Dashboard/ProjectGrid.cs index 423fe3ea0..0e60eff72 100644 --- a/project/WebDashboard/Dashboard/ProjectGrid.cs +++ b/project/WebDashboard/Dashboard/ProjectGrid.cs @@ -157,45 +157,19 @@ private List getLastFiveDataGridRows(IServerSpecifier serverSpecifi private DataGridRow getBuildData(IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, string dir, ProjectStatus status, IBuildSpecifier buildSpecifier) { DataGridRow dataToReturn; + string buildName = buildSpecifier.BuildName; + string lastStatus = ""; string localserver = new AppSettingsReader().GetValue("servername", typeof(System.String)).ToString(); - - var file = String.Format(dir + @"{0}\ccnet\{1}\Artifacts\buildlogs\{2}", localserver, projectSpecifier.ProjectName,buildSpecifier.BuildName); - try - { - var doc = XDocument.Load(file); - string lastStatus = ""; - string lastDate = ""; - string lastRunningTime = ""; - string lastLink = ""; - var tests = doc.Descendants("CCNetIntegrationStatus"); - foreach (var test in tests) - { - lastStatus = test.Value; - } - - var elemList = doc.Descendants("build"); - foreach (var node in elemList) - { - lastDate = (string)node.Attribute("date"); - - lastRunningTime = (string)node.Attribute("buildtime"); - if (status.BuildStatus.ToString() != "Unknown") - { - lastLink = String.Format("http://{0}/ccnet/server/{0}/project/{1}/build/{2}/ViewBuildReport.aspx", - serverSpecifier.ServerName, projectSpecifier.ProjectName, buildSpecifier.BuildName); - } - else - { - lastLink = ""; - } - } - DataGridRow aux = new DataGridRow(lastStatus, lastDate, lastRunningTime, lastLink); - dataToReturn = aux; - } - catch (Exception e) - { - throw new System.ArgumentException("File not found or corrupted. Error: " + e, "Argument"); - } + if (buildName.Contains("Lbuild")) + { lastStatus = "Success"; } + else + { lastStatus = "Failure"; } + string lastDate = String.Format("{0}-{1}-{2} {3}:{4}:{5}", buildName.Substring(3, 4), buildName.Substring(7, 2), buildName.Substring(9, 2), + buildName.Substring(11, 2), buildName.Substring(13, 2), buildName.Substring(15, 2)); + string lastLink = String.Format("http://{0}/ccnet/server/{0}/project/{1}/build/{2}/ViewBuildReport.aspx", + serverSpecifier.ServerName, projectSpecifier.ProjectName, buildName); + DataGridRow aux = new DataGridRow(lastStatus, lastDate, lastLink); + dataToReturn = aux; return dataToReturn; } From 3cf05b964a749b12ffd39280fec24c4bbe3e736e Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 28 Apr 2016 16:36:59 +0200 Subject: [PATCH 033/118] Update DataGridRow.cs --- project/WebDashboard/Dashboard/DataGridRow.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/project/WebDashboard/Dashboard/DataGridRow.cs b/project/WebDashboard/Dashboard/DataGridRow.cs index de6117e39..59ad824fe 100644 --- a/project/WebDashboard/Dashboard/DataGridRow.cs +++ b/project/WebDashboard/Dashboard/DataGridRow.cs @@ -10,14 +10,12 @@ public class DataGridRow { private readonly string buildStatus; private readonly string date; - private readonly string runningTime; private readonly string link; - public DataGridRow(string buildStatus, string date, string runningTime, string link) + public DataGridRow(string buildStatus, string date, string link) { this.buildStatus = buildStatus; this.date = date; - this.runningTime = runningTime; this.link = link; } @@ -25,8 +23,6 @@ public DataGridRow(string buildStatus, string date, string runningTime, string l public string Date { get { return date; } } - public string RunningTime { get { return runningTime; } } - public string Link { get { return link; } } } } From b8021b01a24a143d08724cd8571b6b3b851c783d Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 5 May 2016 11:20:09 +0200 Subject: [PATCH 034/118] Update VelocityProjectGridAction.cs New action receiver for volunteer to fix the build. --- .../Dashboard/VelocityProjectGridAction.cs | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs index a70429132..22ceda2af 100644 --- a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs +++ b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs @@ -11,10 +11,15 @@ using ThoughtWorks.CruiseControl.WebDashboard.MVC.View; using ThoughtWorks.CruiseControl.WebDashboard.ServerConnection; using ThoughtWorks.CruiseControl.WebDashboard.Resources; +using System.Net; +using System.Collections.Specialized; +using ThoughtWorks.CruiseControl.Remote.Security; +using Microsoft.TeamFoundation.Client; +using Microsoft.TeamFoundation.Server; namespace ThoughtWorks.CruiseControl.WebDashboard.Dashboard { - // ToDo - Test! + // ToDo - Test public class VelocityProjectGridAction : IProjectGridAction { private readonly IFarmService FarmService; @@ -97,7 +102,6 @@ private HtmlFragmentResponse GenerateView(ProjectStatusListAndExceptions project velocityContext["serverNameSortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.ServerName, sortColumn, sortReverse); velocityContext["projectCategorySortLink"] = GenerateSortLink(serverSpecifier, actionName, ProjectGridSortColumn.Category, sortColumn, sortReverse); velocityContext["exceptions"] = projectStatusListAndExceptions.Exceptions; - ProjectGridParameters parameters = new ProjectGridParameters(projectStatusListAndExceptions.StatusAndServerList, sortColumn, sortReverse, category, CruiseUrlBuilder, FarmService, this.translation); ProjectGridRow[] projectGridRows = ProjectGrid.GenerateProjectGridRows(parameters); velocityContext["projectGrid"] = projectGridRows; @@ -105,6 +109,7 @@ private HtmlFragmentResponse GenerateView(ProjectStatusListAndExceptions project Array categoryList = this.GenerateCategoryList(projectGridRows); velocityContext["categoryList"] = categoryList; + var username = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString(); velocityContext["barAtTop"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Top) || (this.SuccessIndicatorBarLocation == IndicatorBarLocation.TopAndBottom); velocityContext["barAtBottom"] = (this.SuccessIndicatorBarLocation == IndicatorBarLocation.Bottom) || @@ -197,35 +202,54 @@ private string ForceBuildIfNecessary(IRequest request) } // Make the actual call + // Right now the message returned is not used, but it will in a future if (request.FindParameterStartingWith("StopBuild") != string.Empty) { FarmService.Stop(ProjectSpecifier(request), sessionToken); + System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); return this.translation.Translate("Stopping project {0}", SelectedProject(request)); } else if (request.FindParameterStartingWith("StartBuild") != string.Empty) { FarmService.Start(ProjectSpecifier(request), sessionToken); + System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); return this.translation.Translate("Starting project {0}", SelectedProject(request)); } else if (request.FindParameterStartingWith("ForceBuild") != string.Empty) { FarmService.ForceBuild(ProjectSpecifier(request), sessionToken, parameters); + System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); return this.translation.Translate("Build successfully forced for {0}", SelectedProject(request)); } else if (request.FindParameterStartingWith("AbortBuild") != string.Empty) { FarmService.AbortBuild(ProjectSpecifier(request), sessionToken); + System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); return this.translation.Translate("Abort successfully forced for {0}", SelectedProject(request)); } else if (request.FindParameterStartingWith("CancelPending") != string.Empty) { FarmService.CancelPendingRequest(ProjectSpecifier(request), sessionToken); + System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); return this.translation.Translate("Cancel pending successfully forced for {0}", SelectedProject(request)); } - else - { - return string.Empty; - } + else if (request.FindParameterStartingWith("Volunteer") != string.Empty) + { + if (request.GetText("FixerName") != string.Empty) + { + FarmService.VolunteerFixer(ProjectSpecifier(request), sessionToken, request.GetText("FixerName")); + System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); + return this.translation.Translate("You succesfully offered as a fixer for {0}", SelectedProject(request)); + } + else + { + return this.translation.Translate("Fixer's name cannot be empty"); + } + } + else + { + return string.Empty; + } } private DefaultProjectSpecifier ProjectSpecifier(IRequest request) From b117cd551159002613eb34041749982ce106cd5a Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 5 May 2016 11:21:17 +0200 Subject: [PATCH 035/118] Update IFarmService.cs Added the function for volunteer to fix the build --- project/WebDashboard/ServerConnection/IFarmService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/project/WebDashboard/ServerConnection/IFarmService.cs b/project/WebDashboard/ServerConnection/IFarmService.cs index 9e1f1248f..91721fe64 100644 --- a/project/WebDashboard/ServerConnection/IFarmService.cs +++ b/project/WebDashboard/ServerConnection/IFarmService.cs @@ -20,6 +20,7 @@ public interface IFarmService void Stop(IProjectSpecifier projectSpecifier, string sessionToken); void CancelPendingRequest(IProjectSpecifier projectSpecifier, string sessionToken); void ForceBuild(IProjectSpecifier projectSpecifier, string sessionToken, Dictionary parameters); + void VolunteerFixer(IProjectSpecifier projectSpecifier, string sessionToken, string fixingUserName); ProjectStatusListAndExceptions GetProjectStatusListAndCaptureExceptions(string sessionToken); ProjectStatusListAndExceptions GetProjectStatusListAndCaptureExceptions(IServerSpecifier serverSpecifier, string sessionToken); ExternalLink[] GetExternalLinks(IProjectSpecifier projectSpecifier, string sessionToken); From e28b0dd2e58fe257d24b0167168c7636aa0faebf Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 5 May 2016 11:22:42 +0200 Subject: [PATCH 036/118] Update ServerAggregatingCruiseManagerWrapper.cs Added the function for volunteer to fix the build --- .../ServerAggregatingCruiseManagerWrapper.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs b/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs index 31f50d890..cb53dcca0 100644 --- a/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs +++ b/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Net.Sockets; using ThoughtWorks.CruiseControl.Core; @@ -9,6 +9,8 @@ using ThoughtWorks.CruiseControl.Remote.Parameters; using ThoughtWorks.CruiseControl.Remote.Security; using ThoughtWorks.CruiseControl.WebDashboard.Configuration; +using ThoughtWorks.CruiseControl.CCTrayLib.Presentation; +using ThoughtWorks.CruiseControl.CCTrayLib.Monitoring; namespace ThoughtWorks.CruiseControl.WebDashboard.ServerConnection { @@ -110,6 +112,18 @@ public void AbortBuild(IProjectSpecifier projectSpecifier, string sessionToken) GetCruiseManager(projectSpecifier, sessionToken).AbortBuild(projectSpecifier.ProjectName); } + public void CancelPendingRequest(IProjectSpecifier projectSpecifier, string sessionToken) + { + GetCruiseManager(projectSpecifier.ServerSpecifier, sessionToken) + .CancelPendingRequest(projectSpecifier.ProjectName); + } + + public void VolunteerFixer(IProjectSpecifier projectSpecifier, string sessionToken, string fixingUserName) + { + string message = string.Format(System.Globalization.CultureInfo.CurrentCulture,"{0} is fixing the build.", fixingUserName); + GetCruiseManager(projectSpecifier.ServerSpecifier, sessionToken).SendMessage(projectSpecifier.ProjectName, new Message(message, Message.MessageKind.Fixer)); + } + private ServerLocation GetServerUrl(IServerSpecifier serverSpecifier) { var locations = ServerLocations; From 76e7692ab2d30ffda97162fed02dc7983d3df985 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 5 May 2016 11:23:54 +0200 Subject: [PATCH 037/118] Update ProjectGridRow.cs Added a getter that returns an array with the name of the failure users --- project/WebDashboard/Dashboard/ProjectGridRow.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/project/WebDashboard/Dashboard/ProjectGridRow.cs b/project/WebDashboard/Dashboard/ProjectGridRow.cs index 6a838377d..0397878c6 100644 --- a/project/WebDashboard/Dashboard/ProjectGridRow.cs +++ b/project/WebDashboard/Dashboard/ProjectGridRow.cs @@ -94,6 +94,17 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, public string ParametersUrl { get { return parametersUrl; } } + public string[] BreakersNames + { + get + { + string text = GetMessageText(Message.MessageKind.Breakers); + text = System.Text.RegularExpressions.Regex.Replace(text, ",.", "/", System.Text.RegularExpressions.RegexOptions.None); + string[] users = text.Split('/'); + return users; + } + } + public string Description { get From 511ba89860701e4ab555c0708b8d7ac70e2ab708 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 5 May 2016 11:25:13 +0200 Subject: [PATCH 038/118] Update ProjectGrid.vm Added the button for volunteer to fix the build. --- project/WebDashboard/templates/ProjectGrid.vm | 348 ++++++++++-------- 1 file changed, 190 insertions(+), 158 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 2b640af72..b9e2075b3 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -22,8 +22,9 @@ sortList:sortList }); }); + $('#StatusGrid').load(); - + @@ -62,20 +63,19 @@ #set ($NOKPercent = 50 - $OKPercent) #end #set ($OKPercentToolTip = $OKPercent * 2) - +
- Build state { +

Caption [

Build state ( : Succes | : Failure | - - : Exception | + - : Unknown - } - / Actions { - + : Unknown + ) +

|

Actions ( + : Start | @@ -85,25 +85,21 @@ : Force run | - : Cancel Pending } + : Cancel Pending )

]

#if ($forceBuildMessage.Length > 0) -

- - - $forceBuildMessage - - -

- +

+ + + $translations.Translate($forceBuildMessage) + + +

#end #if ($projectGrid.Length > 0) +
#if ($barAtTop) @@ -131,14 +127,14 @@ #end - + - - - - - - + + + + + + @@ -147,146 +143,180 @@ #set ($RowId = 0) #foreach ($projectGridRow in $projectGrid) #set ($RowId = $RowId + 1) + #set($colorText="") #set($cont=0) - - - - - - #if ($projectGridRow.Breakers.Length == 0) - - - - - - - + + #if ($projectGridRow.Breakers.Length == 0) + - + + + + + + - + + + + #if ($projectGridRow.BuildStage.Length > 0) #if ($wholeFarm) @@ -298,6 +328,7 @@ #end #end + #if ($barAtBottom) @@ -324,6 +355,7 @@ #end
$translations.Translate("Project Name")$translations.Translate("Project Name") $translations.Translate("Last 5 Builds")$translations.Translate("Statistics")$translations.Translate("Messages")$translations.Translate("Last Build Time")$translations.Translate("Running Time")$translations.Translate("Status")$translations.Translate("Activity")$translations.Translate("Statistics")$translations.Translate("Messages")$translations.Translate("Last Build Time")$translations.Translate("Running Time")$translations.Translate("Status")$translations.Translate("Activity") $translations.Translate("Admin")
- $projectGridRow.Name - - #set($cont = 0) - #foreach($dataGridRow in $projectGridRow.LastFiveData) - #if ($dataGridRow.BuildStatus == "Failure" ) - #set($color = "red") - #set($span = "Failure: ") - #elseif ($dataGridRow.BuildStatus == "Exception" ) - #set($color = "orange") - #set($span = "Exception: ") - #elseif ($dataGridRow.BuildStatus == "Unknown" ) - #set($color = "blue") - #set($span = "Unknown: ") - #else - #set($color = "green") - #set($span = "Success: ") + #if ($projectGridRow.BuildStatus == "Failure" ) + #set($colorText = "Red") + #elseif ($projectGridRow.BuildStatus == "Exception" ) + #set($colorText = "Orange") + #elseif ($projectGridRow.BuildStatus == "Unknown" ) + #set($colorText = "Blue") + #elseif ($projectGridRow.BuildStatus == "Success" ) + #set($colorText = "Green") #end - #set($date = $dataGridRow.Date) - #set($link = $dataGridRow.Link) - #set($runningTime = $dataGridRow.RunningTime) - #if($cont == 0) - #set($lastRunningTime = $runningTime) - #set($lastBuildDate = $date) - #end - - - - - - #set($cont = $cont + 1) - #end - $projectGridRow.Statistics - #else - - #end -
    - #if ($projectGridRow.Fixer.Length > 0) -
  • $projectGridRow.Fixer
  • - #end - #if (($projectGridRow.Breakers.Length > 0) && ($translations.Translate($projectGridRow.BuildStatus) == "Failure")) -
  • - $translations.Translate("Breakers :
    {0}",$projectGridRow.Breakers) -
  • - #end -
+
+ $projectGridRow.Name - $projectGridRow.LastBuildDate - - $projectGridRow.RunningTime + + #set($cont = 0) + #foreach($dataGridRow in $projectGridRow.LastFiveData) + #if ($dataGridRow.BuildStatus == "Failure" ) + #set($color = "red") + #set($span = "Failure: ") + #elseif ($dataGridRow.BuildStatus == "Exception" ) + #set($color = "orange") + #set($span = "Exception: ") + #elseif ($dataGridRow.BuildStatus == "Unknown" ) + #set($color = "blue") + #set($span = "Unknown: ") + #else + #set($color = "green") + #set($span = "Success: ") + #end + #set($date = $dataGridRow.Date) + #set($link = $dataGridRow.Link) + + + + + + #set($cont = $cont + 1) + #end $translations.Translate($projectGridRow.Status) - - #if($projectGridRow.Activity.ToString() == "Pending") - + $projectGridRow.Statistics #else - + #end - $translations.Translate($projectGridRow.Activity.ToString()) (P$projectGridRow.QueuePriority) - #if($projectGridRow.Activity.ToString() == "Pending") - #if($projectGridRow.QueuePosition < 10) - (Q0$projectGridRow.QueuePosition) - #else - (Q$projectGridRow.QueuePosition) + #if($projectGridRow.BuildStatus == "Failure") + #if(($projectGridRow.Breakers.Length > 0) && !($projectGridRow.Fixer.Length > 0)) +
+ + + + + + + + + #foreach($UserName in $projectGridRow.BreakersNames) + + +
#end - #end - -
-
- - - - - #if ($projectGridRow.allowForceBuild) - #if($projectGridRow.ForceAbortBuildButtonValue == "Force") - - - - #else - - - + #if (($projectGridRow.Fixer.Length > 0) && ($projectGridRow.Activity != "Building")) +
  • $projectGridRow.Fixer
  • #end +
      + #if ($projectGridRow.Breakers.Length > 0) +
    • + $translations.Translate("Breakers :
      {0}",$projectGridRow.Breakers) +
    • + #end +
    #end - #if($projectGridRow.Activity.ToString() == "Pending") - - - - #end - #if ($projectGridRow.AllowStartStopBuild) - #if ($projectGridRow.Status == "Running") - - - - #else - - - +
    + $projectGridRow.LastBuildDate + + $projectGridRow.RunningTime + $translations.Translate($projectGridRow.Status) + + #if($projectGridRow.Activity.ToString() == "Pending") + + #else + + #end + $translations.Translate($projectGridRow.Activity.ToString()) (P$projectGridRow.QueuePriority) + #if($projectGridRow.Activity.ToString() == "Pending") + #if($projectGridRow.QueuePosition < 10) + (Q0$projectGridRow.QueuePosition) + #else + (Q$projectGridRow.QueuePosition) + #end #end - #end - - -
    +
    + + + + + #if ($projectGridRow.allowForceBuild) + #if($projectGridRow.ForceAbortBuildButtonValue == "Force") + + + + #else + + + + #end + #end + + #if($projectGridRow.Activity.ToString() == "Pending") + + #else + + #end + + #if ($projectGridRow.AllowStartStopBuild) + #if ($projectGridRow.Status == "Running") + + + + #else + + + + #end + #end + +
    +
    +
    #end #if ($exceptions.Length > 0) From b295ab87e544a96456d5753d9755c16bd5d52157 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 5 May 2016 11:26:53 +0200 Subject: [PATCH 039/118] Update cruisecontrol.css Updated and added news ones --- project/WebDashboard/cruisecontrol.css | 102 +++++++++++++++++++++++-- 1 file changed, 96 insertions(+), 6 deletions(-) diff --git a/project/WebDashboard/cruisecontrol.css b/project/WebDashboard/cruisecontrol.css index 486e46093..a32734f13 100644 --- a/project/WebDashboard/cruisecontrol.css +++ b/project/WebDashboard/cruisecontrol.css @@ -244,6 +244,9 @@ td>a.selected:hover { color:#2E8A2E; } align:left; } +.legend h3{ + display:inline; +} .legend span { font-size: 13px; height: 30px; @@ -266,6 +269,11 @@ td>a.selected:hover { color:#2E8A2E; } padding: 0px 5px; } +.StatusLabel{ + margin-left: 6px; + margin-top:-10px; +} + .nav--main { background: #fff; border: solid 1px #ccc; @@ -377,6 +385,32 @@ input.stop--task:hover { background: #ee4040; } +.forceAbort{ + display:inline; + width:30px; +} + +.cancelPending{ + + display:inline; +} + +.action--icon{ + padding-left: 10px; +} + +.cancelPendingIcon{ + padding-left: 5px; + padding-bottom:4px; +} + +.playSmallIcon{ + margin-left:4px; + padding-left:2px; + margin-right:4px; + margin-bottom:4px; +} + .action--iconSmall{ padding: 5px 10px; } @@ -413,7 +447,7 @@ input.stop--task:hover { { border-top: solid 1px #ccc; border-bottom: solid 1px #ccc; - padding:3px 0; + padding:1px 0; text-align:center; } @@ -469,6 +503,15 @@ input.stop--task:hover { color:blue; } +.content--fixer +{ + margin-top:2px; + list-style-type: none; + font-weight:bold; + color:blue; +} + + .SortableGrid .left.scroll--content ul li.content--task__fail { color:red; @@ -560,14 +603,55 @@ input.stop--task:hover { border: none !important; text-align:left !important; } + .SortableGrid thead tr .header { - padding-right:16px; + padding:0 8px; background-image: url(images/bg.gif); background-repeat: no-repeat; background-position: center right; cursor: pointer; } + +.messageTh{ + width:350px; +} + +.volunteerFixForm{ + width:100%; + border:0; + padding:5px 10px; + background-color:red; + display:inline; +} + +.volunteerFix{ + margin-top:5px; + padding-top:5px; + border:0; + width:40%; + background-color:red; + padding: 3px 5px; + color:white; + font-weight: bold; + display:inline; +} + +.volunteerFixText{ + margin-top:5px; + padding-top:5px; + border:0; + width:45%; + padding: 3px 5px; + margin-right: 29px; + font-weight: bold; + display:inline; +} + +.hiddenSubmit{ + display:none; +} + .SortableGrid thead tr .headerSortUp { background-image: url(images/asc.gif); } @@ -646,15 +730,15 @@ tr.buildStatus td /* ICONS */ .icon0{ - height:20px; + height:22px; } .icon1{ - height:18px; + height:14px; } .icon2{ - height:16px; + height:14px; } .icon3{ @@ -662,7 +746,7 @@ tr.buildStatus td } .icon4{ - height:12px; + height:14px; } .ico { @@ -703,3 +787,9 @@ tr.buildStatus td transform:scale(1.3); background-image: url(images/UNIT4info.png); } + + + + + + From ed4cc2283ef027fd2118e35180b3173276a515dc Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 09:54:25 +0200 Subject: [PATCH 040/118] Update Project.cs Updated to add a message if ForceBuildPublisher fails --- project/core/Project.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/project/core/Project.cs b/project/core/Project.cs index 03b3b719d..1db4cb80a 100644 --- a/project/core/Project.cs +++ b/project/core/Project.cs @@ -1066,6 +1066,10 @@ private void RunTask(ITask task, IIntegrationResult result, bool isPublisher) if (baseTask != null) { wasSuccessful = baseTask.WasSuccessful; + if (!wasSuccessful && baseTask.Name.Equals("ForceBuildPublisher")) + { + messages.Add(new Message("ForceBuildPublisher Failed", Message.MessageKind.ForceBuildPublisherFailed)); + } } // Only need to update the status if it is not already set @@ -1090,6 +1094,7 @@ private void RunTask(ITask task, IIntegrationResult result, bool isPublisher) { // An exception was thrown, so we will assume that the task failed if (status != null) status.Status = ItemBuildStatus.CompletedFailed; + messages.Add(new Message("ForceBuildPublisher Failed", Message.MessageKind.ForceBuildPublisherFailed)); throw; } finally @@ -1896,4 +1901,4 @@ public void InitialiseForBuild(IntegrationRequest request) this.AddMessage(new Message(request.ToString(), Message.MessageKind.BuildStatus)); } } -} \ No newline at end of file +} From b6e563e733d7d800bc58e612716a9f371822cc49 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 09:55:34 +0200 Subject: [PATCH 041/118] Update ProjectGrid.vm Added the message for ForceBuildPublisher Failed --- project/WebDashboard/templates/ProjectGrid.vm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index b9e2075b3..58eb0fa20 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -217,16 +217,19 @@ name="Volunteer"/> #end + #if($projectGridRow.ForceBuildPublisher.Length > 0) +
  • $projectGridRow.ForceBuildPublisher
  • + #end #if (($projectGridRow.Fixer.Length > 0) && ($projectGridRow.Activity != "Building"))
  • $projectGridRow.Fixer
  • #end -
      - #if ($projectGridRow.Breakers.Length > 0) + #if ($projectGridRow.Breakers.Length > 0) +
      • $translations.Translate("Breakers :
        {0}",$projectGridRow.Breakers)
      • - #end -
      +
    + #end #end From 49b286b8b0a9cef4d79b679117136d07d3eb8e23 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 09:56:18 +0200 Subject: [PATCH 042/118] Update cruisecontrol.css Added styles for the new Message --- project/WebDashboard/cruisecontrol.css | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/project/WebDashboard/cruisecontrol.css b/project/WebDashboard/cruisecontrol.css index a32734f13..571c49a20 100644 --- a/project/WebDashboard/cruisecontrol.css +++ b/project/WebDashboard/cruisecontrol.css @@ -505,12 +505,18 @@ input.stop--task:hover { .content--fixer { - margin-top:2px; + margin-top:5px; list-style-type: none; font-weight:bold; color:blue; } +.content--force__fail +{ + list-style-type: none; + font-weight:bold; + color:#F88017; +} .SortableGrid .left.scroll--content ul li.content--task__fail { @@ -614,7 +620,7 @@ input.stop--task:hover { } .messageTh{ - width:350px; + width:350px; } .volunteerFixForm{ From 42a2a3852474aedf136a2243491c9ca1251f31d6 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 09:57:25 +0200 Subject: [PATCH 043/118] Update Message.cs Added a new Kind for ForceBuildPublisher fails --- project/Remote/Message.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/project/Remote/Message.cs b/project/Remote/Message.cs index e2ffbce26..d87230370 100644 --- a/project/Remote/Message.cs +++ b/project/Remote/Message.cs @@ -45,7 +45,12 @@ public enum MessageKind /// /// /// - BuildAbortedBy = 5 + BuildAbortedBy = 5, + /// + /// + /// + /// + ForceBuildPublisherFailed = 6 } private string message; @@ -137,4 +142,4 @@ public override int GetHashCode() return this.ToString().GetHashCode(); } } -} \ No newline at end of file +} From b958230b53310926d36553cb1262f2d6cb8473ef Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 09:58:55 +0200 Subject: [PATCH 044/118] Update ProjectGridRow.cs Added a new getter that returns the Messages which kind is ForceBuildPublisherFailed --- project/WebDashboard/Dashboard/ProjectGridRow.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/project/WebDashboard/Dashboard/ProjectGridRow.cs b/project/WebDashboard/Dashboard/ProjectGridRow.cs index 6a838377d..93c7a6fbe 100644 --- a/project/WebDashboard/Dashboard/ProjectGridRow.cs +++ b/project/WebDashboard/Dashboard/ProjectGridRow.cs @@ -66,6 +66,8 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, public string Fixer { get { return GetMessageText(Message.MessageKind.Fixer); } } + public string ForceBuildPublisher { get { return GetMessageText(Message.MessageKind.ForceBuildPublisherFailed); } } + public string Url { get { return url; } } public string Queue { get { return status.Queue; } } @@ -94,6 +96,17 @@ public ProjectGridRow(ProjectStatus status, IServerSpecifier serverSpecifier, public string ParametersUrl { get { return parametersUrl; } } + public string[] BreakersNames + { + get + { + string text = GetMessageText(Message.MessageKind.Breakers); + text = System.Text.RegularExpressions.Regex.Replace(text, ",.", "/", System.Text.RegularExpressions.RegexOptions.None); + string[] users = text.Split('/'); + return users; + } + } + public string Description { get From fae40c6791023821c163f4f807094992dd14b1fa Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 10:25:45 +0200 Subject: [PATCH 045/118] Update Project.cs Updated so it will delete the message if ForceBuildPublisher stop failing --- project/core/Project.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/project/core/Project.cs b/project/core/Project.cs index 1db4cb80a..51499b13b 100644 --- a/project/core/Project.cs +++ b/project/core/Project.cs @@ -1070,6 +1070,10 @@ private void RunTask(ITask task, IIntegrationResult result, bool isPublisher) { messages.Add(new Message("ForceBuildPublisher Failed", Message.MessageKind.ForceBuildPublisherFailed)); } + else if (wasSuccessful && baseTask.Name.Equals("ForceBuildPublisher")) + { + messages.Add(new Message(string.Empty, Message.MessageKind.ForceBuildPublisherFailed)); + } } // Only need to update the status if it is not already set @@ -1094,7 +1098,6 @@ private void RunTask(ITask task, IIntegrationResult result, bool isPublisher) { // An exception was thrown, so we will assume that the task failed if (status != null) status.Status = ItemBuildStatus.CompletedFailed; - messages.Add(new Message("ForceBuildPublisher Failed", Message.MessageKind.ForceBuildPublisherFailed)); throw; } finally From d9b46b31409603fc20f47b22fba858df9c061aa0 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 11:17:48 +0200 Subject: [PATCH 046/118] Update VelocityProjectGridAction.cs Added the function to remove the fixer of a build --- .../Dashboard/VelocityProjectGridAction.cs | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs index 22ceda2af..2b0f18360 100644 --- a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs +++ b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs @@ -235,11 +235,10 @@ private string ForceBuildIfNecessary(IRequest request) } else if (request.FindParameterStartingWith("Volunteer") != string.Empty) { - if (request.GetText("FixerName") != string.Empty) + string userName = request.GetText("FixerName"); + if (userName != string.Empty) { - FarmService.VolunteerFixer(ProjectSpecifier(request), sessionToken, request.GetText("FixerName")); - System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); - return this.translation.Translate("You succesfully offered as a fixer for {0}", SelectedProject(request)); + return SendFixerMessage(userName, request, sessionToken); } else { @@ -262,5 +261,21 @@ private static string SelectedProject(IRequest request) { return request.GetText("projectName"); } + + private string SendFixerMessage(string userName, IRequest request, string sessionToken) + { + if (userName.Equals("nobody", StringComparison.InvariantCultureIgnoreCase)) + { + FarmService.RemoveFixer(ProjectSpecifier(request), sessionToken, userName); + System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); + return this.translation.Translate("{0} removed as fixer for {1}", userName, SelectedProject(request)); + } + else + { + FarmService.VolunteerFixer(ProjectSpecifier(request), sessionToken, userName); + System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); + return this.translation.Translate("{0} succesfully selected as a fixer for {1}", userName, SelectedProject(request)); + } + } } } From 0076783130b06a315fad5291c4a1d61b02334710 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 11:18:39 +0200 Subject: [PATCH 047/118] Update IFarmService.cs Added removeFixer function --- project/WebDashboard/ServerConnection/IFarmService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/project/WebDashboard/ServerConnection/IFarmService.cs b/project/WebDashboard/ServerConnection/IFarmService.cs index 91721fe64..e75430952 100644 --- a/project/WebDashboard/ServerConnection/IFarmService.cs +++ b/project/WebDashboard/ServerConnection/IFarmService.cs @@ -21,6 +21,7 @@ public interface IFarmService void CancelPendingRequest(IProjectSpecifier projectSpecifier, string sessionToken); void ForceBuild(IProjectSpecifier projectSpecifier, string sessionToken, Dictionary parameters); void VolunteerFixer(IProjectSpecifier projectSpecifier, string sessionToken, string fixingUserName); + void RemoveFixer(IProjectSpecifier projectSpecifier, string sessionToken, string fixingUserName); ProjectStatusListAndExceptions GetProjectStatusListAndCaptureExceptions(string sessionToken); ProjectStatusListAndExceptions GetProjectStatusListAndCaptureExceptions(IServerSpecifier serverSpecifier, string sessionToken); ExternalLink[] GetExternalLinks(IProjectSpecifier projectSpecifier, string sessionToken); From d7e8ed4ac7ffe02c147daea3e63bf65caabd7180 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 11:19:34 +0200 Subject: [PATCH 048/118] Update ServerAggregatingCruiseManagerWrapper.cs Added the function to remove the fixer of a build --- .../ServerAggregatingCruiseManagerWrapper.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs b/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs index cb53dcca0..50100cb2f 100644 --- a/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs +++ b/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs @@ -124,6 +124,11 @@ public void VolunteerFixer(IProjectSpecifier projectSpecifier, string sessionTok GetCruiseManager(projectSpecifier.ServerSpecifier, sessionToken).SendMessage(projectSpecifier.ProjectName, new Message(message, Message.MessageKind.Fixer)); } + public void RemoveFixer(IProjectSpecifier projectSpecifier, string sessionToken, string fixingUserName) + { + GetCruiseManager(projectSpecifier.ServerSpecifier, sessionToken).SendMessage(projectSpecifier.ProjectName, new Message(string.Empty, Message.MessageKind.Fixer)); + } + private ServerLocation GetServerUrl(IServerSpecifier serverSpecifier) { var locations = ServerLocations; From 04ddfd3157d815ae7196d1cf033e7f3d04557a27 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 11:20:39 +0200 Subject: [PATCH 049/118] Update ServerAggregatingCruiseManagerWrapper.cs --- .../ServerConnection/ServerAggregatingCruiseManagerWrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs b/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs index 50100cb2f..13c274f86 100644 --- a/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs +++ b/project/WebDashboard/ServerConnection/ServerAggregatingCruiseManagerWrapper.cs @@ -124,7 +124,7 @@ public void VolunteerFixer(IProjectSpecifier projectSpecifier, string sessionTok GetCruiseManager(projectSpecifier.ServerSpecifier, sessionToken).SendMessage(projectSpecifier.ProjectName, new Message(message, Message.MessageKind.Fixer)); } - public void RemoveFixer(IProjectSpecifier projectSpecifier, string sessionToken, string fixingUserName) + public void RemoveFixer(IProjectSpecifier projectSpecifier, string sessionToken) { GetCruiseManager(projectSpecifier.ServerSpecifier, sessionToken).SendMessage(projectSpecifier.ProjectName, new Message(string.Empty, Message.MessageKind.Fixer)); } From 52beaa02058ca18fb3d4fb7bc1e325c3d9522524 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 11:20:59 +0200 Subject: [PATCH 050/118] Update IFarmService.cs --- project/WebDashboard/ServerConnection/IFarmService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/WebDashboard/ServerConnection/IFarmService.cs b/project/WebDashboard/ServerConnection/IFarmService.cs index e75430952..1905eae91 100644 --- a/project/WebDashboard/ServerConnection/IFarmService.cs +++ b/project/WebDashboard/ServerConnection/IFarmService.cs @@ -21,7 +21,7 @@ public interface IFarmService void CancelPendingRequest(IProjectSpecifier projectSpecifier, string sessionToken); void ForceBuild(IProjectSpecifier projectSpecifier, string sessionToken, Dictionary parameters); void VolunteerFixer(IProjectSpecifier projectSpecifier, string sessionToken, string fixingUserName); - void RemoveFixer(IProjectSpecifier projectSpecifier, string sessionToken, string fixingUserName); + void RemoveFixer(IProjectSpecifier projectSpecifier, string sessionToken); ProjectStatusListAndExceptions GetProjectStatusListAndCaptureExceptions(string sessionToken); ProjectStatusListAndExceptions GetProjectStatusListAndCaptureExceptions(IServerSpecifier serverSpecifier, string sessionToken); ExternalLink[] GetExternalLinks(IProjectSpecifier projectSpecifier, string sessionToken); From 2ba3ab46bfaa02d1d4b2de057283914e954a7e93 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Fri, 6 May 2016 11:21:16 +0200 Subject: [PATCH 051/118] Update VelocityProjectGridAction.cs --- project/WebDashboard/Dashboard/VelocityProjectGridAction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs index 2b0f18360..93b71201f 100644 --- a/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs +++ b/project/WebDashboard/Dashboard/VelocityProjectGridAction.cs @@ -266,7 +266,7 @@ private string SendFixerMessage(string userName, IRequest request, string sessio { if (userName.Equals("nobody", StringComparison.InvariantCultureIgnoreCase)) { - FarmService.RemoveFixer(ProjectSpecifier(request), sessionToken, userName); + FarmService.RemoveFixer(ProjectSpecifier(request), sessionToken); System.Web.HttpContext.Current.Response.Redirect(request.RawUrl, false); return this.translation.Translate("{0} removed as fixer for {1}", userName, SelectedProject(request)); } From 657edce5636e6281a6801c337dd1607312413dc6 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 12 May 2016 16:23:09 +0200 Subject: [PATCH 052/118] Update ProjectGrid.cs: ReadDataFromFile --- project/WebDashboard/Dashboard/ProjectGrid.cs | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/project/WebDashboard/Dashboard/ProjectGrid.cs b/project/WebDashboard/Dashboard/ProjectGrid.cs index 0e60eff72..2638714b3 100644 --- a/project/WebDashboard/Dashboard/ProjectGrid.cs +++ b/project/WebDashboard/Dashboard/ProjectGrid.cs @@ -133,9 +133,12 @@ private string readRunningTimeIfFileEmpty(IFarmService farmService, DefaultProje var buildFile = String.Format(dir + @"{0}\ccnet\{1}\Artifacts\buildlogs\{2}", serverSpecifier.ServerName, projectSpecifier.ProjectName, mostRecentBuildSpecifiers[0].BuildName); var doc = XDocument.Load(buildFile); IEnumerable elemList = doc.Descendants("build"); - foreach (var node in elemList) + if (Directory.Exists(buildFile)) { - return (string)node.Attribute("buildtime"); + foreach (var node in elemList) + { + return (string)node.Attribute("buildtime"); + } } return String.Empty; } @@ -143,27 +146,40 @@ private string readRunningTimeIfFileEmpty(IFarmService farmService, DefaultProje private List getLastFiveDataGridRows(IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, string dir, IFarmService farmService, ProjectStatus status) { var lastFiveDataList = new List(); - IBuildSpecifier[] mostRecentBuildSpecifiers = farmService.GetMostRecentBuildSpecifiers(projectSpecifier, 5, BuildReportBuildPlugin.ACTION_NAME); - if (Directory.Exists(dir)) + int cont = 0; + if (Directory.Exists(String.Format(dir + @"{0}\ccnet\{1}\Artifacts\buildlogs", serverSpecifier.ServerName, projectSpecifier.ProjectName))) { - foreach (IBuildSpecifier buildSpecifier in mostRecentBuildSpecifiers) + IBuildSpecifier[] mostRecentBuildSpecifiers = farmService.GetMostRecentBuildSpecifiers(projectSpecifier, 5, BuildReportBuildPlugin.ACTION_NAME); + if (Directory.Exists(dir)) { - lastFiveDataList.Add(getBuildData(serverSpecifier, projectSpecifier, dir, status, buildSpecifier)); + foreach (IBuildSpecifier buildSpecifier in mostRecentBuildSpecifiers) + { + lastFiveDataList.Add(getBuildData(serverSpecifier, projectSpecifier, dir, status, buildSpecifier, cont)); + cont = 1; + } } + return lastFiveDataList; } - return lastFiveDataList; + return null; } - private DataGridRow getBuildData(IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, string dir, ProjectStatus status, IBuildSpecifier buildSpecifier) + private DataGridRow getBuildData(IServerSpecifier serverSpecifier, DefaultProjectSpecifier projectSpecifier, string dir, ProjectStatus status, IBuildSpecifier buildSpecifier, int cont) { DataGridRow dataToReturn; string buildName = buildSpecifier.BuildName; string lastStatus = ""; string localserver = new AppSettingsReader().GetValue("servername", typeof(System.String)).ToString(); - if (buildName.Contains("Lbuild")) - { lastStatus = "Success"; } + if (cont == 0) + { + lastStatus = status.BuildStatus.ToString(); + } else - { lastStatus = "Failure"; } + { + if (buildName.Contains("Lbuild")) + { lastStatus = "Success"; } + else + { lastStatus = "Failure"; } + } string lastDate = String.Format("{0}-{1}-{2} {3}:{4}:{5}", buildName.Substring(3, 4), buildName.Substring(7, 2), buildName.Substring(9, 2), buildName.Substring(11, 2), buildName.Substring(13, 2), buildName.Substring(15, 2)); string lastLink = String.Format("http://{0}/ccnet/server/{0}/project/{1}/build/{2}/ViewBuildReport.aspx", From bafbcff66b3a7fafc386fcfbc1d1b0c62bffa7d9 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 12 May 2016 17:04:54 +0200 Subject: [PATCH 053/118] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 81 ++++++++++++------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 58eb0fa20..5b1a085a4 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -65,27 +65,17 @@ #set ($OKPercentToolTip = $OKPercent * 2)
    -

    Caption [

    Build state ( - - : Succes | - - : Failure | - - - : Unknown - ) -

    |

    Actions ( - +

    Caption [

    : Start | : Stop | : Abort | - + : Force run | - : Cancel Pending )

    ]

    + : Cancel Pending

    ]

    #if ($forceBuildMessage.Length > 0) @@ -192,8 +182,8 @@ #end #if($projectGridRow.BuildStatus == "Failure") - #if(($projectGridRow.Breakers.Length > 0) && !($projectGridRow.Fixer.Length > 0)) -
    + #if(!($projectGridRow.Fixer.Length > 0)) + @@ -201,27 +191,49 @@ name="serverName" value="$projectGridRow.ServerName" /> - - + - #foreach($UserName in $projectGridRow.BreakersNames) - + + +
    #end #if($projectGridRow.ForceBuildPublisher.Length > 0)
  • $projectGridRow.ForceBuildPublisher
  • #end - #if (($projectGridRow.Fixer.Length > 0) && ($projectGridRow.Activity != "Building")) -
  • $projectGridRow.Fixer
  • + #if ($projectGridRow.Fixer.Length > 0) + #if($projectGridRow.Breakers.Length > 0) +
    + #else + + #end +
  • $projectGridRow.Fixer
  • + + + + + + +
    #end #if ($projectGridRow.Breakers.Length > 0)