chef-server-webui 0.9.18 → 0.10.0.beta.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.
Files changed (68) hide show
  1. data/README.rdoc +0 -4
  2. data/Rakefile +10 -0
  3. data/app/controllers/application.rb +34 -6
  4. data/app/controllers/cookbooks.rb +125 -35
  5. data/app/controllers/environments.rb +235 -0
  6. data/app/controllers/nodes.rb +26 -19
  7. data/app/controllers/roles.rb +37 -44
  8. data/app/controllers/search.rb +13 -13
  9. data/app/helpers/application_helper.rb +34 -0
  10. data/app/views/cookbooks/_cookbook_content.html.haml +7 -0
  11. data/app/views/cookbooks/index.html.haml +22 -7
  12. data/app/views/cookbooks/show.html.haml +8 -50
  13. data/app/views/environments/_form.html.erb +91 -0
  14. data/app/views/environments/_navigation.html.haml +9 -0
  15. data/app/views/environments/_version_selector.html.erb +8 -0
  16. data/app/views/environments/edit.html.erb +17 -0
  17. data/app/views/environments/index.html.haml +26 -0
  18. data/app/views/environments/new.html.erb +17 -0
  19. data/app/views/environments/show.html.haml +31 -0
  20. data/app/views/layout/application.html.haml +22 -13
  21. data/app/views/layout/login.html.haml +2 -2
  22. data/app/views/nodes/_form.html.erb +69 -0
  23. data/app/views/nodes/index.html.haml +6 -2
  24. data/app/views/nodes/show.html.haml +4 -1
  25. data/app/views/roles/_form.html.erb +92 -0
  26. data/app/views/roles/_run_lists.html.erb +26 -0
  27. data/app/views/roles/edit.html.haml +1 -1
  28. data/app/views/roles/new.html.haml +1 -1
  29. data/app/views/roles/show.html.haml +10 -7
  30. data/app/views/status/index.html.haml +2 -1
  31. data/bin/chef-server-webui +1 -0
  32. data/config/router.rb +14 -8
  33. data/lib/chef-server-webui/version.rb +1 -1
  34. data/public/javascripts/chef.js +206 -49
  35. data/public/javascripts/cookbook_constraint_ctrl.js +191 -0
  36. data/public/javascripts/cookbook_versions.js +75 -0
  37. data/public/javascripts/jquery-1.4.4.min.js +167 -0
  38. data/public/javascripts/jquery.suggest.js +250 -0
  39. data/public/stylesheets/base.css +30 -24
  40. data/public/stylesheets/chef.css +212 -45
  41. data/public/stylesheets/jquery.suggest.css +28 -0
  42. data/public/stylesheets/jsonedit_main.css +26 -10
  43. data/public/stylesheets/themes/djime-cerulean/style.css +31 -18
  44. metadata +22 -29
  45. data/app/controllers/cookbook_attributes.rb +0 -41
  46. data/app/controllers/cookbook_definitions.rb +0 -41
  47. data/app/controllers/cookbook_files.rb +0 -39
  48. data/app/controllers/cookbook_libraries.rb +0 -41
  49. data/app/controllers/cookbook_recipes.rb +0 -40
  50. data/app/controllers/cookbook_templates.rb +0 -57
  51. data/app/helpers/cookbook_attributes_helper.rb +0 -7
  52. data/app/helpers/cookbook_definitions_helper.rb +0 -8
  53. data/app/helpers/cookbook_files_helper.rb +0 -8
  54. data/app/helpers/cookbook_libraries_helper.rb +0 -7
  55. data/app/helpers/cookbook_recipes_helper.rb +0 -8
  56. data/app/helpers/cookbook_templates_helper.rb +0 -8
  57. data/app/helpers/exceptions_helper.rb +0 -6
  58. data/app/helpers/global_helpers.rb +0 -39
  59. data/app/helpers/nodes_helper.rb +0 -43
  60. data/app/helpers/openid_consumer_helper.rb +0 -8
  61. data/app/helpers/openid_register_helper.rb +0 -8
  62. data/app/helpers/openid_server_helper.rb +0 -6
  63. data/app/helpers/openid_server_helpers.rb +0 -32
  64. data/app/helpers/roles_helper.rb +0 -5
  65. data/app/helpers/search_entries_helper.rb +0 -8
  66. data/app/helpers/search_helper.rb +0 -44
  67. data/app/views/nodes/_form.html.haml +0 -52
  68. data/app/views/roles/_form.html.haml +0 -52
@@ -1,39 +0,0 @@
1
- #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Author:: Christopher Brown (<cb@opscode.com>)
4
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- require 'chef' / 'mixin' / 'checksum'
21
- require 'chef' / 'cookbook_loader'
22
- require 'chef' / 'mixin' / 'find_preferred_file'
23
-
24
- class CookbookFiles < Application
25
-
26
- provides :html
27
- before :login_required
28
-
29
- include Chef::Mixin::Checksum
30
- include Chef::Mixin::FindPreferredFile
31
-
32
- layout nil
33
-
34
- def index
35
- @remote_files = load_cookbook_files(params[:cookbook_id], :remote_file)
36
- render
37
- end
38
-
39
- end
@@ -1,41 +0,0 @@
1
- #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Author:: Christopher Brown (<cb@opscode.com>)
4
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- require 'chef' / 'mixin' / 'checksum'
21
- require 'chef' / 'cookbook_loader'
22
-
23
- class CookbookLibraries < Application
24
-
25
- provides :html
26
- before :login_required
27
-
28
- include Chef::Mixin::Checksum
29
-
30
- def load_cookbook_libs()
31
- @lib_files = load_cookbook_segment(params[:cookbook_id], :libraries)
32
- end
33
-
34
- def index
35
- load_cookbook_libs()
36
- render
37
- end
38
-
39
- end
40
-
41
-
@@ -1,40 +0,0 @@
1
- #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Author:: Christopher Brown (<cb@opscode.com>)
4
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- require 'chef' / 'mixin' / 'checksum'
21
-
22
- class CookbookRecipes < Application
23
-
24
- provides :html
25
- before :login_required
26
-
27
- include Chef::Mixin::Checksum
28
-
29
- def load_cookbook_recipes()
30
- @recipe_files = load_cookbook_segment(params[:cookbook_id], :recipes)
31
- end
32
-
33
- def index
34
- load_cookbook_recipes()
35
- render
36
- end
37
-
38
- end
39
-
40
-
@@ -1,57 +0,0 @@
1
- #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Author:: Christopher Brown (<cb@opscode.com>)
4
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- require 'chef' / 'mixin' / 'checksum'
21
- require 'chef' / 'cookbook_loader'
22
- require 'chef' / 'mixin' / 'find_preferred_file'
23
-
24
- class CookbookTemplates < Application
25
-
26
- provides :html
27
- before :login_required
28
-
29
- include Chef::Mixin::Checksum
30
- include Chef::Mixin::FindPreferredFile
31
-
32
- # def load_cookbook_templates()
33
- # @cl = Chef::CookbookLoader.new
34
- # @cookbook = @cl[params[:cookbook_id]]
35
- # raise NotFound unless @cookbook
36
- #
37
- # @templates = Hash.new
38
- # @cookbook.template_files.each do |tf|
39
- # full = File.expand_path(tf)
40
- # name = File.basename(full)
41
- # tf =~ /^.+#{params[:cookbook_id]}[\\|\/]templates[\\|\/](.+?)[\\|\/]#{name}/
42
- # singlecopy = $1
43
- # @templates[full] = {
44
- # :name => name,
45
- # :singlecopy => singlecopy,
46
- # :file => full,
47
- # }
48
- # end
49
- # @templates
50
- # end
51
-
52
- def index
53
- @templates = load_cookbook_files(params[:cookbook_id], :template)
54
- display @templates
55
- end
56
-
57
- end
@@ -1,7 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module CookbookAttributesHelper
4
-
5
- end
6
- end
7
- end # Merb
@@ -1,8 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module CookbookDefinitionsHelper
4
-
5
- end
6
-
7
- end
8
- end # Merb
@@ -1,8 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module CookbookFilesHelper
4
-
5
- end
6
-
7
- end
8
- end # Merb
@@ -1,7 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module CookbookLibrariesHelper
4
-
5
- end
6
- end
7
- end # Merb
@@ -1,8 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module CookbookRecipesHelper
4
-
5
- end
6
-
7
- end
8
- end # Merb
@@ -1,8 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module CookbookTemplatesHelper
4
-
5
- end
6
-
7
- end
8
- end # Merb
@@ -1,6 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module ExceptionsHelper
4
- end
5
- end
6
- end # Merb
@@ -1,39 +0,0 @@
1
- #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- # Possibly Dead Code. To revive it, move the GlobalHelpers module into the
20
- # Merb namespace
21
-
22
- # module Merb
23
- # module ChefServerWebui
24
- #
25
- # module GlobalHelpers
26
- # # helpers defined here available to all views.
27
- # def resource_collection(collection)
28
- # html = "<ul>"
29
- # collection.each do |resource|
30
- # html << "<li><b>#{resource.class}</b></li>"
31
- # end
32
- # html << "</ul>"
33
- # html
34
- # end
35
- #
36
- # end
37
- # end
38
- # end
39
- #
@@ -1,43 +0,0 @@
1
- #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Author:: AJ Christensen (<aj@junglist.gen.nz>)
4
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
18
- #
19
-
20
- # Possibly dead code. to revive it, move NodesHelper into the Merb namespace.
21
- # module Merb
22
- # module ChefServerWebui
23
- # module NodesHelper
24
- # def recipe_list(node)
25
- # response = ""
26
- # node.recipes.each do |recipe|
27
- # response << "<li>#{recipe}</li>\n"
28
- # end
29
- # response
30
- # end
31
- #
32
- # def attribute_list(node)
33
- # response = ""
34
- # node.each_attribute do |k,v|
35
- # response << "<li><b>#{k}</b>: #{v}</li>\n"
36
- # end
37
- # response
38
- # end
39
- #
40
- # end
41
- # end
42
- # end
43
- #
@@ -1,8 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module OpenidConsumerHelper
4
-
5
- end
6
- end
7
-
8
- end # Merb
@@ -1,8 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module OpenidRegisterHelper
4
-
5
- end
6
- end
7
-
8
- end # Merb
@@ -1,6 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module OpenidServerHelper
4
- end
5
- end
6
- end # Merb
@@ -1,32 +0,0 @@
1
- #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Copyright:: Copyright (c) 2008 Opscode, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- # possibly dead code.
20
-
21
- # module Merb
22
- # module ChefServerWebui
23
- # module OpenidServerHelper
24
- #
25
- # def url_for_user
26
- # url(:openid_node, :username => session[:username])
27
- # end
28
- #
29
- # end
30
- # end
31
- # end
32
- #
@@ -1,5 +0,0 @@
1
- module Merb
2
- module RolesHelper
3
-
4
- end
5
- end # Merb
@@ -1,8 +0,0 @@
1
- module Merb
2
- module ChefServerWebui
3
- module SearchEntriesHelper
4
-
5
- end
6
- end
7
-
8
- end # Merb
@@ -1,44 +0,0 @@
1
- # TODO: missing license header.
2
-
3
-
4
- # possibly dead code. to revive, move SearchHelper to the Merb namespace.
5
-
6
- # module Merb
7
- # module ChefServerWebui
8
- # module SearchHelper
9
- # def output_path(attributes)
10
- # res = Hash.new
11
- # attributes.each do |path|
12
- # parts = path.split("/")
13
- # unless parts[0].nil?
14
- # parts.shift if parts[0].length == 0
15
- # end
16
- # res[path] = ohai_walk(parts)
17
- # end
18
- # res
19
- # end
20
- #
21
- # def ohai_walk(path)
22
- # unless path[0]
23
- # @@ohai.to_json
24
- # else
25
- # ohai_walk_r(@@ohai, path)
26
- # end
27
- # end
28
- #
29
- # def ohai_walk_r(ohai, path)
30
- # hop = (ohai.is_a?(Array) ? path.shift.to_i : path.shift)
31
- # if ohai[hop]
32
- # if path[0]
33
- # ohai_walk_r(ohai[hop], path)
34
- # else
35
- # ohai[hop].to_json
36
- # end
37
- # else
38
- # nil
39
- # end
40
- # end
41
- # end
42
- # end
43
- # end # Merb
44
- #