dashing 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -1
- data/javascripts/dashing.coffee +14 -10
- data/lib/dashing.rb +1 -1
- data/templates/project/assets/javascripts/application.coffee +1 -0
- data/templates/project/assets/javascripts/dashing.gridster.coffee +9 -4
- data/templates/project/widgets/clock/clock.scss +3 -3
- data/templates/project/widgets/comments/comments.coffee +1 -1
- data/templates/project/widgets/comments/comments.html +2 -2
- data/templates/project/widgets/comments/comments.scss +5 -5
- data/templates/project/widgets/graph/graph.html +1 -1
- data/templates/project/widgets/graph/graph.scss +4 -4
- data/templates/project/widgets/iframe/iframe.coffee +1 -1
- data/templates/project/widgets/iframe/iframe.html +1 -1
- data/templates/project/widgets/iframe/iframe.scss +2 -2
- data/templates/project/widgets/image/image.coffee +1 -1
- data/templates/project/widgets/image/image.html +1 -1
- data/templates/project/widgets/image/image.scss +2 -2
- data/templates/project/widgets/list/list.coffee +1 -1
- data/templates/project/widgets/list/list.html +1 -1
- data/templates/project/widgets/list/list.scss +4 -4
- data/templates/project/widgets/meter/meter.coffee +1 -1
- data/templates/project/widgets/meter/meter.html +1 -1
- data/templates/project/widgets/meter/meter.scss +6 -6
- data/templates/project/widgets/number/number.coffee +1 -1
- data/templates/project/widgets/number/number.html +1 -1
- data/templates/project/widgets/number/number.scss +5 -5
- data/templates/project/widgets/text/text.coffee +1 -1
- data/templates/project/widgets/text/text.html +1 -1
- data/templates/project/widgets/text/text.scss +5 -5
- metadata +60 -20
data/README.md
CHANGED
@@ -1 +1,8 @@
|
|
1
|
-
|
1
|
+
# [Dashing](http://shopify.github.com/dashing)
|
2
|
+
|
3
|
+
Dashing is a Sinatra based framework that lets you build beautiful dashboards. It looks especially great on TVs.
|
4
|
+
|
5
|
+
[Check out the homepage](http://shopify.github.com/dashing).
|
6
|
+
|
7
|
+
# License
|
8
|
+
Distributed under the [MIT license](https://github.com/Shopify/dashing/blob/master/MIT-LICENSE)
|
data/javascripts/dashing.coffee
CHANGED
@@ -44,8 +44,10 @@ class Dashing.Widget extends Batman.View
|
|
44
44
|
|
45
45
|
@accessor 'updatedAtMessage', ->
|
46
46
|
if updatedAt = @get('updatedAt')
|
47
|
-
timestamp = updatedAt
|
48
|
-
|
47
|
+
timestamp = new Date(updatedAt * 1000)
|
48
|
+
hours = timestamp.getHours()
|
49
|
+
minutes = ("0" + timestamp.getMinutes()).slice(-2)
|
50
|
+
"Last updated at #{hours}:#{minutes}"
|
49
51
|
|
50
52
|
@::on 'ready', ->
|
51
53
|
Dashing.Widget.fire 'ready'
|
@@ -70,7 +72,7 @@ Dashing.AnimatedValue =
|
|
70
72
|
num = parseFloat(num)
|
71
73
|
up = to > num
|
72
74
|
num_interval = Math.abs(num - to) / 90
|
73
|
-
@[timer] =
|
75
|
+
@[timer] =
|
74
76
|
setInterval =>
|
75
77
|
num = if up then Math.ceil(num+num_interval) else Math.floor(num-num_interval)
|
76
78
|
if (up && num > to) || (!up && num < to)
|
@@ -80,7 +82,8 @@ Dashing.AnimatedValue =
|
|
80
82
|
delete @[timer]
|
81
83
|
@[k] = num
|
82
84
|
@set k, to
|
83
|
-
|
85
|
+
, 10
|
86
|
+
@[k] = num
|
84
87
|
|
85
88
|
Dashing.widgets = widgets = {}
|
86
89
|
Dashing.lastEvents = lastEvents = {}
|
@@ -97,12 +100,13 @@ source.addEventListener 'error', (e)->
|
|
97
100
|
|
98
101
|
source.addEventListener 'message', (e) =>
|
99
102
|
data = JSON.parse(e.data)
|
100
|
-
if
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
widget.
|
103
|
+
if lastEvents[data.id]?.updatedAt != data.updatedAt
|
104
|
+
if Dashing.debugMode
|
105
|
+
console.log("Received data for #{data.id}", data)
|
106
|
+
lastEvents[data.id] = data
|
107
|
+
if widgets[data.id]?.length > 0
|
108
|
+
for widget in widgets[data.id]
|
109
|
+
widget.receiveData(data)
|
106
110
|
|
107
111
|
|
108
112
|
$(document).ready ->
|
data/lib/dashing.rb
CHANGED
@@ -13,20 +13,25 @@ Dashing.gridsterLayout = (positions) ->
|
|
13
13
|
$(widget).attr('data-row', positions[index].row)
|
14
14
|
$(widget).attr('data-col', positions[index].col)
|
15
15
|
|
16
|
+
Dashing.getWidgetPositions = ->
|
17
|
+
$(".gridster ul:first").gridster().data('gridster').serialize()
|
18
|
+
|
16
19
|
Dashing.showGridsterInstructions = ->
|
17
|
-
|
20
|
+
newWidgetPositions = Dashing.getWidgetPositions()
|
21
|
+
|
22
|
+
unless JSON.stringify(newWidgetPositions) == JSON.stringify(Dashing.currentWidgetPositions)
|
23
|
+
Dashing.currentWidgetPositions = newWidgetPositions
|
18
24
|
$('#save-gridster').slideDown()
|
19
25
|
$('#gridster-code').text("
|
20
26
|
<script type='text/javascript'>\n
|
21
27
|
$(function() {\n
|
22
|
-
\ \ Dashing.gridsterLayout('#{JSON.stringify(
|
28
|
+
\ \ Dashing.gridsterLayout('#{JSON.stringify(Dashing.currentWidgetPositions)}')\n
|
23
29
|
});\n
|
24
30
|
</script>
|
25
31
|
")
|
26
32
|
|
27
|
-
|
28
33
|
$ ->
|
29
34
|
$('#save-gridster').leanModal()
|
30
35
|
|
31
36
|
$('#save-gridster').click ->
|
32
|
-
$('#save-gridster').slideUp()
|
37
|
+
$('#save-gridster').slideUp()
|
@@ -6,8 +6,8 @@ $background-color: #dc5945;
|
|
6
6
|
// ----------------------------------------------------------------------------
|
7
7
|
// Widget-clock styles
|
8
8
|
// ----------------------------------------------------------------------------
|
9
|
-
.widget-clock {
|
9
|
+
.widget-clock {
|
10
10
|
|
11
11
|
background-color: $background-color;
|
12
|
-
|
13
|
-
}
|
12
|
+
|
13
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<h1 class="title" data-bind="title"></h1>
|
2
2
|
<div class="comment-container">
|
3
|
-
<h3><img data-bind-src='current_comment.avatar'/><span data-bind='current_comment.name' class="name"></span></h3>
|
3
|
+
<h3><img data-bind-src='current_comment.avatar'/><span data-bind='current_comment.name' class="name"></span></h3>
|
4
4
|
<p class="comment" data-bind='quote'></p>
|
5
5
|
</div>
|
6
6
|
|
7
|
-
<p class="more-info" data-bind="moreinfo | raw"></p>
|
7
|
+
<p class="more-info" data-bind="moreinfo | raw"></p>
|
@@ -9,11 +9,11 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);
|
|
9
9
|
// ----------------------------------------------------------------------------
|
10
10
|
// Widget-comment styles
|
11
11
|
// ----------------------------------------------------------------------------
|
12
|
-
.widget-comments {
|
12
|
+
.widget-comments {
|
13
13
|
|
14
14
|
background-color: $background-color;
|
15
|
-
|
16
|
-
.title {
|
15
|
+
|
16
|
+
.title {
|
17
17
|
color: $title-color;
|
18
18
|
margin-bottom: 15px;
|
19
19
|
}
|
@@ -29,5 +29,5 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);
|
|
29
29
|
.more-info {
|
30
30
|
color: $moreinfo-color;
|
31
31
|
}
|
32
|
-
|
33
|
-
}
|
32
|
+
|
33
|
+
}
|
@@ -11,7 +11,7 @@ $tick-color: rgba(0, 0, 0, 0.4);
|
|
11
11
|
// ----------------------------------------------------------------------------
|
12
12
|
// Widget-graph styles
|
13
13
|
// ----------------------------------------------------------------------------
|
14
|
-
.widget-graph {
|
14
|
+
.widget-graph {
|
15
15
|
|
16
16
|
background-color: $background-color;
|
17
17
|
position: relative;
|
@@ -30,7 +30,7 @@ $tick-color: rgba(0, 0, 0, 0.4);
|
|
30
30
|
z-index: 99;
|
31
31
|
}
|
32
32
|
|
33
|
-
.title {
|
33
|
+
.title {
|
34
34
|
color: $title-color;
|
35
35
|
}
|
36
36
|
|
@@ -51,7 +51,7 @@ $tick-color: rgba(0, 0, 0, 0.4);
|
|
51
51
|
padding-bottom: 3px;
|
52
52
|
}
|
53
53
|
}
|
54
|
-
|
54
|
+
|
55
55
|
.y_ticks {
|
56
56
|
font-size: 20px;
|
57
57
|
fill: $tick-color;
|
@@ -62,4 +62,4 @@ $tick-color: rgba(0, 0, 0, 0.4);
|
|
62
62
|
display: none;
|
63
63
|
}
|
64
64
|
|
65
|
-
}
|
65
|
+
}
|
@@ -6,4 +6,4 @@ class Dashing.Iframe extends Dashing.Widget
|
|
6
6
|
onData: (data) ->
|
7
7
|
# Handle incoming data
|
8
8
|
# You can access the html node of this widget with `@node`
|
9
|
-
# Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.
|
9
|
+
# Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.
|
@@ -1 +1 @@
|
|
1
|
-
<iframe data-bind-src="url" frameborder=0></iframe>
|
1
|
+
<iframe data-bind-src="url" frameborder=0></iframe>
|
@@ -6,4 +6,4 @@ class Dashing.Image extends Dashing.Widget
|
|
6
6
|
onData: (data) ->
|
7
7
|
# Handle incoming data
|
8
8
|
# You can access the html node of this widget with `@node`
|
9
|
-
# Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.
|
9
|
+
# Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.
|
@@ -1 +1 @@
|
|
1
|
-
<img data-bind-src="image | prepend '/assets'" data-bind-width="width"/>
|
1
|
+
<img data-bind-src="image | prepend '/assets'" data-bind-width="width"/>
|
@@ -6,8 +6,8 @@ $background-color: #4b4b4b;
|
|
6
6
|
// ----------------------------------------------------------------------------
|
7
7
|
// Widget-image styles
|
8
8
|
// ----------------------------------------------------------------------------
|
9
|
-
.widget-image {
|
9
|
+
.widget-image {
|
10
10
|
|
11
11
|
background-color: $background-color;
|
12
12
|
|
13
|
-
}
|
13
|
+
}
|
@@ -11,12 +11,12 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);
|
|
11
11
|
// ----------------------------------------------------------------------------
|
12
12
|
// Widget-list styles
|
13
13
|
// ----------------------------------------------------------------------------
|
14
|
-
.widget-list {
|
14
|
+
.widget-list {
|
15
15
|
|
16
16
|
background-color: $background-color;
|
17
17
|
vertical-align: top;
|
18
18
|
|
19
|
-
.title {
|
19
|
+
.title {
|
20
20
|
color: $title-color;
|
21
21
|
}
|
22
22
|
|
@@ -39,7 +39,7 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);
|
|
39
39
|
}
|
40
40
|
|
41
41
|
.label {
|
42
|
-
color: $label-color;
|
42
|
+
color: $label-color;
|
43
43
|
}
|
44
44
|
|
45
45
|
.value {
|
@@ -57,4 +57,4 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);
|
|
57
57
|
color: $moreinfo-color;
|
58
58
|
}
|
59
59
|
|
60
|
-
}
|
60
|
+
}
|
@@ -11,16 +11,16 @@ $meter-background: darken($background-color, 15%);
|
|
11
11
|
// ----------------------------------------------------------------------------
|
12
12
|
// Widget-meter styles
|
13
13
|
// ----------------------------------------------------------------------------
|
14
|
-
.widget-meter {
|
14
|
+
.widget-meter {
|
15
15
|
|
16
16
|
background-color: $background-color;
|
17
|
-
|
18
|
-
input.meter {
|
17
|
+
|
18
|
+
input.meter {
|
19
19
|
background-color: $meter-background;
|
20
20
|
color: #fff;
|
21
21
|
}
|
22
22
|
|
23
|
-
.title {
|
23
|
+
.title {
|
24
24
|
color: $title-color;
|
25
25
|
}
|
26
26
|
|
@@ -31,5 +31,5 @@ $meter-background: darken($background-color, 15%);
|
|
31
31
|
.updated-at {
|
32
32
|
color: rgba(0, 0, 0, 0.3);
|
33
33
|
}
|
34
|
-
|
35
|
-
}
|
34
|
+
|
35
|
+
}
|
@@ -10,11 +10,11 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);;
|
|
10
10
|
// ----------------------------------------------------------------------------
|
11
11
|
// Widget-number styles
|
12
12
|
// ----------------------------------------------------------------------------
|
13
|
-
.widget-number {
|
13
|
+
.widget-number {
|
14
14
|
|
15
15
|
background-color: $background-color;
|
16
|
-
|
17
|
-
.title {
|
16
|
+
|
17
|
+
.title {
|
18
18
|
color: $title-color;
|
19
19
|
}
|
20
20
|
|
@@ -35,5 +35,5 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);;
|
|
35
35
|
.updated-at {
|
36
36
|
color: rgba(0, 0, 0, 0.3);
|
37
37
|
}
|
38
|
-
|
39
|
-
}
|
38
|
+
|
39
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
class Dashing.Text extends Dashing.Widget
|
1
|
+
class Dashing.Text extends Dashing.Widget
|
@@ -9,11 +9,11 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);
|
|
9
9
|
// ----------------------------------------------------------------------------
|
10
10
|
// Widget-text styles
|
11
11
|
// ----------------------------------------------------------------------------
|
12
|
-
.widget-text {
|
12
|
+
.widget-text {
|
13
13
|
|
14
14
|
background-color: $background-color;
|
15
|
-
|
16
|
-
.title {
|
15
|
+
|
16
|
+
.title {
|
17
17
|
color: $title-color;
|
18
18
|
}
|
19
19
|
|
@@ -24,9 +24,9 @@ $moreinfo-color: rgba(255, 255, 255, 0.7);
|
|
24
24
|
.updated-at {
|
25
25
|
color: rgba(255, 255, 255, 0.7);
|
26
26
|
}
|
27
|
-
|
27
|
+
|
28
28
|
|
29
29
|
&.large h3 {
|
30
30
|
font-size: 65px;
|
31
31
|
}
|
32
|
-
}
|
32
|
+
}
|
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:
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-10-30 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sass
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: coffee-script
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: sinatra
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: sinatra-contrib
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: thin
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :runtime
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: rufus-scheduler
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,10 +101,15 @@ dependencies:
|
|
76
101
|
version: '0'
|
77
102
|
type: :runtime
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
80
110
|
- !ruby/object:Gem::Dependency
|
81
111
|
name: thor
|
82
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
83
113
|
none: false
|
84
114
|
requirements:
|
85
115
|
- - ! '>='
|
@@ -87,10 +117,15 @@ dependencies:
|
|
87
117
|
version: '0'
|
88
118
|
type: :runtime
|
89
119
|
prerelease: false
|
90
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
91
126
|
- !ruby/object:Gem::Dependency
|
92
127
|
name: sprockets
|
93
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
94
129
|
none: false
|
95
130
|
requirements:
|
96
131
|
- - ! '>='
|
@@ -98,7 +133,12 @@ dependencies:
|
|
98
133
|
version: '0'
|
99
134
|
type: :runtime
|
100
135
|
prerelease: false
|
101
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
102
142
|
description: This framework lets you build & easily layout dashboards with your own
|
103
143
|
custom widgets. Use it to make a status boards for your ops team, or use it to track
|
104
144
|
signups, conversion rates, or whatever else metrics you'd like to see in one spot.
|
@@ -177,8 +217,7 @@ files:
|
|
177
217
|
- templates/widget/%name%/%name%.scss.tt
|
178
218
|
- templates/project/lib/.empty_directory
|
179
219
|
- lib/dashing.rb
|
180
|
-
-
|
181
|
-
YmluL2Rhc2hpbmc=
|
220
|
+
- bin/dashing
|
182
221
|
homepage: http://shopify.github.com/dashing
|
183
222
|
licenses: []
|
184
223
|
post_install_message:
|
@@ -199,8 +238,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
238
|
version: '0'
|
200
239
|
requirements: []
|
201
240
|
rubyforge_project:
|
202
|
-
rubygems_version: 1.8.
|
241
|
+
rubygems_version: 1.8.23
|
203
242
|
signing_key:
|
204
243
|
specification_version: 3
|
205
244
|
summary: The exceptionally handsome dashboard framework.
|
206
245
|
test_files: []
|
246
|
+
has_rdoc:
|