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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9928548b5874bca05dd4fabc05972fde4a50913
4
- data.tar.gz: f0c88b2b2c1e6651f7e95f4e5a12e48f7ffd6aea
3
+ metadata.gz: 74f6a424eb4c104a4d30c8d62c63750c9fa7d236
4
+ data.tar.gz: 41a78f4f3c23af33791782f15739c864826f8f9b
5
5
  SHA512:
6
- metadata.gz: c0066bb8dcc6a7d74bb345907ec0682496fbf57f28e5aba5fc54bd354070e4e30829b5c97d53242df16e8510cbed168d308048069509bbd358dad4901b302890
7
- data.tar.gz: 2dc32a663f977e82b0d94a79ed1568723fa3ac9692330f0789da385240330d5afaaf32449f93cb5e7a89379e23d17e7bd42e6f93cc89ca195b5ff4cb9fdd720f
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
- $(':checkbox').change (event) ->
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).val()
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
 
@@ -21,6 +21,10 @@
21
21
  padding-right: 8px;
22
22
  }
23
23
 
24
+ input.select_all_group {
25
+ margin-top: 30px;
26
+ }
27
+
24
28
  td.snooze_for {
25
29
  color: #e6e6e6;
26
30
  }
@@ -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` <= NOW() OR `my_nagios_checks`.`snooze_for` IS NULL') }
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 and check.snooze_for > Time.now
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: is_snooze ? 'snooze_for' : '' }
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: 5 }
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 }
@@ -1,3 +1,3 @@
1
1
  module MyNagios
2
- VERSION = "0.0.19"
2
+ VERSION = "0.0.20"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_nagios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Omelchenko