runit-man 1.8.1 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 => name,
46
- :action => action,
47
- :label => label
45
+ :name => name,
46
+ :action => action,
47
+ :label => label,
48
+ :enabled => enabled
48
49
  }
49
50
  end
50
51
 
@@ -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%;}
@@ -1,3 +1,7 @@
1
- <form class="service-action" action="<%= h(name) %>/<%= h(action) %>" method="POST">
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 %>
@@ -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 %>
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 8
8
- - 1
9
- version: 1.8.1
8
+ - 2
9
+ version: 1.8.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Akzhan Abdulin