1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00
endofunky--sidetiq/lib/sidetiq/views/locks.erb

54 lines
1.6 KiB
Text

<style>
<%= File.read(File.join(view_path, 'assets', 'styles.css')) %>
</style>
<header class="row">
<div class="col-md-5">
<h3>Active Locks</h3>
</div>
</header>
<div class="container">
<div class="row">
<%= erb File.read(File.join(view_path, '_home_nav.erb')) %>
<div class="col-md-9">
<% if @locks_available %>
<% if @locks.length > 0 %>
<table class="table table-striped table-bordered table-white table-sidetiq">
<thead>
<th style="width: 20%">Key</th>
<th style="width: 30%">Owner Node</th>
<th style="width: 10%">Timetamp</th>
<th style="width: 10%">TTL</th>
<th style="width: 10%">Actions</th>
</thead>
<% @locks.each do |meta| %>
<% pttl = meta.pttl %>
<tr>
<td><%= meta.key %></td>
<td><%= meta.owner %></td>
<td><%= meta.timestamp.to_i %></td>
<td>
<%= pttl / 1000 %> s
</td>
<td>
<form action="<%= "#{root_path}sidetiq/#{meta.key}/unlock" %>" method="post">
<%= csrf_tag %>
<input class="btn btn-danger btn-small" type="submit" name="trigger" value="Unlock" data-confirm="Are you sure you want remove this lock?" />
</form>
</td>
</tr>
<% end %>
</table>
<% else %>
<div class="alert alert-success">No locks set.</div>
<% end %>
<% else %>
<div class="alert alert-danger">KEYS command is disabled in your redis instance, lock information is not available.</div>
<% end %>
</div>
</div>