ganglia_js_charts 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/ganglia_js_charts.gemspec +1 -1
- data/public/ganglia-js.js +9 -1
- data/public/index.html +3 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/ganglia_js_charts.gemspec
CHANGED
data/public/ganglia-js.js
CHANGED
@@ -6,16 +6,20 @@ Function.prototype.bind = function(object) {
|
|
6
6
|
};
|
7
7
|
|
8
8
|
var viewModel = {
|
9
|
+
graphTitle: ko.observable(""),
|
9
10
|
timeWindow: ko.observable("1.hour"),
|
11
|
+
|
10
12
|
clusters: ko.observableArray([]),
|
11
13
|
servers: ko.observableArray([]),
|
12
14
|
metrics: ko.observableArray([]),
|
13
15
|
selectedCluster: ko.observable(""),
|
14
16
|
selectedServer: ko.observable(""),
|
15
17
|
selectedMetric: ko.observable(""),
|
18
|
+
|
19
|
+
metricsLoading: ko.observable(false),
|
20
|
+
|
16
21
|
currentGraph: ko.observableArray([]),
|
17
22
|
savedGraphs: ko.observableArray([]),
|
18
|
-
graphTitle: ko.observable(""),
|
19
23
|
savingSavedGraphs: ko.observable(false),
|
20
24
|
selectSavedGraph: function(i) {
|
21
25
|
var graph = this.savedGraphs()[i];
|
@@ -67,8 +71,12 @@ var viewModel = {
|
|
67
71
|
var cluster = this.selectedCluster();
|
68
72
|
var server = this.selectedServer();
|
69
73
|
|
74
|
+
_.each(this.metrics(), function(m) { this.metrics.remove(m); }.bind(this));
|
75
|
+
|
76
|
+
this.metricsLoading(true);
|
70
77
|
$.getJSON("/" + cluster + "/" + server + "/metrics.json", function(data) {
|
71
78
|
$.each(data, function(i, e) { this.metrics.push(e); }.bind(this));
|
79
|
+
this.metricsLoading(false);
|
72
80
|
}.bind(this));
|
73
81
|
},
|
74
82
|
addToGraph: function() {
|
data/public/index.html
CHANGED
@@ -51,7 +51,7 @@
|
|
51
51
|
<div class="graphOptions">
|
52
52
|
<p>
|
53
53
|
${g.name}
|
54
|
-
<a href="#scale_${i}" data-bind="click: function() { viewModel.scale(i); }, style: { backgroundColor:
|
54
|
+
<a href="#scale_${i}" data-bind="click: function() { viewModel.scale(i); }, style: { backgroundColor: g.scale ? 'red' : '' }">scale to per minute</a>
|
55
55
|
<a href="#remove_${i}" data-bind="click: function() { viewModel.remove(i); }">remove</a>
|
56
56
|
</p>
|
57
57
|
</div>
|
@@ -69,7 +69,8 @@
|
|
69
69
|
</p>
|
70
70
|
<p style="float:left; margin-right: 10px;">
|
71
71
|
<label for="metric">Metric:</label>
|
72
|
-
<select name="metric" data-bind="options: metrics, value: selectedMetric"></select>
|
72
|
+
<select name="metric" data-bind="options: metrics, value: selectedMetric, visible: !metricsLoading()"></select>
|
73
|
+
<span data-bind="visible: metricsLoading"><img src="/ajax-loader.gif" /></span>
|
73
74
|
</p>
|
74
75
|
<p style="float:left">
|
75
76
|
<input type="button" value="Add to Graph" data-bind="click: addToGraph" />
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ganglia_js_charts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Golick
|