diff --git a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java index 6b6d9fa214cb5..9c06799d6db44 100644 --- a/core/src/main/java/jenkins/widgets/HistoryPageFilter.java +++ b/core/src/main/java/jenkins/widgets/HistoryPageFilter.java @@ -73,6 +73,7 @@ public class HistoryPageFilter { public long newestOnPage = Long.MIN_VALUE; // see updateNewestOldest() public long oldestOnPage = Long.MAX_VALUE; // see updateNewestOldest() + public boolean activeRuns = false; /** * Create a history page filter instance. @@ -259,6 +260,7 @@ private void addQueueItem(QueueItem item) { HistoryPageEntry entry = new HistoryPageEntry<>(item); queueItems.add(entry); updateNewestOldest(entry.getEntryId()); + updateActiveRuns(true); } private void addRun(Run run) { @@ -271,6 +273,7 @@ private void addRun(Run run) { } runs.add(entry); updateNewestOldest(entry.getEntryId()); + updateActiveRuns(run.isBuilding()); } private void updateNewestOldest(long entryId) { @@ -278,6 +281,10 @@ private void updateNewestOldest(long entryId) { oldestOnPage = Math.min(oldestOnPage, entryId); } + private void updateActiveRuns(boolean isActive) { + activeRuns = activeRuns || isActive; + } + private boolean add(Object entry) { // Purposely not calling isFull(). May need to add a greater number of entries // to the page initially, newerThan then cutting it back down to size using cutLeading() diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly b/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly index 8d4663bb00dde..a7fb11d54b512 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly @@ -43,7 +43,8 @@ THE SOFTWARE. data-page-entry-newest="${page.newestOnPage}" data-page-entry-oldest="${page.oldestOnPage}" data-page-has-up="${page.hasUpPage}" - data-page-has-down="${page.hasDownPage}"> + data-page-has-down="${page.hasDownPage}" + data-active-runs="${page.activeRuns}"> @@ -56,7 +57,7 @@ THE SOFTWARE.
-
+