side_bro 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,9 +14,8 @@
14
14
  <div class="brand">
15
15
  <div class="brand-mark"></div>
16
16
  <div>
17
- <div class="brand-name">Side<span>Bro</span></div>
17
+ <div class="brand-name">Side Bro</div>
18
18
  </div>
19
- <div class="brand-pill">live</div>
20
19
  </div>
21
20
 
22
21
  <div class="nav-label">Overview</div>
@@ -30,23 +30,24 @@
30
30
  </div>
31
31
  </div>
32
32
 
33
+ <div class="chart-grid">
33
34
  <!-- Realtime chart panel -->
34
35
  <div class="panel">
35
36
  <div class="panel-head">
36
37
  <div class="ph-title">Throughput · last <span id="chartWindow">60s</span></div>
37
38
  <div class="ph-meta"><span id="chartTime"></span></div>
38
39
  <div class="ph-spacer"></div>
39
- <div style="display:flex; align-items:center; gap:14px; font-size:12px; color:var(--text-dim);">
40
- <span style="display:inline-flex; align-items:center; gap:6px"><span class="legend-dot" style="background:var(--cyan); box-shadow:0 0 6px var(--cyan)"></span>Processed</span>
41
- <span style="display:inline-flex; align-items:center; gap:6px"><span class="legend-dot" style="background:var(--red); box-shadow:0 0 6px var(--red)"></span>Failed</span>
40
+ <div class="chart-legend">
41
+ <span><span class="legend-dot legend-processed"></span>Processed</span>
42
+ <span><span class="legend-dot legend-failed"></span>Failed</span>
42
43
  </div>
43
44
  </div>
44
45
  <div class="chart-wrap">
45
- <svg id="liveChart" viewBox="0 0 1200 280" preserveAspectRatio="none"></svg>
46
+ <svg id="liveChart"></svg>
46
47
  <div class="chart-tooltip" id="chartTip">
47
48
  <div class="tip-time" id="tipTime"></div>
48
- <div class="tip-row"><span class="legend-dot" style="background:var(--cyan)"></span>Processed: <b id="tipProc">0</b></div>
49
- <div class="tip-row"><span class="legend-dot" style="background:var(--red)"></span>Failed: <b id="tipFail">0</b></div>
49
+ <div class="tip-row"><span class="legend-dot legend-processed"></span>Processed: <b id="tipProc">0</b></div>
50
+ <div class="tip-row"><span class="legend-dot legend-failed"></span>Failed: <b id="tipFail">0</b></div>
50
51
  </div>
51
52
  </div>
52
53
  </div>
@@ -64,10 +65,11 @@
64
65
  <button class="chip" data-range="6m">6 months</button>
65
66
  </div>
66
67
  </div>
67
- <div class="chart-wrap" style="padding: 24px 28px 28px;">
68
- <svg id="historyChart" viewBox="0 0 1200 320" preserveAspectRatio="none"></svg>
68
+ <div class="chart-wrap">
69
+ <svg id="historyChart"></svg>
69
70
  </div>
70
71
  </div>
72
+ </div>
71
73
 
72
74
  <!-- Redis panel -->
73
75
  <div class="panel">
@@ -121,4 +123,4 @@ window.HISTORY_DATA = {
121
123
  };
122
124
  window.SIDE_BRO_ROOT = '<%= action.root_path %>';
123
125
  </script>
124
- <script src="<%= action.root_path %>assets/javascripts/dashboard.js" nonce="<%= nonce %>"></script>
126
+ <script src="<%= action.asset_path("javascripts/dashboard.js") %>" nonce="<%= nonce %>"></script>
@@ -25,7 +25,7 @@
25
25
  <div class="panel-head">
26
26
  <div class="ph-title">Job Details</div>
27
27
  </div>
28
- <div style="padding: 20px 16px;">
28
+ <div class="panel-body">
29
29
  <%= action.render_partial(:job_info) %>
30
30
  </div>
31
31
  </div>
@@ -6,8 +6,8 @@
6
6
  <title>SideBro<%= @page_title ? " — #{@page_title}" : "" %></title>
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
- <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
10
- <link rel="stylesheet" href="<%= action.root_path %>assets/stylesheets/style.css" nonce="<%= nonce %>">
9
+ <link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">
10
+ <link rel="stylesheet" href="<%= action.asset_path("stylesheets/style.css") %>" nonce="<%= nonce %>">
11
11
  </head>
12
12
  <body>
13
13
  <div class="app">
@@ -52,10 +52,9 @@
52
52
 
53
53
  <%= content %>
54
54
 
55
- <%= action.render_partial(:footer) %>
56
55
  </main>
57
56
 
58
57
  </div>
59
- <script src="<%= action.root_path %>assets/javascripts/application.js" nonce="<%= nonce %>"></script>
58
+ <script src="<%= action.asset_path("javascripts/application.js") %>" nonce="<%= nonce %>"></script>
60
59
  </body>
61
60
  </html>
@@ -21,11 +21,15 @@
21
21
  </div>
22
22
 
23
23
  <div class="toolbar">
24
- <div class="search">
24
+ <form class="search" method="get" action="<%= action.root_path %>queues/<%= action.h(@queue.name) %>">
25
+ <%- request_params = action.request.params.reject { |k, _| %w[q page].include?(k) } %>
26
+ <%- request_params.each do |k, v| %>
27
+ <input type="hidden" name="<%= action.h(k) %>" value="<%= action.h(v) %>">
28
+ <%- end %>
25
29
  <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
26
- <input id="queueSearch" placeholder="Search jobs, args, JIDs…" />
27
- <kbd>⌘K</kbd>
28
- </div>
30
+ <input id="queueSearch" name="q" value="<%= action.h(@search) %>" placeholder="Search class, args, JID — press Enter" autocomplete="off" />
31
+ <button type="submit" class="btn ghost search-btn">Search</button>
32
+ </form>
29
33
 
30
34
  <div class="divider-v"></div>
31
35
 
@@ -76,6 +80,16 @@
76
80
  </div>
77
81
  <%- end %>
78
82
 
83
+ <%- if @searching %>
84
+ <div class="active-filters">
85
+ <span>Search results for</span>
86
+ <span class="filter-tag">
87
+ <span><%= action.h(@search) %></span>
88
+ <a href="?<%= action.query_string("q" => nil, "page" => "1") %>" class="x" title="Clear search">✕</a>
89
+ </span>
90
+ </div>
91
+ <%- end %>
92
+
79
93
  <%- if @jobs.empty? %>
80
94
  <div class="panel">
81
95
  <div class="empty"><%= action.t(:no_jobs) %></div>
@@ -85,7 +99,7 @@
85
99
  <div class="panel-head">
86
100
  <div class="ph-title">Jobs</div>
87
101
  <div class="ph-meta">
88
- <%- if @filtering %>
102
+ <%- if @filtering || @searching %>
89
103
  first <%= @jobs.size %> matches · newest first
90
104
  <%- else %>
91
105
  <%= @total %> total · sorted <%= @asc ? "newest first" : "oldest first" %>
@@ -158,7 +172,7 @@
158
172
  </div>
159
173
 
160
174
  <div class="panel-foot">
161
- <%- if @filtering %>
175
+ <%- if @filtering || @searching %>
162
176
  <div class="paging" style="color:var(--text-faint);font-size:12px;justify-content:center">
163
177
  Showing first <%= @per_page %> matches — filtered results are not paginated
164
178
  </div>
@@ -172,14 +186,7 @@
172
186
  <script nonce="<%= nonce %>">
173
187
  (function () {
174
188
  var input = document.getElementById("queueSearch");
175
- var table = document.getElementById("queueTable");
176
- if (!input || !table) return;
177
- input.addEventListener("input", function () {
178
- var q = input.value.toLowerCase();
179
- table.querySelectorAll("tbody tr").forEach(function (row) {
180
- row.style.display = q === "" || row.textContent.toLowerCase().includes(q) ? "" : "none";
181
- });
182
- });
189
+ if (!input) return;
183
190
  document.addEventListener("keydown", function (e) {
184
191
  if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") {
185
192
  e.preventDefault();
@@ -26,7 +26,7 @@
26
26
  <div class="panel-head">
27
27
  <div class="ph-title">Job Details</div>
28
28
  </div>
29
- <div style="padding: 20px 16px;">
29
+ <div class="panel-body">
30
30
  <%= action.render_partial(:job_info) %>
31
31
  </div>
32
32
  </div>
@@ -25,7 +25,7 @@
25
25
  <div class="ph-meta">Scheduled for <%= @job.at.utc.strftime("%Y-%m-%d %H:%M:%S UTC") %></div>
26
26
  <%- end %>
27
27
  </div>
28
- <div style="padding: 20px 16px;">
28
+ <div class="panel-body">
29
29
  <%= action.render_partial(:job_info) %>
30
30
  </div>
31
31
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: side_bro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruby Dev SRL
@@ -79,7 +79,6 @@ files:
79
79
  - web/assets/javascripts/metrics.js
80
80
  - web/assets/stylesheets/style.css
81
81
  - web/locales/en.yml
82
- - web/views/_footer.html.erb
83
82
  - web/views/_job_info.html.erb
84
83
  - web/views/_metrics_period_select.html.erb
85
84
  - web/views/_nav.html.erb
@@ -120,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
119
  - !ruby/object:Gem::Version
121
120
  version: '0'
122
121
  requirements: []
123
- rubygems_version: 4.0.9
122
+ rubygems_version: 4.0.22
124
123
  specification_version: 4
125
124
  summary: A Rack-mountable Sidekiq Web UI alternative
126
125
  test_files: []
@@ -1,3 +0,0 @@
1
- <div style="padding: 12px 0; color: var(--text-faint); font-size: 11px; font-family: var(--mono);">
2
- SideBro <%= SideBro::VERSION %> · Sidekiq <%= Sidekiq::VERSION %>
3
- </div>