From bf53d07488a97b94a8043ff448876c32f09772d9 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Tue, 5 Apr 2016 09:51:54 +0200 Subject: [PATCH 1/2] Update ProjectGrid.vm --- project/WebDashboard/templates/ProjectGrid.vm | 616 ++++++++++-------- 1 file changed, 361 insertions(+), 255 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 4bc32b3a0..50c90cab9 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -1,265 +1,371 @@ - - - -
- - - - -
- -
-
+ + -#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) + #set ($lastsFive = []) + #set ($lastsSpan = []) + #set ($lastsDates = []) + #set ($lastsLinks = []) + #set ($lastsRunningTime = []) + #foreach ($projectGridRow in $projectGrid) + #set ($RowId = $RowId + 1) + #set($cont=0) + - - #if ($wholeFarm) - - #end - - - - - - - - - + #foreach($dataGridRow in $projectGridRow.LastFiveData) + #if ($translations.Translate($dataGridRow.BuildStatus) == "Failure" ) + #set($color="red") + #set($span="Failure: ") + #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Exception" ) + #set($color="orange") + #set($span="Exception: ") + #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Unknown" ) + #set($color="blue") + #set($span="Unknown: ") + #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Success" ) + #set($color="green") + #set($span="Success: ") + #end + #set($add=$lastsFive.add($color)) + #set($add=$lastsSpan.add($span)) + #set($add=$lastsDates.add($dataGridrow.Date)) + #set($add=$lastsLinks.add($dataGridRow.Link)) + #set($add=$lastsRunningTime.add($dataGridRow.RunningTime)) + #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($last in $lastsFive) + #set($curSpan = $lastsSpan.get($cont)) + #set($curDate = $lastsDates.get($cont)) + #set($curRunningTime = $lastsRunningTime.get($cont)) + #set($curLink = $lastsLinks.get($cont)) + #set($curColor = $lastsFive.get($cont)) + + + + + + #set($cont=$cont+1) + #end + #set ($lastFive = []) + #set ($lastSpan = []) + #set ($lastsDates = []) + #set ($lastsLinks = []) + #set ($lastsRunningTime = []) + $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 + + $curRunningTime + + + $translations.Translate($projectGridRow.Status) + $projectGridRow.QueuePriority + $translations.Translate($projectGridRow.Activity.ToString())($projectGridRow.QueuePriority) + +
+ + + + + #if ($projectGridRow.allowForceBuild) + #if($projectGridRow.ForceAbortBuildButtonValue == "Force") + + + + #else + + + + #end + #end + #if ($projectGridRow.AllowStartStopBuild) + #if ($translations.Translate($projectGridRow.Status) == "Running") + + + + #else + + + + #end + #if ($translations.Translate($projectGridRow.Activity.ToString()) == "Pending") + + + + + #end + #end + #if ($translations.Translate($projectGridRow.BuildStatus) == "Failure" || $translations.Translate($projectGridRow.BuildStatus) == "Exception" || $translations.Translate($projectGridRow.BuildStatus) == "Unknown" ) + + #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 5b62a9dc64a0f2c3e02f362aa8df0914c3a02030 Mon Sep 17 00:00:00 2001 From: PabloJHM Date: Thu, 7 Apr 2016 14:41:54 +0200 Subject: [PATCH 2/2] Update ProjectGrid.vm Re-writed the part of the last 5 builds and their icons. --- project/WebDashboard/templates/ProjectGrid.vm | 275 +++++++++--------- 1 file changed, 131 insertions(+), 144 deletions(-) diff --git a/project/WebDashboard/templates/ProjectGrid.vm b/project/WebDashboard/templates/ProjectGrid.vm index 50c90cab9..bcac827c2 100644 --- a/project/WebDashboard/templates/ProjectGrid.vm +++ b/project/WebDashboard/templates/ProjectGrid.vm @@ -133,163 +133,150 @@ #set ($RowId = 0) - #set ($lastsFive = []) - #set ($lastsSpan = []) - #set ($lastsDates = []) - #set ($lastsLinks = []) - #set ($lastsRunningTime = []) #foreach ($projectGridRow in $projectGrid) - #set ($RowId = $RowId + 1) - #set($cont=0) - + #set ($RowId = $RowId + 1) + #set($cont=0) + + + #set($add=$lastsFive.add("red")) + #set($add=$lastsFive.add("blue")) - #foreach($dataGridRow in $projectGridRow.LastFiveData) - #if ($translations.Translate($dataGridRow.BuildStatus) == "Failure" ) - #set($color="red") - #set($span="Failure: ") - #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Exception" ) - #set($color="orange") - #set($span="Exception: ") - #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Unknown" ) - #set($color="blue") - #set($span="Unknown: ") - #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Success" ) - #set($color="green") - #set($span="Success: ") + + $projectGridRow.Name + + + #set($cont = 0) + #foreach($dataGridRow in $projectGridRow.LastFiveData) + #if ($translations.Translate($dataGridRow.BuildStatus) == "Failure" ) + #set($color = "red") + #set($span = "Failure: ") + #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Exception" ) + #set($color = "orange") + #set($span = "Exception: ") + #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Unknown" ) + #set($color = "blue") + #set($span = "Unknown: ") + #elseif ($translations.Translate($dataGridRow.BuildStatus) == "Success" ) + #set($color = "green") + #set($span = "Success: ") + #end + #set($date = $dataGridrow.Date) + #set($link = $dataGridRow.Link) + #set($runningTime = $dataGridRow.RunningTime) + + + + + + #set($cont = $cont + 1) #end - #set($add=$lastsFive.add($color)) - #set($add=$lastsSpan.add($span)) - #set($add=$lastsDates.add($dataGridrow.Date)) - #set($add=$lastsLinks.add($dataGridRow.Link)) - #set($add=$lastsRunningTime.add($dataGridRow.RunningTime)) - #end - - - $projectGridRow.Name + + + $projectGridRow.Statistics + #if ($projectGridRow.Breakers.Length == 0) + + #else + + #end + + + + $projectGridRow.LastBuildDate - - - #set($cont=0) - #foreach($last in $lastsFive) - #set($curSpan = $lastsSpan.get($cont)) - #set($curDate = $lastsDates.get($cont)) - #set($curRunningTime = $lastsRunningTime.get($cont)) - #set($curLink = $lastsLinks.get($cont)) - #set($curColor = $lastsFive.get($cont)) - - - - - - #set($cont=$cont+1) - #end - #set ($lastFive = []) - #set ($lastSpan = []) - #set ($lastsDates = []) - #set ($lastsLinks = []) - #set ($lastsRunningTime = []) + + + $curRunningTime - - $projectGridRow.Statistics - #if ($projectGridRow.Breakers.Length == 0) - - #else - - #end - - - - $projectGridRow.LastBuildDate - - - - $curRunningTime - - - $translations.Translate($projectGridRow.Status) - $projectGridRow.QueuePriority - $translations.Translate($projectGridRow.Activity.ToString())($projectGridRow.QueuePriority) - -
- - - - - #if ($projectGridRow.allowForceBuild) - #if($projectGridRow.ForceAbortBuildButtonValue == "Force") - - - - #else - - - - #end - #end - #if ($projectGridRow.AllowStartStopBuild) - #if ($translations.Translate($projectGridRow.Status) == "Running") - - - - #else - - - + + + + + + + + #if ($projectGridRow.allowForceBuild) + #if($projectGridRow.ForceAbortBuildButtonValue == "Force") + + + + #else + + + + #end #end - #if ($translations.Translate($projectGridRow.Activity.ToString()) == "Pending") - - + #if ($projectGridRow.AllowStartStopBuild) + #if ($translations.Translate($projectGridRow.Status) == "Running") + + src="http://contxpm5/ccnet/images/stopsmall.png" + class="action--iconSmall"/> + + #else + + + #end + #if ($translations.Translate($projectGridRow.Activity.ToString()) == "Pending") + + + + + #end #end + #if ($translations.Translate($projectGridRow.BuildStatus) != "Success") + + #end + + + + + #if ($projectGridRow.BuildStage.Length > 0) + + #if ($wholeFarm) + $translations.FormatBuildStage($projectGridRow.BuildStage) + #else + $translations.FormatBuildStage($projectGridRow.BuildStage) #end - #if ($translations.Translate($projectGridRow.BuildStatus) == "Failure" || $translations.Translate($projectGridRow.BuildStatus) == "Exception" || $translations.Translate($projectGridRow.BuildStatus) == "Unknown" ) - - #end -
- - - - #if ($projectGridRow.BuildStage.Length > 0) - - #if ($wholeFarm) - $translations.FormatBuildStage($projectGridRow.BuildStage) - #else - $translations.FormatBuildStage($projectGridRow.BuildStage) + #end - - #end - #end + #end #if ($barAtBottom)