dashing-rails 1.0.3 → 2.0.0
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/.gitignore +10 -0
- data/.rspec +1 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +22 -0
- data/Gemfile +21 -0
- data/Gemfile.lock +150 -0
- data/README.md +34 -62
- data/app/assets/javascripts/dashing/application.js +1 -12
- data/app/assets/stylesheets/dashing/application.css +1 -5
- data/app/controllers/dashing/dashboards_controller.rb +3 -3
- data/app/controllers/dashing/widgets_controller.rb +2 -7
- data/app/views/dashing/{default_widgets/clock → widgets}/clock.html +0 -0
- data/app/views/dashing/{default_widgets/comments → widgets}/comments.html +0 -0
- data/app/views/dashing/{default_widgets/graph → widgets}/graph.html +0 -0
- data/app/views/dashing/{default_widgets/iframe → widgets}/iframe.html +0 -0
- data/app/views/dashing/{default_widgets/image → widgets}/image.html +0 -0
- data/app/views/dashing/{default_widgets/list → widgets}/list.html +0 -0
- data/app/views/dashing/{default_widgets/meter → widgets}/meter.html +0 -0
- data/app/views/dashing/{default_widgets/number → widgets}/number.html +0 -0
- data/app/views/dashing/{default_widgets/text → widgets}/text.html +0 -0
- data/bin/rails +8 -0
- data/dashing.gemspec +31 -0
- data/lib/dashing.rb +1 -1
- data/lib/dashing/configuration.rb +29 -12
- data/lib/dashing/engine.rb +7 -3
- data/lib/dashing/version.rb +1 -1
- data/lib/generators/dashing/install_generator.rb +2 -2
- data/lib/generators/dashing/widget_generator.rb +17 -0
- data/lib/generators/templates/dashboards/sample.html.erb +1 -1
- data/lib/generators/templates/initializer.rb +15 -15
- data/lib/generators/templates/widgets/new.coffee +9 -0
- data/lib/generators/templates/widgets/new.html +1 -0
- data/lib/generators/templates/widgets/new.scss +10 -0
- data/spec/dummy/app/{views/dashing/widgets/foo/foo.coffee → assets/images/.keep} +0 -0
- data/spec/dummy/app/{views/dashing/widgets/foo/foo.html → assets/javascripts/dashing/widgets/foo.coffee} +0 -0
- data/{app/views/dashing/default_widgets → spec/dummy/app/assets/javascripts/dashing/widgets}/index.js +0 -0
- data/spec/dummy/app/{views/dashing/widgets/foo → assets/stylesheets/dashing/widgets}/foo.scss +0 -0
- data/{app/views/dashing/default_widgets → spec/dummy/app/assets/stylesheets/dashing/widgets}/index.css +0 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/jobs/sample.rb +9 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/dashing/dashboards/sample.html.erb +28 -0
- data/spec/dummy/app/views/dashing/widgets/foo.html +0 -0
- data/spec/dummy/config/initializers/dashing.rb +57 -0
- data/spec/dummy/config/routes.rb +1 -2
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/lib/dashing/configuration_spec.rb +19 -9
- data/spec/lib/dashing_spec.rb +2 -2
- data/{app → vendor}/assets/fonts/dashing/fontawesome-webfont.eot +0 -0
- data/{app → vendor}/assets/fonts/dashing/fontawesome-webfont.svg +0 -0
- data/{app → vendor}/assets/fonts/dashing/fontawesome-webfont.ttf +0 -0
- data/{app → vendor}/assets/fonts/dashing/fontawesome-webfont.woff +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/batman.jquery.js +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/batman.js +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/d3-3.2.8.min.js +0 -0
- data/{app → vendor}/assets/javascripts/dashing/dashing-src.coffee +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/es5-shim.js +0 -0
- data/vendor/assets/javascripts/dashing/index.js +24 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/jquery.gridster.js +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/jquery.js +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/jquery.knob.js +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/jquery.leanModal.min.js +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/jquery.timeago.js +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/moment.min.js +0 -0
- data/{lib/assets/javascripts → vendor/assets/javascripts/dashing}/rickshaw-1.4.3.min.js +0 -0
- data/{app/views/dashing/default_widgets/clock → vendor/assets/javascripts/dashing/widgets}/clock.coffee +0 -0
- data/{app/views/dashing/default_widgets/comments → vendor/assets/javascripts/dashing/widgets}/comments.coffee +0 -0
- data/{app/views/dashing/default_widgets/graph → vendor/assets/javascripts/dashing/widgets}/graph.coffee +0 -0
- data/{app/views/dashing/default_widgets/iframe → vendor/assets/javascripts/dashing/widgets}/iframe.coffee +0 -0
- data/{app/views/dashing/default_widgets/image → vendor/assets/javascripts/dashing/widgets}/image.coffee +0 -0
- data/vendor/assets/javascripts/dashing/widgets/index.js +13 -0
- data/{app/views/dashing/default_widgets/list → vendor/assets/javascripts/dashing/widgets}/list.coffee +0 -0
- data/{app/views/dashing/default_widgets/meter → vendor/assets/javascripts/dashing/widgets}/meter.coffee +0 -0
- data/{app/views/dashing/default_widgets/number → vendor/assets/javascripts/dashing/widgets}/number.coffee +0 -0
- data/{app/views/dashing/default_widgets/text → vendor/assets/javascripts/dashing/widgets}/text.coffee +0 -0
- data/{app/assets/stylesheets/dashing/dashing.scss → vendor/assets/stylesheets/dashing/dashing-src.scss} +0 -0
- data/{lib/assets/stylesheets → vendor/assets/stylesheets/dashing}/font-awesome.css +0 -0
- data/vendor/assets/stylesheets/dashing/index.css +15 -0
- data/{lib/assets/stylesheets → vendor/assets/stylesheets/dashing}/jquery.gridster.css +0 -0
- data/{app/views/dashing/default_widgets/clock → vendor/assets/stylesheets/dashing/widgets}/clock.scss +0 -0
- data/{app/views/dashing/default_widgets/comments → vendor/assets/stylesheets/dashing/widgets}/comments.scss +0 -0
- data/{app/views/dashing/default_widgets/graph → vendor/assets/stylesheets/dashing/widgets}/graph.scss +0 -0
- data/{app/views/dashing/default_widgets/iframe → vendor/assets/stylesheets/dashing/widgets}/iframe.scss +0 -0
- data/{app/views/dashing/default_widgets/image → vendor/assets/stylesheets/dashing/widgets}/image.scss +0 -0
- data/vendor/assets/stylesheets/dashing/widgets/index.css +12 -0
- data/{app/views/dashing/default_widgets/list → vendor/assets/stylesheets/dashing/widgets}/list.scss +0 -0
- data/{app/views/dashing/default_widgets/meter → vendor/assets/stylesheets/dashing/widgets}/meter.scss +0 -0
- data/{app/views/dashing/default_widgets/number → vendor/assets/stylesheets/dashing/widgets}/number.scss +0 -0
- data/{app/views/dashing/default_widgets/text → vendor/assets/stylesheets/dashing/widgets}/text.scss +0 -0
- metadata +111 -73
- data/spec/dummy/log/test.log +0 -421
data/.gitignore
ADDED
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## 2.0.0
|
|
2
|
+
|
|
3
|
+
* Refactor assets management. Now they all live in `vendor` directory.
|
|
4
|
+
* Introduce a widget generator to build custom widget in a few seconds (`rails g dashing:widget my_widget`).
|
|
5
|
+
* Rename configuration attributes (you need to regenerate the initializer config file with `rails g dashing:install`)
|
|
6
|
+
* Simplify widget view path
|
|
7
|
+
* Bug fixes
|
|
8
|
+
|
|
9
|
+
## 1.0.3
|
|
10
|
+
|
|
11
|
+
* cherrypick https://github.com/Shopify/dashing/pull/253
|
|
12
|
+
* cherrypick https://github.com/Shopify/dashing/commit/2b715ac63dd2de5c718142822663dbded44bbecd
|
|
13
|
+
* cherrypick https://github.com/Shopify/dashing/commit/9f93895bd40aad02e88f7ed7bfd954c930aa27db
|
|
14
|
+
* cherrypick https://github.com/Shopify/dashing/commit/9496b31d7787182b561bd99f8674901bd7667976
|
|
15
|
+
* cherrypick https://github.com/Shopify/dashing/pull/181
|
|
16
|
+
* cherrypick https://github.com/Shopify/dashing/commit/3af326da84251069c4e6f7464d0ae8506b20e98b
|
|
17
|
+
* cherrypick https://github.com/Shopify/dashing/pull/211
|
|
18
|
+
|
|
19
|
+
## 1.0.2
|
|
20
|
+
|
|
21
|
+
* Fix redis connection. Now using connection pool
|
|
22
|
+
* Allow redis custom connection using custom redis host, port and password.
|
data/Gemfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# Declare your gem's dependencies in dashing.gemspec.
|
|
4
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
|
5
|
+
# development dependencies will be added by default to the :development group.
|
|
6
|
+
gemspec
|
|
7
|
+
|
|
8
|
+
# Declare any dependencies that are still in development here instead of in
|
|
9
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
|
10
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
|
11
|
+
# your gem to rubygems.org.
|
|
12
|
+
|
|
13
|
+
gem 'sqlite3'
|
|
14
|
+
gem 'jquery-rails', '~> 3.0'
|
|
15
|
+
|
|
16
|
+
group :test do
|
|
17
|
+
gem 'coveralls', require: false
|
|
18
|
+
gem 'simplecov', require: false
|
|
19
|
+
gem 'rspec-rails', '~> 2.14'
|
|
20
|
+
gem 'pry-rails', '~> 0.3'
|
|
21
|
+
end
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
dashing-rails (2.0.0)
|
|
5
|
+
coffee-script (~> 2.2)
|
|
6
|
+
connection_pool (~> 1.1)
|
|
7
|
+
jquery-rails (~> 3.0)
|
|
8
|
+
rails (~> 4.0.0)
|
|
9
|
+
redis (~> 3.0)
|
|
10
|
+
rufus-scheduler (~> 3.0)
|
|
11
|
+
|
|
12
|
+
GEM
|
|
13
|
+
remote: https://rubygems.org/
|
|
14
|
+
specs:
|
|
15
|
+
actionmailer (4.0.0)
|
|
16
|
+
actionpack (= 4.0.0)
|
|
17
|
+
mail (~> 2.5.3)
|
|
18
|
+
actionpack (4.0.0)
|
|
19
|
+
activesupport (= 4.0.0)
|
|
20
|
+
builder (~> 3.1.0)
|
|
21
|
+
erubis (~> 2.7.0)
|
|
22
|
+
rack (~> 1.5.2)
|
|
23
|
+
rack-test (~> 0.6.2)
|
|
24
|
+
activemodel (4.0.0)
|
|
25
|
+
activesupport (= 4.0.0)
|
|
26
|
+
builder (~> 3.1.0)
|
|
27
|
+
activerecord (4.0.0)
|
|
28
|
+
activemodel (= 4.0.0)
|
|
29
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
|
30
|
+
activesupport (= 4.0.0)
|
|
31
|
+
arel (~> 4.0.0)
|
|
32
|
+
activerecord-deprecated_finders (1.0.3)
|
|
33
|
+
activesupport (4.0.0)
|
|
34
|
+
i18n (~> 0.6, >= 0.6.4)
|
|
35
|
+
minitest (~> 4.2)
|
|
36
|
+
multi_json (~> 1.3)
|
|
37
|
+
thread_safe (~> 0.1)
|
|
38
|
+
tzinfo (~> 0.3.37)
|
|
39
|
+
arel (4.0.1)
|
|
40
|
+
atomic (1.1.12)
|
|
41
|
+
better_errors (1.0.1)
|
|
42
|
+
coderay (>= 1.0.0)
|
|
43
|
+
erubis (>= 2.6.6)
|
|
44
|
+
builder (3.1.4)
|
|
45
|
+
coderay (1.0.9)
|
|
46
|
+
coffee-script (2.2.0)
|
|
47
|
+
coffee-script-source
|
|
48
|
+
execjs
|
|
49
|
+
coffee-script-source (1.6.3)
|
|
50
|
+
connection_pool (1.1.0)
|
|
51
|
+
coveralls (0.7.0)
|
|
52
|
+
multi_json (~> 1.3)
|
|
53
|
+
rest-client
|
|
54
|
+
simplecov (>= 0.7)
|
|
55
|
+
term-ansicolor
|
|
56
|
+
thor
|
|
57
|
+
diff-lcs (1.2.4)
|
|
58
|
+
erubis (2.7.0)
|
|
59
|
+
execjs (2.0.2)
|
|
60
|
+
hike (1.2.3)
|
|
61
|
+
i18n (0.6.4)
|
|
62
|
+
jquery-rails (3.0.4)
|
|
63
|
+
railties (>= 3.0, < 5.0)
|
|
64
|
+
thor (>= 0.14, < 2.0)
|
|
65
|
+
mail (2.5.4)
|
|
66
|
+
mime-types (~> 1.16)
|
|
67
|
+
treetop (~> 1.4.8)
|
|
68
|
+
method_source (0.8.2)
|
|
69
|
+
mime-types (1.25)
|
|
70
|
+
minitest (4.7.5)
|
|
71
|
+
multi_json (1.7.7)
|
|
72
|
+
polyglot (0.3.3)
|
|
73
|
+
pry (0.9.12.2)
|
|
74
|
+
coderay (~> 1.0.5)
|
|
75
|
+
method_source (~> 0.8)
|
|
76
|
+
slop (~> 3.4)
|
|
77
|
+
pry-rails (0.3.2)
|
|
78
|
+
pry (>= 0.9.10)
|
|
79
|
+
rack (1.5.2)
|
|
80
|
+
rack-test (0.6.2)
|
|
81
|
+
rack (>= 1.0)
|
|
82
|
+
rails (4.0.0)
|
|
83
|
+
actionmailer (= 4.0.0)
|
|
84
|
+
actionpack (= 4.0.0)
|
|
85
|
+
activerecord (= 4.0.0)
|
|
86
|
+
activesupport (= 4.0.0)
|
|
87
|
+
bundler (>= 1.3.0, < 2.0)
|
|
88
|
+
railties (= 4.0.0)
|
|
89
|
+
sprockets-rails (~> 2.0.0)
|
|
90
|
+
railties (4.0.0)
|
|
91
|
+
actionpack (= 4.0.0)
|
|
92
|
+
activesupport (= 4.0.0)
|
|
93
|
+
rake (>= 0.8.7)
|
|
94
|
+
thor (>= 0.18.1, < 2.0)
|
|
95
|
+
rake (10.1.0)
|
|
96
|
+
redis (3.0.5)
|
|
97
|
+
rest-client (1.6.7)
|
|
98
|
+
mime-types (>= 1.16)
|
|
99
|
+
rspec-core (2.14.4)
|
|
100
|
+
rspec-expectations (2.14.0)
|
|
101
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
|
102
|
+
rspec-mocks (2.14.1)
|
|
103
|
+
rspec-rails (2.14.0)
|
|
104
|
+
actionpack (>= 3.0)
|
|
105
|
+
activesupport (>= 3.0)
|
|
106
|
+
railties (>= 3.0)
|
|
107
|
+
rspec-core (~> 2.14.0)
|
|
108
|
+
rspec-expectations (~> 2.14.0)
|
|
109
|
+
rspec-mocks (~> 2.14.0)
|
|
110
|
+
rufus-scheduler (3.0.2)
|
|
111
|
+
tzinfo
|
|
112
|
+
simplecov (0.7.1)
|
|
113
|
+
multi_json (~> 1.0)
|
|
114
|
+
simplecov-html (~> 0.7.1)
|
|
115
|
+
simplecov-html (0.7.1)
|
|
116
|
+
slop (3.4.6)
|
|
117
|
+
sprockets (2.10.0)
|
|
118
|
+
hike (~> 1.2)
|
|
119
|
+
multi_json (~> 1.0)
|
|
120
|
+
rack (~> 1.0)
|
|
121
|
+
tilt (~> 1.1, != 1.3.0)
|
|
122
|
+
sprockets-rails (2.0.1)
|
|
123
|
+
actionpack (>= 3.0)
|
|
124
|
+
activesupport (>= 3.0)
|
|
125
|
+
sprockets (~> 2.8)
|
|
126
|
+
sqlite3 (1.3.7)
|
|
127
|
+
term-ansicolor (1.2.2)
|
|
128
|
+
tins (~> 0.8)
|
|
129
|
+
thor (0.18.1)
|
|
130
|
+
thread_safe (0.1.2)
|
|
131
|
+
atomic
|
|
132
|
+
tilt (1.4.1)
|
|
133
|
+
tins (0.12.0)
|
|
134
|
+
treetop (1.4.15)
|
|
135
|
+
polyglot
|
|
136
|
+
polyglot (>= 0.3.1)
|
|
137
|
+
tzinfo (0.3.37)
|
|
138
|
+
|
|
139
|
+
PLATFORMS
|
|
140
|
+
ruby
|
|
141
|
+
|
|
142
|
+
DEPENDENCIES
|
|
143
|
+
better_errors (~> 1.0)
|
|
144
|
+
coveralls
|
|
145
|
+
dashing-rails!
|
|
146
|
+
jquery-rails (~> 3.0)
|
|
147
|
+
pry-rails (~> 0.3)
|
|
148
|
+
rspec-rails (~> 2.14)
|
|
149
|
+
simplecov
|
|
150
|
+
sqlite3
|
data/README.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
Dashing-rails is the Rails Engine version of [Dashing by Shopify](http://shopify.github.io/dashing/).
|
|
8
8
|
A huge thanks to Shopify for their great work with the Sinatra version.
|
|
9
9
|
|
|
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
|
+
|
|
10
12
|
## Introduction
|
|
11
13
|
|
|
12
14
|
Dashing is a Rails engine that lets you build beautiful dashboards.
|
|
@@ -33,11 +35,11 @@ Key features:
|
|
|
33
35
|
|
|
34
36
|
1. Install the gem by adding the following in your `Gemfile`:
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
gem 'dashing-rails'
|
|
37
39
|
|
|
38
40
|
2. Install puma server by adding the following in your `Gemfile`:
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
gem 'puma'
|
|
41
43
|
|
|
42
44
|
3. Bundle install
|
|
43
45
|
|
|
@@ -47,17 +49,17 @@ Key features:
|
|
|
47
49
|
|
|
48
50
|
$ rails g dashing:install
|
|
49
51
|
|
|
50
|
-
5.
|
|
52
|
+
5. Start redis server:
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
$ redis-server
|
|
53
55
|
|
|
54
|
-
6.
|
|
56
|
+
6. Open `config/development.rb` and add:
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
config.allow_concurrency = true
|
|
57
59
|
|
|
58
|
-
7.
|
|
60
|
+
7. Start your server (must be a multi threaded server - See [Requirements](https://github.com/gottfrois/dashing-rails#requirements))
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
$ rails s
|
|
61
63
|
|
|
62
64
|
8. Point your browser at [http://0.0.0.0:9292/dashing/dashboards](http://0.0.0.0:9292/dashing/dashboards) and have fun!
|
|
63
65
|
|
|
@@ -70,7 +72,8 @@ Every new Dashing project comes with sample widgets & sample dashboards for you
|
|
|
70
72
|
|
|
71
73
|
* `app/views/dashing/dashboards` — One .erb file for each dashboard that contains the layout for the widgets.
|
|
72
74
|
* `app/jobs` — Your ruby jobs for fetching data (e.g for calling third party APIs like twitter).
|
|
73
|
-
* `app/
|
|
75
|
+
* `app/assets/javascripts/dashing/widgets/` — One folder with widget's name containing a JS file.
|
|
76
|
+
* `app/assets/stylesheets/dashing/widgets/` — One folder with widget's name containing a CSS file.
|
|
74
77
|
* `app/views/layouts/dashing/` — All your custom layouts where your dashboards and widgets will be included.
|
|
75
78
|
|
|
76
79
|
## Getting Data Into Your Widgets
|
|
@@ -84,11 +87,11 @@ Dashing uses [rufus-scheduler](http://rufus.rubyforge.org/rufus-scheduler/) to s
|
|
|
84
87
|
Example:
|
|
85
88
|
|
|
86
89
|
# :first_in sets how long it takes before the job is first run. In this case, it is run immediately
|
|
87
|
-
Dashing.scheduler.every '1m', :
|
|
90
|
+
Dashing.scheduler.every '1m', first_in: 0 do |job|
|
|
88
91
|
Dashing.send_event('karma', { current: rand(1000) })
|
|
89
92
|
end
|
|
90
93
|
|
|
91
|
-
This job will run every minute, and will send a random number to ALL widgets that have `data-id` set to
|
|
94
|
+
This job will run every minute, and will send a random number to ALL widgets that have `data-id` set to `"karma"`.
|
|
92
95
|
|
|
93
96
|
You send data using the following method:
|
|
94
97
|
|
|
@@ -130,87 +133,56 @@ Your widgets can be updated directly over HTTP. Post the data you want in json t
|
|
|
130
133
|
|
|
131
134
|
Example:
|
|
132
135
|
|
|
133
|
-
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "current": 100 }' http://
|
|
136
|
+
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "current": 100 }' http://locahost:3000/dashing/widgets/karma
|
|
134
137
|
|
|
135
138
|
or
|
|
136
139
|
|
|
137
|
-
HTTParty.post('http://
|
|
140
|
+
HTTParty.post('http://locahost:3000/dashing/widgets/karma',
|
|
138
141
|
body: { auth_token: "YOUR_AUTH_TOKEN", current: 1000 }.to_json)
|
|
139
142
|
|
|
140
143
|
#### Dasboards
|
|
141
144
|
|
|
142
145
|
The `reload` action provided by [Shopify Dashing](http://shopify.github.io/dashing/) is currently not available.
|
|
143
146
|
|
|
144
|
-
##
|
|
145
|
-
|
|
146
|
-
Check out the [wiki](https://github.com/gottfrois/dashing-rails/wiki) for interesting tips such as hosting on Heroku, or adding authentication.
|
|
147
|
-
|
|
148
|
-
For more information on Dashboards and Widgets HTML/CSS/JS, please read [Shopify Dashing documentation](http://shopify.github.io/dashing).
|
|
149
|
-
|
|
150
|
-
Be sure to look at the [list of third party widgets](https://github.com/Shopify/dashing/wiki/Additional-Widgets).
|
|
151
|
-
|
|
152
|
-
## Browser Compatibility
|
|
147
|
+
## Create a new Widget
|
|
153
148
|
|
|
154
|
-
|
|
149
|
+
In order to create or add a custom widget to dashing-rails, simply follow the following steps:
|
|
155
150
|
|
|
156
|
-
|
|
151
|
+
1. Run
|
|
157
152
|
|
|
158
|
-
|
|
153
|
+
$ rails g dashing:widget my_widget
|
|
159
154
|
|
|
160
|
-
|
|
155
|
+
2. Edit `app/views/dashing/widgets/my_widget.html`
|
|
161
156
|
|
|
162
|
-
|
|
157
|
+
3. Edit `app/assets/javascripts/dashing/widgets/my_widget.coffee`
|
|
163
158
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
2. Add [RedisToGo](https://devcenter.heroku.com/articles/redistogo) addon to heroku's app:
|
|
159
|
+
4. Edit `app/assets/stylesheets/dashing/widgets/my_widget.scss`
|
|
167
160
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
3. Add [PostgresSQL](https://devcenter.heroku.com/articles/heroku-postgresql) addon to heroku's app (this is up to you):
|
|
161
|
+
You can also install pre-package widget compatible with dashing-rails. Here is [a list of all Dashing-Rails compatible Widgets](https://github.com/gottfrois/dashing-rails/wiki).
|
|
171
162
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
4. Add `puma` to your `Gemfile`:
|
|
163
|
+
*Note: the paths may be different depending on your dashing-rails configuration. Check your `config/initializers/dashing.rb` file.*
|
|
175
164
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
5. Create a new `Procfile` for you application:
|
|
165
|
+
## Additional Resources
|
|
179
166
|
|
|
180
|
-
|
|
167
|
+
Check out the [wiki](https://github.com/gottfrois/dashing-rails/wiki) for interesting tips such as hosting on Heroku, adding authentication or adding custom widgets.
|
|
181
168
|
|
|
182
|
-
|
|
169
|
+
## Browser Compatibility
|
|
183
170
|
|
|
184
|
-
|
|
185
|
-
config.redis_port = URI.parse(ENV["REDISTOGO_URL"]).port
|
|
186
|
-
config.redis_password = URI.parse(ENV["REDISTOGO_URL"]).password
|
|
187
|
-
|
|
188
|
-
7. Commit and Push to heroku:
|
|
171
|
+
Tested in Chrome, Safari 6+, and Firefox 15+.
|
|
189
172
|
|
|
190
|
-
|
|
191
|
-
git push heroku master
|
|
192
|
-
|
|
193
|
-
8. That's it! Visit [http://your_app.herokuapp.com/dashing/dashboards](http://dashing-rails-demo.herokuapp.com/dashing/dashboards)
|
|
194
|
-
|
|
195
|
-
You can checkout the following application on [Github](https://github.com/gottfrois/dashing-rails-demo) running on [Heroku](http://dashing-rails-demo.herokuapp.com/dashing/dashboards)
|
|
196
|
-
|
|
197
|
-
*`puma -t 0:5` lets you configure the number of threads you want puma to run on.*
|
|
173
|
+
Does not work in Internet Explorer because it relies on [Server Sent Events](http://www.html5rocks.com/en/tutorials/eventsource/basics/).
|
|
198
174
|
|
|
199
175
|
## Contributors
|
|
200
176
|
|
|
201
|
-
[Shopify Dashing official page](http://shopify.github.io/dashing/)
|
|
202
|
-
|
|
203
|
-
[Dashing
|
|
204
|
-
|
|
205
|
-
[Shopify Dashing contributors](https://github.com/Shopify/dashing/graphs/contributors)
|
|
177
|
+
* [Shopify Dashing official page](http://shopify.github.io/dashing/)
|
|
178
|
+
* [Dashing-rails contributors](https://github.com/gottfrois/dashing-rails/contributors)
|
|
179
|
+
* [Shopify Dashing contributors](https://github.com/Shopify/dashing/graphs/contributors)
|
|
206
180
|
|
|
207
181
|
All contributions are more than welcome; especially new widgets!
|
|
208
182
|
|
|
209
183
|
Please add spec to your Pull Requests and run them using:
|
|
210
184
|
|
|
211
|
-
rake
|
|
212
|
-
|
|
213
|
-
You can use the following [demo application](https://github.com/gottfrois/dashing-rails-demo) to test dashing-rails in development.
|
|
185
|
+
$ rake
|
|
214
186
|
|
|
215
187
|
## License
|
|
216
188
|
|
|
@@ -10,18 +10,7 @@
|
|
|
10
10
|
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
|
11
11
|
// GO AFTER THE REQUIRES BELOW.
|
|
12
12
|
//
|
|
13
|
-
//= require
|
|
14
|
-
//= require jquery.gridster
|
|
15
|
-
//= require jquery.knob
|
|
16
|
-
//= require jquery.leanModal.min
|
|
17
|
-
//= require jquery.timeago
|
|
18
|
-
//= require moment.min
|
|
19
|
-
//= require rickshaw-1.4.3.min
|
|
20
|
-
//= require batman
|
|
21
|
-
//= require batman.jquery
|
|
22
|
-
//= require d3-3.2.8.min
|
|
23
|
-
//= require es5-shim
|
|
13
|
+
//= require dashing
|
|
24
14
|
//= require_tree .
|
|
25
15
|
//= require dashing.gridster
|
|
26
|
-
//= require default_widgets
|
|
27
16
|
//= require widgets
|
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
|
9
9
|
* compiled file, but it's generally better to create a new file per style scope.
|
|
10
10
|
*
|
|
11
|
-
*= require
|
|
12
|
-
*= require jquery.gridster
|
|
13
|
-
*= require default_widgets
|
|
14
|
-
*= require widgets
|
|
15
|
-
*= require_self
|
|
11
|
+
*= require dashing
|
|
16
12
|
*= require_tree .
|
|
17
13
|
*/
|
|
@@ -6,11 +6,11 @@ module Dashing
|
|
|
6
6
|
rescue_from ActionView::MissingTemplate, with: :template_not_found
|
|
7
7
|
|
|
8
8
|
def index
|
|
9
|
-
render file: dashboard_path(Dashing.config.default_dashboard || Dashing.first_dashboard || ''), layout: Dashing.config.
|
|
9
|
+
render file: dashboard_path(Dashing.config.default_dashboard || Dashing.first_dashboard || ''), layout: Dashing.config.dashboard_layout_path
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def show
|
|
13
|
-
render file: dashboard_path(params[:name]), layout: Dashing.config.
|
|
13
|
+
render file: dashboard_path(params[:name]), layout: Dashing.config.dashboard_layout_path
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
private
|
|
@@ -20,7 +20,7 @@ module Dashing
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def dashboard_path(name)
|
|
23
|
-
Rails.root.join(Dashing.config.
|
|
23
|
+
Rails.root.join(Dashing.config.dashboards_views_path, name)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def template_not_found
|