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 +1 -1
- data/lib/visage-app.rb +4 -4
- data/lib/visage/collectd/json.rb +1 -1
- data/lib/visage/public/javascripts/graph.js +9 -10
- data/lib/visage/public/javascripts/raphael.js +0 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
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
|
data/lib/visage/collectd/json.rb
CHANGED
@@ -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
|
-
|
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) {
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
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-
|
17
|
+
date: 2010-07-19 00:00:00 +10:00
|
18
18
|
default_executable: visage
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|