foreman_packages 0.0.18 → 0.0.19
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/app/controllers/foreman_packages/packages_controller.rb +23 -23
- data/app/uploaders/attachment_uploader.rb +2 -3
- data/app/views/foreman_packages/packages/_form.html.erb +3 -3
- data/app/views/foreman_packages/packages/_list.html.erb +20 -20
- data/app/views/foreman_packages/packages/index.html.erb +2 -2
- data/app/views/foreman_packages/packages/show.html.erb +20 -20
- data/app/views/foreman_packages/packages/upload.html.erb +1 -1
- data/lib/foreman_packages/version.rb +1 -1
- metadata +1 -1
@@ -1,55 +1,55 @@
|
|
1
|
-
|
2
|
-
class PackagesController < ApplicationController
|
1
|
+
|
2
|
+
class ForemanPackages::PackagesController < ApplicationController
|
3
3
|
# GET /packages
|
4
4
|
# GET /packages.json
|
5
5
|
def index
|
6
|
-
@
|
6
|
+
@foreman_packages_packages = ForemanPackages::Package.all.paginate(:page => params[:page])
|
7
7
|
|
8
8
|
respond_to do |format|
|
9
9
|
format.html # index.html.erb
|
10
|
-
format.json { render json: @
|
10
|
+
format.json { render json: @foreman_packages_packages }
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
# GET /packages/1
|
15
15
|
# GET /packages/1.json
|
16
16
|
def show
|
17
|
-
@
|
17
|
+
@foreman_packages_package = ForemanPackages::Package.find(params[:id])
|
18
18
|
|
19
19
|
respond_to do |format|
|
20
20
|
format.html # show.html.erb
|
21
|
-
format.json { render json: @
|
21
|
+
format.json { render json: @foreman_packages_package }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
# GET /packages/new
|
26
26
|
# GET /packages/new.json
|
27
27
|
def new
|
28
|
-
@
|
28
|
+
@foreman_packages_package = ForemanPackages::Package.new
|
29
29
|
|
30
30
|
respond_to do |format|
|
31
31
|
format.html # new.html.erb
|
32
|
-
format.json { render json: @
|
32
|
+
format.json { render json: @foreman_packages_package }
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
# GET /packages/1/edit
|
37
37
|
def edit
|
38
|
-
@
|
38
|
+
@foreman_packages_package = ForemanPackages::Package.find(params[:id])
|
39
39
|
end
|
40
40
|
|
41
41
|
# POST /packages
|
42
42
|
# POST /packages.json
|
43
43
|
def create
|
44
|
-
@
|
45
|
-
@
|
44
|
+
@foreman_packages_package = ForemanPackages::Package.new(params[:foreman_packages_package])
|
45
|
+
@foreman_packages_package.filename = params[:foreman_packages_package][:filename].original_filename
|
46
46
|
respond_to do |format|
|
47
|
-
if @
|
48
|
-
format.html { redirect_to @
|
49
|
-
format.json { render json: @
|
47
|
+
if @foreman_packages_package.save
|
48
|
+
format.html { redirect_to @foreman_packages_package, notice: 'foreman_packages_package was successfully created.' }
|
49
|
+
format.json { render json: @foreman_packages_package, status: :created, location: @foreman_packages_package }
|
50
50
|
else
|
51
51
|
format.html { render action: "new" }
|
52
|
-
format.json { render json: @
|
52
|
+
format.json { render json: @foreman_packages_package.errors, status: :unprocessable_entity }
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
@@ -57,15 +57,15 @@ module ForemanPackages
|
|
57
57
|
# PUT /packages/1
|
58
58
|
# PUT /packages/1.json
|
59
59
|
def update
|
60
|
-
@
|
61
|
-
@
|
60
|
+
@foreman_packages_package = ForemanPackages::Package.find(params[:id])
|
61
|
+
@foreman_packages_package.filename = params[:foreman_packages_package][:filename].original_filename
|
62
62
|
respond_to do |format|
|
63
|
-
if @
|
64
|
-
format.html { redirect_to @
|
63
|
+
if @foreman_packages_package.update_attributes(params[:foreman_packages_package])
|
64
|
+
format.html { redirect_to @foreman_packages_package, notice: 'foreman_packages_package was successfully updated.' }
|
65
65
|
format.json { head :no_content }
|
66
66
|
else
|
67
67
|
format.html { render action: "edit" }
|
68
|
-
format.json { render json: @
|
68
|
+
format.json { render json: @foreman_packages_package.errors, status: :unprocessable_entity }
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
@@ -73,8 +73,8 @@ module ForemanPackages
|
|
73
73
|
# DELETE /packages/1
|
74
74
|
# DELETE /packages/1.json
|
75
75
|
def destroy
|
76
|
-
@
|
77
|
-
@
|
76
|
+
@foreman_packages_package = ForemanPackages::Package.find(params[:id])
|
77
|
+
@foreman_packages_package.destroy
|
78
78
|
|
79
79
|
respond_to do |format|
|
80
80
|
format.html { redirect_to packages_url }
|
@@ -82,4 +82,4 @@ module ForemanPackages
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
85
|
-
|
85
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
3
|
-
class AttachmentUploader < CarrierWave::Uploader::Base
|
2
|
+
|
3
|
+
class ForemanPackages::AttachmentUploader < CarrierWave::Uploader::Base
|
4
4
|
storage :file
|
5
5
|
|
6
6
|
def store_dir
|
@@ -13,4 +13,3 @@ module ForemanPackages
|
|
13
13
|
# "#{model.uploader_secure_token}.#{file.extension.downcase}"
|
14
14
|
# end
|
15
15
|
end
|
16
|
-
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<%= javascript '
|
1
|
+
<%= javascript 'foreman_packages_packages', 'foreman_packages_package_edit', 'foreman_packages_package_edit_interfaces', 'class_edit', 'compute_resource', 'lookup_keys'%>
|
2
2
|
|
3
|
-
<%= form_for @
|
4
|
-
<%= base_errors_for @
|
3
|
+
<%= form_for @foreman_packages_package, :html => {:data => {:id => @foreman_packages_package.try(:id), :submit => 'progress_bar'}} do |f| %>
|
4
|
+
<%= base_errors_for @foreman_packages_package %>
|
5
5
|
<div class="row clearfix">
|
6
6
|
<div class="row">
|
7
7
|
<div class="form-group col-md-6">
|
@@ -23,28 +23,28 @@
|
|
23
23
|
</tr>
|
24
24
|
</thead>
|
25
25
|
<tbody>
|
26
|
-
<%
|
26
|
+
<% foreman_packages_packages.each do |foreman_packages_package| %>
|
27
27
|
<tr>
|
28
|
-
<td class=''><%=
|
29
|
-
<td class="hidden-xs"><%=
|
30
|
-
<td class="hidden-xs"><%=
|
31
|
-
<td class="hidden-tablet hidden-xs"><%=
|
32
|
-
<td class="hidden-tablet hidden-xs"><%=
|
33
|
-
<td class="hidden-tablet hidden-xs"><%=
|
34
|
-
<td class="hidden-tablet hidden-xs"><%=
|
35
|
-
<td class="hidden-tablet hidden-xs"><%=
|
36
|
-
<td class="hidden-tablet hidden-xs"><%=
|
37
|
-
<td class="hidden-tablet hidden-xs"><%=
|
28
|
+
<td class=''><%= foreman_packages_package.foreman_packages_packagename %></td>
|
29
|
+
<td class="hidden-xs"><%= foreman_packages_package.ensure %></td>
|
30
|
+
<td class="hidden-xs"><%= foreman_packages_package.file_path %></td>
|
31
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.file_ensure %></td>
|
32
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.file_source %></td>
|
33
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.file_mode %></td>
|
34
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.file_onwer %></td>
|
35
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.file_group %></td>
|
36
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.file_notify %></td>
|
37
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.file_require %></td>
|
38
38
|
|
39
|
-
<td class="hidden-tablet hidden-xs"><%=
|
40
|
-
<td class="hidden-tablet hidden-xs"><%=
|
41
|
-
<td class="hidden-tablet hidden-xs"><%=
|
42
|
-
<td class="hidden-tablet hidden-xs"><%=
|
43
|
-
<td class="hidden-tablet hidden-xs"><%=
|
39
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.service_name %></td>
|
40
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.service_ensure %></td>
|
41
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.service_enable %></td>
|
42
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.service_hasstatus %></td>
|
43
|
+
<td class="hidden-tablet hidden-xs"><%= foreman_packages_package.service_hasrestart %></td>
|
44
44
|
<td>
|
45
|
-
<%= link_to '查看',
|
46
|
-
<%= link_to '编辑',
|
47
|
-
<%= link_to '删除',
|
45
|
+
<%= link_to '查看', foreman_packages_package %>
|
46
|
+
<%= link_to '编辑', edit_foreman_packages_package_path(foreman_packages_package) %>
|
47
|
+
<%= link_to '删除', foreman_packages_package, method: :delete, data: { confirm: 'Are you sure?' } %>
|
48
48
|
</td>
|
49
49
|
</tr>
|
50
50
|
<% end %>
|
@@ -66,4 +66,4 @@
|
|
66
66
|
</div><!-- /.modal-content -->
|
67
67
|
</div><!-- /.modal-dialog -->
|
68
68
|
</div><!-- /.modal -->
|
69
|
-
<%= will_paginate_with_info
|
69
|
+
<%= will_paginate_with_info foreman_packages_packages, :more => " - "+_("<b class='select_count'>0</b> selected") %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if authorized? %>
|
2
|
-
<% title_actions button_group(link_to "新增",
|
2
|
+
<% title_actions button_group(link_to "新增", new_foreman_packages_package_path) %>
|
3
3
|
<% end %>
|
4
4
|
|
5
|
-
<%= render 'list', :
|
5
|
+
<%= render 'list', :foreman_packages_packages => @foreman_packages_packages, :header => @title || _("foreman_packages_package") %>
|
@@ -2,9 +2,9 @@
|
|
2
2
|
<div class="container">
|
3
3
|
<div class="row">
|
4
4
|
<h1 class="clearfix">
|
5
|
-
<%#= @
|
6
|
-
<%= link_to '返回',
|
7
|
-
<%= link_to '编辑',
|
5
|
+
<%#= @foreman_packages_package.name %>
|
6
|
+
<%= link_to '返回', foreman_packages_packages_path, class: "btn btn-primary pull-right mr1" %>
|
7
|
+
<%= link_to '编辑', edit_foreman_packages_package_path(@foreman_packages_package), class: "btn btn-warning pull-right mr1" %>
|
8
8
|
</h1>
|
9
9
|
</div>
|
10
10
|
|
@@ -19,10 +19,10 @@
|
|
19
19
|
<td><strong>file_ensure</strong></td>
|
20
20
|
</tr>
|
21
21
|
<tr>
|
22
|
-
<td><%= @
|
23
|
-
<td><%= @
|
24
|
-
<td><%= @
|
25
|
-
<td><%= @
|
22
|
+
<td><%= @foreman_packages_package.packagename %></td>
|
23
|
+
<td><%= @foreman_packages_package.ensure %></td>
|
24
|
+
<td><%= @foreman_packages_package.file_path %></td>
|
25
|
+
<td><%= @foreman_packages_package.file_ensure %></td>
|
26
26
|
</tr>
|
27
27
|
|
28
28
|
<tr>
|
@@ -32,10 +32,10 @@
|
|
32
32
|
<td><strong>file_group</strong></td>
|
33
33
|
</tr>
|
34
34
|
<tr>
|
35
|
-
<td><%= @
|
36
|
-
<td><%= @
|
37
|
-
<td><%= @
|
38
|
-
<td><%= @
|
35
|
+
<td><%= @foreman_packages_package.file_source %></td>
|
36
|
+
<td><%= @foreman_packages_package.file_mode %></td>
|
37
|
+
<td><%= @foreman_packages_package.file_onwer %></td>
|
38
|
+
<td><%= @foreman_packages_package.file_group %></td>
|
39
39
|
</tr>
|
40
40
|
|
41
41
|
<tr>
|
@@ -45,10 +45,10 @@
|
|
45
45
|
<td><strong>service_ensure</strong></td>
|
46
46
|
</tr>
|
47
47
|
<tr>
|
48
|
-
<td><%= @
|
49
|
-
<td><%= @
|
50
|
-
<td><%= @
|
51
|
-
<td><%= @
|
48
|
+
<td><%= @foreman_packages_package.file_notify %></td>
|
49
|
+
<td><%= @foreman_packages_package.file_require %></td>
|
50
|
+
<td><%= @foreman_packages_package.service_name %></td>
|
51
|
+
<td><%= @foreman_packages_package.service_ensure %></td>
|
52
52
|
</tr>
|
53
53
|
|
54
54
|
<tr>
|
@@ -58,10 +58,10 @@
|
|
58
58
|
<td><strong>created_at</strong></td>
|
59
59
|
</tr>
|
60
60
|
<tr>
|
61
|
-
<td><%= @
|
62
|
-
<td><%= @
|
63
|
-
<td><%= @
|
64
|
-
<td><%= @
|
61
|
+
<td><%= @foreman_packages_package.service_enable %></td>
|
62
|
+
<td><%= @foreman_packages_package.service_hasstatus %></td>
|
63
|
+
<td><%= @foreman_packages_package.service_hasrestart %></td>
|
64
|
+
<td><%= @foreman_packages_package.created_at %></td>
|
65
65
|
</tr>
|
66
66
|
</tbody>
|
67
67
|
</table>
|
@@ -70,7 +70,7 @@
|
|
70
70
|
<table class="table table-striped table-bordered">
|
71
71
|
<thead></thead>
|
72
72
|
<tbody>
|
73
|
-
<%= @
|
73
|
+
<%= @foreman_packages_package.filename %>
|
74
74
|
</tbody>
|
75
75
|
</table>
|
76
76
|
</div>
|