Skip to content

Commit 24066ca

Browse files
nuclearcatJenySadadia
authored andcommitted
template/stats: Make limit configurable
Turned out, on production we have almost 1000 builds per week, so default is not enough. Let's make few options more. Signed-off-by: Denys Fedoryshchenko <[email protected]>
1 parent fc1dc6a commit 24066ca

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

api/templates/stats.html

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,33 @@ <h1 class="text-center mb-4">
125125
<div class="form-section">
126126
<h3 class="mb-3"><i class="bi bi-sliders"></i> Filter Options</h3>
127127
<div class="row">
128-
<div class="col-md-4 mb-3">
128+
<div class="col-md-3 mb-3">
129129
<label for="duration" class="form-label">Duration</label>
130130
<select class="form-select" id="duration">
131131
<option value="24h">Last 24 hours</option>
132132
<option value="48h">Last 48 hours</option>
133133
<option value="7d">Last 7 days</option>
134134
</select>
135135
</div>
136-
<div class="col-md-4 mb-3">
136+
<div class="col-md-3 mb-3">
137137
<label for="kind" class="form-label">Kind</label>
138138
<select class="form-select" id="kind">
139139
<option value="kbuild">Kernel Builds</option>
140140
<option value="job">Test Jobs</option>
141141
<option value="checkout">Checkouts</option>
142142
</select>
143143
</div>
144-
<div class="col-md-4 mb-3 d-flex align-items-end">
144+
<div class="col-md-3 mb-3">
145+
<label for="limit" class="form-label">Limit</label>
146+
<select class="form-select" id="limit">
147+
<option value="1000" selected>1,000</option>
148+
<option value="10000">10,000</option>
149+
<option value="20000">20,000</option>
150+
<option value="30000">30,000</option>
151+
<option value="100000">100,000</option>
152+
</select>
153+
</div>
154+
<div class="col-md-6 mb-3 d-flex align-items-end">
145155
<button type="button" class="btn btn-generate btn-primary w-100" id="generateBtn">
146156
<i class="bi bi-play-circle"></i> Generate Statistics
147157
</button>
@@ -303,14 +313,15 @@ <h6>Nodes with result "${result}":</h6>
303313
function generateStatistics() {
304314
var duration = $('#duration').val();
305315
var kind = $('#kind').val();
316+
var limit = $('#limit').val();
306317

307318
showLoading();
308319

309320
// Build API URL with filters
310321
var dateFilter = getDurationFilter(duration);
311322
var url = apiurl + '/latest/nodes?kind=' + encodeURIComponent(kind) +
312323
'&created__gt=' + encodeURIComponent(dateFilter) +
313-
'&limit=1000';
324+
'&limit=' + encodeURIComponent(limit);
314325

315326
console.log('Fetching statistics from:', url);
316327

0 commit comments

Comments
 (0)