my_nagios 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/my_nagios/checks.coffee +13 -2
- data/app/assets/stylesheets/my_nagios/checks.scss +4 -0
- data/app/models/my_nagios/check.rb +1 -1
- data/app/views/my_nagios/checks/_check_row.haml +6 -4
- data/app/views/my_nagios/welcome/index.haml +4 -1
- data/lib/my_nagios/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74f6a424eb4c104a4d30c8d62c63750c9fa7d236
|
4
|
+
data.tar.gz: 41a78f4f3c23af33791782f15739c864826f8f9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bb4bf4269479a807debb39721ff2229c016292bc2744183271737859b701cbf12bece5af2f0486d9061d297aed3c659b71b6c886936ef2f8f6b7420e4dab0b3
|
7
|
+
data.tar.gz: 996ffe877bee2475e84ad9a2bf2a3613cdde09e83e076be05d72df0853a5582a211f322ac9800a79b570fb7a8343e792b482c3288d0f716fa95efd760f3d2fcb
|
@@ -11,14 +11,25 @@ $ ->
|
|
11
11
|
$('.check_now').click (event) ->
|
12
12
|
onclick_check_now(event)
|
13
13
|
|
14
|
-
|
14
|
+
# Select all checkboxes in group
|
15
|
+
$('.select_all_group').click (event) ->
|
16
|
+
group_id = $(this).data('select-all-group')
|
17
|
+
$(':checkbox.group_' + group_id).click()
|
18
|
+
|
19
|
+
# Select all checkboxes
|
20
|
+
$('#select_all').click (event) ->
|
21
|
+
$(':checkbox.select_all_group').click()
|
22
|
+
|
23
|
+
# Show and hide action dialog for selected checkboxes, store selected check ids
|
24
|
+
$('.my_nagios_check :checkbox').change (event) ->
|
15
25
|
if $('input:checked').length > 0
|
16
26
|
$('#group_action').show();
|
17
27
|
selected_ids = $('input:checked').map () ->
|
18
|
-
return $(this).
|
28
|
+
return $(this).data('check-id')
|
19
29
|
|
20
30
|
$('#group_action_check_ids').val(selected_ids.get() + '')
|
21
31
|
else
|
32
|
+
$('#group_action_check_ids').val('')
|
22
33
|
$('#group_action').hide();
|
23
34
|
|
24
35
|
|
@@ -6,7 +6,7 @@ module MyNagios
|
|
6
6
|
enum state: [ :completed, :running ]
|
7
7
|
|
8
8
|
scope :enabled, -> { where(enabled: true) }
|
9
|
-
scope :not_snoozed, -> { where('`my_nagios_checks`.`snooze_for` <=
|
9
|
+
scope :not_snoozed, -> { where('`my_nagios_checks`.`snooze_for` <= UTC_TIMESTAMP() OR `my_nagios_checks`.`snooze_for` IS NULL') }
|
10
10
|
|
11
11
|
attr_accessor :additional_command_result
|
12
12
|
|
@@ -1,11 +1,13 @@
|
|
1
1
|
- run_now ||= false
|
2
2
|
- show_group ||= false
|
3
|
-
- is_snooze = check.snooze_for
|
3
|
+
- is_snooze = check.snooze_for && (check.snooze_for.utc > Time.now.utc)
|
4
4
|
|
5
5
|
- tr_id = show_group ? nil : dom_id(check)
|
6
6
|
- tr_html_class = check.enabled? ? 'enabled' : 'disabled'
|
7
7
|
- tr_html_class += ' alert alert-info' if is_snooze
|
8
8
|
|
9
|
+
- td_html_class = is_snooze ? 'snooze_for' : ''
|
10
|
+
|
9
11
|
%tr{ id: tr_id, class: tr_html_class }
|
10
12
|
- if show_group
|
11
13
|
%td
|
@@ -16,7 +18,7 @@
|
|
16
18
|
="(regexp: #{check.regexp})" unless check.regexp.blank?
|
17
19
|
%p.check_interval= "run every: #{check.interval} min"
|
18
20
|
|
19
|
-
%td{ class:
|
21
|
+
%td{ class: td_html_class }
|
20
22
|
%span.label{ class: "label-#{status_to_label(check.status)}"}= check.status
|
21
23
|
=check.latest_state
|
22
24
|
|
@@ -40,5 +42,5 @@
|
|
40
42
|
=link_to (check.enabled? ? 'disable' : 'enable' ), toggle_check_path(check), class: 'disable_check', method: :post, data: { remote: true, confirm: 'Are you sure?' }
|
41
43
|
|
42
44
|
%td
|
43
|
-
.checkbox_holder
|
44
|
-
=check_box_tag dom_id(check), check.id
|
45
|
+
.checkbox_holder.my_nagios_check
|
46
|
+
=check_box_tag dom_id(check, :checkbox), nil, false, data: { check_id: check.id }, class: "group_#{check.group_id}"
|
@@ -31,8 +31,11 @@
|
|
31
31
|
|
32
32
|
- @group.each do |group|
|
33
33
|
%tr
|
34
|
-
%td{ colspan:
|
34
|
+
%td{ colspan: 4 }
|
35
35
|
%h3=group.name
|
36
|
+
%td
|
37
|
+
.checkbox_holder
|
38
|
+
=check_box_tag "select_all_group_#{group.id}", nil, false, class: 'select_all_group', data: { select_all_group: group.id}
|
36
39
|
|
37
40
|
- group.checks.each do |check|
|
38
41
|
= render partial: '/my_nagios/checks/check_row', locals: { check: check, run_now: true }
|
data/lib/my_nagios/version.rb
CHANGED