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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94d1250ed739bbb7c84bd8b4a4a5242cac48a700a367d5d37ba15ec2801fd65f
4
- data.tar.gz: f1f048e745653292ef32b83f04216f148bc3f44d418be39fcd3507447feb7283
3
+ metadata.gz: c74e9e69e8a2eaf81fbfa0397841aa0c26dc8e3e99508889d3d236fbd9752700
4
+ data.tar.gz: d22fe31571e487240b613b4b8a9ace297db9eca9a29d7cbdecba55db491832a2
5
5
  SHA512:
6
- metadata.gz: a727924cdeff8601df79753b10c262d48179078dca21d1ad7f2be286ef2f1b764ec5dc18b30c54875e0136cfcaff5dd06eb4ca7aeb76ae625426603adbdb4560
7
- data.tar.gz: f030dce6e1e4024f2d0fc20acdf97f6778bc0a5b2a99e8e8d49d80963f3084f9987f64171830e419a18434b946cf6c76da7015b652f4c53ba0aeb4c2f80ed94c
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
 
@@ -59,4 +59,7 @@
59
59
  = f.text_field :deleted_at
60
60
 
61
61
  .actions
62
- = f.submit 'Go'
62
+ = f.submit 'Go'
63
+
64
+ %hr
65
+ = appliance_tmpl.inspect
@@ -10,5 +10,8 @@
10
10
  .field
11
11
  %label slug
12
12
  = f.text_field :slug
13
+ .field
14
+ %label port
15
+ = f.text_field :port
13
16
  .actions
14
17
  = f.submit 'Go'
@@ -4,7 +4,7 @@
4
4
  Appliances
5
5
  = link_to '[+]', new_appliance_path
6
6
 
7
- %table.bordered.data-table
7
+ %table.bordered
8
8
  %thead
9
9
  %td &nbsp;
10
10
  %td created_at
@@ -18,5 +18,9 @@
18
18
  = f.label :ssh_host
19
19
  = f.text_field :ssh_host
20
20
 
21
+ .field
22
+ %label skip do resource?
23
+ = check_box_tag :skip_do_resource
24
+
21
25
  .actions
22
26
  = f.submit
@@ -1,2 +1,4 @@
1
1
 
2
- = render 'form', serverhost: @serverhost
2
+ .maxwidth
3
+
4
+ = render 'form', serverhost: @serverhost
@@ -10,14 +10,15 @@
10
10
  %th ssh_host
11
11
  %th public_ip
12
12
  %th next_port
13
- -# %td &nbsp;
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
- -# %td= ser.inspect
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.26
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-05 00:00:00.000000000 Z
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