chef-server-slice 0.7.10
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +201 -0
- data/README.rdoc +135 -0
- data/app/controllers/application.rb +228 -0
- data/app/controllers/cookbook_attributes.rb +59 -0
- data/app/controllers/cookbook_definitions.rb +60 -0
- data/app/controllers/cookbook_files.rb +94 -0
- data/app/controllers/cookbook_libraries.rb +60 -0
- data/app/controllers/cookbook_recipes.rb +59 -0
- data/app/controllers/cookbook_templates.rb +80 -0
- data/app/controllers/cookbooks.rb +63 -0
- data/app/controllers/exceptions.rb +33 -0
- data/app/controllers/main.rb +7 -0
- data/app/controllers/nodes.rb +144 -0
- data/app/controllers/openid_consumer.rb +133 -0
- data/app/controllers/openid_register.rb +113 -0
- data/app/controllers/openid_server.rb +252 -0
- data/app/controllers/roles.rb +138 -0
- data/app/controllers/search.rb +58 -0
- data/app/controllers/search_entries.rb +73 -0
- data/app/controllers/status.rb +34 -0
- data/app/helpers/application_helper.rb +144 -0
- data/app/helpers/cookbook_attributes_helper.rb +7 -0
- data/app/helpers/cookbook_definitions_helper.rb +8 -0
- data/app/helpers/cookbook_files_helper.rb +8 -0
- data/app/helpers/cookbook_libraries_helper.rb +7 -0
- data/app/helpers/cookbook_recipes_helper.rb +8 -0
- data/app/helpers/cookbook_templates_helper.rb +8 -0
- data/app/helpers/cookbooks_helper.rb +31 -0
- data/app/helpers/exceptions_helper.rb +6 -0
- data/app/helpers/global_helpers.rb +39 -0
- data/app/helpers/nodes_helper.rb +33 -0
- data/app/helpers/openid_consumer_helper.rb +8 -0
- data/app/helpers/openid_register_helper.rb +8 -0
- data/app/helpers/openid_server_helper.rb +6 -0
- data/app/helpers/openid_server_helpers.rb +29 -0
- data/app/helpers/roles_helper.rb +5 -0
- data/app/helpers/search_entries_helper.rb +8 -0
- data/app/helpers/search_helper.rb +38 -0
- data/app/helpers/status_helper.rb +26 -0
- data/app/views/cookbook_templates/index.html.haml +7 -0
- data/app/views/cookbooks/index.html.haml +10 -0
- data/app/views/cookbooks/show.html.haml +40 -0
- data/app/views/exceptions/bad_request.json.erb +1 -0
- data/app/views/exceptions/internal_server_error.html.erb +216 -0
- data/app/views/exceptions/not_acceptable.html.erb +63 -0
- data/app/views/exceptions/not_found.html.erb +47 -0
- data/app/views/exceptions/standard_error.html.erb +217 -0
- data/app/views/layout/chef_server_slice.html.haml +53 -0
- data/app/views/layout/login.html.haml +37 -0
- data/app/views/main/index.html.erb +1 -0
- data/app/views/nodes/_action.html.haml +13 -0
- data/app/views/nodes/_form.html.haml +56 -0
- data/app/views/nodes/_navigation.html.haml +9 -0
- data/app/views/nodes/_resource.html.haml +22 -0
- data/app/views/nodes/edit.html.haml +7 -0
- data/app/views/nodes/index.html.haml +25 -0
- data/app/views/nodes/new.html.haml +6 -0
- data/app/views/nodes/show.html.haml +60 -0
- data/app/views/openid_consumer/index.html.haml +23 -0
- data/app/views/openid_consumer/start.html.haml +4 -0
- data/app/views/openid_login/index.html.haml +5 -0
- data/app/views/openid_register/index.html.haml +19 -0
- data/app/views/openid_register/show.html.haml +7 -0
- data/app/views/openid_server/decide.html.haml +27 -0
- data/app/views/roles/_form.html.haml +48 -0
- data/app/views/roles/_navigation.html.haml +9 -0
- data/app/views/roles/edit.html.haml +6 -0
- data/app/views/roles/index.html.haml +22 -0
- data/app/views/roles/new.html.haml +6 -0
- data/app/views/roles/show.html.haml +29 -0
- data/app/views/search/_search_form.html.haml +6 -0
- data/app/views/search/index.html.haml +9 -0
- data/app/views/search/show.html.haml +14 -0
- data/app/views/search_entries/index.html.haml +8 -0
- data/app/views/search_entries/show.html.haml +7 -0
- data/app/views/status/index.html.haml +88 -0
- data/config/init.rb +48 -0
- data/config/router.rb +6 -0
- data/lib/chef-server-slice.rb +150 -0
- data/lib/chef-server-slice/merbtasks.rb +103 -0
- data/lib/chef-server-slice/slicetasks.rb +20 -0
- data/lib/chef-server-slice/spectasks.rb +53 -0
- data/public/facebox/README.txt +4 -0
- data/public/facebox/b.png +0 -0
- data/public/facebox/bl.png +0 -0
- data/public/facebox/br.png +0 -0
- data/public/facebox/closelabel.gif +0 -0
- data/public/facebox/facebox.css +95 -0
- data/public/facebox/facebox.js +319 -0
- data/public/facebox/loading.gif +0 -0
- data/public/facebox/tl.png +0 -0
- data/public/facebox/tr.png +0 -0
- data/public/images/avatar.png +0 -0
- data/public/images/black_big.png +0 -0
- data/public/images/indicator.gif +0 -0
- data/public/images/merb.jpg +0 -0
- data/public/images/toggle-collapse-dark.png +0 -0
- data/public/images/toggle-collapse-light.png +0 -0
- data/public/images/toggle-collapse.gif +0 -0
- data/public/images/toggle-expand-dark.png +0 -0
- data/public/images/toggle-expand-light.png +0 -0
- data/public/images/toggle-expand.gif +0 -0
- data/public/images/treeBuilderImages/Thumbs.db +0 -0
- data/public/images/treeBuilderImages/doc.gif +0 -0
- data/public/images/treeBuilderImages/docNode.gif +0 -0
- data/public/images/treeBuilderImages/docNodeLast.gif +0 -0
- data/public/images/treeBuilderImages/docNodeLastFirst.gif +0 -0
- data/public/images/treeBuilderImages/folder.gif +0 -0
- data/public/images/treeBuilderImages/folderNode.gif +0 -0
- data/public/images/treeBuilderImages/folderNodeFirst.gif +0 -0
- data/public/images/treeBuilderImages/folderNodeLast.gif +0 -0
- data/public/images/treeBuilderImages/folderNodeLastFirst.gif +0 -0
- data/public/images/treeBuilderImages/folderNodeOpen.gif +0 -0
- data/public/images/treeBuilderImages/folderNodeOpenFirst.gif +0 -0
- data/public/images/treeBuilderImages/folderNodeOpenLast.gif +0 -0
- data/public/images/treeBuilderImages/folderNodeOpenLastFirst.gif +0 -0
- data/public/images/treeBuilderImages/folderOpen.gif +0 -0
- data/public/images/treeBuilderImages/vertLine.gif +0 -0
- data/public/javascripts/JSONeditor.js +1171 -0
- data/public/javascripts/chef.js +126 -0
- data/public/javascripts/jquery-1.3.2.min.js +19 -0
- data/public/javascripts/jquery-ui-1.7.1.custom.min.js +65 -0
- data/public/javascripts/jquery.editinline.js +108 -0
- data/public/javascripts/jquery.jeditable.mini.js +30 -0
- data/public/javascripts/jquery.livequery.js +250 -0
- data/public/javascripts/jquery.localscroll.js +104 -0
- data/public/javascripts/jquery.scrollTo.js +150 -0
- data/public/javascripts/jquery.tools.min.js +17 -0
- data/public/javascripts/jquery.treeTable.min.js +165 -0
- data/public/stylesheets/base.css +336 -0
- data/public/stylesheets/chef.css +157 -0
- data/public/stylesheets/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png +0 -0
- data/public/stylesheets/images/ui-bg_diagonals-thick_15_444444_40x40.png +0 -0
- data/public/stylesheets/images/ui-bg_glass_100_f0f0f0_1x400.png +0 -0
- data/public/stylesheets/images/ui-bg_glass_50_99c2ff_1x400.png +0 -0
- data/public/stylesheets/images/ui-bg_glass_55_fbf5d0_1x400.png +0 -0
- data/public/stylesheets/images/ui-bg_glass_80_e6e6e6_1x400.png +0 -0
- data/public/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/stylesheets/images/ui-bg_highlight-hard_100_f9f9f9_1x100.png +0 -0
- data/public/stylesheets/images/ui-bg_highlight-soft_100_e7eef3_1x100.png +0 -0
- data/public/stylesheets/images/ui-icons_222222_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_2694e8_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_72a7cf_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_888888_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_ffffff_256x240.png +0 -0
- data/public/stylesheets/jquery-ui-1.7.1.custom.css +404 -0
- data/public/stylesheets/jquery.treeTable.css +43 -0
- data/public/stylesheets/themes/bec-green/style.css +290 -0
- data/public/stylesheets/themes/bec/style.css +301 -0
- data/public/stylesheets/themes/blue/style.css +280 -0
- data/public/stylesheets/themes/default/style.css +267 -0
- data/public/stylesheets/themes/djime-cerulean/style.css +298 -0
- data/public/stylesheets/themes/kathleene/style.css +272 -0
- data/public/stylesheets/themes/orange/style.css +263 -0
- data/public/stylesheets/themes/reidb-greenish/style.css +301 -0
- metadata +341 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
.secondary-navigation
|
2
|
+
%ul
|
3
|
+
%li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', slice_url(:nodes))
|
4
|
+
%li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', slice_url(:new_node))
|
5
|
+
- if active != 'create' && active != 'index'
|
6
|
+
%li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', slice_url(:node, escape_node_id(@node.name)))
|
7
|
+
%li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', slice_url(:edit_node, escape_node_id(@node.name)))
|
8
|
+
%li= link_to('Delete', slice_url(:node, escape_node_id(@node.name)), :method => "delete", :confirm => "Really delete node #{@node.name}? There is no undo.")
|
9
|
+
.clear
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.resource
|
2
|
+
%h3= "#{h resource.to_s} (#{resource.class})"
|
3
|
+
%table
|
4
|
+
- resource.instance_variables.sort.each do |v|
|
5
|
+
- attr_name = v.gsub(/\@/, "")
|
6
|
+
- unless attr_name == "collection"
|
7
|
+
%tr.attr_group
|
8
|
+
%td.attr_name
|
9
|
+
= "#{h attr_name}"
|
10
|
+
%td.attr_value
|
11
|
+
- value = resource.instance_variable_get(v)
|
12
|
+
- if value.kind_of?(String)
|
13
|
+
= "#{h value}"
|
14
|
+
- elsif value.kind_of?(Array)
|
15
|
+
= "#{h value.join(", ")}"
|
16
|
+
- elsif value.kind_of?(Symbol)
|
17
|
+
= "#{h value.to_s}"
|
18
|
+
- elsif attr_name == "actions"
|
19
|
+
= partial(:action, :actions => value)
|
20
|
+
- else
|
21
|
+
= "#{h value.inspect}"
|
22
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title= "Node #{h @node.name}"
|
4
|
+
.inner
|
5
|
+
= partial('navigation', :active => 'edit')
|
6
|
+
= partial('form', :header => "Edit Node #{@node.name}", :form_id => 'edit_node', :submit_name => "Save Node", :submit_id => "edit_node_button", :form_for => 'edit', :form_url => slice_url(:node, escape_node_id(@node.name)) )
|
7
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title Node List
|
4
|
+
.inner
|
5
|
+
= partial('navigation', :active => 'index')
|
6
|
+
.content
|
7
|
+
.inner
|
8
|
+
%table.table
|
9
|
+
%tr
|
10
|
+
%th.first{:colspan => 2} Name
|
11
|
+
%th
|
12
|
+
%th.last
|
13
|
+
- even = false
|
14
|
+
- if @node_list.empty?
|
15
|
+
%td{:colspan => 4}= "You appear to have no nodes - try connecting one, or validating an existing #{link_to('registration', slice_url(:registrations))}"
|
16
|
+
- else
|
17
|
+
- @node_list.each do |node|
|
18
|
+
%tr{:class => even ? "even": "odd" }
|
19
|
+
%td{:colspan => 2}= link_to node, slice_url(:node, { :id => escape_node_id(node) } )
|
20
|
+
%td
|
21
|
+
= link_to('Edit', slice_url(:edit_node, escape_node_id(node)))
|
22
|
+
|
|
23
|
+
= link_to('Delete', slice_url(:node, escape_node_id(node)), :method => "delete", :confirm => "Really delete Node #{node}? There is no undo.")
|
24
|
+
- even ? even = false: even = true
|
25
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title= "Node"
|
4
|
+
.inner
|
5
|
+
= partial('navigation', :active => 'create')
|
6
|
+
= partial('form', :header => "Create new Node", :form_id => 'create_node', :submit_name => "Create Node", :submit_id => "create_node_button", :form_for => 'create', :form_url => slice_url(:nodes))
|
@@ -0,0 +1,60 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title= "Node #{h @node.name}"
|
4
|
+
.inner
|
5
|
+
= partial('navigation', :active => 'show')
|
6
|
+
|
7
|
+
.content
|
8
|
+
.inner
|
9
|
+
.left
|
10
|
+
%h3 Run List
|
11
|
+
%table.table
|
12
|
+
%tr
|
13
|
+
%th.first Position
|
14
|
+
%th Name
|
15
|
+
%th.last Type
|
16
|
+
- if @node.run_list.empty?
|
17
|
+
%tr
|
18
|
+
%td{:colspan => 2} This node has no roles or recipes applied.
|
19
|
+
- else
|
20
|
+
-@node.run_list.each_index do |i|
|
21
|
+
- type, name, fname = @node.run_list.parse_entry(@node.run_list[i])
|
22
|
+
%tr
|
23
|
+
%td.position= i
|
24
|
+
%td= name
|
25
|
+
%td= type
|
26
|
+
.left.accordion
|
27
|
+
%h3.head= link_to("Recipes", "#")
|
28
|
+
- full_recipe_list, default_attrs, override_attrs = @node.run_list.expand("couchdb")
|
29
|
+
%div
|
30
|
+
%span.description.form.help
|
31
|
+
This is the list of recipes, fully expanded, as they will be applied to the node in question.
|
32
|
+
%table#recipes.table
|
33
|
+
%tr
|
34
|
+
%th.first Position
|
35
|
+
%th.last Name
|
36
|
+
- if @node.run_list.empty?
|
37
|
+
%tr
|
38
|
+
%td{:colspan => 2} This node has no recipes applied.
|
39
|
+
- else
|
40
|
+
- full_recipe_list.each_index do |i|
|
41
|
+
%tr
|
42
|
+
%td.position= i
|
43
|
+
%td= full_recipe_list[i]
|
44
|
+
|
45
|
+
.left
|
46
|
+
%h3 Tags
|
47
|
+
%table#recipes.table
|
48
|
+
%tr
|
49
|
+
%th.first Tags
|
50
|
+
%th.last
|
51
|
+
%tr
|
52
|
+
- if (@node.attribute?(:tags) == false) || @node[:tags].empty?
|
53
|
+
%td{:colspan => 2} This node has no tags applied.
|
54
|
+
- else
|
55
|
+
%td{:colspan => 2}= @node[:tags].join(", ")
|
56
|
+
|
57
|
+
.left
|
58
|
+
%h3 Attributes
|
59
|
+
= build_tree('attrs', @node.attribute, default_attrs, override_attrs)
|
60
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
- unless Chef::Config[:authorized_openid_providers]
|
2
|
+
- throw_content(:sidebar_block_notice) do
|
3
|
+
%h4 Where do I get a Login?
|
4
|
+
%p Chef uses OpenID for user logins. By default, Chef allows you to use any OpenID provider you like. You should configure the server to utilize only trusted OpenID servers and URIs. This box will disappear when you have altered the default security configuration.
|
5
|
+
%p= link_to("How to secure your Chef Server on the Chef Wiki.", "http://wiki.opscode.com/display/chef/Securing+Chef+Server")
|
6
|
+
|
7
|
+
.block#block-forms
|
8
|
+
.content
|
9
|
+
%h2.title Login
|
10
|
+
.inner
|
11
|
+
%form.form{ :method => "get", "accept-charset" => "UTF-8", :action => slice_url(:openid_consumer_login) }
|
12
|
+
.group
|
13
|
+
.text_field= text_field :openid_identifier
|
14
|
+
.group
|
15
|
+
.check_box= check_box :name => "immediate", :label => "Use immediate mode", :value => "0"
|
16
|
+
.group
|
17
|
+
.check_box= check_box :name => "use_sreg", :label => "Request registration data", :value => "0"
|
18
|
+
.group
|
19
|
+
.check_box= check_box :name => "use_pape", :label => "Request phishing-resistent auth policy", :value => "0"
|
20
|
+
.group
|
21
|
+
.check_box= check_box :name => "force_post", :label => "Force the transaction to POST", :value => "0"
|
22
|
+
.group.navform
|
23
|
+
.button= submit "Login →"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title Registrations
|
4
|
+
.inner
|
5
|
+
%table.table
|
6
|
+
%tr
|
7
|
+
%th.first Registration Name
|
8
|
+
%th  
|
9
|
+
%th Control
|
10
|
+
%th.last
|
11
|
+
- @registered_nodes.sort{ |a,b| a.name.to_s <=> b.name.to_s }.each_with_index do |node, index|
|
12
|
+
%tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
|
13
|
+
%td{:colspan => 2}= link_to(node.name, slice_url(:registration, { :id => node.name }))
|
14
|
+
%td
|
15
|
+
= link_to( (node.validated ? "Invalidate Registration" : "Validate Registration"), slice_url( :validate_registration, { :id => node.name} ), :method => "post", :confirm => "Are you sure you want to" + (node.validated ? " invalidate " : " validate ") + "this node's registration?")
|
16
|
+
|
|
17
|
+
= link_to((node.admin ? "Remove Admin Rights" : "Grant Admin Rights"), slice_url(:admin_registration, { :id => node.name}), :method => "post", :confirm => "Are you sure you want to" + (node.admin ? " remove administrator privileges from this node?" : " grant administrator privileges to this node?"))
|
18
|
+
|
|
19
|
+
= link_to("Delete", slice_url(:registration, { :id => node.name} ), :method => "delete", :confirm => "Are you sure you want to delete this registration")
|
@@ -0,0 +1,7 @@
|
|
1
|
+
.block#block-text
|
2
|
+
.content
|
3
|
+
%h2.title= "Registration #{@registered_node.name}"
|
4
|
+
.inner
|
5
|
+
= link_to "OpenID URL", slice_url(:openid_node, { :id => @registered_node.name.gsub(/\./, "_")})
|
6
|
+
%br= "Validated: #{@registered_node.validated}"
|
7
|
+
%br= "Admin: #{@registered_node.admin}"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
%form{:method => "post", :action => slice_url(:openid_server_decision)}
|
2
|
+
%table
|
3
|
+
%tr
|
4
|
+
%td Site:
|
5
|
+
%td= @oidreq.trust_root
|
6
|
+
- if @oidreq.id_select
|
7
|
+
%tr
|
8
|
+
%td{:colspan => "2"}
|
9
|
+
You entered the server identifier at the relying party.
|
10
|
+
You will need to send an identifier of your choosing.
|
11
|
+
Enter a username and password below.
|
12
|
+
%tr
|
13
|
+
%td Identity to send:
|
14
|
+
%td
|
15
|
+
%input{:type => "text", :name => "id_to_send", :size => "25"}
|
16
|
+
- else
|
17
|
+
%tr
|
18
|
+
%td Identity:
|
19
|
+
%td= @oidreq.identity
|
20
|
+
%tr
|
21
|
+
%td
|
22
|
+
%label{:for => "password"} Password:
|
23
|
+
%td
|
24
|
+
%input{:type => "password", :name => "password"}
|
25
|
+
%input{:type => "submit", :name => "submit", :value => "Authenticate"}
|
26
|
+
%input{:type => "submit", :name => "cancel", :value => "Cancel"}
|
27
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
.content
|
2
|
+
.inner
|
3
|
+
- if form_for != "edit"
|
4
|
+
%div.group.form
|
5
|
+
%label.label Name
|
6
|
+
= text_field :id => "role_name", :name => "name", :class => "text_field", :value => params.has_key?(:name) ? h(params[:name]) : @role.name
|
7
|
+
%span.description The name of the Role
|
8
|
+
%div.group.form
|
9
|
+
%label.label Description
|
10
|
+
= text_area(params.has_key?(:description) ? h(params[:description]) : @role.description, :name => "description", :class => "text_area", :id => "role_description")
|
11
|
+
%span.description A description of this Role
|
12
|
+
|
13
|
+
%div.group.form
|
14
|
+
%table.sortable
|
15
|
+
%tr
|
16
|
+
%td
|
17
|
+
%label.label Available Recipes
|
18
|
+
%td
|
19
|
+
%label.label Recipes for this Role
|
20
|
+
%tr
|
21
|
+
%td
|
22
|
+
%div.sortable
|
23
|
+
%ul#available_recipes.connectedSortable
|
24
|
+
- @available_recipes.each do |recipe|
|
25
|
+
%li{ :id => h(recipe), :class => 'ui-state-highlight' }= h recipe
|
26
|
+
%td
|
27
|
+
%div.sortable
|
28
|
+
%ul#for_role.connectedSortable
|
29
|
+
- @current_recipes.each do |recipe|
|
30
|
+
%li{ :id => h(recipe), :class => 'ui-state-highlight' }= h recipe
|
31
|
+
|
32
|
+
%td.help
|
33
|
+
%span.description
|
34
|
+
Drag recipes from the list of Available Recipes section on the left, and drop them
|
35
|
+
in the "Recipes for this Role" section on the right. Then sort the recipes for this role list to the order you would like to see the recipes applied.
|
36
|
+
|
37
|
+
%div.group.form
|
38
|
+
%label.label Default and Override Attributes
|
39
|
+
%div.editor
|
40
|
+
%div#tree
|
41
|
+
%div#jform
|
42
|
+
%div.clear
|
43
|
+
%script= "$(document).ready(function() { JSONeditor.start('tree', 'jform', #{ { :defaults => @role.default_attributes, :overrides => @role.override_attributes }.to_json }, false); });"
|
44
|
+
%span.description A JSON hash for default attributes for nodes of this role. These attributes will only be applied if the node does not already have a value for the attributes.
|
45
|
+
= form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do
|
46
|
+
%div.group
|
47
|
+
.actions-bar
|
48
|
+
.actions= submit submit_name, :id => submit_id, :class => 'button'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
.secondary-navigation
|
2
|
+
%ul
|
3
|
+
%li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', slice_url(:roles))
|
4
|
+
%li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', slice_url(:new_role))
|
5
|
+
- if active != 'create' && active != 'index'
|
6
|
+
%li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', slice_url(:role, @role.name))
|
7
|
+
%li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', slice_url(:edit_role, @role.name))
|
8
|
+
%li= link_to('Delete', slice_url(:role, @role.name), :method => "delete", :confirm => "Really delete Role #{@role.name}? There is no undo.")
|
9
|
+
.clear
|
@@ -0,0 +1,6 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title= "Role #{h @role.name}"
|
4
|
+
.inner
|
5
|
+
= partial('navigation', :active => 'edit')
|
6
|
+
= partial('form', :header => "Edit Role #{@role.name}", :form_id => 'edit_role', :submit_name => "Save Role", :submit_id => "edit_role_button", :form_for => 'edit', :form_url => slice_url(:role, @role.name) )
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title Roles
|
4
|
+
.inner
|
5
|
+
= partial('navigation', :active => 'index')
|
6
|
+
.content
|
7
|
+
.inner
|
8
|
+
%table.table
|
9
|
+
%tr
|
10
|
+
%th.first Name
|
11
|
+
%th Description
|
12
|
+
%th.last
|
13
|
+
- even = false;
|
14
|
+
- @role_list.each do |role|
|
15
|
+
%tr{ :class => even ? "even" : "odd" }
|
16
|
+
%td= link_to(role.name, slice_url(:role, role.name))
|
17
|
+
%td= role.description
|
18
|
+
%td
|
19
|
+
= link_to('Edit', slice_url(:edit_role, role.name))
|
20
|
+
|
|
21
|
+
= link_to('Delete', slice_url(:role, role.name), :method => "delete", :confirm => "Really delete Role #{role.name}? there is no undo.")
|
22
|
+
- even ? even = false: even = true
|
@@ -0,0 +1,6 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title= "Role"
|
4
|
+
.inner
|
5
|
+
= partial('navigation', :active => 'create')
|
6
|
+
= partial('form', :header => "Create new Role", :form_id => 'create_role', :submit_name => "Create Role", :submit_id => "create_role_button", :form_for => 'create', :form_url => slice_url(:roles))
|
@@ -0,0 +1,29 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title= "Role #{h @role.name}"
|
4
|
+
.inner
|
5
|
+
= partial("navigation", :active => "show")
|
6
|
+
.content
|
7
|
+
.inner
|
8
|
+
.left
|
9
|
+
%h3 Description
|
10
|
+
= @role.description
|
11
|
+
|
12
|
+
.left
|
13
|
+
%h3 Recipes
|
14
|
+
%table#recipes.table
|
15
|
+
%tr
|
16
|
+
%th.first Position
|
17
|
+
%th.last Name
|
18
|
+
- @role.recipes.each_index do |i|
|
19
|
+
%tr
|
20
|
+
%td.position= i
|
21
|
+
%td= @role.recipes[i]
|
22
|
+
.left
|
23
|
+
%h3 Default Attributes
|
24
|
+
= build_tree('defattrs', @role.default_attributes)
|
25
|
+
|
26
|
+
.left
|
27
|
+
%h3 Override Attributes
|
28
|
+
= build_tree('overattrs', @role.override_attributes)
|
29
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
.block#block-forms
|
2
|
+
.content
|
3
|
+
%h2.title Search Indexes
|
4
|
+
.inner
|
5
|
+
- @search_indexes.sort{ |a,b| a.to_s <=> b.to_s}.each do |index|
|
6
|
+
%form.form{ :method => "get", "accept-charset" => "UTF-8", :action => slice_url(:search, { :id => index})}
|
7
|
+
.group.label= text_field :name => "q", :label => "Query"
|
8
|
+
.group.label= text_field :name => "a", :label => "Attributes"
|
9
|
+
.group= submit "Search #{index}"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title Search Results
|
4
|
+
.inner
|
5
|
+
- @results.each do |result|
|
6
|
+
%table.table.search{:width => '400px'}
|
7
|
+
%tr
|
8
|
+
%th.first Attribute
|
9
|
+
%th.last Value
|
10
|
+
- @results.each do |result|
|
11
|
+
- result.sort { |a,b| a[0].to_s <=> b[0].to_s}.each_with_index do |h,index|
|
12
|
+
%tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
|
13
|
+
%td= "#{h[0]} (#{h[1].class})"
|
14
|
+
%td= h[1]
|
@@ -0,0 +1,88 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title Status
|
4
|
+
.inner
|
5
|
+
%table.table
|
6
|
+
%tr
|
7
|
+
%th.first Node Name
|
8
|
+
%th Platform
|
9
|
+
%th FQDN
|
10
|
+
%th IP Address
|
11
|
+
%th Uptime
|
12
|
+
%th Last Check-in
|
13
|
+
%th.last Run List
|
14
|
+
- if @status.empty?
|
15
|
+
%tr
|
16
|
+
%td{:colspan => 7}= "You appear to have no nodes - try connecting one, or validating an existing #{link_to('registration', slice_url(:registrations))}"
|
17
|
+
- else
|
18
|
+
- @status.each_with_index do |node, index|
|
19
|
+
%tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
|
20
|
+
%td= link_to(node["name"], slice_url(:node, escape_node_id(node["name"])))
|
21
|
+
%td= "#{node["platform"]} #{node["platform_version"]}"
|
22
|
+
%td= node["fqdn"]
|
23
|
+
%td= node["ipaddress"]
|
24
|
+
%td
|
25
|
+
.accordion
|
26
|
+
= link_to(node["uptime"].split(" ")[0..1].join(" ") , "#", :class => 'tooltip')
|
27
|
+
.tooltip
|
28
|
+
%table.table.tooltip
|
29
|
+
%tr
|
30
|
+
%td= node["uptime"]
|
31
|
+
- if node["ohai_time"].to_s != "Undefined"
|
32
|
+
- current_time = DateTime.now
|
33
|
+
- date = DateTime.parse(Time.at(node["ohai_time"]).to_s)
|
34
|
+
- hours, minutes, seconds, frac = DateTime.day_fraction_to_time(current_time - date)
|
35
|
+
- hours_text = "#{hours} hour#{hours == 1 ? '' : 's'}"
|
36
|
+
- minutes_text = "#{minutes} minute#{minutes == 1 ? '' : 's'}"
|
37
|
+
%td.flash
|
38
|
+
- status_class = ""
|
39
|
+
- if hours > 24
|
40
|
+
- status_class = "message error"
|
41
|
+
- elsif hours > 1
|
42
|
+
- status_class = "message warning"
|
43
|
+
%div{ :class => status_class }
|
44
|
+
.accordion
|
45
|
+
- if hours > 48
|
46
|
+
- status_msg = "> #{hours/24} days ago"
|
47
|
+
- elsif hours > 0
|
48
|
+
- status_msg = "> #{hours_text} ago"
|
49
|
+
- elsif minutes < 1
|
50
|
+
- status_msg = "< 1 minute ago"
|
51
|
+
- else
|
52
|
+
- status_msg = "#{minutes_text} ago"
|
53
|
+
= link_to(status_msg, "#", :class=> 'tooltip')
|
54
|
+
.tooltip
|
55
|
+
%table.table.tooltip
|
56
|
+
%tr
|
57
|
+
%td
|
58
|
+
= date
|
59
|
+
%br
|
60
|
+
- if hours == 0
|
61
|
+
= "#{minutes_text} ago"
|
62
|
+
- else
|
63
|
+
= "#{hours_text}, #{minutes_text} ago"
|
64
|
+
- else
|
65
|
+
%td Undefined
|
66
|
+
- if node["run_list"] != "Undefined"
|
67
|
+
%td
|
68
|
+
.accordion
|
69
|
+
= link_to("Run List", "#", :class => 'tooltip')
|
70
|
+
.tooltip
|
71
|
+
%table.table.tooltip
|
72
|
+
%tr
|
73
|
+
%th.first Position
|
74
|
+
%th Name
|
75
|
+
%th.last Type
|
76
|
+
- if node['run_list'].empty?
|
77
|
+
%tr
|
78
|
+
%td{:colspan => 2} This node has no roles or recipes applied.
|
79
|
+
- else
|
80
|
+
- rl = Chef::RunList.new
|
81
|
+
- rl.reset(node["run_list"])
|
82
|
+
-rl.each_index do |i|
|
83
|
+
- type, name, fname = rl.parse_entry(rl[i])
|
84
|
+
%tr
|
85
|
+
%td.position= i
|
86
|
+
%td= name
|
87
|
+
%td= type
|
88
|
+
|