dashing-contrib 0.1.12 → 0.1.14

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: 5c4f833763c66a8d55882aa3148dd0e9f3cd4cd0
4
- data.tar.gz: 04db4b265177f482a994b6d268229fef6fbdbfdb
3
+ metadata.gz: 243b48fd56fbbd707229e45199f3e93924b534e6
4
+ data.tar.gz: a65cc15ddff4dce410c03ca7fa69366c66d20fa6
5
5
  SHA512:
6
- metadata.gz: 6770777c4fa20f77e4937c035f4ca3fa9f7d60ab070f53ddf74c92326c9d5738f076928a7e8d14d79ab87d222fe88135f203abe3d43f09fc6d5c7cb7d4d5e51b
7
- data.tar.gz: ce75dedd3e3eae470b3871595d7c0b7b85deea78b75516ad1906c32a88d8b9d506a58f945bea821a13952bc68a33f703b529355c73ce3fe0c54cf4ca538a00aa
6
+ metadata.gz: 3609c31c176dc5fefdbe6126d771dfbfaeb4b79a585475dcb989c3282fc90145be7846dffc757be9580f9c5c20aad1b6cf43afe2a7d470d5643c691678b67db1
7
+ data.tar.gz: e0d457b2fbf78d2f46c6ee6f572535ab51a28c5425eeb7a34028dc1e32ec3c333f564aa5fd24d96dce0878f187b4dc7af4f718df1019943a83b6712289aeb470
data/README.md CHANGED
@@ -18,7 +18,7 @@ Read each individual widget documentation to use dashing-contrib built-in widget
18
18
  ## Installation
19
19
  Requires Ruby >= 1.9.3. Add this line to your Dashing's dashboard Gemfile:
20
20
 
21
- gem 'dashing-contrib', '~> 0.1.12'
21
+ gem 'dashing-contrib', '~> 0.1.14'
22
22
 
23
23
  Update dependencies:
24
24
 
@@ -203,6 +203,11 @@ class DashboardSwitcherControls
203
203
  if @currentTime < 0
204
204
  @currentTime = 0
205
205
 
206
+ # Expose our API
207
+ Dashing.DashboardSwitcher = DashboardSwitcher
208
+ Dashing.WidgetSwitcher = WidgetSwitcher
209
+ Dashing.DashboardSwitcherControls = DashboardSwitcherControls
210
+
206
211
  # Dashboard loaded and ready
207
212
  Dashing.on 'ready', ->
208
213
  # If multiple widgets per list item, switch them periodically
@@ -8,7 +8,15 @@ module DashingContrib
8
8
  extend self
9
9
 
10
10
  def calc(credentials, id, from_time, to_time, rounding = 2)
11
- payload = make_request(credentials, id, from_time, to_time)
11
+ # Find out when the check was created
12
+ checks = ::DashingContrib::Pingdom::Checks.fetch(credentials, id)
13
+ used_from_time = from_time
14
+ # if we're looking at time time range over the creation time, start from the creation time
15
+ if from_time <= checks[:check][:created] and checks[:check][:created] <= to_time
16
+ # use the creation time + 1 second (for initial check to settle)
17
+ used_from_time = checks[:check][:created] + 1
18
+ end
19
+ payload = make_request(credentials, id, used_from_time, to_time)
12
20
  summary = payload[:summary][:status]
13
21
  up = summary[:totalup]
14
22
  unkown = summary[:totalunknown]
@@ -30,4 +38,4 @@ module DashingContrib
30
38
  end
31
39
  end
32
40
  end
33
- end
41
+ end
@@ -20,7 +20,7 @@ module DashingContrib
20
20
  second_uptime = client.uptime(id, user_opt[:second_date_range], user_opt[:now])
21
21
  status = client.checks(id)
22
22
 
23
- if status[:check][:lasterrortime].nil ?
23
+ if status[:check][:lasterrortime].nil?
24
24
  last_down = "never"
25
25
  else
26
26
  last_down = ::DashingContrib::Time.readable_diff(::Time.at(status[:check][:lasterrortime]))
@@ -1,3 +1,3 @@
1
1
  module DashingContrib
2
- VERSION = '0.1.12'
2
+ VERSION = '0.1.14'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dashing-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jing Dong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-17 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv