wco_hosting 0.0.0.17 → 0.0.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 925161dea305615f15641b1d225e64ed138116934c5b47cf10c202519b76020d
4
- data.tar.gz: 97db1e81f6629066cbe060c03ee2b49a3e4094f61feecdce4eb14d5813dda266
3
+ metadata.gz: b178202623e8e58406613183f3c2ba45a1159b8b95eac0a68398466b578a7fbc
4
+ data.tar.gz: 5dfbe1301dab5b5ed929427f698bd19363d9459e8e41ee8e2101e0aee551aa3d
5
5
  SHA512:
6
- metadata.gz: 2d0e22a2fdc1b9b025472b4f6a23e7b141efeaac2b7ad3df8ae45036d38cdaec820b6df70c7419249c1712964cc62b48af2a5d7f1e338fd247a547e0553ec6a6
7
- data.tar.gz: c7d4a7ba01588caf892f0386e4e7f74f45425d377a13cf010b66e790225915a9de63f4cd38ae1ab4102c77d2602f1ae82dd5a00ad5272fa5c42913a887e169f4
6
+ metadata.gz: e40a0614f9d21ddc737e62483d6afb6f506ec3bb176b6d06ac816c22bc0b10091f391bcd787ae42b84aa84969099132ec175ab1d48421cb793cc94aa7b6eda7a
7
+ data.tar.gz: 87c8bea0677755b19fbb1a74c557f9062b2e697fa6c70b0dffbeff6f94ac309e5f290e8db9b8d360ea96639102de823253be7d7d7ad4be7d51c1b238dce6a20b
@@ -11,6 +11,11 @@ class WcoHosting::AppliancesController < WcoHosting::ApplicationController
11
11
  authorize! :edit, @appliance
12
12
  end
13
13
 
14
+ def show
15
+ @appliance = WcoHosting::Appliance.find params[:id]
16
+ authorize! :show, @appliance
17
+ end
18
+
14
19
  # def update
15
20
  # @serverhost = WcoHosting::Serverhost.find params[:id]
16
21
  # authorize! :update, @serverhost
@@ -1,7 +1,5 @@
1
1
 
2
- class WcoHosting::ApplicationController < ActionController::Base
3
-
4
- check_authorization
2
+ class WcoHosting::ApplicationController < Wco::ApplicationController
5
3
 
6
4
  def home
7
5
  authorize! :index, ::WcoHosting::Appliance
@@ -11,6 +11,12 @@ class WcoHosting::DomainsController < WcoHosting::ApplicationController
11
11
  authorize! :edit, @domain
12
12
  end
13
13
 
14
+ def show
15
+ @domain = WcoHosting::Domain.find params[:id]
16
+ authorize! :show, @domain
17
+ @subdomains = WcoHosting::Appliance.where( domain: @domain.name ).map( &:subdomain )
18
+ end
19
+
14
20
  def update
15
21
  @domain = WcoHosting::Domain.find params[:id]
16
22
  authorize! :update, @domain
@@ -4,6 +4,24 @@
4
4
  %meta{content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}
5
5
  %title Wco Hosting
6
6
 
7
+ = javascript_include_tag "//code.jquery.com/jquery-3.3.1.min.js"
8
+
9
+ = javascript_include_tag "//cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"
10
+ = stylesheet_link_tag "//cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"
11
+
12
+ = stylesheet_link_tag "//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", :media => 'all'
13
+ = stylesheet_link_tag "//fonts.googleapis.com/icon?family=Material+Icons"
14
+
15
+ = stylesheet_link_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"
16
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js"
17
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"
18
+
19
+ = stylesheet_link_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/css/select2.min.css"
20
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/select2@4.0.0/dist/js/select2.min.js", defer: 'defer'
21
+
22
+ = stylesheet_link_tag "//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css"
23
+ = javascript_include_tag "//cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"
24
+
7
25
  = javascript_include_tag "wco/application"
8
26
  = stylesheet_link_tag "wco/application", media: "all"
9
27
 
@@ -25,3 +43,6 @@
25
43
  %script{:src => "https://js.stripe.com/v3/"}
26
44
  :javascript
27
45
  stripe = Stripe('#{::STRIPE_PK}', { apiVersion: '2020-08-27' });
46
+
47
+ = render '/wco/main_footer'
48
+ = render '/wco_email/analytics' if Rails.env.production?
@@ -5,10 +5,6 @@
5
5
  = form_for appliance_tmpl, as: :tmpl, url: url do |f|
6
6
  .actions
7
7
  = f.submit 'Submit'
8
-
9
-
10
- -# = f.select :leadset_ids, options_for_select( @leadsets_list, selected: appliance_tmpl.leadset_ids ), {}, { multiple: true }
11
-
12
8
  .d-flex
13
9
  = f.label :kind
14
10
  = f.text_field :kind, style: 'flex-grow: 1'
@@ -24,20 +20,5 @@
24
20
  .field
25
21
  %label volume_zip
26
22
  = f.text_field :volume_zip, class: 'w-100'
27
- -# .field
28
- -# %label Price in Cents
29
- -# = f.number_field :tmp_price_cents
30
- -# %label Price interval
31
- -# = f.select :tmp_price_interval, options_for_select( Wco::Price::INTERVALS ), class: 'select2'
32
-
33
23
  .actions
34
- = f.submit 'Submit'
35
-
36
- .prices
37
- %label Prices
38
- %ul
39
- - appliance_tmpl.prices.each do |price|
40
- %li= price.inspect
41
-
42
-
43
- = appliance_tmpl.inspect
24
+ = f.submit 'Submit'
@@ -4,26 +4,37 @@
4
4
 
5
5
  .field
6
6
  %h5 Customers
7
- %ul
7
+ %table.bordered.data-table
8
+ %thead
9
+ %td &nbsp;
10
+ %td Leadset
11
+ %td Amount Cents
12
+ %td Interval
8
13
  - @leadsets.each do |leadset|
9
- - price = leadset.appliance_tmpl_prices.where( product: @appliance_tmpl ).first
10
- - price ||= Wco::Price.new({ product: @appliance_tmpl, appliance_tmpl_leadset: leadset })
11
- - url = price.new_record? ? wco.prices_path : wco.price_path(price)
12
- %li
14
+ %tr
15
+ - price = leadset.appliance_tmpl_prices.where( product: @appliance_tmpl ).first
16
+ - price ||= Wco::Price.new({ product: @appliance_tmpl, appliance_tmpl_leadset: leadset })
17
+ - url = price.new_record? ? wco.prices_path : wco.price_path(price)
18
+ - if !price.new_record?
19
+ %td
20
+ = button_to 'x', wco.price_path(price), method: :delete, data: { confirm: 'Are you sure?' }
21
+ - else
22
+ %td
13
23
  = form_for price, url: url do |f|
14
24
  = hidden_field_tag 'price[product_id]', price.product_id
15
25
  = hidden_field_tag 'price[product_type]', price.product_type
16
26
  = hidden_field_tag 'price[appliance_tmpl_leadset_id]', leadset.id
17
- .d-flex
27
+ %td
18
28
  %b= leadset
19
- &nbsp;
20
- %label Amount Cents
29
+ %td
21
30
  = f.number_field :amount_cents
22
- %label interval
23
- = f.select :interval, options_for_select( Wco::Price::INTERVALS ), class: 'select2'
31
+ %td
32
+ = f.select :interval, options_for_select( Wco::Price::INTERVALS, selected: price.interval ), class: 'select2'
24
33
  = f.submit '>'
25
34
  &nbsp;
26
35
  .gray= price.price_id || 'nil'
36
+
37
+
27
38
  %hr
28
39
 
29
40
  = render 'form', appliance_tmpl: @appliance_tmpl
@@ -22,6 +22,8 @@
22
22
  %td= tmpl.image
23
23
  %td= tmpl.volume_zip
24
24
  %td
25
+ %b Product:
26
+ .gray= tmpl.product_id
25
27
  %ul
26
28
  - tmpl.prices.each do |price|
27
29
  %li
@@ -3,23 +3,25 @@
3
3
  %h5 Appliances
4
4
 
5
5
  %table.bordered.data-table
6
- %tr
7
- %th &nbsp;
8
- %th created_at
9
- %th tmpl
10
- %th host
11
- %th service_name
6
+ %thead
7
+ %td &nbsp;
8
+ %td created_at
9
+ %td tmpl
10
+ %td host
11
+ %td service_name
12
+ %td port
12
13
 
13
14
  - @appliances.each do |app|
14
15
  %tr
15
16
  %td
16
17
  = link_to '[~]', edit_appliance_path(app)
17
18
  -# = link_to '[view]', appliance_path(app)
18
- .gray.mini= app.id
19
+ .gray.mini= link_to app.id, appliance_path(app)
19
20
  %td
20
21
  = app.created_at
21
22
  %td= app.tmpl
22
23
  %td= app.host
23
24
  %td= app.service_name
25
+ %td= app.port
24
26
 
25
27
 
@@ -0,0 +1,27 @@
1
+
2
+ .appliances-edit.maxwidth
3
+ %h5 Appliance `#{@appliance}`
4
+
5
+ %ul
6
+ %li
7
+ %label.bold Leadset:
8
+ = link_to @appliance.leadset, wco.leadset_path(@appliance.leadset)
9
+ %li
10
+ %label.bold Env:
11
+ = @appliance.environment
12
+ %li
13
+ %label.bold Tmpl:
14
+ = @appliance.appliance_tmpl
15
+
16
+ .logs
17
+ %h5 Logs
18
+ %ul
19
+ - @appliance.logs.each do |log|
20
+ %li
21
+ = log.created_at
22
+ %b= log.label
23
+ %pre.descr= log.message
24
+
25
+ = @appliance.inspect
26
+
27
+
@@ -14,6 +14,6 @@
14
14
  %td
15
15
  = link_to '[~]', edit_domain_path(dom)
16
16
  %td
17
- = dom.name
17
+ = link_to dom.name, domain_path(dom)
18
18
  %td= dom.status
19
19
  -# %td= dom.inspect
@@ -0,0 +1,7 @@
1
+
2
+ .domains-show
3
+ %h5 Domain `#{@domain}`
4
+
5
+ %ul
6
+ - @subdomains.each do |sub|
7
+ %li= sub
@@ -7,16 +7,17 @@
7
7
  %table.bordered
8
8
  %tr
9
9
  %th name
10
- %th next_port
11
- %th public_ip
12
10
  %th ssh_host
11
+ %th public_ip
12
+ %th next_port
13
13
  -# %td &nbsp;
14
- - @serverhosts.each do |s|
14
+ - @serverhosts.each do |ser|
15
15
  %tr
16
16
  %td
17
- = link_to s.name, edit_serverhost_path(s)
18
- %td= s.ssh_host
19
- %td= s.next_port
20
- %td= s.public_ip
21
- -# %td= s.inspect
17
+ = link_to '[~]', edit_serverhost_path(ser)
18
+ = ser.name
19
+ %td= ser.ssh_host
20
+ %td= ser.public_ip
21
+ %td= ser.next_port
22
+ -# %td= ser.inspect
22
23
 
@@ -1,4 +1,10 @@
1
1
 
2
2
  Rails.application.config.assets.version = '1.0'
3
3
 
4
- Rails.application.config.assets.precompile += %w( application.js application.css )
4
+ Rails.application.config.assets.precompile += %w(
5
+ wco_models/application.js
6
+ wco_models/application.css
7
+
8
+ application.js
9
+ application.css
10
+ );
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.17
4
+ version: 0.0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2024-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cancancan
@@ -249,10 +249,12 @@ files:
249
249
  - app/views/wco_hosting/appliance_tmpls/new.haml
250
250
  - app/views/wco_hosting/appliances/edit.haml
251
251
  - app/views/wco_hosting/appliances/index.haml
252
+ - app/views/wco_hosting/appliances/show.haml
252
253
  - app/views/wco_hosting/application/home.haml
253
254
  - app/views/wco_hosting/domains/_form.haml
254
255
  - app/views/wco_hosting/domains/edit.haml
255
256
  - app/views/wco_hosting/domains/index.haml
257
+ - app/views/wco_hosting/domains/show.haml
256
258
  - app/views/wco_hosting/leadsets/_form.haml
257
259
  - app/views/wco_hosting/leadsets/index.haml
258
260
  - app/views/wco_hosting/leadsets/show.haml