dashing-contrib 0.1.12 → 0.1.14
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 243b48fd56fbbd707229e45199f3e93924b534e6
|
4
|
+
data.tar.gz: a65cc15ddff4dce410c03ca7fa69366c66d20fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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]))
|
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.
|
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-
|
11
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|