chef-server-webui 0.9.18 → 0.10.0.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +0 -4
- data/Rakefile +10 -0
- data/app/controllers/application.rb +34 -6
- data/app/controllers/cookbooks.rb +125 -35
- data/app/controllers/environments.rb +235 -0
- data/app/controllers/nodes.rb +26 -19
- data/app/controllers/roles.rb +37 -44
- data/app/controllers/search.rb +13 -13
- data/app/helpers/application_helper.rb +34 -0
- data/app/views/cookbooks/_cookbook_content.html.haml +7 -0
- data/app/views/cookbooks/index.html.haml +22 -7
- data/app/views/cookbooks/show.html.haml +8 -50
- data/app/views/environments/_form.html.erb +91 -0
- data/app/views/environments/_navigation.html.haml +9 -0
- data/app/views/environments/_version_selector.html.erb +8 -0
- data/app/views/environments/edit.html.erb +17 -0
- data/app/views/environments/index.html.haml +26 -0
- data/app/views/environments/new.html.erb +17 -0
- data/app/views/environments/show.html.haml +31 -0
- data/app/views/layout/application.html.haml +22 -13
- data/app/views/layout/login.html.haml +2 -2
- data/app/views/nodes/_form.html.erb +69 -0
- data/app/views/nodes/index.html.haml +6 -2
- data/app/views/nodes/show.html.haml +4 -1
- data/app/views/roles/_form.html.erb +92 -0
- data/app/views/roles/_run_lists.html.erb +26 -0
- data/app/views/roles/edit.html.haml +1 -1
- data/app/views/roles/new.html.haml +1 -1
- data/app/views/roles/show.html.haml +10 -7
- data/app/views/status/index.html.haml +2 -1
- data/bin/chef-server-webui +1 -0
- data/config/router.rb +14 -8
- data/lib/chef-server-webui/version.rb +1 -1
- data/public/javascripts/chef.js +206 -49
- data/public/javascripts/cookbook_constraint_ctrl.js +191 -0
- data/public/javascripts/cookbook_versions.js +75 -0
- data/public/javascripts/jquery-1.4.4.min.js +167 -0
- data/public/javascripts/jquery.suggest.js +250 -0
- data/public/stylesheets/base.css +30 -24
- data/public/stylesheets/chef.css +212 -45
- data/public/stylesheets/jquery.suggest.css +28 -0
- data/public/stylesheets/jsonedit_main.css +26 -10
- data/public/stylesheets/themes/djime-cerulean/style.css +31 -18
- metadata +22 -29
- data/app/controllers/cookbook_attributes.rb +0 -41
- data/app/controllers/cookbook_definitions.rb +0 -41
- data/app/controllers/cookbook_files.rb +0 -39
- data/app/controllers/cookbook_libraries.rb +0 -41
- data/app/controllers/cookbook_recipes.rb +0 -40
- data/app/controllers/cookbook_templates.rb +0 -57
- data/app/helpers/cookbook_attributes_helper.rb +0 -7
- data/app/helpers/cookbook_definitions_helper.rb +0 -8
- data/app/helpers/cookbook_files_helper.rb +0 -8
- data/app/helpers/cookbook_libraries_helper.rb +0 -7
- data/app/helpers/cookbook_recipes_helper.rb +0 -8
- data/app/helpers/cookbook_templates_helper.rb +0 -8
- data/app/helpers/exceptions_helper.rb +0 -6
- data/app/helpers/global_helpers.rb +0 -39
- data/app/helpers/nodes_helper.rb +0 -43
- data/app/helpers/openid_consumer_helper.rb +0 -8
- data/app/helpers/openid_register_helper.rb +0 -8
- data/app/helpers/openid_server_helper.rb +0 -6
- data/app/helpers/openid_server_helpers.rb +0 -32
- data/app/helpers/roles_helper.rb +0 -5
- data/app/helpers/search_entries_helper.rb +0 -8
- data/app/helpers/search_helper.rb +0 -44
- data/app/views/nodes/_form.html.haml +0 -52
- data/app/views/roles/_form.html.haml +0 -52
@@ -0,0 +1,91 @@
|
|
1
|
+
<div class="content environmentFormContainer">
|
2
|
+
<%= form(:action => form_url, :method => (method || :post), :id => form_id, :class => 'form') do -%>
|
3
|
+
<% unless form_for == 'edit' %>
|
4
|
+
<div class="group form">
|
5
|
+
<label class="label" for="environment_name">Name</label>
|
6
|
+
<% if !@environment.invalid_fields[:name].nil? && @environment.invalid_fields[:name].size != 0 %>
|
7
|
+
<span class="inline_error_message">The environment name contains illegal characters. The following characters are allowed: a-z, A-Z, 0-9, _, and -.</span>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<%= text_field :id => "environment_name", :name => "name", :class => "text_field", :value => params.has_key?(:name) ? h(params[:name]) : @environment.name %>
|
11
|
+
<span class="description">The name of the Environment</span>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<div class="group form">
|
16
|
+
<label class="label" for="environment_description">Description</label>
|
17
|
+
<%= text_area(params.has_key?(:description) ? h(params[:description]) : @environment.description, :name => "description", :class => "text_area", :id => "environment_description") %>
|
18
|
+
<span class="description">A description of this Environment</span>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="group form cbVerPicker" id=<%=form_for%>>
|
22
|
+
<label class="label" for="cookbook_version_constraints">Cookbook Version Constraints</label>
|
23
|
+
<% if !@environment.invalid_fields[:cookbook_version].nil? && !@environment.invalid_fields[:cookbook_version].empty? %>
|
24
|
+
<span class="inline_error_message" id='error'>There was a problem in one of your constraints. Please enter version constraints in acceptable formats (e.g. 0.0.0). </span>
|
25
|
+
<% end %>
|
26
|
+
<table class="table" id="cbVerPickerTable">
|
27
|
+
<tbody>
|
28
|
+
<tr>
|
29
|
+
<th class = "first" id="CookbookVersionConstraints">Name</th>
|
30
|
+
<th class="operator" id="CookbookVersionConstraints">Operator</th>
|
31
|
+
<th class="version" id="CookbookVersionConstraints">Version</th>
|
32
|
+
<th class="last" id="CookbookVersionConstraints"> </th>
|
33
|
+
</tr>
|
34
|
+
<tr id="cbVerAddRow">
|
35
|
+
<td>
|
36
|
+
<select size="1" name="cookbook_selector"
|
37
|
+
id="cookbook_name_0000"
|
38
|
+
onchange="jQuerySuggest('0000')"
|
39
|
+
onfocus="clearCookbookError()">
|
40
|
+
<option value=""></option>
|
41
|
+
<% @cookbooks.each do |book| %>
|
42
|
+
<option value="<%= book %>"><%= book %></option>
|
43
|
+
<% end %>
|
44
|
+
</select>
|
45
|
+
</td>
|
46
|
+
<td>
|
47
|
+
<select size="1" name="cookbook_operator_selector"
|
48
|
+
id="cookbook_operator_selector">
|
49
|
+
<% constraint_operators.each do |op| %>
|
50
|
+
<option value="<%= op %>"><%= op %></option>
|
51
|
+
<% end %>
|
52
|
+
</select>
|
53
|
+
</td>
|
54
|
+
<td>
|
55
|
+
<input id="cookbook_version_0000"
|
56
|
+
class="text" name="cookbook_version_selector"
|
57
|
+
onfocus="clearVersionBox(this, '0000')"
|
58
|
+
onblur="validateVersionBoxValue(this, '0000')"
|
59
|
+
value="0.0.0">
|
60
|
+
</td>
|
61
|
+
<td>
|
62
|
+
<a href="javascript:void(0)"
|
63
|
+
onclick="addTableRow0000()">Add</a>
|
64
|
+
</td>
|
65
|
+
</tr>
|
66
|
+
</tbody>
|
67
|
+
</table>
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<div class="group form attrEditor">
|
71
|
+
<label class="label">Environment Attributes</label>
|
72
|
+
<%= partial 'layout/jsonedit', :json => @environment.attributes.to_json%>
|
73
|
+
<span class="description">
|
74
|
+
A JSON hash for attributes of this environment. These attributes will be applied according to the attribute precedence rules.
|
75
|
+
</span>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
<div class="group">
|
79
|
+
<div class="actions-bar">
|
80
|
+
<%= submit(submit_name, :id => submit_id, :class => 'button') -%>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
<% end =%>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<script type='text/javascript'>
|
87
|
+
function cookbook_versions() {
|
88
|
+
return <%= cookbook_version_constraints.to_json %>;
|
89
|
+
}
|
90
|
+
</script>
|
91
|
+
<script type='text/javascript' charset="utf-8" src="/javascripts/cookbook_constraint_ctrl.js"></script>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
.secondary-navigation
|
2
|
+
%ul
|
3
|
+
%li{ :class => "first #{active == 'index' ? "active" : ''}"}= link_to('List', url(:environments))
|
4
|
+
%li{ :class => (active == 'create' ? "active" : '')}= link_to('Create', url(:new_environment))
|
5
|
+
- if active != 'create' && active != 'index'
|
6
|
+
%li{ :class => (active == 'show' ? "active" : '')}= link_to('Show', url(:environment, @environment.name))
|
7
|
+
%li{ :class => (active == 'edit' ? "active" : '')}= link_to('Edit', url(:edit_environment, @environment.name))
|
8
|
+
%li= link_to('Delete', url(:environment, @environment.name), :method => "delete", :confirm => "Really delete Environment #{@environment.name}? There is no undo.")
|
9
|
+
.clear
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="cookbook_version_constraint_control_container">
|
2
|
+
<span class="label">
|
3
|
+
<label for="cookbook_version[<%= cookbook_version_index -%>]">cookbook version constraint:</label>
|
4
|
+
</span>
|
5
|
+
<span>
|
6
|
+
<%= text_field(:name => "cookbook_version[#{cookbook_version_index}]", :value => "#{cookbook_name} #{constraint}")%>
|
7
|
+
</span>
|
8
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div id="block-tables" class="block">
|
2
|
+
<div class="content">
|
3
|
+
<h2 class="title">Environment <%= params[:id] %></h2>
|
4
|
+
<div class="inner">
|
5
|
+
<%= partial "environments/navigation", :environment => @environment, :active => 'edit'%>
|
6
|
+
</div>
|
7
|
+
<%= partial 'environments/form', :environment => @environment,
|
8
|
+
:route => :environments,
|
9
|
+
:method => :put,
|
10
|
+
:form_url => url(:environment, @environment.name),
|
11
|
+
:form_id => 'edit_environment',
|
12
|
+
:form_for => 'edit',
|
13
|
+
:submit_name => "Update Environment",
|
14
|
+
:submit_id => "edit_environment_button",
|
15
|
+
:new_object => true %>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title Environments
|
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
|
+
- @environment_list.each do |env|
|
15
|
+
%tr{ :class => even ? "even" : "odd" }
|
16
|
+
%td{:colspan => 2}= link_to(env[0], url(:environment, env[0]))
|
17
|
+
%td
|
18
|
+
- if session[:environment] != env[0]
|
19
|
+
= link_to('Select', url(:environment_select, env[0]))
|
20
|
+
- else
|
21
|
+
Select
|
22
|
+
|
|
23
|
+
= link_to('Edit', url(:edit_environment, env[0]))
|
24
|
+
|
|
25
|
+
= link_to('Delete', url(:environment, env[0]), :method => "delete", :confirm => "Really delete Environment #{env[0]}? there is no undo.")
|
26
|
+
- even = (not even)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div id="block-tables" class="block">
|
2
|
+
<div class="content">
|
3
|
+
<h2 class="title">Environment <%= params[:id] %></h2>
|
4
|
+
<div class="inner">
|
5
|
+
<%= partial "environments/navigation", :environment => @environment, :active => 'create'%>
|
6
|
+
</div>
|
7
|
+
<%= partial 'environments/form', :environment => @environment,
|
8
|
+
:route => :environments,
|
9
|
+
:method => :post,
|
10
|
+
:form_url => url(:environments),
|
11
|
+
:form_id => 'create_environment',
|
12
|
+
:form_for => 'create',
|
13
|
+
:submit_name => "Create Environment",
|
14
|
+
:submit_id => "create_environment_button",
|
15
|
+
:new_object => true %>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
.block#block-tables
|
2
|
+
.content
|
3
|
+
%h2.title= "Environment #{h @environment.name}"
|
4
|
+
.inner
|
5
|
+
= partial("navigation", :active => "show")
|
6
|
+
.content
|
7
|
+
.inner
|
8
|
+
.left
|
9
|
+
%h3 Name
|
10
|
+
= @environment.name
|
11
|
+
.left
|
12
|
+
%h3 Description
|
13
|
+
= @environment.description
|
14
|
+
.left
|
15
|
+
%h3 Cookbook Version Constraints
|
16
|
+
%table.table
|
17
|
+
%tr
|
18
|
+
%th.first Name
|
19
|
+
%th.last Version Constraints
|
20
|
+
- if @environment.cookbook_versions.empty?
|
21
|
+
%tr
|
22
|
+
%td{:colspan => 2} This environment does not include any cookbook version constraints.
|
23
|
+
- else
|
24
|
+
- @environment.cookbook_versions.keys.sort.each do |name|
|
25
|
+
- versions = @environment.cookbook_versions[name]
|
26
|
+
%tr
|
27
|
+
%td= name
|
28
|
+
%td= versions
|
29
|
+
.left
|
30
|
+
%h3 Attributes
|
31
|
+
= build_tree('attrs', @environment.attributes)
|
@@ -1,22 +1,30 @@
|
|
1
|
-
!!!
|
2
|
-
!!!
|
1
|
+
!!! 5
|
3
2
|
%html
|
4
3
|
%head
|
5
4
|
%meta{ "http-equiv" => "content-type", :content => "text/html; charset=utf-8" }
|
6
5
|
%title Chef Server
|
7
|
-
= css_include_tag "base", "themes/djime-cerulean/style", "chef", "/facebox/facebox.css", "jquery-ui-1.7.1.custom", "jquery.treeTable", "jsonedit_main.css"
|
8
|
-
= js_include_tag "jquery-1.
|
6
|
+
= css_include_tag "base", "themes/djime-cerulean/style", "chef", "/facebox/facebox.css", "jquery-ui-1.7.1.custom", "jquery.treeTable", "jsonedit_main.css", "jquery.suggest.css"
|
7
|
+
= js_include_tag "jquery-1.4.4.min", "jquery.jeditable.mini", "jquery.livequery", "jquery.localscroll", "jquery.scrollTo", "jquery.tools.min"
|
9
8
|
= js_include_tag "/facebox/facebox.js"
|
10
9
|
= js_include_tag "jquery-ui-1.7.1.custom.min"
|
11
10
|
= js_include_tag "jquery.treeTable.min"
|
12
11
|
= js_include_tag "chef"
|
12
|
+
= js_include_tag "drop_down_menu"
|
13
|
+
= js_include_tag "jquery.suggest"
|
13
14
|
|
14
15
|
= catch_content :header_content
|
15
16
|
|
16
17
|
%body
|
17
18
|
#container
|
18
19
|
#header
|
19
|
-
%h1
|
20
|
+
%h1
|
21
|
+
= link_to "Chef Server", url(:top)
|
22
|
+
%label{:for => 'environment-select'} Environment:
|
23
|
+
%select{:name => 'environment-select', :onchange => 'jump(this)', :size => 1, :class => 'title-select'}
|
24
|
+
- current_env = session[:environment]
|
25
|
+
%option{:value => url(:environment_select, :environment_id => '_none'), :selected => current_env == nil} None
|
26
|
+
- @environments.each do |env|
|
27
|
+
%option{:value => url(:environment_select, :environment_id => env), :selected => current_env == env}= env
|
20
28
|
#user-navigation
|
21
29
|
%ul
|
22
30
|
- if session[:user]
|
@@ -27,14 +35,15 @@
|
|
27
35
|
.clear
|
28
36
|
#main-navigation
|
29
37
|
%ul
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
+
= nav_link_item("Environments", :environments)
|
39
|
+
= nav_link_item("Search", :searches)
|
40
|
+
= nav_link_item("Status", :status)
|
41
|
+
= nav_link_item("Roles", :roles)
|
42
|
+
= nav_link_item("Nodes", :nodes)
|
43
|
+
= nav_link_item("Cookbooks", :cookbooks)
|
44
|
+
= nav_link_item("Databags", :databags)
|
45
|
+
= nav_link_item("Clients", :clients)
|
46
|
+
= nav_link_item("Users", :users)
|
38
47
|
.clear
|
39
48
|
#wrapper
|
40
49
|
#main
|
@@ -1,5 +1,5 @@
|
|
1
1
|
!!! XML
|
2
|
-
!!!
|
2
|
+
!!! 5
|
3
3
|
%html
|
4
4
|
%head
|
5
5
|
%meta{ "http-equiv" => "content-type", :content => "text/html; charset=utf-8" }
|
@@ -16,7 +16,7 @@
|
|
16
16
|
#header
|
17
17
|
%h1= link_to "Chef Server", url(:top)
|
18
18
|
#wrapper
|
19
|
-
#main
|
19
|
+
#main.loginPage
|
20
20
|
- unless message.empty?
|
21
21
|
.block#block-messages
|
22
22
|
.content
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<div class="content nodeFormContainer">
|
2
|
+
<%= form(:action => form_url, :method => :post, :id => form_id, :class => 'form') do -%>
|
3
|
+
<% unless form_for == 'edit' %>
|
4
|
+
<div class="group form">
|
5
|
+
<label class="label" for="node_name">Name</label>
|
6
|
+
<%= text_field :id => "node_name", :name => "name", :class => "text_field", :value => params.has_key?(:name) ? h(params[:name]) : @node.name %>
|
7
|
+
<span class="description">The name of the Node</span>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<div>
|
12
|
+
<label class="label" for="nodeEnvironment">Environment:</label>
|
13
|
+
<%= select :chef_environment, :collection => @environments, :id => 'nodeEnvironment', :selected => @env %>
|
14
|
+
<br />
|
15
|
+
<span class="description">The node's environment</span>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="group form" id="run_list_editor_container">
|
19
|
+
<div id="availableRunListItemContainer" class="runListEditorColumn">
|
20
|
+
<div id="available_roles_container" class="runListItemListContainer">
|
21
|
+
<div class="runListEditorLabel">Available Roles</div>
|
22
|
+
<div class="sortable runListAvailableItemContainer">
|
23
|
+
<ul id="node_available_roles" class="connectedSortable runListAvailableItemList">
|
24
|
+
<% @available_roles.each do |role| %>
|
25
|
+
<li id="role[<%=h(role) -%>]" class="ui-state-highlight runListItem"><%= h(role) -%></li>
|
26
|
+
<% end %>
|
27
|
+
</ul>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<div id="available_recipes_container" class="runListItemListContainer">
|
31
|
+
<div class="runListEditorLabel">Available Recipes</div>
|
32
|
+
<div class="sortable runListAvailableItemContainer">
|
33
|
+
<ul id="node_available_recipes" class="connectedSortable runListAvailableItemList availableRecipes">
|
34
|
+
<% @available_recipes.each do |recipe| %>
|
35
|
+
<li id="recipe[<%= h(recipe) -%>]" class="ui-state-default runListItem"><%= h(recipe) -%></li>
|
36
|
+
<% end %>
|
37
|
+
</ul>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
<div id="run_list_container" class="runListEditorColumn">
|
42
|
+
<div class="runListItemListContainer">
|
43
|
+
<div class="runListEditorLabel">Run List</div>
|
44
|
+
<div class="sortable runListContainer runListContainerForNode">
|
45
|
+
<ul class="ui-sortable connectedSortable runListItemList" id="for_node">
|
46
|
+
<% @run_list.each do |entry| %>
|
47
|
+
<li id="<%=h(entry)%>" class="<%= class_for_run_list_item(entry) -%> runListItem"><%=h(entry.name) -%></li>
|
48
|
+
<% end %>
|
49
|
+
</ul>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<div class="group form attrEditor">
|
56
|
+
<label class="label">Attributes</label>
|
57
|
+
<%= partial 'layout/jsonedit', :json => @node.normal_attrs.to_json %>
|
58
|
+
<span class="description">
|
59
|
+
A JSON hash for default attributes for nodes of this node. These attributes will only be applied if the node does not already have a value for the attributes.
|
60
|
+
</span>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div class="group">
|
64
|
+
<div class="actions-bar">
|
65
|
+
<%= submit(submit_name, :id => submit_id, :class => 'button') -%>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
<% end =%>
|
69
|
+
</div>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
.block#block-tables
|
2
2
|
.content
|
3
|
-
%h2.title
|
3
|
+
%h2.title
|
4
|
+
Node List
|
4
5
|
.inner
|
5
6
|
= partial('navigation', :active => 'index')
|
6
7
|
.content
|
@@ -12,7 +13,10 @@
|
|
12
13
|
%th.last
|
13
14
|
- even = false
|
14
15
|
- if @node_list.empty?
|
15
|
-
|
16
|
+
- if session[:environment]
|
17
|
+
%td{:colspan => 4}= "The environment #{session[:environment]} has no nodes"
|
18
|
+
- else
|
19
|
+
%td{:colspan => 4}= "You have no nodes - try connecting one, or creating or editing a #{link_to('node', url(:nodes))}"
|
16
20
|
- else
|
17
21
|
- @node_list.each do |node|
|
18
22
|
%tr{:class => even ? "even": "odd" }
|
@@ -7,12 +7,14 @@
|
|
7
7
|
.content
|
8
8
|
.inner
|
9
9
|
.left
|
10
|
+
%h3 Environment: #{@node.chef_environment}
|
10
11
|
%h3 Run List
|
11
12
|
%table.table
|
12
13
|
%thead
|
13
14
|
%tr
|
14
15
|
%th.first Position
|
15
16
|
%th Name
|
17
|
+
%th Version
|
16
18
|
%th.last Type
|
17
19
|
%tbody
|
18
20
|
- if @node.run_list.empty?
|
@@ -23,10 +25,11 @@
|
|
23
25
|
%tr
|
24
26
|
%td.position= i
|
25
27
|
%td= run_list_item.name
|
28
|
+
%td= run_list_item.version
|
26
29
|
%td= run_list_item.type
|
27
30
|
.left.accordion
|
28
31
|
%h3.head= link_to("Recipes", "#")
|
29
|
-
- recipes = @node.run_list.expand('server').recipes
|
32
|
+
- recipes = @node.run_list.expand(@node.chef_environment, 'server').recipes
|
30
33
|
%div
|
31
34
|
%span.description.form.help
|
32
35
|
This is the list of recipes, fully expanded, as they will be applied to the node in question.
|
@@ -0,0 +1,92 @@
|
|
1
|
+
<div class="content roleFormContainer">
|
2
|
+
<%= form(:action => form_url, :method => method, :id => form_id, :class => 'form roleForm') do -%>
|
3
|
+
<% unless form_for == 'edit' %>
|
4
|
+
<div class="group form">
|
5
|
+
<label class="label" for="role_name">Name</label>
|
6
|
+
<%= text_field :id => "role_name", :name => "name", :class => "text_field", :value => params.has_key?(:name) ? h(params[:name]) : @role.name %>
|
7
|
+
<span class="description">The name of the Role</span>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<div class="group form">
|
12
|
+
<label class="label" for="role_description">Description</label>
|
13
|
+
<%= text_area(params.has_key?(:description) ? h(params[:description]) : @role.description, :name => "description", :class => "text_area", :id => "role_description") %>
|
14
|
+
<span class="description">A description of this Role</span>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="group form" id="run_list_editor_container">
|
18
|
+
<div id="availableRunListItemContainer" class="runListEditorColumn">
|
19
|
+
<div id="available_roles_container" class="runListItemListContainer">
|
20
|
+
<div class="runListEditorLabel">Available Roles</div>
|
21
|
+
<div class="sortable runListAvailableItemContainer">
|
22
|
+
<ul id="availableRoles" class="connectedSortable runListAvailableItemList" data-role-list='<%= @available_roles.to_json -%>'>
|
23
|
+
<% @available_roles.each do |role| %>
|
24
|
+
<li id="role[<%=h(role) -%>]" class="ui-state-highlight runListItem"><%= h(role) -%></li>
|
25
|
+
<% end %>
|
26
|
+
</ul>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<div id="available_recipes_container" class="runListItemListContainer">
|
30
|
+
<div class="runListEditorLabel">Available Recipes</div>
|
31
|
+
<div class="sortable runListAvailableItemContainer">
|
32
|
+
<div class="spinner">
|
33
|
+
<%= image_tag('indicator.gif') -%>
|
34
|
+
</div>
|
35
|
+
<ul id="role" class="connectedSortable runListAvailableItemList availableRecipes">
|
36
|
+
</ul>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<div id="run_list_container" class="runListEditorColumn">
|
41
|
+
<div class="runListItemListContainer">
|
42
|
+
<div id="environmentRunListSelector" data-initial-env="<%=h @current_env -%>">
|
43
|
+
<div class="runListEditorLabel">
|
44
|
+
<span id="selectedRunListEditorLabel">
|
45
|
+
<% if @current_env == '_default' -%>
|
46
|
+
Default Run List
|
47
|
+
<% else -%>
|
48
|
+
Run List for <%= @current_env -%>
|
49
|
+
<% end -%>
|
50
|
+
</span>
|
51
|
+
<span id="environment_run_list_selection_control">
|
52
|
+
<%= select :environment, :collection => [['noop','Other Environments']].concat(@environments.map {|e| [e,e]}), :id => 'activeEnvironment'%>
|
53
|
+
</span>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
<% @run_lists.each do |environment, run_list| %>
|
57
|
+
<%= partial('run_lists', :environment => environment, :run_list => run_list)%>
|
58
|
+
<% end %>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
<div id="current_run_list_display_container" class="runListEditorColumn">
|
62
|
+
<div class="runListItemListContainer">
|
63
|
+
<div class="runListEditorLabel activeRunListLabel">Active Run List for <%= h(@current_env) -%></div>
|
64
|
+
<div class="sortable activeRunListContainer">
|
65
|
+
<% if @current_env != "_default" && @role.env_run_lists[@current_env].nil? %>
|
66
|
+
<div id="activeRunListName">using <%= @role.active_run_list_for(@current_env).gsub('_default', 'default') -%> run list</div>
|
67
|
+
<% end %>
|
68
|
+
<ul class="runListItemList" id="active_run_list">
|
69
|
+
<% @role.run_list_for(@current_env).each do |item| %>
|
70
|
+
<li class="displayRunListItem"><%= h(item) -%></li>
|
71
|
+
<% end %>
|
72
|
+
</ul>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
<div class="group form attrEditor">
|
79
|
+
<label class="label">Default and Override Attributes</label>
|
80
|
+
<%= partial 'layout/jsonedit', :json => { :defaults => @role.default_attributes, :overrides => @role.override_attributes }.to_json%>
|
81
|
+
<span class="description">
|
82
|
+
A JSON hash for default attributes for nodes of this role. These attributes will be applied according to the attribute precedence rules.
|
83
|
+
</span>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<div class="group">
|
87
|
+
<div class="actions-bar">
|
88
|
+
<%= submit(submit_name, :id => submit_id, :class => 'button') -%>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
<% end =%>
|
92
|
+
</div>
|