-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
142 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
spec/dummy/app/assets/javascripts/dashing/widgets/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This is a manifest file that'll be compiled into application.js, which will include all the files | ||
// listed below. | ||
// | ||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | ||
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | ||
// | ||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | ||
// the compiled file. | ||
// | ||
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD | ||
// GO AFTER THE REQUIRES BELOW. | ||
// | ||
//= require_tree . |
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
spec/dummy/app/assets/stylesheets/dashing/widgets/index.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* This is a manifest file that'll be compiled into application.css, which will include all the files | ||
* listed below. | ||
* | ||
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, | ||
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. | ||
* | ||
* You're free to add application-wide styles to this file and they'll appear at the top of the | ||
* compiled file, but it's generally better to create a new file per style scope. | ||
* | ||
*= require_tree . | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
current_valuation = 0 | ||
|
||
Dashing.scheduler.every '2s' do | ||
last_valuation = current_valuation | ||
current_valuation = rand(100) | ||
|
||
Dashing.send_event('valuation', { current: current_valuation, last: last_valuation }) | ||
Dashing.send_event('synergy', { value: rand(100) }) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<% content_for :title do %> | ||
My super sweet dashboard | ||
<% end %> | ||
|
||
<div class="gridster"> | ||
<ul> | ||
<li data-row="1" data-col="1" data-sizex="2" data-sizey="1"> | ||
<div data-id="welcome" data-view="Text" data-title="Hello" data-text="This is your shiny new dashboard." data-moreinfo="Protip: You can drag the widgets around!"></div> | ||
</li> | ||
|
||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1"> | ||
<div data-id="synergy" data-view="Meter" data-title="Synergy" data-min="0" data-max="100"></div> | ||
</li> | ||
|
||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="2"> | ||
<div data-id="buzzwords" data-view="List" data-unordered="true" data-title="Buzzwords" data-moreinfo="# of times said around the office"></div> | ||
</li> | ||
|
||
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1"> | ||
<div data-id="valuation" data-view="Number" data-title="Current Valuation" data-moreinfo="In billions" data-prefix="$"></div> | ||
</li> | ||
|
||
<li data-row="1" data-col="1" data-sizex="2" data-sizey="1"> | ||
<div data-id="convergence" data-view="Graph" data-title="Convergence" style="background-color:#ff9618"></div> | ||
</li> | ||
</ul> | ||
<center><div style="font-size: 12px">Try this: curl -X PUT 'http://<%= request.host %>:<%= request.port %>/dashing/widgets/welcome' --data "widget%5Btext%5D=Dashing+is+awesomecurl"</div></center> | ||
</div> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Use this hook to configure Dashing bahaviors. | ||
Dashing.configure do |config| | ||
# Scheduler instance. | ||
# config.scheduler = ::Rufus::Scheduler.new | ||
|
||
# Redis credentials. | ||
# See https://devcenter.heroku.com/articles/redistogo to configure redis for heroku. | ||
# config.redis_host = '127.0.0.1' | ||
# config.redis_port = '6379' | ||
# config.redis_password = nil | ||
|
||
# Redis namespace when pushing new data. | ||
# config.redis_namespace = 'dashing_events' | ||
|
||
# Dashing come with default widgets using css and coffeescript. | ||
# You can create your own widgets by adding the following files: | ||
# | ||
# A widget is composed of: | ||
# - an HTML file used for layout and bindings - app/views/dashing/widgets/foo.html | ||
# - a SCSS file for styles - app/assets/stylesheets/dashing/widgets/foo.scss | ||
# - a coffeescript file which allows you to handle incoming data & functionality - app/assets/javascripts/dashing/widgets/foo.coffee | ||
# | ||
# CSS and JS file will be added to the asset path and the asset pipeline automatically. | ||
# | ||
# More information at http://shopify.github.io/dashing/ | ||
# | ||
# You can change default views and assets paths with the following config: | ||
# | ||
# config.widgets_views_path = 'app/views/dashing/widgets/' | ||
# config.widgets_js_path = 'app/assets/javascripts/dashing' | ||
# config.widgets_css_path = 'app/assets/stylesheets/dashing' | ||
|
||
# rufus-scheduler worker path | ||
# config.jobs_path = 'app/jobs/' | ||
|
||
# Engine path to use for accessing engine's routes. | ||
# Ex: http://your_app/dashing/dashboard/my_dashboard_name | ||
# config.engine_path = '/dashing' | ||
|
||
# The dashboards views path used to find dashboards. | ||
# config.dashboards_views_path = 'app/views/dashing/dashboards/' | ||
|
||
# The Dashing layout used to display metrics. | ||
# config.dashboard_layout_path = 'dashing/dashboard' | ||
|
||
# Default dashboard name to load when going to /dashing/dashboards | ||
# config.default_dashboard = nil | ||
|
||
# A secure random string to authenticate with for curl requests. | ||
# Put nil if you don't want to use authentication. | ||
# You can use SecureRandom.hex to generate a hex. | ||
# config.auth_token = nil | ||
|
||
# List of Devise models that should access the whole dashboard. | ||
# List the models. E.g: '[:user, :admin]' | ||
# config.devise_allowed_models = [] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Rails.application.routes.draw do | ||
|
||
mount Dashing::Engine => "/dashing" | ||
mount Dashing::Engine, at: Dashing.config.engine_path | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters