wco_hosting 0.0.0.16 → 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: 30b3e225190919ad99c8611730e0e75415b394eda5b89bc5d173bf70a921dcb5
4
- data.tar.gz: 904a1f18e6c3df858c15865dc7d366e0431f75c51644f2688fed523c461b1998
3
+ metadata.gz: b178202623e8e58406613183f3c2ba45a1159b8b95eac0a68398466b578a7fbc
4
+ data.tar.gz: 5dfbe1301dab5b5ed929427f698bd19363d9459e8e41ee8e2101e0aee551aa3d
5
5
  SHA512:
6
- metadata.gz: 7a3094645efe8b263d3eda8b57912cf38dc18b37a92537356b3a121754a369e298b122249b4d7cb16646468d467c651e7463c02de76c13a4cfe23472fccbf97b
7
- data.tar.gz: 1d9449a7c3718c7b83cafd40a71bd0012092ff79af6167c143c3796a6ec92bceb4f12a0d7841cce2a55f3fcc8d8d846a15526cb69e42d94d4979d3ea7779d2ff
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.16
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-13 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
@@ -232,13 +232,11 @@ files:
232
232
  - app/assets/config/wco_hosting_manifest.js
233
233
  - app/assets/javascript/wco_hosting/application.js
234
234
  - app/assets/stylesheets/wco_hosting/application.css
235
- - app/assets/stylesheets/wco_hosting/dark_theme.scss
236
235
  - app/assets/stylesheets/wco_hosting/main.scss
237
236
  - app/controllers/wco_hosting/appliance_tmpls_controller.rb
238
237
  - app/controllers/wco_hosting/appliances_controller.rb
239
238
  - app/controllers/wco_hosting/application_controller.rb
240
239
  - app/controllers/wco_hosting/domains_controller.rb
241
- - app/controllers/wco_hosting/leadsets_controller.rb-trash
242
240
  - app/controllers/wco_hosting/serverhosts_controller.rb
243
241
  - app/controllers/wco_hosting/subscriptions_controller.rb
244
242
  - app/helpers/wco_hosting/application_helper.rb
@@ -251,10 +249,12 @@ files:
251
249
  - app/views/wco_hosting/appliance_tmpls/new.haml
252
250
  - app/views/wco_hosting/appliances/edit.haml
253
251
  - app/views/wco_hosting/appliances/index.haml
252
+ - app/views/wco_hosting/appliances/show.haml
254
253
  - app/views/wco_hosting/application/home.haml
255
254
  - app/views/wco_hosting/domains/_form.haml
256
255
  - app/views/wco_hosting/domains/edit.haml
257
256
  - app/views/wco_hosting/domains/index.haml
257
+ - app/views/wco_hosting/domains/show.haml
258
258
  - app/views/wco_hosting/leadsets/_form.haml
259
259
  - app/views/wco_hosting/leadsets/index.haml
260
260
  - app/views/wco_hosting/leadsets/show.haml
@@ -1,16 +0,0 @@
1
-
2
- body {
3
- background: #222;
4
- color: #ccc;
5
- }
6
- a {
7
- // color: #d30048;
8
- color: #00c5b7;
9
- }
10
-
11
- input,
12
- select,
13
- textarea {
14
- background: #333;
15
- color: #ccc;
16
- }
@@ -1,44 +0,0 @@
1
-
2
- class WcoHosting::LeadsetsController < WcoHosting::ApplicationController
3
-
4
- before_action :set_lists
5
-
6
- def index
7
- authorize! :index, Wco::Leadset
8
- @leadsets = Wco::Leadset.all
9
- end
10
-
11
- def show
12
- @leadset = Wco::Leadset.find params[:id]
13
- authorize! :show, @leadset
14
-
15
- end
16
-
17
- def update
18
- @leadset = Wco::Leadset.find params[:id]
19
- authorize! :update, @leadset
20
- params[:leadset][:serverhost_ids].delete("")
21
- puts! params, 'params'
22
-
23
- flag = @leadset.update_attributes( params.require(:leadset).permit(
24
- :company_url, :email, serverhost_ids: [] )
25
- )
26
- if flag
27
- flash_notice @leadset
28
- else
29
- flash_alert @leadset
30
- end
31
- redirect_to action: :index
32
- end
33
-
34
- ##
35
- ## private
36
- ##
37
- private
38
-
39
- def set_lists
40
- @serverhosts_list = WcoHosting::Serverhost.list
41
- end
42
-
43
-
44
- end