riemann-dash 0.2.11 → 0.2.12

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -31,6 +31,11 @@ set :bind, "1.2.3.4" # Bind to a different interface
31
31
  config[:ws_config] = 'custom/config.json' # Specify custom workspace config
32
32
  ```
33
33
 
34
+ You can also specify the default config file to be used by setting the
35
+ `RIEMANN_DASH_CONFIG` environment variable. If set, this value will override
36
+ the default config file location of `config.rb` when no config file is passed
37
+ on the command line.
38
+
34
39
  Putting in production
35
40
  =====================
36
41
 
@@ -17,7 +17,7 @@ module Riemann
17
17
  end
18
18
 
19
19
  def self.load(filename)
20
- filename ||= 'config.rb'
20
+ filename ||= ENV['RIEMANN_DASH_CONFIG'] || 'config.rb'
21
21
  unless config.load_config(filename)
22
22
  # Configuration failed; load a default view.
23
23
  puts "No configuration loaded; using defaults."
@@ -10,7 +10,7 @@
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. To display the configuration, press c.</p>" +
12
12
  "<p>You can refresh the page, or press r to reload.</p>" +
13
- "<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>" +
13
+ "<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 or press d.</p>" +
14
14
  "<p>Switch between workspaces with alt-1, alt-2, etc.</p>" +
15
15
  "<p>View is an empty space. Title is an editable text title. Fullscreen and Balloon are top-level container views; you probably won't use them. HStack and VStack are the horizontal and vertical container views; they're implicitly created by splits, but you can create them yourself for fine control. Gauge shows a single event. Grid shows a table of events. Timeseries and Flot show metrics over time--Timeseries is deprecated; Flot will probably replace it.</p>" +
16
16
  "<p>My sincere apologies for layout jankiness. There are a few gross bugs and incapabilities in the current hstack/vstack system; if things get really bad, you can always edit ws/config.json on the server. The control scheme will probably change; I appreciate your ideas and patches.</p>" +
@@ -0,0 +1,45 @@
1
+ (function() {
2
+ var iframe = function(json) {
3
+ view.View.call(this, json);
4
+ this.title = json.title;
5
+ this.url = json.url;
6
+ this.clickFocusable = true;
7
+ this.el.addClass("iframe");
8
+ this.h2 = $('<h2/>');
9
+ this.el.append(this.h2);
10
+ this.h2.text(this.title);
11
+ this.iframe = $('<iframe />');
12
+ this.iframe.addClass('container').addClass('quickfit');
13
+ this.iframe.attr('src', this.url);
14
+ this.el.append(this.iframe);
15
+ this.reflow();
16
+ }
17
+
18
+ view.inherit(view.View, iframe);
19
+ view.iframe = iframe;
20
+ view.types.iframe = iframe;
21
+
22
+ iframe.prototype.json = function() {
23
+ return $.extend(view.View.prototype.json.call(this), {
24
+ type: 'iframe',
25
+ title: this.title,
26
+ url: this.url
27
+ });
28
+ }
29
+
30
+ var editTemplate = _.template(
31
+ '<label for="title">Title</label>' +
32
+ '<input type="title" name="title" value="{{title}}" /><br />' +
33
+ '<label for="title">URL</label>' +
34
+ '<input type="text" name="url" value="{{url}}" />'
35
+ );
36
+
37
+ iframe.prototype.editForm = function() {
38
+ return editTemplate(this);
39
+ }
40
+
41
+ iframe.prototype.reflow = function() {
42
+ this.iframe.height(this.el.innerHeight() - this.h2.height())
43
+ this.iframe.width(this.width())
44
+ }
45
+ })();
@@ -1,4 +1,4 @@
1
1
  module Riemann; end
2
2
  module Riemann::Dash
3
- VERSION = '0.2.11'
3
+ VERSION = '0.2.12'
4
4
  end
@@ -57,6 +57,7 @@
57
57
  <script src="views/gauge.js"></script>
58
58
  <script src="views/dial.js"></script>
59
59
  <script src="views/grid.js"></script>
60
+ <script src="views/iframe.js"></script>
60
61
  <script src="dash.js"></script>
61
62
 
62
63
  <script>dash.reload()</script>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-dash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-03 00:00:00.000000000 Z
12
+ date: 2015-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubis
@@ -178,6 +178,7 @@ files:
178
178
  - lib/riemann/dash/public/views/gauge.js
179
179
  - lib/riemann/dash/public/views/grid.js
180
180
  - lib/riemann/dash/public/views/help.js
181
+ - lib/riemann/dash/public/views/iframe.js
181
182
  - lib/riemann/dash/public/views/list.js
182
183
  - lib/riemann/dash/public/views/log.js
183
184
  - lib/riemann/dash/public/views/timeseries.js