runit-man 1.8.1 → 1.8.2
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.
- data/lib/runit-man/helpers.rb +5 -4
- data/public/css/runit-man.css +4 -1
- data/views/_service_action.erb +6 -2
- data/views/_service_info.erb +3 -4
- metadata +2 -2
data/lib/runit-man/helpers.rb
CHANGED
@@ -40,11 +40,12 @@ module Helpers
|
|
40
40
|
end.flatten).uniq.sort
|
41
41
|
end
|
42
42
|
|
43
|
-
def service_action(name, action, label)
|
43
|
+
def service_action(name, action, label, enabled = true)
|
44
44
|
partial :service_action, :locals => {
|
45
|
-
:name
|
46
|
-
:action
|
47
|
-
:label
|
45
|
+
:name => name,
|
46
|
+
:action => action,
|
47
|
+
:label => label,
|
48
|
+
:enabled => enabled
|
48
49
|
}
|
49
50
|
end
|
50
51
|
|
data/public/css/runit-man.css
CHANGED
@@ -16,7 +16,10 @@ form.service-action, form.service-signal
|
|
16
16
|
.error a {color:#8a1f11;}
|
17
17
|
.notice a {color:#514721;}
|
18
18
|
.success a {color:#264409;}
|
19
|
-
|
19
|
+
|
20
20
|
span.inactive {color:#gray;}
|
21
21
|
span.down {color:#8a1f11;}
|
22
22
|
span.run {color:#264409;}
|
23
|
+
|
24
|
+
#services { text-align: center; }
|
25
|
+
#services table {width:90%; margin-left:5%; margin-right:5%;}
|
data/views/_service_action.erb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
-
|
1
|
+
<% if enabled %>
|
2
|
+
<form class="service-action" action="<%= h(name) %>/<%= h(action) %>" method="POST">
|
2
3
|
<input type="submit" value="<%= h(label) %>" />
|
3
|
-
</form>
|
4
|
+
</form>
|
5
|
+
<% else %>
|
6
|
+
<input type="submit" disabled="disabled" value="<%= h(label) %>" onclick="return false;" />
|
7
|
+
<% end %>
|
data/views/_service_info.erb
CHANGED
@@ -8,14 +8,13 @@ need_second_row = !service_info.files_to_view.empty? || !service_info.urls_to_vi
|
|
8
8
|
<td><%= stat_subst(service_info.stat) %></td>
|
9
9
|
<td>
|
10
10
|
<% if service_info.active? %>
|
11
|
+
<%= service_action service_info.name, :restart, t.runit.services.table.actions.restart, !service_info.down? %>
|
12
|
+
<%= service_action service_info.name, :down, t.runit.services.table.actions.stop, !service_info.down? %>
|
13
|
+
<%= service_action service_info.name, :up, t.runit.services.table.actions.start, service_info.down? %>
|
11
14
|
<% unless service_info.down? %>
|
12
|
-
<%= service_action service_info.name, :restart, t.runit.services.table.actions.restart %>
|
13
|
-
<%= service_action service_info.name, :down, t.runit.services.table.actions.stop %>
|
14
15
|
<% service_info.allowed_signals.each do |signal| %>
|
15
16
|
<%= service_signal service_info.name, signal, t.runit.services.table.signals[signal] %>
|
16
17
|
<% end %>
|
17
|
-
<% else %>
|
18
|
-
<%= service_action service_info.name, :up, t.runit.services.table.actions.start %>
|
19
18
|
<% end %>
|
20
19
|
<% if service_info.switchable? %>
|
21
20
|
<%= service_action service_info.name, :switch_down, t.runit.services.table.actions.switch_down %>
|