wco_hosting 0.0.0.26 → 0.0.0.27
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.
- checksums.yaml +4 -4
- data/app/controllers/wco_hosting/domains_controller.rb +5 -0
- data/app/controllers/wco_hosting/serverhosts_controller.rb +20 -1
- data/app/views/wco_hosting/appliance_tmpls/_form.haml +4 -1
- data/app/views/wco_hosting/appliances/_form.haml +3 -0
- data/app/views/wco_hosting/appliances/index.haml +1 -1
- data/app/views/wco_hosting/serverhosts/_form.haml +4 -0
- data/app/views/wco_hosting/serverhosts/edit.haml +3 -1
- data/app/views/wco_hosting/serverhosts/index.haml +3 -2
- metadata +5 -5
- /data/app/views/wco_hosting/{leadsets → leadsets-bk}/_form.haml +0 -0
- /data/app/views/wco_hosting/{leadsets/index.haml → leadsets-bk/index.haml-bk} +0 -0
- /data/app/views/wco_hosting/{leadsets/show.haml → leadsets-bk/show.haml-bk} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c74e9e69e8a2eaf81fbfa0397841aa0c26dc8e3e99508889d3d236fbd9752700
|
4
|
+
data.tar.gz: d22fe31571e487240b613b4b8a9ace297db9eca9a29d7cbdecba55db491832a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '099f34448ff3e40d9f56d0f0a006fe2377dfa2cbf4c1318ec0877aeaf44a029d6ad7375e1b50248f77a57d915fad962a3126ea9d1fc368c3a68c209b4384ba52'
|
7
|
+
data.tar.gz: d304e57b0bdfe790189e012cfaf5e2b7df46de9169cd2f4630330f788616b850e8abd35e68acca2cfecbbf1f5174c1189f9010d6de9381e91521e8294657445e
|
@@ -36,6 +36,11 @@ class WcoHosting::DomainsController < WcoHosting::ApplicationController
|
|
36
36
|
@subdomains = WcoHosting::Appliance.where( domain: @domain.name ).map( &:subdomain )
|
37
37
|
end
|
38
38
|
|
39
|
+
def new
|
40
|
+
@domain = WcoHosting::Domain.new
|
41
|
+
authorize! :new, @domain
|
42
|
+
end
|
43
|
+
|
39
44
|
def update
|
40
45
|
@domain = WcoHosting::Domain.find params[:id]
|
41
46
|
authorize! :update, @domain
|
@@ -5,6 +5,8 @@ class WcoHosting::ServerhostsController < WcoHosting::ApplicationController
|
|
5
5
|
@serverhost = WcoHosting::Serverhost.new params[:serverhost].permit!
|
6
6
|
authorize! :create, @serverhost
|
7
7
|
|
8
|
+
@serverhost.do_create_server! unless params[:skip_do_resource]
|
9
|
+
|
8
10
|
flag = @serverhost.save
|
9
11
|
if flag
|
10
12
|
flash[:notice] = 'Success.'
|
@@ -15,6 +17,23 @@ class WcoHosting::ServerhostsController < WcoHosting::ApplicationController
|
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
20
|
+
def destroy
|
21
|
+
@serverhost = WcoHosting::Serverhost.find params[:id]
|
22
|
+
authorize! :destroy, @serverhost
|
23
|
+
out = HTTParty.delete( "https://api.digitalocean.com/v2/droplets/#{@serverhost.do_id}",
|
24
|
+
headers: { 'Authorization' => "Bearer #{DO_READER_TOKEN}" },
|
25
|
+
:debug_output => $stdout,
|
26
|
+
);
|
27
|
+
puts! out, 'out'
|
28
|
+
flag = @serverhost.destroy!
|
29
|
+
if flag
|
30
|
+
flash_notice @serverhost
|
31
|
+
else
|
32
|
+
flash_alert @serverhost
|
33
|
+
end
|
34
|
+
redirect_to action: :index
|
35
|
+
end
|
36
|
+
|
18
37
|
def edit
|
19
38
|
@serverhost = WcoHosting::Serverhost.find params[:id]
|
20
39
|
authorize! :edit, @serverhost
|
@@ -22,7 +41,7 @@ class WcoHosting::ServerhostsController < WcoHosting::ApplicationController
|
|
22
41
|
|
23
42
|
def index
|
24
43
|
authorize! :index, WcoHosting::Serverhost
|
25
|
-
@serverhosts = WcoHosting::Serverhost.all
|
44
|
+
@serverhosts = WcoHosting::Serverhost.all.order_by name: :asc
|
26
45
|
@new_serverhost = WcoHosting::Serverhost.new
|
27
46
|
end
|
28
47
|
|
@@ -10,14 +10,15 @@
|
|
10
10
|
%th ssh_host
|
11
11
|
%th public_ip
|
12
12
|
%th next_port
|
13
|
-
|
13
|
+
%th do id
|
14
14
|
- @serverhosts.each do |ser|
|
15
15
|
%tr
|
16
16
|
%td
|
17
17
|
= link_to '[~]', edit_serverhost_path(ser)
|
18
18
|
= link_to ser.name, serverhost_path(ser)
|
19
|
+
.d-inline-block= button_to 'x', serverhost_path(ser), method: :delete, data: { confirm: 'Are you sure?' }
|
19
20
|
%td= ser.ssh_host
|
20
21
|
%td= ser.public_ip
|
21
22
|
%td= ser.next_port
|
22
|
-
|
23
|
+
%td= ser.do_id
|
23
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cancancan
|
@@ -273,9 +273,9 @@ files:
|
|
273
273
|
- app/views/wco_hosting/files/index.haml
|
274
274
|
- app/views/wco_hosting/files/new.haml
|
275
275
|
- app/views/wco_hosting/files/show.haml
|
276
|
-
- app/views/wco_hosting/leadsets/_form.haml
|
277
|
-
- app/views/wco_hosting/leadsets/index.haml
|
278
|
-
- app/views/wco_hosting/leadsets/show.haml
|
276
|
+
- app/views/wco_hosting/leadsets-bk/_form.haml
|
277
|
+
- app/views/wco_hosting/leadsets-bk/index.haml-bk
|
278
|
+
- app/views/wco_hosting/leadsets-bk/show.haml-bk
|
279
279
|
- app/views/wco_hosting/serverhosts/_form.haml
|
280
280
|
- app/views/wco_hosting/serverhosts/edit.haml
|
281
281
|
- app/views/wco_hosting/serverhosts/index.haml
|
File without changes
|
File without changes
|
File without changes
|