rtdi 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/README.md +9 -0
  2. data/bin/dashing +9 -0
  3. data/javascripts/batman.jquery.js +163 -0
  4. data/javascripts/batman.js +13680 -0
  5. data/javascripts/dashing.coffee +125 -0
  6. data/javascripts/es5-shim.js +1021 -0
  7. data/javascripts/jquery.js +4 -0
  8. data/lib/dashing.rb +6 -0
  9. data/lib/dashing/app.rb +178 -0
  10. data/lib/dashing/cli.rb +109 -0
  11. data/lib/dashing/downloader.rb +18 -0
  12. data/lib/rtdi.rb +6 -0
  13. data/lib/rtdi/socket.rb +39 -0
  14. data/lib/rtdi/start.rb +170 -0
  15. data/lib/rtdi/status.rb +476 -0
  16. data/templates/dashboard/%name%.erb.tt +7 -0
  17. data/templates/job/%name%.rb +4 -0
  18. data/templates/project/.gitignore +2 -0
  19. data/templates/project/Gemfile +7 -0
  20. data/templates/project/README.md +1 -0
  21. data/templates/project/assets/favicon.ico +0 -0
  22. data/templates/project/assets/fonts/fontawesome-webfont.eot +0 -0
  23. data/templates/project/assets/fonts/fontawesome-webfont.svg +255 -0
  24. data/templates/project/assets/fonts/fontawesome-webfont.ttf +0 -0
  25. data/templates/project/assets/fonts/fontawesome-webfont.woff +0 -0
  26. data/templates/project/assets/images/favicon.ico +0 -0
  27. data/templates/project/assets/images/itslogo.png +0 -0
  28. data/templates/project/assets/images/itslogoflur.png +0 -0
  29. data/templates/project/assets/images/itslogozi207.png +0 -0
  30. data/templates/project/assets/images/logo.png +0 -0
  31. data/templates/project/assets/javascripts/application.coffee +42 -0
  32. data/templates/project/assets/javascripts/cycleDashboard.coffee +523 -0
  33. data/templates/project/assets/javascripts/d3-3.2.8.js +5 -0
  34. data/templates/project/assets/javascripts/d3.v2.min.js +4 -0
  35. data/templates/project/assets/javascripts/dashing.gridster.coffee +37 -0
  36. data/templates/project/assets/javascripts/gridster/jquery.gridster.js +3263 -0
  37. data/templates/project/assets/javascripts/gridster/jquery.leanModal.min.js +5 -0
  38. data/templates/project/assets/javascripts/jquery.knob.js +646 -0
  39. data/templates/project/assets/javascripts/rickshaw-1.4.3.min.js +2 -0
  40. data/templates/project/assets/javascripts/rickshaw.min.js +3 -0
  41. data/templates/project/assets/javascripts/rickshaw.min.js.1 +3 -0
  42. data/templates/project/assets/javascripts/rickshaw.min.js.bak +2 -0
  43. data/templates/project/assets/stylesheets/application.scss +342 -0
  44. data/templates/project/assets/stylesheets/font-awesome.css +313 -0
  45. data/templates/project/assets/stylesheets/jquery.gridster.css +57 -0
  46. data/templates/project/config.ru +19 -0
  47. data/templates/project/dashboards/layout.erb +32 -0
  48. data/templates/project/dashboards/rtdi_sample.erb +31 -0
  49. data/templates/project/dashboards/sample.erb +25 -0
  50. data/templates/project/dashboards/sampletv.erb +56 -0
  51. data/templates/project/jobs/buzzwords.rb +9 -0
  52. data/templates/project/jobs/convergence.rb +14 -0
  53. data/templates/project/jobs/rtdi_sample.rb +16 -0
  54. data/templates/project/jobs/sample.rb +13 -0
  55. data/templates/project/lib/bsp.csv +16 -0
  56. data/templates/project/public/404.html +26 -0
  57. data/templates/project/public/favicon.ico +0 -0
  58. data/templates/project/widgets/clock/clock.coffee +18 -0
  59. data/templates/project/widgets/clock/clock.html +2 -0
  60. data/templates/project/widgets/clock/clock.scss +13 -0
  61. data/templates/project/widgets/comments/comments.coffee +24 -0
  62. data/templates/project/widgets/comments/comments.html +7 -0
  63. data/templates/project/widgets/comments/comments.scss +33 -0
  64. data/templates/project/widgets/graph/graph.coffee +36 -0
  65. data/templates/project/widgets/graph/graph.html +5 -0
  66. data/templates/project/widgets/graph/graph.scss +65 -0
  67. data/templates/project/widgets/iframe/iframe.coffee +9 -0
  68. data/templates/project/widgets/iframe/iframe.html +1 -0
  69. data/templates/project/widgets/iframe/iframe.scss +8 -0
  70. data/templates/project/widgets/image/image.coffee +9 -0
  71. data/templates/project/widgets/image/image.html +1 -0
  72. data/templates/project/widgets/image/image.scss +13 -0
  73. data/templates/project/widgets/list/list.coffee +34 -0
  74. data/templates/project/widgets/list/list.html +18 -0
  75. data/templates/project/widgets/list/list.scss +60 -0
  76. data/templates/project/widgets/meter/meter.coffee +14 -0
  77. data/templates/project/widgets/meter/meter.html +7 -0
  78. data/templates/project/widgets/meter/meter.scss +35 -0
  79. data/templates/project/widgets/number/number.coffee +24 -0
  80. data/templates/project/widgets/number/number.html +11 -0
  81. data/templates/project/widgets/number/number.scss +39 -0
  82. data/templates/project/widgets/text/text.coffee +1 -0
  83. data/templates/project/widgets/text/text.html +7 -0
  84. data/templates/project/widgets/text/text.scss +32 -0
  85. data/templates/widget/%name%/%name%.coffee.tt +9 -0
  86. data/templates/widget/%name%/%name%.html +1 -0
  87. data/templates/widget/%name%/%name%.scss.tt +3 -0
  88. metadata +392 -0
@@ -0,0 +1,36 @@
1
+ class Dashing.Graph extends Dashing.Widget
2
+
3
+ @accessor 'current', ->
4
+ return @get('displayedValue') if @get('displayedValue')
5
+ points = @get('points')
6
+ if points
7
+ points[points.length - 1].y
8
+
9
+ ready: ->
10
+ container = $(@node).parent()
11
+ # Gross hacks. Let's fix this.
12
+ width = (Dashing.widget_base_dimensions[0] * container.data("sizex")) + Dashing.widget_margins[0] * 2 * (container.data("sizex") - 1)
13
+ height = (Dashing.widget_base_dimensions[1] * container.data("sizey"))
14
+ @graph = new Rickshaw.Graph(
15
+ element: @node
16
+ width: width
17
+ height: height
18
+ renderer: @get("graphtype")
19
+ series: [
20
+ {
21
+ color: "#fff",
22
+ data: [{x:0, y:0}]
23
+ }
24
+ ]
25
+ )
26
+
27
+ @graph.series[0].data = @get('points') if @get('points')
28
+
29
+ x_axis = new Rickshaw.Graph.Axis.Time(graph: @graph)
30
+ y_axis = new Rickshaw.Graph.Axis.Y(graph: @graph, tickFormat: Rickshaw.Fixtures.Number.formatKMBT)
31
+ @graph.render()
32
+
33
+ onData: (data) ->
34
+ if @graph
35
+ @graph.series[0].data = data.points
36
+ @graph.render()
@@ -0,0 +1,5 @@
1
+ <h1 class="title" data-bind="title"></h1>
2
+
3
+ <h2 class="value" data-bind="current | prettyNumber | prepend prefix"></h2>
4
+
5
+ <p class="more-info" data-bind="moreinfo"></p>
@@ -0,0 +1,65 @@
1
+ // ----------------------------------------------------------------------------
2
+ // Sass declarations
3
+ // ----------------------------------------------------------------------------
4
+ $background-color: #dc5945;
5
+
6
+ $title-color: rgba(255, 255, 255, 0.7);
7
+ $moreinfo-color: rgba(255, 255, 255, 0.3);
8
+ $tick-color: rgba(0, 0, 0, 0.4);
9
+
10
+
11
+ // ----------------------------------------------------------------------------
12
+ // Widget-graph styles
13
+ // ----------------------------------------------------------------------------
14
+ .widget-graph {
15
+
16
+ background-color: $background-color;
17
+ position: relative;
18
+
19
+
20
+ svg {
21
+ position: absolute;
22
+ opacity: 0.4;
23
+ fill-opacity: 0.4;
24
+ left: 0px;
25
+ top: 0px;
26
+ }
27
+
28
+ .title, .value {
29
+ position: relative;
30
+ z-index: 99;
31
+ }
32
+
33
+ .title {
34
+ color: $title-color;
35
+ }
36
+
37
+ .more-info {
38
+ color: $moreinfo-color;
39
+ font-weight: 600;
40
+ font-size: 20px;
41
+ margin-top: 0;
42
+ }
43
+
44
+ .x_tick {
45
+ position: absolute;
46
+ bottom: 0;
47
+ .title {
48
+ font-size: 20px;
49
+ color: $tick-color;
50
+ opacity: 0.5;
51
+ padding-bottom: 3px;
52
+ }
53
+ }
54
+
55
+ .y_ticks {
56
+ font-size: 20px;
57
+ fill: $tick-color;
58
+ fill-opacity: 1;
59
+ }
60
+
61
+ .domain {
62
+ display: none;
63
+ }
64
+
65
+ }
@@ -0,0 +1,9 @@
1
+ class Dashing.Iframe extends Dashing.Widget
2
+
3
+ ready: ->
4
+ # This is fired when the widget is done being rendered
5
+
6
+ onData: (data) ->
7
+ # Handle incoming data
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.
@@ -0,0 +1 @@
1
+ <iframe data-bind-src="url" frameborder=0></iframe>
@@ -0,0 +1,8 @@
1
+ .widget-iframe {
2
+ padding: 3px 0px 0px 0px !important;
3
+
4
+ iframe {
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+ }
@@ -0,0 +1,9 @@
1
+ class Dashing.Image extends Dashing.Widget
2
+
3
+ ready: ->
4
+ # This is fired when the widget is done being rendered
5
+
6
+ onData: (data) ->
7
+ # Handle incoming data
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.
@@ -0,0 +1 @@
1
+ <img data-bind-src="image | prepend '/assets'" data-bind-width="width"/>
@@ -0,0 +1,13 @@
1
+ // ----------------------------------------------------------------------------
2
+ // Sass declarations
3
+ // ----------------------------------------------------------------------------
4
+ $background-color: #4b4b4b;
5
+
6
+ // ----------------------------------------------------------------------------
7
+ // Widget-image styles
8
+ // ----------------------------------------------------------------------------
9
+ .widget-image {
10
+
11
+ background-color: $background-color;
12
+
13
+ }
@@ -0,0 +1,34 @@
1
+ class Dashing.List extends Dashing.Widget
2
+ ready: ->
3
+ if @get('unordered')
4
+ $(@node).find('ol').remove()
5
+ else
6
+ $(@node).find('ul').remove()
7
+
8
+ onData: (data) ->
9
+ if data.status
10
+ # clear existing "status-*" classes
11
+ $(@get('node')).attr 'class', (i,c) ->
12
+ c.replace /\bstatus-\S+/g, ''
13
+ # add new class
14
+ $(@get('node')).addClass "status-#{data.status}"
15
+
16
+ seticon = (id, art) ->
17
+ $(".icon-" + id).remove().after "." + id
18
+ $("<i class=\"icon-" + art + " icon-background icon-" + id + "\"></i>").insertAfter "." + id
19
+ return
20
+ switch data.status
21
+ when "warningack"
22
+ seticon data.id, "cog"
23
+ when "criticalack"
24
+ seticon data.id, "cog"
25
+ when "unknownack"
26
+ seticon data.id, "cog"
27
+ when "normal"
28
+ seticon data.id, "ok"
29
+ when "unknown"
30
+ seticon data.id, "question-sign"
31
+ when "warning"
32
+ seticon data.id, "warning-sign"
33
+ when "danger"
34
+ seticon data.id, "remove"
@@ -0,0 +1,18 @@
1
+ <h1 class="title" data-bind="title"></h1>
2
+
3
+ <ol>
4
+ <li data-foreach-item="items">
5
+ <span class="label" data-bind="item.label"></span>
6
+ <span class="value" data-bind="item.value | raw"></span>
7
+ </li>
8
+ </ol>
9
+
10
+ <ul class="list-nostyle">
11
+ <li data-foreach-item="items">
12
+ <span class="label" data-bind="item.label"></span>
13
+ <span class="value" data-bind="item.value | raw"></span>
14
+ </li>
15
+ </ul>
16
+
17
+ <p class="more-info" data-bind="moreinfo"></p>
18
+ <p class="updated-at" data-bind="updatedAtMessage"></p>
@@ -0,0 +1,60 @@
1
+ // ----------------------------------------------------------------------------
2
+ // Sass declarations
3
+ // ----------------------------------------------------------------------------
4
+ $background-color: #12b554;
5
+ $value-color: #fff;
6
+
7
+ $title-color: rgba(255, 255, 255, 0.7);
8
+ $label-color: rgba(255, 255, 255, 0.7);
9
+ $moreinfo-color: rgba(255, 255, 255, 0.7);
10
+
11
+ // ----------------------------------------------------------------------------
12
+ // Widget-list styles
13
+ // ----------------------------------------------------------------------------
14
+ .widget-list {
15
+
16
+ background-color: $background-color;
17
+ vertical-align: top;
18
+
19
+ .title {
20
+ color: $title-color;
21
+ }
22
+
23
+ ol, ul {
24
+ margin: 0 15px;
25
+ text-align: left;
26
+ color: $label-color;
27
+ }
28
+
29
+ ol {
30
+ list-style-position: inside;
31
+ }
32
+
33
+ li {
34
+ margin-bottom: 5px;
35
+ }
36
+
37
+ .list-nostyle {
38
+ list-style: none;
39
+ }
40
+
41
+ .label {
42
+ color: $label-color;
43
+ }
44
+
45
+ .value {
46
+ float: right;
47
+ margin-left: 12px;
48
+ font-weight: 600;
49
+ color: $value-color;
50
+ }
51
+
52
+ .updated-at {
53
+ color: rgba(0, 0, 0, 0.3);
54
+ }
55
+
56
+ .more-info {
57
+ color: $moreinfo-color;
58
+ }
59
+
60
+ }
@@ -0,0 +1,14 @@
1
+ class Dashing.Meter extends Dashing.Widget
2
+
3
+ @accessor 'value', Dashing.AnimatedValue
4
+
5
+ constructor: ->
6
+ super
7
+ @observe 'value', (value) ->
8
+ $(@node).find(".meter").val(value).trigger('change')
9
+
10
+ ready: ->
11
+ meter = $(@node).find(".meter")
12
+ meter.attr("data-bgcolor", meter.css("background-color"))
13
+ meter.attr("data-fgcolor", meter.css("color"))
14
+ meter.knob()
@@ -0,0 +1,7 @@
1
+ <h1 class="title" data-bind="title"></h1>
2
+
3
+ <input class="meter" data-angleOffset=-125 data-angleArc=250 data-width=200 data-readOnly=true data-bind-value="value | shortenedNumber" data-bind-data-min="min" data-bind-data-max="max">
4
+
5
+ <p class="more-info" data-bind="moreinfo"></p>
6
+
7
+ <p class="updated-at" data-bind="updatedAtMessage"></p>
@@ -0,0 +1,35 @@
1
+ // ----------------------------------------------------------------------------
2
+ // Sass declarations
3
+ // ----------------------------------------------------------------------------
4
+ $background-color: #9c4274;
5
+
6
+ $title-color: rgba(255, 255, 255, 0.7);
7
+ $moreinfo-color: rgba(255, 255, 255, 0.3);
8
+
9
+ $meter-background: darken($background-color, 15%);
10
+
11
+ // ----------------------------------------------------------------------------
12
+ // Widget-meter styles
13
+ // ----------------------------------------------------------------------------
14
+ .widget-meter {
15
+
16
+ background-color: $background-color;
17
+
18
+ input.meter {
19
+ background-color: $meter-background;
20
+ color: #fff;
21
+ }
22
+
23
+ .title {
24
+ color: $title-color;
25
+ }
26
+
27
+ .more-info {
28
+ color: $moreinfo-color;
29
+ }
30
+
31
+ .updated-at {
32
+ color: rgba(0, 0, 0, 0.3);
33
+ }
34
+
35
+ }
@@ -0,0 +1,24 @@
1
+ class Dashing.Number extends Dashing.Widget
2
+ @accessor 'current', Dashing.AnimatedValue
3
+
4
+ @accessor 'difference', ->
5
+ if @get('last')
6
+ last = parseInt(@get('last'))
7
+ current = parseInt(@get('current'))
8
+ if last != 0
9
+ diff = Math.abs(Math.round((current - last) / last * 100))
10
+ "#{diff}%"
11
+ else
12
+ ""
13
+
14
+ @accessor 'arrow', ->
15
+ if @get('last')
16
+ if parseInt(@get('current')) > parseInt(@get('last')) then 'icon-arrow-up' else 'icon-arrow-down'
17
+
18
+ onData: (data) ->
19
+ if 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}"
@@ -0,0 +1,11 @@
1
+ <h1 class="title" data-bind="title"></h1>
2
+
3
+ <h2 class="value" data-bind="current | shortenedNumber | prepend prefix | append suffix"></h2>
4
+
5
+ <p class="change-rate">
6
+ <i data-bind-class="arrow"></i><span data-bind="difference"></span>
7
+ </p>
8
+
9
+ <p class="more-info" data-bind="moreinfo"></p>
10
+
11
+ <p class="updated-at" data-bind="updatedAtMessage"></p>
@@ -0,0 +1,39 @@
1
+ // ----------------------------------------------------------------------------
2
+ // Sass declarations
3
+ // ----------------------------------------------------------------------------
4
+ $background-color: #47bbb3;
5
+ $value-color: #fff;
6
+
7
+ $title-color: rgba(255, 255, 255, 0.7);
8
+ $moreinfo-color: rgba(255, 255, 255, 0.7);
9
+
10
+ // ----------------------------------------------------------------------------
11
+ // Widget-number styles
12
+ // ----------------------------------------------------------------------------
13
+ .widget-number {
14
+
15
+ background-color: $background-color;
16
+
17
+ .title {
18
+ color: $title-color;
19
+ }
20
+
21
+ .value {
22
+ color: $value-color;
23
+ }
24
+
25
+ .change-rate {
26
+ font-weight: 500;
27
+ font-size: 30px;
28
+ color: $value-color;
29
+ }
30
+
31
+ .more-info {
32
+ color: $moreinfo-color;
33
+ }
34
+
35
+ .updated-at {
36
+ color: rgba(0, 0, 0, 0.3);
37
+ }
38
+
39
+ }
@@ -0,0 +1 @@
1
+ class Dashing.Text extends Dashing.Widget
@@ -0,0 +1,7 @@
1
+ <h1 class="title" data-bind="title"></h1>
2
+
3
+ <h3 data-bind="text"></h3>
4
+
5
+ <p class="more-info" data-bind="moreinfo"></p>
6
+
7
+ <p class="updated-at" data-bind="updatedAtMessage"></p>
@@ -0,0 +1,32 @@
1
+ // ----------------------------------------------------------------------------
2
+ // Sass declarations
3
+ // ----------------------------------------------------------------------------
4
+ $background-color: #ec663c;
5
+
6
+ $title-color: rgba(255, 255, 255, 0.7);
7
+ $moreinfo-color: rgba(255, 255, 255, 0.7);
8
+
9
+ // ----------------------------------------------------------------------------
10
+ // Widget-text styles
11
+ // ----------------------------------------------------------------------------
12
+ .widget-text {
13
+
14
+ background-color: $background-color;
15
+
16
+ .title {
17
+ color: $title-color;
18
+ }
19
+
20
+ .more-info {
21
+ color: $moreinfo-color;
22
+ }
23
+
24
+ .updated-at {
25
+ color: rgba(255, 255, 255, 0.7);
26
+ }
27
+
28
+
29
+ &.large h3 {
30
+ font-size: 65px;
31
+ }
32
+ }