Skip to content

Commit 8ee4f95

Browse files
committed
feat: Simple pools display table
1 parent 17fcac6 commit 8ee4f95

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

lib/proxes/controllers/status_controller.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ def self.policy_class
1515
ProxES::StatusPolicy
1616
end
1717

18+
get '/pools/?' do
19+
pools = client_with_context(user_id: current_user&.id).cat.thread_pool(format: 'json')
20+
21+
respond_to do |format|
22+
format.html do
23+
haml :'status/pools', locals: { title: 'Clustr Pools', pools: pools }
24+
end
25+
format.json do
26+
json result
27+
end
28+
end
29+
end
30+
1831
# This provides a URL that can be polled by a monitoring system. It will return
1932
# 200 OK if all the checks pass, or 500 if any of the checks fail.
2033
get '/check' do

views/status/pools.haml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.row
2+
.col-md-12
3+
%table.table.table-striped.table-bordered.table-hover
4+
%thead.thead-dark
5+
%tr
6+
%th Node
7+
%th Pool
8+
%th Active
9+
%th Queued
10+
%th Rejected
11+
%tbody
12+
- pools.each do |pool|
13+
%tr{ class: pool['queue'] < pool['active'] * 12.5 ? '' : 'table-warning' }
14+
%td= pool['node_name']
15+
%td= pool['name']
16+
%td= pool['active']
17+
%td= pool['queue']
18+
%td= pool['rejected']

0 commit comments

Comments
 (0)