dashing 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/dashing.rb CHANGED
@@ -49,7 +49,11 @@ end
49
49
 
50
50
  get '/:dashboard' do
51
51
  protected!
52
- erb params[:dashboard].to_sym
52
+ if File.exist? File.join(settings.views, "#{params[:dashboard]}.erb")
53
+ erb params[:dashboard].to_sym
54
+ else
55
+ halt 404
56
+ end
53
57
  end
54
58
 
55
59
  get '/views/:widget?.html' do
@@ -71,6 +75,10 @@ post '/widgets/:id' do
71
75
  end
72
76
  end
73
77
 
78
+ not_found do
79
+ send_file File.join(settings.public_folder, '404.html')
80
+ end
81
+
74
82
  def development?
75
83
  ENV['RACK_ENV'] == 'development'
76
84
  end
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>This Dashboard doesn't exist.</title>
5
+ <style>
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>Drats! That Dashboard doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -17,4 +17,8 @@ class Dashing.Number extends Dashing.Widget
17
17
 
18
18
  onData: (data) ->
19
19
  if data.status
20
- $(@get('node')).addClass("status-#{data.status}")
20
+ # clear existing "status-*" classes
21
+ $(@get('node')).attr 'class', (i,c) ->
22
+ c.replace /\bstatus-\S+/g, ''
23
+ # add new class
24
+ $(@get('node')).addClass "status-#{data.status}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dashing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
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-02-07 00:00:00.000000000 Z
12
+ date: 2013-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass
@@ -179,7 +179,6 @@ files:
179
179
  - templates/project/assets/fonts/fontawesome-webfont.svg
180
180
  - templates/project/assets/fonts/fontawesome-webfont.ttf
181
181
  - templates/project/assets/fonts/fontawesome-webfont.woff
182
- - templates/project/assets/images/favicon.ico
183
182
  - templates/project/assets/images/logo.png
184
183
  - templates/project/assets/javascripts/application.coffee
185
184
  - templates/project/assets/javascripts/d3.v2.min.js
@@ -200,6 +199,8 @@ files:
200
199
  - templates/project/jobs/convergence.rb
201
200
  - templates/project/jobs/sample.rb
202
201
  - templates/project/jobs/twitter.rb
202
+ - templates/project/public/404.html
203
+ - templates/project/public/favicon.ico
203
204
  - templates/project/README.md
204
205
  - templates/project/widgets/clock/clock.coffee
205
206
  - templates/project/widgets/clock/clock.html