riemann-dash 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  this.el.append('<div class="box">' +
7
7
  "<p>Welcome to Riemann-Dash.</p>" +
8
8
  "<p>Need a refresher on the query language? See the <a href=\"https://github.com/aphyr/riemann/blob/master/test/riemann/query_test.clj\">query tests</a> for examples, or read the <a href=\"https://github.com/aphyr/riemann/blob/master/src/riemann/Query.g\">spec</a>.</p>" +
9
- "<p>Click to select a view. Escape unfocuses. Use the arrow keys to move a view. Use Control+arrow to <i>split</i> a view in the given direction.</p>" +
9
+ "<p>Press <b>Control/Meta+click</b> to select a view. Escape unfocuses. Use the arrow keys to move a view. Use Control+arrow to <i>split</i> a view in the given direction.</p>" +
10
10
  "<p>To edit a view, hit e. Use enter, or click 'apply', to apply your changes. Escape cancels.</p>" +
11
11
  "<p>To save your changes to the server, press s. You can refresh the page, or press r to reload.</p>" +
12
12
  "<p>Make views bigger and smaller with the +/- keys. Pageup selects the parent of the current view. To delete a view, use the delete key.</p>" +
@@ -0,0 +1,73 @@
1
+ (function() {
2
+ var List = function(json) {
3
+ view.View.call(this, json);
4
+ this.query = json.query;
5
+ this.title = json.title;
6
+ this.el.addClass('list');
7
+ this.el.append(
8
+ '<h2 class="quickfit"></h2>' +
9
+ '<ul></ul>'
10
+ );
11
+
12
+ this.ul = this.el.find('ul');
13
+ this.el.find('h2').text(this.title);
14
+
15
+ this.events = {};
16
+
17
+ if (this.query) {
18
+ var me = this;
19
+ this.sub = subs.subscribe(this.query, function(e) {
20
+ me.update.call(me, e);
21
+ });
22
+ }
23
+ }
24
+
25
+ view.inherit(view.View, List);
26
+ view.List = List;
27
+ view.types.List = List;
28
+
29
+ List.prototype.json = function() {
30
+ return $.extend(view.View.prototype.json.call(this), {
31
+ type: 'List',
32
+ title: this.title,
33
+ query: this.query
34
+ });
35
+ }
36
+
37
+ var editTemplate = _.template(
38
+ "<label for='title'>Title</label>" +
39
+ "<input type='text' name='title' value='{{title}}' /><br />" +
40
+ "<label for='query'>Query</label>" +
41
+ '<textarea type="text" name="query" class="query">{{query}}</textarea>');
42
+
43
+ List.prototype.editForm = function() {
44
+ return editTemplate(this);
45
+ }
46
+
47
+ List.prototype.reflow = function() {
48
+ }
49
+
50
+ List.prototype.delete = function() {
51
+ if (this.sub) {
52
+ subs.unsubscribe(this.sub);
53
+ }
54
+ view.View.prototype.delete.call(this);
55
+ }
56
+
57
+ List.prototype.update = function(e) {
58
+ var key = [e.host, e.service];
59
+ if (e.state == "expired") {
60
+ delete this.events[key];
61
+ } else {
62
+ this.events[key] = e;
63
+ }
64
+ this.ul.empty();
65
+ for (var row in this.events) {
66
+ var e = this.events[row];
67
+ var li = $('<li>' + e.host + " " + e.service + '</li>');
68
+ li.attr('class', "state " + e.state);
69
+ li.attr('title', e.description);
70
+ this.ul.append(li);
71
+ }
72
+ }
73
+ })();
@@ -76,6 +76,9 @@
76
76
  // Accept events from a subscription and update the log.
77
77
  LogView.prototype.update = function(event) {
78
78
  this.log.append(this.lineTemplate(event));
79
+ while (this.log[0].children.length > this.lines) {
80
+ this.log[0].deleteRow(0);
81
+ }
79
82
  if (this.tracking) { this.scrollToBottom(); };
80
83
  };
81
84
 
@@ -1,4 +1,4 @@
1
1
  module Riemann; end
2
2
  module Riemann::Dash
3
- VERSION = '0.2.8'
3
+ VERSION = '0.2.9'
4
4
  end
@@ -8,9 +8,10 @@ $amber: #FFC712;
8
8
  $light-blue: #2CCCFE;
9
9
  $blue: #2C55FF;
10
10
  $dark-grey: #1F1F1F;
11
+ $grey: #888;
11
12
  $light-grey: #ccc;
12
13
  $off-white: #dedede;
13
- $grey: #888;
14
+ $cream: #f6f6f6;
14
15
  $green: #06FA23;
15
16
  $yellow: #FEF206;
16
17
 
@@ -128,6 +129,54 @@ html,table {
128
129
  }
129
130
  }
130
131
 
132
+ #event-pane {
133
+ position: absolute;
134
+ left: 0;
135
+ right: 0;
136
+ bottom: 0;
137
+ height: auto;
138
+ max-height: 30%;
139
+ overflow-y: auto;
140
+ z-index: 100;
141
+ background: #fff;
142
+ border-top: 1px solid $off-white;
143
+ padding: 3px;
144
+
145
+ &.active {
146
+ box-shadow: 0 0 40px rgba(0,0,0,0.2);
147
+ }
148
+
149
+ * {
150
+ float: left;
151
+ padding: 3px;
152
+ }
153
+
154
+ .state {
155
+ margin: 0 3px;
156
+ padding: 3px 6px;
157
+ border-radius: 3px;
158
+ }
159
+
160
+ .host {
161
+ font-style: italic;
162
+ }
163
+
164
+ .ttl:before {
165
+ color: $grey;
166
+ content: 'ttl ';
167
+ }
168
+
169
+ .tags:before {
170
+ color: $grey;
171
+ content: "tags: ";
172
+ }
173
+
174
+ .description {
175
+ clear: both;
176
+ white-space: pre-wrap;
177
+ }
178
+ }
179
+
131
180
  #view {
132
181
  position: absolute;
133
182
  left: 3px;
@@ -336,6 +385,16 @@ h2 {
336
385
  }
337
386
  }
338
387
 
388
+ .list {
389
+ ul {
390
+ display: inline-block;
391
+ position: relative;
392
+ }
393
+ ul li {
394
+ background: #cacaca;
395
+ }
396
+ }
397
+
339
398
  .grid {
340
399
  white-space: nowrap;
341
400
 
@@ -9,6 +9,7 @@
9
9
  <body>
10
10
  <div id="toolbar"></div>
11
11
  <div id="view"></div>
12
+ <div id="event-pane"></div>
12
13
 
13
14
  <!-- begin third party dependencies -->
14
15
  <script src="vendor/smoothie.js"></script>
@@ -43,11 +44,13 @@
43
44
  <script src="keys.js"></script>
44
45
  <script src="subs.js"></script>
45
46
  <script src="toolbar.js"></script>
47
+ <script src="eventPane.js"></script>
46
48
  <script src="view.js"></script>
47
49
  <script src="views/timeseries.js"></script>
48
50
  <script src="views/flot.js"></script>
49
51
  <script src="views/title.js"></script>
50
52
  <script src="views/log.js"></script>
53
+ <script src="views/list.js"></script>
51
54
  <script src="views/help.js"></script>
52
55
  <script src="views/gauge.js"></script>
53
56
  <script src="views/grid.js"></script>
data/riemann-dash.gemspec CHANGED
@@ -15,11 +15,10 @@ Gem::Specification.new do |gem|
15
15
  gem.homepage = 'https://github.com/aphyr/riemann-dash'
16
16
  gem.platform = Gem::Platform::RUBY
17
17
 
18
- gem.add_dependency 'riemann-client', '>= 0.0.7'
19
18
  gem.add_dependency 'erubis', '>= 2.7.0'
20
- gem.add_dependency 'sinatra', '>= 1.3.2'
19
+ gem.add_dependency 'sinatra', '~> 1.4.5'
21
20
  gem.add_dependency 'sass', '>= 3.1.14'
22
- gem.add_dependency 'thin', '>= 1.3.1'
21
+ gem.add_dependency 'webrick', '~> 1.3.1'
23
22
  gem.add_dependency 'multi_json', '1.3.6'
24
23
  gem.files = `git ls-files`.split($/)
25
24
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-dash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kingsbury
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-24 00:00:00.000000000 Z
11
+ date: 2014-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: riemann-client
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 0.0.7
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: 0.0.7
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: erubis
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -42,16 +28,16 @@ dependencies:
42
28
  name: sinatra
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
- - - '>='
31
+ - - ~>
46
32
  - !ruby/object:Gem::Version
47
- version: 1.3.2
33
+ version: 1.4.5
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
- - - '>='
38
+ - - ~>
53
39
  - !ruby/object:Gem::Version
54
- version: 1.3.2
40
+ version: 1.4.5
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: sass
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -67,17 +53,17 @@ dependencies:
67
53
  - !ruby/object:Gem::Version
68
54
  version: 3.1.14
69
55
  - !ruby/object:Gem::Dependency
70
- name: thin
56
+ name: webrick
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - '>='
59
+ - - ~>
74
60
  - !ruby/object:Gem::Version
75
61
  version: 1.3.1
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - '>='
66
+ - - ~>
81
67
  - !ruby/object:Gem::Version
82
68
  version: 1.3.1
83
69
  - !ruby/object:Gem::Dependency
@@ -112,11 +98,15 @@ files:
112
98
  - example/config.rb
113
99
  - lib/riemann/dash.rb
114
100
  - lib/riemann/dash/app.rb
101
+ - lib/riemann/dash/browser_config.rb
102
+ - lib/riemann/dash/browser_config/file.rb
103
+ - lib/riemann/dash/browser_config/s3.rb
115
104
  - lib/riemann/dash/config.rb
116
105
  - lib/riemann/dash/controller/css.rb
117
106
  - lib/riemann/dash/controller/index.rb
118
107
  - lib/riemann/dash/public/clock.js
119
108
  - lib/riemann/dash/public/dash.js
109
+ - lib/riemann/dash/public/eventPane.js
120
110
  - lib/riemann/dash/public/format.js
121
111
  - lib/riemann/dash/public/keys.js
122
112
  - lib/riemann/dash/public/persistence.js
@@ -172,6 +162,7 @@ files:
172
162
  - lib/riemann/dash/public/views/gauge.js
173
163
  - lib/riemann/dash/public/views/grid.js
174
164
  - lib/riemann/dash/public/views/help.js
165
+ - lib/riemann/dash/public/views/list.js
175
166
  - lib/riemann/dash/public/views/log.js
176
167
  - lib/riemann/dash/public/views/timeseries.js
177
168
  - lib/riemann/dash/public/views/title.js
@@ -210,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
201
  version: '0'
211
202
  requirements: []
212
203
  rubyforge_project: riemann-dash
213
- rubygems_version: 2.1.11
204
+ rubygems_version: 2.0.14
214
205
  signing_key:
215
206
  specification_version: 4
216
207
  summary: HTTP dashboard for the distributed event system Riemann.