wco_hosting 0.0.0.0 → 0.0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/wco_hosting/main.scss +22 -0
- data/app/controllers/wco_hosting/appliance_tmpls_controller.rb +7 -0
- data/app/controllers/wco_hosting/appliances_controller.rb +26 -0
- data/app/controllers/wco_hosting/application_controller.rb +26 -4
- data/app/controllers/wco_hosting/leadsets_controller.rb +44 -0
- data/app/controllers/wco_hosting/serverhosts_controller.rb +26 -0
- data/app/controllers/wco_hosting/{sessions_controller.rb → sessions_controller.rb-trash} +1 -1
- data/app/models/{wco_hosting → wco}/ability.rb +2 -1
- data/app/views/layouts/wco_hosting/application.haml +12 -3
- data/app/views/wco/application/_alerts_notices.haml +22 -0
- data/app/views/wco_hosting/appliance_tmpls/index.haml +23 -0
- data/app/views/wco_hosting/appliances/index.haml +21 -0
- data/app/views/wco_hosting/application/home.haml +1 -1
- data/app/views/wco_hosting/leadsets/_form.haml +19 -0
- data/app/views/wco_hosting/leadsets/index.haml +13 -0
- data/app/views/wco_hosting/leadsets/show.haml +5 -0
- data/app/views/wco_hosting/serverhosts/_form.haml +22 -0
- data/app/views/wco_hosting/serverhosts/edit.haml +2 -0
- data/app/views/wco_hosting/serverhosts/index.haml +21 -0
- data/config/routes.rb +8 -3
- data/lib/wco_hosting/engine.rb +3 -6
- metadata +60 -7
- data/app/views/wco/email_conversations/index.haml +0 -6
- data/app/views/wco_hosting/sessions/new.html.erb +0 -4
- data/config/initialisers/misc.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: beb77daf73609eecd8757c3f1f8a19b2ba71e03820d5bb1dbafb065f3d4ad839
|
4
|
+
data.tar.gz: da6e5c4106e559345df1926ba8a3158136eb8c0f7126dfb14fb8ee27675f5006
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b8b1d37e70e5a7f9b520945303ba96abe02a5a97ad0afef2b1ed8c1713f473b49099300fc2f87572ad41f242bc809c152406eafbf952ed44c69aa8fa327e35f
|
7
|
+
data.tar.gz: 1bf76b9cd431ad9a37789b60d95796c12665d487652e250a36ebe64f1d8b5b999fa1213d25e23a1f7fa0918a27d1ade48677482f0667a06d4be136271002ef00
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
table.bordered {
|
3
|
+
|
4
|
+
border: 1px solid gray;
|
5
|
+
border-bottom: 0;
|
6
|
+
border-right: 0;
|
7
|
+
|
8
|
+
th {
|
9
|
+
background: #ddd;
|
10
|
+
}
|
11
|
+
|
12
|
+
td {
|
13
|
+
border: 1px solid gray;
|
14
|
+
border-top: 0;
|
15
|
+
border-left: 0;
|
16
|
+
}
|
17
|
+
|
18
|
+
}
|
19
|
+
|
20
|
+
.flex-row {
|
21
|
+
display: flex;
|
22
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
class WcoHosting::AppliancesController < WcoHosting::ApplicationController
|
3
|
+
|
4
|
+
def index
|
5
|
+
authorize! :index, WcoHosting::Appliance
|
6
|
+
@appliances = WcoHosting::Appliance.all
|
7
|
+
end
|
8
|
+
|
9
|
+
# def edit
|
10
|
+
# @serverhost = WcoHosting::Serverhost.find params[:id]
|
11
|
+
# authorize! :edit, @serverhost
|
12
|
+
# end
|
13
|
+
|
14
|
+
# def update
|
15
|
+
# @serverhost = WcoHosting::Serverhost.find params[:id]
|
16
|
+
# authorize! :update, @serverhost
|
17
|
+
# if @serverhost.update_attributes( params[:serverhost].permit! )
|
18
|
+
# flash_notice @serverhost
|
19
|
+
# else
|
20
|
+
# flash_alert @serverhost
|
21
|
+
# end
|
22
|
+
# redirect_to action: :index
|
23
|
+
# end
|
24
|
+
|
25
|
+
|
26
|
+
end
|
@@ -1,12 +1,10 @@
|
|
1
1
|
|
2
|
-
require 'ish_models'
|
3
|
-
|
4
2
|
class WcoHosting::ApplicationController < ActionController::Base
|
5
3
|
|
6
4
|
check_authorization
|
7
5
|
|
8
6
|
def home
|
9
|
-
authorize! :index, ::
|
7
|
+
authorize! :index, ::WcoHosting::Appliance
|
10
8
|
end
|
11
9
|
|
12
10
|
##
|
@@ -15,11 +13,35 @@ class WcoHosting::ApplicationController < ActionController::Base
|
|
15
13
|
private
|
16
14
|
|
17
15
|
def current_ability
|
18
|
-
@current_ability ||= ::
|
16
|
+
@current_ability ||= ::Wco::Ability.new(current_user)
|
19
17
|
end
|
20
18
|
|
21
19
|
def current_profile
|
22
20
|
@current_profile ||= Wco::Profile.find_by( email: current_user.email )
|
23
21
|
end
|
24
22
|
|
23
|
+
def current_leadset
|
24
|
+
@current_leadset ||= current_profile.leadset
|
25
|
+
end
|
26
|
+
|
27
|
+
def flash_alert what
|
28
|
+
flash[:alert] ||= []
|
29
|
+
if String == what.class
|
30
|
+
str = what
|
31
|
+
else
|
32
|
+
str = "Cannot create/update #{what.class.name}: #{what.errors.full_messages.join(', ')} ."
|
33
|
+
end
|
34
|
+
flash[:alert] << str
|
35
|
+
end
|
36
|
+
|
37
|
+
def flash_notice what
|
38
|
+
flash[:notice] ||= []
|
39
|
+
if String == what.class
|
40
|
+
str = what
|
41
|
+
else
|
42
|
+
str = "Created/updated #{what.class.name} ."
|
43
|
+
end
|
44
|
+
flash[:notice] << str
|
45
|
+
end
|
46
|
+
|
25
47
|
end
|
@@ -0,0 +1,44 @@
|
|
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
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
class WcoHosting::ServerhostsController < WcoHosting::ApplicationController
|
3
|
+
|
4
|
+
def index
|
5
|
+
authorize! :index, WcoHosting::Serverhost
|
6
|
+
@serverhosts = WcoHosting::Serverhost.all
|
7
|
+
end
|
8
|
+
|
9
|
+
def edit
|
10
|
+
@serverhost = WcoHosting::Serverhost.find params[:id]
|
11
|
+
authorize! :edit, @serverhost
|
12
|
+
end
|
13
|
+
|
14
|
+
def update
|
15
|
+
@serverhost = WcoHosting::Serverhost.find params[:id]
|
16
|
+
authorize! :update, @serverhost
|
17
|
+
if @serverhost.update_attributes( params[:serverhost].permit! )
|
18
|
+
flash_notice @serverhost
|
19
|
+
else
|
20
|
+
flash_alert @serverhost
|
21
|
+
end
|
22
|
+
redirect_to action: :index
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
end
|
@@ -7,10 +7,19 @@
|
|
7
7
|
= csp_meta_tag
|
8
8
|
= stylesheet_link_tag "wco_hosting/application", media: "all"
|
9
9
|
%body
|
10
|
+
|
11
|
+
%h1 Wco Hosting
|
10
12
|
%nav
|
11
13
|
%ul
|
12
|
-
%li= link_to '
|
13
|
-
%li= link_to '
|
14
|
+
%li= link_to 'Wco::Leadsets', leadsets_path
|
15
|
+
%li= link_to 'ApplianceTmpl`s', appliance_tmpls_path
|
16
|
+
%li= link_to 'Appliances', appliances_path
|
17
|
+
%li= link_to 'Serverhosts', serverhosts_path
|
14
18
|
%hr
|
19
|
+
|
20
|
+
= render '/wco/application/alerts_notices'
|
21
|
+
%hr
|
22
|
+
|
15
23
|
= yield
|
16
|
-
%hr
|
24
|
+
%hr
|
25
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
.row.max-width
|
3
|
+
.col-sm-12
|
4
|
+
- if notice&.class == String
|
5
|
+
.notice
|
6
|
+
= notice
|
7
|
+
.close [x]
|
8
|
+
- if notice&.class == Array
|
9
|
+
- notice.each do |i|
|
10
|
+
.notice
|
11
|
+
= i
|
12
|
+
.close [x]
|
13
|
+
- if alert&.class == String
|
14
|
+
.alert
|
15
|
+
= alert
|
16
|
+
.close [x]
|
17
|
+
- if alert&.class == Array
|
18
|
+
- alert.each do |i|
|
19
|
+
.alert
|
20
|
+
= i
|
21
|
+
.close [x]
|
22
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
.appliance-tmpls-index
|
3
|
+
%h5 ApplianceTmpl's
|
4
|
+
|
5
|
+
%table.bordered
|
6
|
+
%tr
|
7
|
+
%th id
|
8
|
+
%th kind
|
9
|
+
%th version
|
10
|
+
%th image
|
11
|
+
%th volume_zip
|
12
|
+
-# %td
|
13
|
+
|
14
|
+
- @appliance_tmpls.each do |tmpl|
|
15
|
+
%tr
|
16
|
+
%td= tmpl.id
|
17
|
+
%td= tmpl.kind
|
18
|
+
%td= tmpl.version
|
19
|
+
%td= tmpl.image
|
20
|
+
%td= tmpl.volume_zip
|
21
|
+
-# %td= tmpl.inspect
|
22
|
+
|
23
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
.appliances-index
|
3
|
+
%h5 Appliances
|
4
|
+
|
5
|
+
%table.bordered
|
6
|
+
%tr
|
7
|
+
%th id
|
8
|
+
%th tmpl
|
9
|
+
%th host
|
10
|
+
%th service_name
|
11
|
+
%td
|
12
|
+
- @appliances.each do |app|
|
13
|
+
%tr
|
14
|
+
%td= app.id
|
15
|
+
%td= app.tmpl.inspect
|
16
|
+
%td= app.host
|
17
|
+
%td= app.service_name
|
18
|
+
%td
|
19
|
+
= app.inspect
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
- url = leadset.new_record? ? leadsets_path : leadset_path(leadset)
|
3
|
+
.leadsets--form
|
4
|
+
%ul
|
5
|
+
%li <b>Next Serverhost:</b> #{leadset.next_serverhost}
|
6
|
+
|
7
|
+
= form_for leadset, as: :leadset, url: url do |f|
|
8
|
+
.field
|
9
|
+
= f.label :company_url
|
10
|
+
= f.text_field :company_url
|
11
|
+
.field
|
12
|
+
= f.label :email
|
13
|
+
= f.text_field :email
|
14
|
+
.field
|
15
|
+
= f.label :serverhosts
|
16
|
+
= f.select :serverhost_ids, options_for_select(@serverhosts_list, selected: leadset.serverhosts.map(&:id) ), {}, { multiple: true }
|
17
|
+
|
18
|
+
.actions
|
19
|
+
= f.submit
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
.leadsets-index
|
3
|
+
%h5 Leadsets
|
4
|
+
|
5
|
+
%ul
|
6
|
+
- @leadsets.each do |leadset|
|
7
|
+
%li.flex-row
|
8
|
+
.gray= leadset.id.to_s
|
9
|
+
|
10
|
+
= link_to "[view]", leadset_path(leadset)
|
11
|
+
%ul
|
12
|
+
%li <b>company_url:</b> #{leadset.company_url}
|
13
|
+
%li <b>serverhosts:</b> #{leadset.serverhosts.map(&:name).join(",")}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
.serverhosts--form
|
3
|
+
= form_for serverhost do |f|
|
4
|
+
|
5
|
+
.field
|
6
|
+
= f.label :name
|
7
|
+
= f.text_field :name
|
8
|
+
|
9
|
+
.field
|
10
|
+
= f.label :next_port
|
11
|
+
= f.text_field :next_port
|
12
|
+
|
13
|
+
.field
|
14
|
+
= f.label :public_ip
|
15
|
+
= f.text_field :public_ip
|
16
|
+
|
17
|
+
.field
|
18
|
+
= f.label :ssh_host
|
19
|
+
= f.text_field :ssh_host
|
20
|
+
|
21
|
+
.actions
|
22
|
+
= f.submit
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
.serverhosts-index
|
3
|
+
%h5 Serverhosts
|
4
|
+
|
5
|
+
%table.bordered
|
6
|
+
%tr
|
7
|
+
%th name
|
8
|
+
%th next_port
|
9
|
+
%th public_ip
|
10
|
+
%th ssh_host
|
11
|
+
%td
|
12
|
+
- @serverhosts.each do |s|
|
13
|
+
%tr
|
14
|
+
%td
|
15
|
+
= link_to s.name, edit_serverhost_path(s)
|
16
|
+
%td= s.ssh_host
|
17
|
+
%td= s.next_port
|
18
|
+
%td= s.public_ip
|
19
|
+
%td
|
20
|
+
= s.inspect
|
21
|
+
|
data/config/routes.rb
CHANGED
@@ -2,9 +2,14 @@
|
|
2
2
|
WcoHosting::Engine.routes.draw do
|
3
3
|
root to: '/wco_hosting/application#home'
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
resources :appliance_tmpls
|
6
|
+
resources :appliances
|
7
7
|
|
8
|
-
|
8
|
+
# get 'email_conversations/in/:tagname', to: '/wco/email_conversations#index', as: :email_conversations_in
|
9
|
+
# get 'email_conversations/not-in/:tagname_not', to: '/wco/email_conversations#index', as: :email_conversations_in_not
|
10
|
+
# resources :email_conversations
|
11
|
+
|
12
|
+
resources :serverhosts
|
13
|
+
resources :leadsets
|
9
14
|
|
10
15
|
end
|
data/lib/wco_hosting/engine.rb
CHANGED
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -150,6 +150,48 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 1.0.1
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: net-ssh
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 7.2.0
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 7.2.0
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: net-scp
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 4.0.0
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 4.0.0
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: sass-rails
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '5.0'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '5.0'
|
153
195
|
description: https://wasya.co
|
154
196
|
email:
|
155
197
|
- victor@wasya.co
|
@@ -161,17 +203,28 @@ files:
|
|
161
203
|
- Rakefile
|
162
204
|
- app/assets/config/wco_hosting_manifest.js
|
163
205
|
- app/assets/stylesheets/wco_hosting/application.css
|
206
|
+
- app/assets/stylesheets/wco_hosting/main.scss
|
207
|
+
- app/controllers/wco_hosting/appliance_tmpls_controller.rb
|
208
|
+
- app/controllers/wco_hosting/appliances_controller.rb
|
164
209
|
- app/controllers/wco_hosting/application_controller.rb
|
165
|
-
- app/controllers/wco_hosting/
|
210
|
+
- app/controllers/wco_hosting/leadsets_controller.rb
|
211
|
+
- app/controllers/wco_hosting/serverhosts_controller.rb
|
212
|
+
- app/controllers/wco_hosting/sessions_controller.rb-trash
|
166
213
|
- app/helpers/wco_hosting/application_helper.rb
|
167
214
|
- app/jobs/wco_hosting/application_job.rb
|
168
215
|
- app/mailers/wco_hosting/application_mailer.rb
|
169
|
-
- app/models/
|
216
|
+
- app/models/wco/ability.rb
|
170
217
|
- app/views/layouts/wco_hosting/application.haml
|
171
|
-
- app/views/wco/
|
218
|
+
- app/views/wco/application/_alerts_notices.haml
|
219
|
+
- app/views/wco_hosting/appliance_tmpls/index.haml
|
220
|
+
- app/views/wco_hosting/appliances/index.haml
|
172
221
|
- app/views/wco_hosting/application/home.haml
|
173
|
-
- app/views/wco_hosting/
|
174
|
-
-
|
222
|
+
- app/views/wco_hosting/leadsets/_form.haml
|
223
|
+
- app/views/wco_hosting/leadsets/index.haml
|
224
|
+
- app/views/wco_hosting/leadsets/show.haml
|
225
|
+
- app/views/wco_hosting/serverhosts/_form.haml
|
226
|
+
- app/views/wco_hosting/serverhosts/edit.haml
|
227
|
+
- app/views/wco_hosting/serverhosts/index.haml
|
175
228
|
- config/routes.rb
|
176
229
|
- lib/tasks/wco_hosting_tasks.rake
|
177
230
|
- lib/wco_hosting.rb
|
data/config/initialisers/misc.rb
DELETED