dashing-contrib 0.2.1 → 0.2.2

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: 37a8674ad3b2e5e50c9ab3b330df38b55e2feaca
4
- data.tar.gz: 30504dd79ba7be3437f49cbf05459f7d85fbf6da
3
+ metadata.gz: aacebe74b8aefafb26d62f73091477fe0c06f8f7
4
+ data.tar.gz: d90fa7998c2412af71815893d258d0fd89edc655
5
5
  SHA512:
6
- metadata.gz: 753c30b10a6ef1c14767e61af86f5101eda9ee749e6ce52bf50538cb546045645cea675c374178a225259b82ebc5aefec5aec40506c1dcb3afbebb84c2f4f359
7
- data.tar.gz: 11967c410e35ad4634127115b6243b453dd772b5dbed6d1990e0a9490ed60a6616d1ca4509df22f73cd16956c79b10f62e0bc5bfccb3146d0a99f9b53a497213
6
+ metadata.gz: 4049e4e431d745c8fd3304481187fea261ead7de2f09a024d673406045b1760c42672c59734397b8d07a1daca84892a665a3d19c07fd7e46d8b5b8fcea578c00
7
+ data.tar.gz: 2ff269e38792f7a818af5b4159cbeed304b07d77ce72061eff49b0ecfe45c9759ac88d5486db8ce87ae61ef06d04fc8b28766b6993f760062bd1ab5b8270b396
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.2.1'
21
+ gem 'dashing-contrib', '~> 0.2.2'
22
22
 
23
23
  Update dependencies:
24
24
 
@@ -0,0 +1,27 @@
1
+ class Dashing.HotState extends Dashing.Widget
2
+
3
+ constructor: ->
4
+ super
5
+
6
+ onData: (data) ->
7
+ return if not @state
8
+ state = @state.toLowerCase()
9
+
10
+ if [ 'critical', 'warning', 'ok', 'unknown' ].indexOf(state) != -1
11
+ backgroundClass = "hot-state-#{state}"
12
+ else
13
+ backgroundClass = "hot-state-neutral"
14
+
15
+ lastClass = @lastClass
16
+
17
+ if lastClass != backgroundClass
18
+ $(@node).toggleClass("#{lastClass} #{backgroundClass}")
19
+ @lastClass = backgroundClass
20
+
21
+ audiosound = @get(state + 'sound')
22
+ audioplayer = new Audio(audiosound) if audiosound?
23
+ if audioplayer
24
+ audioplayer.play()
25
+
26
+ ready: ->
27
+ @onData(null)
@@ -0,0 +1,7 @@
1
+ <h1 class="title" data-bind="title"></h1>
2
+
3
+ <h2 class="state" data-bind="state" data-hideif="lightmode"></h2>
4
+
5
+ <p class="message" data-bind="message" data-hideif="lightmode"></p>
6
+
7
+ <p class="updated-at" data-bind="updatedAtMessage" data-hideif="lightmode"></p>
@@ -0,0 +1,52 @@
1
+ // ----------------------------------------------------------------------------
2
+ // Mixins
3
+ // ----------------------------------------------------------------------------
4
+ @mixin transition($transition-property, $transition-time, $method) {
5
+ -webkit-transition: $transition-property $transition-time $method;
6
+ -moz-transition: $transition-property $transition-time $method;
7
+ -o-transition: $transition-property $transition-time $method;
8
+ transition: $transition-property $transition-time $method;
9
+ }
10
+
11
+ // ----------------------------------------------------------------------------
12
+ // Sass declarations
13
+ // ----------------------------------------------------------------------------
14
+ $background-color: #000000;
15
+ $title-color: rgba(255, 255, 255, 0.7);
16
+ $state-color: #FFFFFF;
17
+ $message-color: rgba(255, 255, 255, 0.7);
18
+ $updated-at-color: rgba(0, 0, 0, 0.3);
19
+
20
+ // ----------------------------------------------------------------------------
21
+ // Widget-state styles
22
+ // ----------------------------------------------------------------------------
23
+ .widget-hot-state {
24
+
25
+ background-color: $background-color;
26
+ @include transition(background-color, 1s, linear);
27
+
28
+ .title {
29
+ color: $title-color;
30
+ margin-bottom: 10px;
31
+ }
32
+
33
+ .state {
34
+ color: $state-color;
35
+ font-size: 40px;
36
+ }
37
+
38
+ .message {
39
+ color: $message-color;
40
+ font-size: 18px;
41
+ }
42
+
43
+ .updated-at {
44
+ color: $updated-at-color;
45
+ }
46
+
47
+ }
48
+
49
+ .hot-state-ok { background-color: #00C176; }
50
+ .hot-state-warning { background-color: #FABE28; }
51
+ .hot-state-critical { background-color: #FF003C; }
52
+ .hot-state-unknown { background-color: #FF003C; }
@@ -1,3 +1,3 @@
1
1
  module DashingContrib
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
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.2.1
4
+ version: 0.2.2
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-08-12 00:00:00.000000000 Z
11
+ date: 2015-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -215,6 +215,9 @@ files:
215
215
  - lib/dashing-contrib/assets/widgets/dashing_state/dashing_state.coffee
216
216
  - lib/dashing-contrib/assets/widgets/dashing_state/dashing_state.html
217
217
  - lib/dashing-contrib/assets/widgets/dashing_state/dashing_state.scss
218
+ - lib/dashing-contrib/assets/widgets/hot_state/hot_state.coffee
219
+ - lib/dashing-contrib/assets/widgets/hot_state/hot_state.html
220
+ - lib/dashing-contrib/assets/widgets/hot_state/hot_state.scss
218
221
  - lib/dashing-contrib/assets/widgets/kue_status/kue_status.coffee
219
222
  - lib/dashing-contrib/assets/widgets/kue_status/kue_status.html
220
223
  - lib/dashing-contrib/assets/widgets/kue_status/kue_status.scss