Skip to content

Commit dca3bb2

Browse files
committed
Add pod events information to the status report
1 parent fbd7186 commit dca3bb2

File tree

1 file changed

+71
-3
lines changed

1 file changed

+71
-3
lines changed

src/main/resources/agent-status-report.template.ftlh

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,35 @@
7878
overflow-x: hidden;
7979
}
8080

81+
[data-plugin-style-id="kubernetes-plugin"] .pod-events table {
82+
width: calc(100% - 40px);
83+
min-width: 95%;
84+
border: 1px solid #D8D8D8;
85+
font-size: 13px;
86+
margin: 10px 20px 20px 20px;
87+
}
88+
89+
[data-plugin-style-id="kubernetes-plugin"] .pod-events table thead {
90+
background: #D8D8D8;
91+
}
92+
93+
[data-plugin-style-id="kubernetes-plugin"] .pod-events table thead th {
94+
padding: 10px 20px;
95+
font-weight: bold;
96+
}
97+
98+
[data-plugin-style-id="kubernetes-plugin"] .pod-events table tbody tr {
99+
border-top: 1px solid #D8D8D8;
100+
border-bottom: 1px solid #D8D8D8;
101+
border-collapse: collapse;
102+
}
103+
104+
[data-plugin-style-id="kubernetes-plugin"] .pod-events table tbody td {
105+
padding: 10px 20px;
106+
max-width: 190px;
107+
text-overflow: ellipsis;
108+
overflow: hidden;
109+
}
81110
</style>
82111

83112
<div data-plugin-style-id="kubernetes-plugin">
@@ -100,21 +129,60 @@
100129
<li ng-class="{'current_tab' : currenttab == 'pod-details' }" ng-click="currenttab='pod-details'">
101130
<a href="#">Details</a>
102131
</li>
132+
<li ng-class="{'current_tab' : currenttab == 'pod-events' }" ng-click="currenttab='pod-events'">
133+
<a href="#">Events</a>
134+
</li>
103135
<li ng-class="{'current_tab' : currenttab == 'pod-logs' }" ng-click="currenttab='pod-logs'">
104136
<a href="#">Logs</a>
105137
</li>
106-
<li ng-class="{'current_tab' : currenttab == 'pod-configuration' }" ng-click="currenttab='pod-configuration'">
138+
<li ng-class="{'current_tab' : currenttab == 'pod-configuration' }"
139+
ng-click="currenttab='pod-configuration'">
107140
<a href="#">Configuration</a>
108141
</li>
109142
</ul>
110143
</div>
111144

112145
<div class="tab-content" ng-show="currenttab == 'pod-details'"></div>
146+
<div class="tab-content pod-events" ng-show="currenttab == 'pod-events'">
147+
<#if events?size != 0>
148+
<table>
149+
<thead>
150+
<tr>
151+
<th>First Seen</th>
152+
<th>Last Seen</th>
153+
<th>Count</th>
154+
<th>Path</th>
155+
<th>Type</th>
156+
<th>Reason</th>
157+
<th>Message</th>
158+
</thead>
159+
</tr>
160+
<tbody>
161+
<#list events as event>
162+
<tr>
163+
<td>${event.firstTimestamp!}</td>
164+
<td>${event.lastTimestamp!}</td>
165+
<td>${event.count!}</td>
166+
<td>${event.fieldPath!}</td>
167+
<td>${event.type!}</td>
168+
<td>${event.reason!}</td>
169+
<td>${event.message!}</td>
170+
</tr>
171+
</#list>
172+
173+
</tbody>
174+
</table>
175+
<#else>
176+
<tr>
177+
<td colspan="5" class="message">No events available for the current pod.</td>
178+
</tr>
179+
</#if>
180+
</div>
113181
<div class="tab-content pod-logs" ng-show="currenttab == 'pod-logs'">
114-
${ logs?html?replace("\n", "<br>") !}
182+
${ logs?html?replace("\n", "<br>") !}
115183
</div>
116184
<div class="tab-content pod-configuration" ng-show="currenttab == 'pod-configuration'">
117-
${ configuration?html?replace("\n", "<br>") !}
185+
${ configuration?html?replace("\n", "<br>") !}
118186
</div>
119187
</div>
120188
</div>

0 commit comments

Comments
 (0)