pencil 0.2.8 → 0.2.9
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.rb +1 -1
- data/examples/pencil.yml +1 -1
- data/lib/dash.rb +3 -5
- data/lib/helpers.rb +2 -1
- data/lib/models/dashboard.rb +6 -1
- data/lib/views/dash-cluster-zoom.erb +1 -1
- data/lib/views/dash-cluster.erb +1 -1
- data/lib/views/dash-global-zoom.erb +1 -1
- data/lib/views/dash-global.erb +1 -1
- data/lib/views/layout.erb +3 -1
- data/lib/views/partials/cluster_switcher.erb +1 -1
- data/lib/views/partials/dash_switcher.erb +3 -1
- metadata +4 -4
data/VERSION.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
PENCIL_VERSION = "0.2.
|
1
|
+
PENCIL_VERSION = "0.2.9"
|
data/examples/pencil.yml
CHANGED
data/lib/dash.rb
CHANGED
@@ -133,13 +133,11 @@ module Dash
|
|
133
133
|
erb :host
|
134
134
|
end
|
135
135
|
|
136
|
-
# fixme make sure not to save shitty values for :start
|
137
|
-
# remove stime, etime
|
138
|
-
# there is definitely something wrong here
|
139
|
-
# disallow saving from, until
|
136
|
+
# fixme make sure not to save shitty values for :start
|
140
137
|
get '/saveprefs' do
|
141
138
|
puts 'saving prefs'
|
142
|
-
params.each do |k,v|
|
139
|
+
params.each do |k ,v|
|
140
|
+
next if [:etime, :stime, :duration].member?(k.to_sym)
|
143
141
|
session[k] = v unless v.empty?
|
144
142
|
end
|
145
143
|
redirect URI.parse(request.referrer).path
|
data/lib/helpers.rb
CHANGED
@@ -132,7 +132,8 @@ module Dash::Helpers
|
|
132
132
|
session.merge(opts).delete_if { |k,v| static_opts.member?(k) || v.empty? }
|
133
133
|
end
|
134
134
|
|
135
|
-
def cluster_switcher
|
135
|
+
def cluster_switcher(clusters)
|
136
|
+
@clusters = clusters
|
136
137
|
erb :'partials/cluster_switcher', :layout => false
|
137
138
|
end
|
138
139
|
|
data/lib/models/dashboard.rb
CHANGED
@@ -25,6 +25,7 @@ module Dash::Models
|
|
25
25
|
@graphs << g if g
|
26
26
|
end
|
27
27
|
|
28
|
+
@valid_hosts_table = {} # cache calls to get_valid_hosts
|
28
29
|
end
|
29
30
|
|
30
31
|
def clusters
|
@@ -45,12 +46,15 @@ module Dash::Models
|
|
45
46
|
end
|
46
47
|
|
47
48
|
def get_valid_hosts(graph, cluster=nil)
|
49
|
+
if @valid_hosts_table[[graph, cluster]]
|
50
|
+
return @valid_hosts_table[[graph, cluster]]
|
51
|
+
end
|
52
|
+
|
48
53
|
clusters = Set.new
|
49
54
|
if cluster
|
50
55
|
hosts = Host.find_by_cluster(cluster)
|
51
56
|
else
|
52
57
|
hosts = Host.all
|
53
|
-
hosts.each { |h| clusters << h.cluster }
|
54
58
|
end
|
55
59
|
|
56
60
|
# filter by what matches the graph definition
|
@@ -63,6 +67,7 @@ module Dash::Models
|
|
63
67
|
|
64
68
|
hosts.each { |h| clusters << h.cluster }
|
65
69
|
|
70
|
+
@valid_hosts_table[[graph, cluster]] = [hosts, clusters]
|
66
71
|
return hosts, clusters
|
67
72
|
end
|
68
73
|
|
data/lib/views/dash-cluster.erb
CHANGED
data/lib/views/dash-global.erb
CHANGED
data/lib/views/layout.erb
CHANGED
@@ -33,7 +33,9 @@
|
|
33
33
|
<% end %>
|
34
34
|
Dashboards: (<%= @cluster %>)
|
35
35
|
<br>
|
36
|
-
<% @dashboards.
|
36
|
+
<% @dashboards.select do |d|
|
37
|
+
@cluster == "global" || d.clusters.member?(@cluster)
|
38
|
+
end.sort.each do |dash| %>
|
37
39
|
<li><a href="<%= dash_link(dash, @cluster) %>"><%= dash["title"] %></a></li>
|
38
40
|
<% end %>
|
39
41
|
<br>
|
@@ -1,6 +1,8 @@
|
|
1
1
|
<span class="graphtitle">
|
2
2
|
dashboards:
|
3
|
-
<%= @dashboards.
|
3
|
+
<%= @dashboards.select do |d|
|
4
|
+
@cluster == "global" || d.clusters.member?(@cluster)
|
5
|
+
end.sort.collect do |d|
|
4
6
|
# this works unless you have a cluster with the same name as a dashboard
|
5
7
|
sub = append_query_string(request.path.sub(@dash.name, d.name))
|
6
8
|
@dash == d ? "#{d}" : "<a href=\"#{sub}\">#{d}</a>"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pencil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 9
|
10
|
+
version: 0.2.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pete Fritchman
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-08-
|
19
|
+
date: 2011-08-17 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: mongrel
|