wco_hosting 0.0.0.3 → 0.0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/wco_hosting/appliance_tmpls_controller.rb +50 -0
- data/app/views/wco_hosting/appliance_tmpls/_form.haml +23 -0
- data/app/views/wco_hosting/appliance_tmpls/edit.haml +4 -0
- data/app/views/wco_hosting/appliance_tmpls/index.haml +3 -1
- data/app/views/wco_hosting/appliance_tmpls/new.haml +4 -0
- data/app/views/wco_hosting/serverhosts/index.haml +2 -3
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f0b58b867b5892b387e86f64a985030cafcf66e4f69249ba1489f1fd6b156ce
|
4
|
+
data.tar.gz: 97e32482d3c0283241f1b179b8c0e07544e6d3c3b9588a8c30a76613a4e18d59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ad9e34cbb40487eb7f1ead61e62c46702e2462778774109d953b3d91dcdbd658d1f3e86ab5d5ded31e3697529e02d85b2cb73049ca13819ebbd7ac256a0a76b
|
7
|
+
data.tar.gz: 9888d34d89214a5e735ea43427f498d87dc716ee25ce14e1380a6922054f1e9d17bdd847233bacce784f28bde77c4f5e2178f2a5f3b3039acf95ad8999f923d3
|
@@ -1,7 +1,57 @@
|
|
1
1
|
|
2
2
|
class WcoHosting::ApplianceTmplsController < WcoHosting::ApplicationController
|
3
|
+
|
4
|
+
before_action :set_lists
|
5
|
+
|
6
|
+
def create
|
7
|
+
@appliance_tmpl = WcoHosting::ApplianceTmpl.new params[:appliance].permit!
|
8
|
+
authorize! :create, @appliance_tmpl
|
9
|
+
|
10
|
+
flag = @appliance_tmpl.save
|
11
|
+
if flag
|
12
|
+
flash[:notice] = 'Success.'
|
13
|
+
redirect_to action: :index
|
14
|
+
else
|
15
|
+
flash[:alert] = "Cannot create appliance tmplate: #{@appliance_tmpl.errors.full_messages.join(', ')}."
|
16
|
+
redirect_to action: :index
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def edit
|
21
|
+
@appliance_tmpl = WcoHosting::ApplianceTmpl.find params[:id]
|
22
|
+
authorize! :edit, @appliance_tmpl
|
23
|
+
end
|
24
|
+
|
3
25
|
def index
|
4
26
|
authorize! :index, WcoHosting::ApplianceTmpl
|
5
27
|
@appliance_tmpls = WcoHosting::ApplianceTmpl.all
|
6
28
|
end
|
29
|
+
|
30
|
+
def new
|
31
|
+
authorize! :index, WcoHosting::ApplianceTmpl
|
32
|
+
@appliance_tmpl = WcoHosting::ApplianceTmpl.new
|
33
|
+
end
|
34
|
+
|
35
|
+
def update
|
36
|
+
@appliance_tmpl = WcoHosting::ApplianceTmpl.find params[:id]
|
37
|
+
authorize! :update, @appliance_tmpl
|
38
|
+
flag = @appliance_tmpl.update params[:appliance].permit!
|
39
|
+
if flag
|
40
|
+
flash_notice 'success'
|
41
|
+
else
|
42
|
+
flash_alert "Cannot update appliance template: #{@appliance_tmpl.errors.full_messages.join(', ')}."
|
43
|
+
end
|
44
|
+
redirect_to action: :index
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
## private
|
49
|
+
##
|
50
|
+
private
|
51
|
+
|
52
|
+
def set_lists
|
53
|
+
@new_appliance_tmpl = WcoHosting::ApplianceTmpl.new
|
54
|
+
end
|
55
|
+
|
7
56
|
end
|
57
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
- url = appliance_tmpl.new_record? ? appliance_tmpls_path : appliance_tmpl_path( appliance_tmpl )
|
3
|
+
|
4
|
+
.appliance-tmpls--form
|
5
|
+
= form_for appliance_tmpl, as: :appliance, url: url do |f|
|
6
|
+
.field
|
7
|
+
= f.label :kind
|
8
|
+
= f.text_field :kind
|
9
|
+
.field
|
10
|
+
= f.label :version
|
11
|
+
= f.text_field :version
|
12
|
+
.field
|
13
|
+
= f.label :descr
|
14
|
+
= f.text_area :descr
|
15
|
+
.field
|
16
|
+
= f.label :image
|
17
|
+
= f.text_field :image, class: 'w-100'
|
18
|
+
.field
|
19
|
+
%label volume_zip
|
20
|
+
= f.text_field :volume_zip, class: 'w-100'
|
21
|
+
|
22
|
+
.actions
|
23
|
+
= f.submit 'Submit'
|
@@ -10,7 +10,7 @@
|
|
10
10
|
%th next_port
|
11
11
|
%th public_ip
|
12
12
|
%th ssh_host
|
13
|
-
%td
|
13
|
+
-# %td
|
14
14
|
- @serverhosts.each do |s|
|
15
15
|
%tr
|
16
16
|
%td
|
@@ -18,6 +18,5 @@
|
|
18
18
|
%td= s.ssh_host
|
19
19
|
%td= s.next_port
|
20
20
|
%td= s.public_ip
|
21
|
-
%td
|
22
|
-
= s.inspect
|
21
|
+
-# %td= s.inspect
|
23
22
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wco_hosting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
@@ -216,7 +216,10 @@ files:
|
|
216
216
|
- app/models/wco/ability.rb
|
217
217
|
- app/views/layouts/wco_hosting/application.haml
|
218
218
|
- app/views/wco/application/_alerts_notices.haml
|
219
|
+
- app/views/wco_hosting/appliance_tmpls/_form.haml
|
220
|
+
- app/views/wco_hosting/appliance_tmpls/edit.haml
|
219
221
|
- app/views/wco_hosting/appliance_tmpls/index.haml
|
222
|
+
- app/views/wco_hosting/appliance_tmpls/new.haml
|
220
223
|
- app/views/wco_hosting/appliances/index.haml
|
221
224
|
- app/views/wco_hosting/application/home.haml
|
222
225
|
- app/views/wco_hosting/leadsets/_form.haml
|