oxidized-web 0.4.0 → 0.5.0
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.
Potentially problematic release.
This version of oxidized-web might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +18 -0
- data/lib/oxidized/web/views/conf_search.haml +43 -0
- data/lib/oxidized/web/views/node.haml +7 -0
- data/lib/oxidized/web/views/nodes.haml +8 -0
- data/lib/oxidized/web/views/sass/oxidized.sass +3 -0
- data/lib/oxidized/web/views/versions.haml +8 -2
- data/lib/oxidized/web/webapp.rb +27 -6
- data/oxidized-web.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d6d01a9cc5ccc9c98d97a28166667c205f32286
|
4
|
+
data.tar.gz: 4a87180d8b75f7c94a1d5135296e31e60bd2ab97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56238ef9618517581efbdb29d9309ab02cf6d41210f1511c147bf6d33224a019fe2508b08cd35cf9eea31bcae203f47a3a59232e2d4fa8cd2c707d7e26b85002
|
7
|
+
data.tar.gz: 9cd62137cd2ce3b23302de68d3ae750829abca616bc469df3c18db14c8c3d8e68e22d110ba6ef104502e9790459e75b3c6f5533d39ec4b89c178ec3f2dd9c330
|
data/README.md
CHANGED
@@ -3,3 +3,21 @@
|
|
3
3
|
Web userinterface and RESTful API for Oxidized.
|
4
4
|
|
5
5
|
This is not useful independently, see https://github.com/ytti/oxidized for install instructions
|
6
|
+
|
7
|
+
# License and Copyright
|
8
|
+
|
9
|
+
Copyright 2013-2015 Saku Ytti <saku@ytti.fi>
|
10
|
+
2013-2015 Samer Abdel-Hafez <sam@arahant.net>
|
11
|
+
|
12
|
+
|
13
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
14
|
+
you may not use this file except in compliance with the License.
|
15
|
+
You may obtain a copy of the License at
|
16
|
+
|
17
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
18
|
+
|
19
|
+
Unless required by applicable law or agreed to in writing, software
|
20
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
21
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
22
|
+
See the License for the specific language governing permissions and
|
23
|
+
limitations under the License.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
%script{:src=>url_for('/scripts/jquery-2.1.1.min.js')}
|
2
|
+
%script{:src=>url_for('/scripts/jquery.dataTables.min.js')}
|
3
|
+
%script{:src=>url_for('/scripts/dataTables.bootstrap.js')}
|
4
|
+
%script{:src=>url_for('/scripts/dataTables.colVis.js')}
|
5
|
+
%link{:rel=>'stylesheet', :href=>url_for('/css/dataTables.bootstrap.css')}
|
6
|
+
%link{:rel=>'stylesheet', :href=>url_for('/css/dataTables.colVis.css')}
|
7
|
+
:javascript
|
8
|
+
$(function() {
|
9
|
+
$('#versionsTable').dataTable({
|
10
|
+
dom: 'C<"clear">lfrtip',
|
11
|
+
"order": [[ 0, "desc" ]]
|
12
|
+
});
|
13
|
+
});
|
14
|
+
%div{:class=>'row tbl-header'}
|
15
|
+
%div{:class=>'col-xs-12 '}
|
16
|
+
%h4
|
17
|
+
%a{:href=>url_for('/nodes')} nodes
|
18
|
+
\/ Nodes that contain
|
19
|
+
%span " #{@to_research} "
|
20
|
+
|
21
|
+
%div{:class=>'row'}
|
22
|
+
%div{:class=>'refresh-div'}
|
23
|
+
%form
|
24
|
+
%button{:class => "ColVis_Button", :type => "button", :onclick => "history.go();"}
|
25
|
+
%span{:class=>"glyphicon glyphicon-repeat"}
|
26
|
+
Refresh
|
27
|
+
%table{:id=>'versionsTable', :class=>'table table-responsive tablesorter'}
|
28
|
+
%thead
|
29
|
+
%tr
|
30
|
+
%th Name
|
31
|
+
%th Configuration
|
32
|
+
|
33
|
+
%tbody
|
34
|
+
-trclass = %w(even odd)
|
35
|
+
- @nodes_match.each do |x|
|
36
|
+
%tr
|
37
|
+
%td
|
38
|
+
#{x[:node]}
|
39
|
+
%td
|
40
|
+
%a{:title => "configuration", :href => url_for("/node/fetch/#{x[:full_name]}") }
|
41
|
+
%span{:class=>'glyphicon glyphicon-cloud-download'}
|
42
|
+
|
43
|
+
|
@@ -4,6 +4,13 @@
|
|
4
4
|
%a{:href=>url_for('/nodes')} nodes
|
5
5
|
%span /
|
6
6
|
=@data[:name]
|
7
|
+
|
8
|
+
%a{:title => "configuration", :href => url_for("/node/fetch/#{@data[:full_name]}") }
|
9
|
+
%span{:class=>'glyphicon glyphicon-cloud-download', :style => "color: #000; font-size: 14px;"}
|
10
|
+
%a{:title => "versions", :href => url_for("/node/version?node_full=#{@data[:full_name]}") }
|
11
|
+
%img{:src=>url_for('/images/versioning_18px.png')}
|
12
|
+
%a{:title => "update", :href => url_for("/node/next/#{@data[:full_name]}") }
|
13
|
+
%span{:class=>'glyphicon glyphicon-repeat', :style => "color: #000; font-size: 14px;"}
|
7
14
|
-out='';PP.pp(@data,out)
|
8
15
|
%pre
|
9
16
|
= preserve "#{out}"
|
@@ -23,6 +23,12 @@
|
|
23
23
|
%h4 nodes /
|
24
24
|
%button{:onclick => "location.href='/migration'" }
|
25
25
|
%span migration
|
26
|
+
%form{ :action => "/nodes/conf_search", :method => "post"}
|
27
|
+
%div{:name => "to_search_in_config", :id => "to_search_in_config"}
|
28
|
+
%input{:type => "submit", :value => "Search in confs"}
|
29
|
+
%input{:type => "text", :name => "search_in_conf_textbox"}
|
30
|
+
|
31
|
+
|
26
32
|
%div{:class=>'row'}
|
27
33
|
%div{:class=>'refresh-div'}
|
28
34
|
%form
|
@@ -34,6 +40,7 @@
|
|
34
40
|
%tr
|
35
41
|
%th Name
|
36
42
|
%th IP
|
43
|
+
%th Model
|
37
44
|
%th Group
|
38
45
|
%th Last Status
|
39
46
|
%th Last Update
|
@@ -47,6 +54,7 @@
|
|
47
54
|
%td
|
48
55
|
%a{:href => url_for("/node/show/#{node[:name]}") } #{node[:name]}
|
49
56
|
%td= node[:ip]
|
57
|
+
%td= node[:model]
|
50
58
|
%td= node[:group]
|
51
59
|
%td
|
52
60
|
%div{:title=>node[:status], :class=>node[:status]}
|
@@ -9,8 +9,8 @@
|
|
9
9
|
$('#versionsTable').dataTable({
|
10
10
|
dom: 'C<"clear">lfrtip',
|
11
11
|
"order": [[ 0, "desc" ]],
|
12
|
-
|
13
|
-
|
12
|
+
columnDefs: [
|
13
|
+
{ visible: false, targets: [2, 3] }
|
14
14
|
}
|
15
15
|
});
|
16
16
|
});
|
@@ -32,6 +32,8 @@
|
|
32
32
|
%tr
|
33
33
|
%th Version
|
34
34
|
%th Dates
|
35
|
+
%th Author
|
36
|
+
%th Message
|
35
37
|
%th Actions
|
36
38
|
|
37
39
|
%tbody
|
@@ -43,6 +45,10 @@
|
|
43
45
|
#{nb -= 1}
|
44
46
|
%td
|
45
47
|
#{time_from_now x[:date]}
|
48
|
+
%td
|
49
|
+
#{x[:author][:name]}
|
50
|
+
%td
|
51
|
+
#{x[:message]}
|
46
52
|
%td
|
47
53
|
%a{:title => "configuration", :href => url_for("/node/version/view?node=#{@node}&group=#{@group}&oid=#{x[:oid]}&date=#{x[:date]}&num=#{nb}") }
|
48
54
|
%span{:class=>'glyphicon glyphicon-cloud-download'}
|
data/lib/oxidized/web/webapp.rb
CHANGED
@@ -4,7 +4,6 @@ require 'sinatra/url_for'
|
|
4
4
|
require 'haml'
|
5
5
|
require 'sass'
|
6
6
|
require 'pp'
|
7
|
-
require 'pp'
|
8
7
|
require 'oxidized/web/mig'
|
9
8
|
module Oxidized
|
10
9
|
module API
|
@@ -29,6 +28,20 @@ module Oxidized
|
|
29
28
|
end
|
30
29
|
out :nodes
|
31
30
|
end
|
31
|
+
|
32
|
+
post '/nodes/conf_search' do
|
33
|
+
@to_research = params[:search_in_conf_textbox]
|
34
|
+
nodes_list = nodes.list.map
|
35
|
+
@nodes_match = []
|
36
|
+
nodes_list.each do |n|
|
37
|
+
node, @json = route_parse n[:name]
|
38
|
+
config = nodes.fetch node, n[:group]
|
39
|
+
if config.include? @to_research
|
40
|
+
@nodes_match.push({:node => n[:name], :full_name => n[:full_name]})
|
41
|
+
end
|
42
|
+
end
|
43
|
+
out :conf_search
|
44
|
+
end
|
32
45
|
|
33
46
|
get '/nodes/stats.?:format?' do
|
34
47
|
@data = {}
|
@@ -117,7 +130,7 @@ module Oxidized
|
|
117
130
|
end
|
118
131
|
|
119
132
|
#show the lists of versions for a node
|
120
|
-
get '/node/version' do
|
133
|
+
get '/node/version.?:format?' do
|
121
134
|
@data = nil
|
122
135
|
@group = nil
|
123
136
|
@node = nil
|
@@ -135,7 +148,7 @@ module Oxidized
|
|
135
148
|
end
|
136
149
|
|
137
150
|
#show the blob of a version
|
138
|
-
get '/node/version/view' do
|
151
|
+
get '/node/version/view.?:format?' do
|
139
152
|
node, @json = route_parse :node
|
140
153
|
@info = {:node => node, :group => params[:group],:oid => params[:oid],:date => params[:date],:num => params[:num]}
|
141
154
|
@data = nodes.get_version node, @info[:group], @info[:oid]
|
@@ -188,8 +201,12 @@ module Oxidized
|
|
188
201
|
|
189
202
|
def out template=:default
|
190
203
|
if @json or params[:format] == 'json'
|
191
|
-
|
192
|
-
|
204
|
+
if @data.is_a?(String)
|
205
|
+
json @data.lines
|
206
|
+
else
|
207
|
+
json @data
|
208
|
+
end
|
209
|
+
elsif template == :text or params[:format] == 'text'
|
193
210
|
content_type :text
|
194
211
|
@data
|
195
212
|
else
|
@@ -203,7 +220,11 @@ module Oxidized
|
|
203
220
|
|
204
221
|
def route_parse param
|
205
222
|
json = false
|
206
|
-
|
223
|
+
if param.respond_to?(:to_str)
|
224
|
+
e = param.split '.'
|
225
|
+
else
|
226
|
+
e = params[param].split '.'
|
227
|
+
end
|
207
228
|
if e.last == 'json'
|
208
229
|
e.pop
|
209
230
|
json = true
|
data/oxidized-web.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oxidized-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saku Ytti
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oxidized
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/oxidized/web/public/scripts/jquery.dataTables.min.js
|
148
148
|
- lib/oxidized/web/public/scripts/jquery.min.js
|
149
149
|
- lib/oxidized/web/public/scripts/script-migration.js
|
150
|
+
- lib/oxidized/web/views/conf_search.haml
|
150
151
|
- lib/oxidized/web/views/default.haml
|
151
152
|
- lib/oxidized/web/views/diffs.haml
|
152
153
|
- lib/oxidized/web/views/head.haml
|
@@ -182,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
183
|
version: '0'
|
183
184
|
requirements: []
|
184
185
|
rubyforge_project: oxidized-web
|
185
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.2.2
|
186
187
|
signing_key:
|
187
188
|
specification_version: 4
|
188
189
|
summary: sinatra API + webUI for oxidized
|