dashing-rails 2.0.0 → 2.0.1
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.
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +24 -22
- data/app/assets/javascripts/dashing/application.js +1 -0
- data/app/controllers/dashing/widgets_controller.rb +2 -2
- data/lib/dashing/version.rb +1 -1
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/clock.coffee +0 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/comments.coffee +0 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/graph.coffee +0 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/iframe.coffee +0 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/image.coffee +0 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/index.js +0 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/list.coffee +0 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/meter.coffee +0 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/number.coffee +1 -0
- data/vendor/assets/javascripts/dashing/{widgets → default_widgets}/text.coffee +0 -0
- metadata +14 -14
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dashing-rails (2.0.
|
4
|
+
dashing-rails (2.0.1)
|
5
5
|
coffee-script (~> 2.2)
|
6
6
|
connection_pool (~> 1.1)
|
7
7
|
jquery-rails (~> 3.0)
|
@@ -93,7 +93,7 @@ GEM
|
|
93
93
|
rake (>= 0.8.7)
|
94
94
|
thor (>= 0.18.1, < 2.0)
|
95
95
|
rake (10.1.0)
|
96
|
-
redis (3.0.
|
96
|
+
redis (3.0.6)
|
97
97
|
rest-client (1.6.7)
|
98
98
|
mime-types (>= 1.16)
|
99
99
|
rspec-core (2.14.4)
|
data/README.md
CHANGED
@@ -9,6 +9,8 @@ A huge thanks to Shopify for their great work with the Sinatra version.
|
|
9
9
|
|
10
10
|
**Warning**: To upgrade from `1.x.x` to `2.x.x` you need to run `rails g dashing:install`. Please read `CHANGELOG.md` for more details.
|
11
11
|
|
12
|
+
<img src="https://dl.dropboxusercontent.com/u/29838807/dashing-rails.png" width="600" />
|
13
|
+
|
12
14
|
## Introduction
|
13
15
|
|
14
16
|
Dashing is a Rails engine that lets you build beautiful dashboards.
|
@@ -39,27 +41,27 @@ Key features:
|
|
39
41
|
|
40
42
|
2. Install puma server by adding the following in your `Gemfile`:
|
41
43
|
|
42
|
-
|
44
|
+
gem 'puma'
|
43
45
|
|
44
46
|
3. Bundle install
|
45
47
|
|
46
|
-
|
48
|
+
$ bundle
|
47
49
|
|
48
50
|
4. Install the dependecies using the following command:
|
49
51
|
|
50
|
-
|
52
|
+
$ rails g dashing:install
|
51
53
|
|
52
54
|
5. Start redis server:
|
53
55
|
|
54
|
-
|
56
|
+
$ redis-server
|
55
57
|
|
56
58
|
6. Open `config/development.rb` and add:
|
57
59
|
|
58
|
-
|
60
|
+
config.allow_concurrency = true
|
59
61
|
|
60
62
|
7. Start your server (must be a multi threaded server - See [Requirements](https://github.com/gottfrois/dashing-rails#requirements))
|
61
63
|
|
62
|
-
|
64
|
+
$ rails s
|
63
65
|
|
64
66
|
8. Point your browser at [http://0.0.0.0:9292/dashing/dashboards](http://0.0.0.0:9292/dashing/dashboards) and have fun!
|
65
67
|
|
@@ -86,16 +88,16 @@ Dashing uses [rufus-scheduler](http://rufus.rubyforge.org/rufus-scheduler/) to s
|
|
86
88
|
|
87
89
|
Example:
|
88
90
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
91
|
+
# :first_in sets how long it takes before the job is first run. In this case, it is run immediately
|
92
|
+
Dashing.scheduler.every '1m', first_in: 1.second.since do |job|
|
93
|
+
Dashing.send_event('karma', { current: rand(1000) })
|
94
|
+
end
|
93
95
|
|
94
96
|
This job will run every minute, and will send a random number to ALL widgets that have `data-id` set to `"karma"`.
|
95
97
|
|
96
98
|
You send data using the following method:
|
97
99
|
|
98
|
-
|
100
|
+
Dashing.send_event(widget_id, json_formatted_data)
|
99
101
|
|
100
102
|
Jobs are where you put stuff such as fetching metrics from a database, or calling a third party API like Twitter. Since the data fetch is happening in only one place, it means that all instances of widgets are in sync.
|
101
103
|
|
@@ -109,21 +111,21 @@ This way you can have a seperate Rails 4 application (with puma) running your da
|
|
109
111
|
|
110
112
|
You can specify Dashing redis credentials in `config/initializers/dashing.rb`:
|
111
113
|
|
112
|
-
|
113
|
-
|
114
|
-
|
114
|
+
config.redis_host = '127.0.0.1'
|
115
|
+
config.redis_port = '6379'
|
116
|
+
config.redis_password = '123456'
|
115
117
|
|
116
118
|
By default Dashing subscribed to the following namespace in redis:
|
117
119
|
|
118
|
-
|
120
|
+
dashing_events.*
|
119
121
|
|
120
122
|
where `*` can be anything. This give you all the flexibility you need to push to redis. For example the `send_event` method provided by Dashing uses the following namespace:
|
121
123
|
|
122
|
-
|
124
|
+
redis.publish("dashing_events.create", {})
|
123
125
|
|
124
126
|
You can configure the redis namespace in `config/initializers/dashing.rb`:
|
125
127
|
|
126
|
-
|
128
|
+
config.redis_namespace = 'your_redis_namespace'
|
127
129
|
|
128
130
|
### API
|
129
131
|
|
@@ -133,12 +135,12 @@ Your widgets can be updated directly over HTTP. Post the data you want in json t
|
|
133
135
|
|
134
136
|
Example:
|
135
137
|
|
136
|
-
|
138
|
+
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "current": 100 }' http://locahost:3000/dashing/widgets/karma
|
137
139
|
|
138
140
|
or
|
139
141
|
|
140
|
-
|
141
|
-
|
142
|
+
HTTParty.post('http://locahost:3000/dashing/widgets/karma',
|
143
|
+
body: { auth_token: "YOUR_AUTH_TOKEN", current: 1000 }.to_json)
|
142
144
|
|
143
145
|
#### Dasboards
|
144
146
|
|
@@ -182,8 +184,8 @@ All contributions are more than welcome; especially new widgets!
|
|
182
184
|
|
183
185
|
Please add spec to your Pull Requests and run them using:
|
184
186
|
|
185
|
-
|
187
|
+
$ rake
|
186
188
|
|
187
189
|
## License
|
188
190
|
|
189
|
-
Dashing is released under the [MIT license](https://github.com/
|
191
|
+
Dashing is released under the [MIT license](https://github.com/gottfrois/dashing-rails/blob/master/MIT-LICENSE)
|
@@ -8,7 +8,7 @@ module Dashing
|
|
8
8
|
rescue_from ActionView::MissingTemplate, with: :template_not_found
|
9
9
|
|
10
10
|
def show
|
11
|
-
render file:
|
11
|
+
render file: widget_path
|
12
12
|
end
|
13
13
|
|
14
14
|
def update
|
@@ -25,7 +25,7 @@ module Dashing
|
|
25
25
|
raise 'bad widget name' unless params[:name] =~ /\A[a-zA-z0-9_\-]+\z/
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
28
|
+
def widget_path
|
29
29
|
params[:name]
|
30
30
|
end
|
31
31
|
|
data/lib/dashing/version.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dashing-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -276,6 +276,16 @@ files:
|
|
276
276
|
- vendor/assets/javascripts/dashing/batman.js
|
277
277
|
- vendor/assets/javascripts/dashing/d3-3.2.8.min.js
|
278
278
|
- vendor/assets/javascripts/dashing/dashing-src.coffee
|
279
|
+
- vendor/assets/javascripts/dashing/default_widgets/clock.coffee
|
280
|
+
- vendor/assets/javascripts/dashing/default_widgets/comments.coffee
|
281
|
+
- vendor/assets/javascripts/dashing/default_widgets/graph.coffee
|
282
|
+
- vendor/assets/javascripts/dashing/default_widgets/iframe.coffee
|
283
|
+
- vendor/assets/javascripts/dashing/default_widgets/image.coffee
|
284
|
+
- vendor/assets/javascripts/dashing/default_widgets/index.js
|
285
|
+
- vendor/assets/javascripts/dashing/default_widgets/list.coffee
|
286
|
+
- vendor/assets/javascripts/dashing/default_widgets/meter.coffee
|
287
|
+
- vendor/assets/javascripts/dashing/default_widgets/number.coffee
|
288
|
+
- vendor/assets/javascripts/dashing/default_widgets/text.coffee
|
279
289
|
- vendor/assets/javascripts/dashing/es5-shim.js
|
280
290
|
- vendor/assets/javascripts/dashing/index.js
|
281
291
|
- vendor/assets/javascripts/dashing/jquery.gridster.js
|
@@ -285,16 +295,6 @@ files:
|
|
285
295
|
- vendor/assets/javascripts/dashing/jquery.timeago.js
|
286
296
|
- vendor/assets/javascripts/dashing/moment.min.js
|
287
297
|
- vendor/assets/javascripts/dashing/rickshaw-1.4.3.min.js
|
288
|
-
- vendor/assets/javascripts/dashing/widgets/clock.coffee
|
289
|
-
- vendor/assets/javascripts/dashing/widgets/comments.coffee
|
290
|
-
- vendor/assets/javascripts/dashing/widgets/graph.coffee
|
291
|
-
- vendor/assets/javascripts/dashing/widgets/iframe.coffee
|
292
|
-
- vendor/assets/javascripts/dashing/widgets/image.coffee
|
293
|
-
- vendor/assets/javascripts/dashing/widgets/index.js
|
294
|
-
- vendor/assets/javascripts/dashing/widgets/list.coffee
|
295
|
-
- vendor/assets/javascripts/dashing/widgets/meter.coffee
|
296
|
-
- vendor/assets/javascripts/dashing/widgets/number.coffee
|
297
|
-
- vendor/assets/javascripts/dashing/widgets/text.coffee
|
298
298
|
- vendor/assets/stylesheets/dashing/dashing-src.scss
|
299
299
|
- vendor/assets/stylesheets/dashing/font-awesome.css
|
300
300
|
- vendor/assets/stylesheets/dashing/index.css
|
@@ -324,7 +324,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
324
324
|
version: '0'
|
325
325
|
segments:
|
326
326
|
- 0
|
327
|
-
hash:
|
327
|
+
hash: 2203029545150692038
|
328
328
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
329
329
|
none: false
|
330
330
|
requirements:
|
@@ -333,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
333
333
|
version: '0'
|
334
334
|
segments:
|
335
335
|
- 0
|
336
|
-
hash:
|
336
|
+
hash: 2203029545150692038
|
337
337
|
requirements: []
|
338
338
|
rubyforge_project:
|
339
339
|
rubygems_version: 1.8.25
|