Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show node monitors on agent page #8725

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions core/src/main/java/hudson/model/Computer.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -1161,6 +1162,17 @@
return r;
}

@Restricted(NoExternalUse.class)
public Map<NodeMonitor, Object> getMonitoringData() {
Map<NodeMonitor, Object> r = new LinkedHashMap<>();
for (NodeMonitor monitor : NodeMonitor.getAll()) {
if (monitor.getColumnCaption() != null) {

Check warning on line 1169 in core/src/main/java/hudson/model/Computer.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 1169 is only partially covered, one branch is missing
r.put(monitor, monitor.data(this));
}
}
return r;
}

/**
* Gets the system properties of the JVM on this computer.
* If this is the master, it returns the system property of the master computer.
Expand Down
14 changes: 13 additions & 1 deletion core/src/main/resources/hudson/model/Computer/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,19 @@ THE SOFTWARE.
<p>${%title.no_manual_launch(it.retentionStrategy.descriptor.displayName)}</p>
</j:if>

<j:if test="${it.node.assignedLabels.size() gt 1}">
<f:advanced title="${%Monitoring Data}">
<table class="jenkins-table jenkins-table--small jenkins-table--auto-width">
<j:forEach var="m" items="${it.monitoringData}">
<tr>
<td>${m.key.columnCaption}</td>
<j:set var="data" value="${m.value}"/>
<st:include page="column.jelly" from="${m.key}" />
</tr>
</j:forEach>
</table>
</f:advanced>

<j:if test="${it.node.assignedLabels.size() gt 1}">
<div class="jenkins-!-margin-bottom-3">
<h2>${%Labels}</h2>
<j:forEach var="entry" items="${it.node.labelCloud}">
Expand Down
4 changes: 4 additions & 0 deletions war/src/main/scss/components/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@
}
}

&--auto-width {
width: auto !important;
}

&--small {
--table-padding: 0.2rem;

Expand Down
Loading