Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream changes #14

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6f097d8
Making meter-widget adjustable
Mar 12, 2014
76a645b
Adding Suffix and Prefix to Meter-Widget
Mar 12, 2014
6c58c68
upgrade gridster.js to v0.5.1
liln May 19, 2014
e42fc5d
Possible to skip overwrites when installing widget.
frvi Aug 28, 2014
8fe3a7e
Updated tests accordingly.
frvi Aug 28, 2014
aa997ac
Enable data suffix
Sep 9, 2014
cef86d2
Ignore log directory
Jan 22, 2015
cfed24e
Ignore tmp/ and history.yml
Jan 29, 2015
6914d99
Trigger onData on widget initialization
adambyrtek Feb 24, 2015
e18a162
Store last events for all widgets
adambyrtek Feb 24, 2015
c49e181
Send last event data when a widget is ready
adambyrtek Feb 24, 2015
bf4a9b8
Merge pull request #506 from kassi/ignore-logs
pushmatrix Jun 8, 2015
203abd6
Merge pull request #438 from schinken/graph-suffix
pushmatrix Jun 8, 2015
1582eb9
Merge pull request #433 from frvi/master
pushmatrix Jun 8, 2015
56162f6
Merge pull request #333 from mr-deamon/meter-suffix-prefix
pushmatrix Jun 8, 2015
ca2dad4
Merge pull request #360 from liln/master
pushmatrix Jun 8, 2015
e386ae8
Squashed commit of the following:
Jun 11, 2015
de30f5e
Merge pull request #579 from tylermauthe/master
pushmatrix Jun 11, 2015
b196298
Update CONTRIBUTING.md
pushmatrix Jun 11, 2015
0765825
bump rack for security
orenmazor Jun 17, 2015
d2cd3a8
Merge pull request #580 from Shopify/bump_rack
orenmazor Jun 17, 2015
581123f
Allow thor 0.19.0
ball-hayden Jul 1, 2015
4991e09
Merge pull request #589 from SparkSeat/master
pushmatrix Jul 8, 2015
5a0bdd9
Merge pull request #521 from adambyrtek/last-event-triggers-ondata
pushmatrix Jul 10, 2015
c601933
Adding MIT license to the gemspec.
reiz Nov 18, 2015
5b585d5
Merge pull request #637 from reiz/patch-1
pushmatrix Nov 18, 2015
5b7ea3f
:art: fix indentation
manuelmeurer Dec 2, 2015
e02401e
Merge pull request #641 from krautcomputing/fix_indentation
pushmatrix Dec 7, 2015
f8d316e
Refactor and fix authentication
byroot Dec 8, 2015
56de2ad
Merge pull request #644 from Shopify/refactor-auth
pushmatrix Dec 8, 2015
cffe451
Update year to 2016
prayagverma Jan 16, 2016
8a695bd
Merge pull request #664 from pra85/2016
pushmatrix Jan 17, 2016
d1d0309
Update travis config to current ruby versions.
qbrossard Feb 15, 2016
5c44600
Merge pull request #683 from qbrossard/fix-travis-configuration
pushmatrix Feb 16, 2016
1b1e390
Updated to use FontAwesome 4.5.0
jmb Feb 22, 2016
64ffae5
Merge pull request #687 from jmb/fontawesome-4.5.0
pushmatrix Apr 1, 2016
c5bb690
Update README.md
pushmatrix Apr 12, 2016
0daba09
Update CONTRIBUTING.md
pushmatrix Apr 12, 2016
8b634d1
Update CONTRIBUTING.md
pushmatrix Apr 12, 2016
4a4b677
Update CONTRIBUTING.md
pushmatrix Apr 12, 2016
1d33b6f
Bump gem spec to latest version.
pushmatrix Apr 12, 2016
ed5463d
Update to latest version.
pushmatrix Apr 12, 2016
61435e9
Mention the fork in the readme
pushmatrix Jun 13, 2016
ac35813
Fix gemspec to have correct date
pushmatrix Jul 11, 2016
bc1c106
Fix spacing issue
pushmatrix Aug 1, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
/Gemfile.lock
*.gem
coverage/
log/
tmp/
.ruby-version
history.yml
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: ruby
rvm:
- 2.1.2
- 2.0.0
- 1.9.3
- 2.3.0
- 2.2.4
- 2.1.8

script: "rake test"
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<a name="issues"></a>
## Have an Issue?

Dashing is no longer being actively maintained.

1. Check the [Troubleshooting Guide](https://github.com/Shopify/dashing/wiki#how-tos) in the wiki.
2. Use the [GitHub Issue Search](https://help.github.com/articles/searching-issues/) to check if the issue has already been reported.
3. You can ask your issue on the tracker, but your best bet is to go to [Stack Overflow](http://stackoverflow.com/questions/tagged/dashing)


<a name="features"></a>

If you feel that you have a really amazing, super neato idea that should be a part of Dashing, it may be a good candidate for an external Gem which supercharges a project. An excellent example of this is
[dashing-contrib](https://github.com/QubitProducts/dashing-contrib). If you
do create a third-party extension for Dashing, please add it [here](https://github.com/Shopify/dashing/wiki/Additional-Widgets#other-third-party-tools).

2 changes: 1 addition & 1 deletion MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 Shopify
Copyright (c) 2016 Shopify

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ Dashing is a Sinatra based framework that lets you build beautiful dashboards. I

[Check out the homepage](http://shopify.github.com/dashing).

Note: Dashing is no longer being actively maintained. Read about it [here](https://github.com/Shopify/dashing/issues/711). There is a fork of the project being maintained at at [https://github.com/dashing-io/dashing](https://github.com/dashing-io/dashing)

# License
Distributed under the [MIT license](MIT-LICENSE)
11 changes: 6 additions & 5 deletions dashing.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Gem::Specification.new do |s|
s.name = 'dashing'
s.version = '1.3.4'
s.date = '2014-05-30'
s.version = '1.3.7'
s.date = '2016-04-11'
s.executables = %w(dashing)


Expand All @@ -12,6 +12,7 @@ Gem::Specification.new do |s|
s.author = "Daniel Beauchamp"
s.email = '[email protected]'
s.homepage = 'http://shopify.github.com/dashing'
s.license = "MIT"

s.files = Dir['README.md', 'javascripts/**/*', 'templates/**/*','templates/**/.[a-z]*', 'lib/**/*']

Expand All @@ -22,14 +23,14 @@ Gem::Specification.new do |s|
s.add_dependency('sinatra-contrib', '~> 1.4.2')
s.add_dependency('thin', '~> 1.6.1')
s.add_dependency('rufus-scheduler', '~> 2.0.24')
s.add_dependency('thor', '~> 0.18.1')
s.add_dependency('thor', '> 0.18.1')
s.add_dependency('sprockets', '~> 2.10.1')
s.add_dependency('rack', '~> 1.5.2')
s.add_dependency('rack', '~> 1.5.4')

s.add_development_dependency('rake', '~> 10.1.0')
s.add_development_dependency('haml', '~> 4.0.4')
s.add_development_dependency('minitest', '~> 5.2.0')
s.add_development_dependency('mocha', '~> 0.14.0')
s.add_development_dependency('fakeweb', '~> 1.3.0')
s.add_development_dependency('simplecov', '~> 0.8.2')
end
end
9 changes: 7 additions & 2 deletions javascripts/dashing.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class Dashing.Widget extends Batman.View
@mixin($(@node).data())
Dashing.widgets[@id] ||= []
Dashing.widgets[@id].push(@)
@mixin(Dashing.lastEvents[@id]) # in case the events from the server came before the widget was rendered

type = Batman.Filters.dashize(@view)
$(@node).addClass("widget widget-#{type} #{@id}")
Expand All @@ -55,6 +54,12 @@ class Dashing.Widget extends Batman.View
@::on 'ready', ->
Dashing.Widget.fire 'ready'

# In case the events from the server came before the widget was rendered
lastData = Dashing.lastEvents[@id]
if lastData
@mixin(lastData)
@onData(lastData)

receiveData: (data) =>
@mixin(data)
@onData(data)
Expand Down Expand Up @@ -109,8 +114,8 @@ source.addEventListener 'message', (e) ->
if lastEvents[data.id]?.updatedAt != data.updatedAt
if Dashing.debugMode
console.log("Received data for #{data.id}", data)
lastEvents[data.id] = data
if widgets[data.id]?.length > 0
lastEvents[data.id] = data
for widget in widgets[data.id]
widget.receiveData(data)

Expand Down
11 changes: 7 additions & 4 deletions lib/dashing/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def production?
def protected!
# override with auth logic
end

def authenticated?(token)
return true unless settings.auth_token
token && Rack::Utils.secure_compare(settings.auth_token, token)
end
end

set :root, Dir.pwd
Expand Down Expand Up @@ -89,8 +94,7 @@ def protected!
request.body.rewind
body = JSON.parse(request.body.read)
body['dashboard'] ||= params['id']
auth_token = body.delete("auth_token")
if !settings.auth_token || settings.auth_token == auth_token
if authenticated?(body.delete("auth_token"))
send_event(params['id'], body, 'dashboards')
204 # response without entity body
else
Expand All @@ -102,8 +106,7 @@ def protected!
post '/widgets/:id' do
request.body.rewind
body = JSON.parse(request.body.read)
auth_token = body.delete("auth_token")
if !settings.auth_token || settings.auth_token == auth_token
if authenticated?(body.delete("auth_token"))
send_event(params['id'], body)
204 # response without entity body
else
Expand Down
12 changes: 6 additions & 6 deletions lib/dashing/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def generate(type, name)
puts "Invalid generator. Either use widget, dashboard, or job"
end

desc "install GIST_ID", "Installs a new widget from a gist."
def install(gist_id)
desc "install GIST_ID [--skip]", "Installs a new widget from a gist (skip overwrite)."
def install(gist_id, *args)
gist = Downloader.get_gist(gist_id)
public_url = "https://gist.github.com/#{gist_id}"

install_widget_from_gist(gist)
install_widget_from_gist(gist, args.include?('--skip'))

print set_color("Don't forget to edit the ", :yellow)
print set_color("Gemfile ", :yellow, :bold)
Expand Down Expand Up @@ -89,15 +89,15 @@ def run_command(command)
system(command)
end

def install_widget_from_gist(gist)
def install_widget_from_gist(gist, skip_overwrite)
gist['files'].each do |file, details|
if file =~ /\.(html|coffee|scss)\z/
widget_name = File.basename(file, '.*')
new_path = File.join(Dir.pwd, 'widgets', widget_name, file)
create_file(new_path, details['content'])
create_file(new_path, details['content'], :skip => skip_overwrite)
elsif file.end_with?('.rb')
new_path = File.join(Dir.pwd, 'jobs', file)
create_file(new_path, details['content'])
create_file(new_path, details['content'], :skip => skip_overwrite)
end
end
end
Expand Down
Binary file added templates/project/assets/fonts/FontAwesome.otf
Binary file not shown.
Binary file modified templates/project/assets/fonts/fontawesome-webfont.eot
Binary file not shown.
Loading