visage-app 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
data/lib/visage-app.rb CHANGED
@@ -79,9 +79,9 @@ module Visage
79
79
 
80
80
  # /data/:host/:plugin/:optional_plugin_instance
81
81
  get %r{/data/([^/]+)/([^/]+)((/[^/]+)*)} do
82
- host = params[:captures][0]
83
- plugin = params[:captures][1]
84
- plugin_instances = params[:captures][2]
82
+ host = params[:captures][0].gsub("\0", "")
83
+ plugin = params[:captures][1].gsub("\0", "")
84
+ plugin_instances = params[:captures][2].gsub("\0", "")
85
85
 
86
86
  collectd = CollectdJSON.new(:rrddir => Visage::Config.rrddir,
87
87
  :fallback_colors => Visage::Config.fallback_colors)
@@ -96,7 +96,7 @@ module Visage
96
96
  end
97
97
 
98
98
  get %r{/data/([^/]+)} do
99
- host = params[:captures][0]
99
+ host = params[:captures][0].gsub("\0", "")
100
100
  metrics = Visage::Collectd::RRDs.metrics(:host => host)
101
101
 
102
102
  json = { host => metrics }.to_json
@@ -72,7 +72,7 @@ class CollectdJSON
72
72
  end
73
73
 
74
74
  # Sometimes the last value from the RRD is ridiculously large.
75
- metric[-1] = 0
75
+ metric.slice!(-1)
76
76
 
77
77
  color = color_for(:host => data[:host],
78
78
  :plugin => data[:plugin],
@@ -30,6 +30,14 @@ var visageBase = new Class({
30
30
  this.buildGraphHeader();
31
31
  this.buildGraphContainer();
32
32
  this.canvas = Raphael(this.graphContainer, this.options.width, this.options.height);
33
+ data = new Hash()
34
+ if($chk(this.options.start)) {
35
+ data.set('start', this.options.start)
36
+ }
37
+ if($chk(this.options.finish)) {
38
+ data.set('finish', this.options.finish)
39
+ }
40
+ this.requestData = data
33
41
  this.getData(); // calls graphData
34
42
  },
35
43
  dataURL: function() {
@@ -46,15 +54,7 @@ var visageBase = new Class({
46
54
  if (!url[0].match(/http\:\/\//)) {
47
55
  url[0] = '/' + url[0]
48
56
  }
49
- var timeRange = []
50
- // If a start time has been given
51
- if ($chk(this.options.start)) {
52
- timeRange.push('start=' + this.options.start)
53
- }
54
- if ($chk(this.options.finish)) {
55
- timeRange.push('finish=' + this.options.finish)
56
- }
57
- return [url.join('/'), timeRange.join('&')].join('?')
57
+ return url.join('/')
58
58
  },
59
59
  getData: function() {
60
60
  this.request = new Request.JSONP({
@@ -384,7 +384,6 @@ var visageGraph = new Class({
384
384
 
385
385
  var container = $(this.timescaleContainer);
386
386
  var form = new Element('form', {
387
- 'action': this.dataURL(),
388
387
  'method': 'get',
389
388
  'events': {
390
389
  'submit': function(e, foo) {
@@ -506,7 +506,6 @@ Raphael = (function () {
506
506
  mx = 0,
507
507
  my = 0,
508
508
  start = 0;
509
- console.log(pathArray)
510
509
  if (pathArray[0][0] == "M") {
511
510
  x = +pathArray[0][1];
512
511
  y = +pathArray[0][2];
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 3
9
- version: 0.2.3
8
+ - 4
9
+ version: 0.2.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Lindsay Holmwood
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-15 00:00:00 +10:00
17
+ date: 2010-07-19 00:00:00 +10:00
18
18
  default_executable: visage
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency