Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace ThoughtWorks.CruiseControl.WebDashboard.Plugins.FarmReport
namespace ThoughtWorks.CruiseControl.WebDashboard.Plugins.FarmReport
{
using System.Collections;
using System.Collections.Generic;
Expand All @@ -17,6 +17,7 @@
using ThoughtWorks.CruiseControl.Core;
using System.Web;
using System.Linq;
using System.Diagnostics;


[ReflectorType("categorizedFarmReportFarmPlugin")]
Expand Down Expand Up @@ -72,13 +73,21 @@ public IResponse Execute(ICruiseRequest request)
var sessionToken = request.RetrieveSessionToken();
velocityContext["forceBuildMessage"] = ForceBuildIfNecessary(request.Request, sessionToken);

var gridRows = this.projectGrid.GenerateProjectGridRows(projectStatus.StatusAndServerList, BaseActionName,
ProjectGridSortColumn.Category, true,
category, urlBuilder, this.translations);
ProjectGridParameters parameters =
new ProjectGridParameters(
projectStatus.StatusAndServerList,
ProjectGridSortColumn.Category,
true,
BaseActionName,
urlBuilder,
farmService,
this.translations);

var gridRows = this.projectGrid.GenerateProjectGridRows(parameters);

var categories = new SortedDictionary<string, CategoryInformation>();

foreach (var row in gridRows.OrderBy( s=> s.ServerName).ThenBy( p => p.Name))
foreach (var row in gridRows.OrderBy(s => s.ServerName).ThenBy(p => p.Name))
{
var rowCategory = row.Category;
CategoryInformation categoryRows;
Expand All @@ -95,7 +104,7 @@ public IResponse Execute(ICruiseRequest request)
// it's annoying to specify a category and still have to press the show link
if (!string.IsNullOrEmpty(category))
{
categories[category].Display = true;
categories[category].Display = true;
}


Expand Down Expand Up @@ -167,6 +176,11 @@ private string ForceBuildIfNecessary(IRequest request, string sessionToken)
farmService.AbortBuild(ProjectSpecifier(request), sessionToken);
return this.translations.Translate("Abort successfully forced for {0}", SelectedProject(request));
}
else if (request.FindParameterStartingWith("CancelPending") != string.Empty)
{
farmService.CancelPendingRequest(ProjectSpecifier(request), sessionToken);
return this.translations.Translate("Cancel pending successfully forced for {0}", SelectedProject(request));
}
else
{
return string.Empty;
Expand Down