foreman_datacenter 0.1.49 → 0.1.50

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
  SHA1:
3
- metadata.gz: 9b07e0a47d71b4b05a50a937eea06dabbd2b0131
4
- data.tar.gz: 1c365a909465a75aab9cf4e4c605448ac66d0245
3
+ metadata.gz: f096d8e5995364d2ad1919c1fd50a41dcf71870f
4
+ data.tar.gz: 48a775014252e6ce5ca677fc92daa83e9bae43c7
5
5
  SHA512:
6
- metadata.gz: 624f0c12cd663ad9b3d89c133d42ac4a76573266794f7e312994a5140089a2eba784541e8d9812eb4195cc87ac404deef6429c2caa6a719f88f1f9e0e41904be
7
- data.tar.gz: 17e8c4a7c91f1668848337db91d1ac0b50e8d6874429ce2170549c15e9a175469e86af1ae2390c40b41713d1e71bd323deda188129f1ab738118080d18848575
6
+ metadata.gz: 290a279214d80f987edc40122003d1f2fa3446ef5cdf6130fa53212d01a1f0f35a937ab23b71aa9583d2c019d3525fadfd5d93f04d30e343383fd4eabaecff28
7
+ data.tar.gz: f6fba572bb44dc45c8be0c5b4f1b161586e357212bf0ba6b5b9f518300d514a5dff4e4f0c7456f38982927e603805d76cac98b1ed716cba6cb8854de2ad94f4d
data/README.md CHANGED
@@ -16,10 +16,68 @@ Foreman Datacenter plugin documents following:
16
16
  * **Power connections** - lists all connections of power cables
17
17
  * **Interface connections** - lists all connections between interfaces
18
18
 
19
- ## Installation
19
+ ## Introduction Video presentation
20
+
21
+ * https://www.youtube.com/watch?v=HVmJ6UYPaz0
22
+
23
+ ## Installation by package
20
24
 
21
25
  See [Plugins Installation](https://theforeman.org/plugins/#2.Installation) for how to install Foreman plugins.
22
26
 
27
+ ### Ubuntu/Debian instructions
28
+ ```
29
+ apt-get install ruby-foreman-datacenter
30
+ ```
31
+
32
+ ### Redhat/Centos instructions
33
+ ```
34
+ yum install ruby-foreman-datacenter
35
+ ```
36
+
37
+ NOTE: on both platforms, after the plugin is installed you have to precompile assets!
38
+ ```
39
+ foreman-rake assets:precompile
40
+ ```
41
+
42
+ ## Installation by gem
43
+
44
+ ### Redhat/Centos instructions (confirmed on Katello 3.4/Foreman 1.15.6 and 1.16)
45
+
46
+ You may need to install additional Gems and feed db:
47
+ ```
48
+ # Install some required gems for precompile assets
49
+ gem install --ignore-dependencies sprockets
50
+ gem install --ignore-dependencies sass
51
+ gem install --ignore-dependencies sass-listen
52
+ gem install --ignore-dependencies rb-fsevent
53
+ gem install --ignore-dependencies rb-inotify
54
+ gem install --ignore-dependencies ffi
55
+
56
+ # Add repo cause ffi needs ruby22-ruby-devel
57
+ cat > /etc/yum.repos.d/CentOS-SCLo-scl.repo << EOF
58
+ [centos-sclo-sclo-rh]
59
+ name=CentOS-7 - SCLo sclo ruby22
60
+ baseurl=http://mirror.centos.org/centos/7/sclo/x86_64/rh/
61
+ gpgcheck=1
62
+ enabled=1
63
+ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
64
+ EOF
65
+
66
+ # Install ruby22-ruby-devel for ruby gem ffi
67
+ yum install rh-ruby22-ruby-devel
68
+ gem install --ignore-dependencies ffi
69
+
70
+ # Precompile assets should work now
71
+ foreman-rake assets:precompile
72
+
73
+ # Now feed database
74
+ RAILS_ENV=production rake db:migrate
75
+
76
+ # If it fails
77
+ cd /opt/rh/rh-ruby22/root/usr/local/share/gems/gems/foreman_datacenter-0.1.49/db/migrate
78
+ for F in `ls`;do sed -i ${F} -e 's/\[4.2\]//';done;
79
+ ```
80
+
23
81
  ## Usage
24
82
 
25
83
  ### Create a device type
@@ -30,15 +88,27 @@ Here you can create a particular device type, for example a model of switch and
30
88
 
31
89
  You can either just create a device - then you have to create first Manufacturer, Device Type, Device Role, Platform; or you can import device from Puppet facts (this feature is still in development phase) - you just click **Devices** -> **Import from host** and then will search your host and click **Import to device**. Then you will get a page with additional information about the machine to be filled like location, position in rack, etc. Once device is created, you can list it in **Devices** section and when you click on this device, you can fill in additional information, e.g. connect its interfaces to a switch, etc.
32
90
 
91
+ ### Bugs
92
+
93
+ Sometimes you may encounter a problem that does not work dropdown select field(like this https://github.com/theforeman/foreman_datacenter/issues/12 or this https://github.com/theforeman/foreman_datacenter/issues/9)
94
+
95
+ Please make assets precompilation manually as following in foreman installation dir:
96
+ ```
97
+ foreman-rake assets:precompile
98
+ ```
99
+
100
+ We are working on this problem
101
+
33
102
  ## Contributing
34
103
 
35
104
  Fork and send a Pull Request. Thanks!
36
105
 
37
106
  ## Copyright
38
107
 
39
- Copyright (c) *cloudevelops, Inc.*
108
+ Copyright (c) *cloudevelops, s.r.o.*, https://www.cloudinfrastack.com
40
109
 
41
110
  Authors: *Pavel Ivanov* and *Eugene Loginov*
111
+ Contributors: *Michal Vesely*, *Michal Cila*, *Zdenek Janda*
42
112
 
43
113
  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
44
114
 
@@ -14,3 +14,20 @@ function connectionsNewRackSelected(item) {
14
14
  });
15
15
  }
16
16
  }
17
+
18
+ function connectionsNewSiteSelected(item) {
19
+ var $item = $(item);
20
+ var site = $item.val();
21
+ if (site === '') {
22
+ return false;
23
+ } else {
24
+ tfm.tools.showSpinner();
25
+ var url = $item.data('url');
26
+ var params = $.param({ site_id: site });
27
+ var $container = $('#dic-container');
28
+ $container.load(url, params, function () {
29
+ $container.find('select').select2({allowClear: true});
30
+ tfm.tools.hideSpinner();
31
+ });
32
+ }
33
+ }
@@ -90,6 +90,11 @@ module ForemanDatacenter
90
90
  render partial: 'racks'
91
91
  end
92
92
 
93
+ def site_racks
94
+ @site = Site.find(params[:site_id])
95
+ render partial: 'site_racks'
96
+ end
97
+
93
98
  def for_rack
94
99
  @rack = ForemanDatacenter::Rack.find(params[:rack_id])
95
100
  render partial: 'for_rack'
@@ -25,5 +25,15 @@ module ForemanDatacenter
25
25
  render partial: 'foreman_datacenter/shared/rack_device_select',
26
26
  locals: { site: site, options: options }
27
27
  end
28
+
29
+ def sites_for_connection_form(site_id)
30
+ collection = Site.select(:id, :name).all
31
+ select_tag :site_id,
32
+ options_from_collection_for_select(collection, 'id', 'name', site_id),
33
+ { :include_blank => 'Choose a site',
34
+ :onchange => 'connectionsNewSiteSelected(this)',
35
+ :'data-url' => site_racks_devices_path,
36
+ :class => 'form-control' }
37
+ end
28
38
  end
29
39
  end
@@ -12,6 +12,13 @@
12
12
  <div class="panel-heading text-center"><strong>A Side</strong></div>
13
13
 
14
14
  <div class="panel-body">
15
+ <div class="clearfix">
16
+ <div class="form-group">
17
+ <label class="col-md-2 control-label required">Site</label>
18
+ <div class="col-md-4"><%= @device_interface_connection.first_rack.site.name %></div>
19
+ </div>
20
+ </div>
21
+
15
22
  <div class="clearfix">
16
23
  <div class="form-group">
17
24
  <label class="col-md-2 control-label required">Rack</label>
@@ -47,9 +54,21 @@
47
54
  <div class="panel-heading text-center"><strong>B Side</strong></div>
48
55
 
49
56
  <div class="panel-body">
50
- <%= rack_device_select @device_interface_connection.first_site,
57
+ <div class="clearfix">
58
+ <div class="form-group">
59
+ <label class="col-md-2 control-label required">Site</label>
60
+ <div class="col-md-4">
61
+ <%= sites_for_connection_form @device_interface_connection.first_site.id %>
62
+ </div>
63
+ <span class="help-block help-inline">First, you need to select a site</span>
64
+ </div>
65
+ </div>
66
+
67
+ <div id="dic-container">
68
+ <%= rack_device_select @device_interface_connection.first_site,
51
69
  url: interfaces_device_interface_connections_path,
52
70
  target: '#interfaces-container' %>
71
+ </div>
53
72
 
54
73
  <div id="interfaces-container">
55
74
  <%= interfaces_for_connection_form f, [] %>
@@ -0,0 +1,5 @@
1
+ <%= rack_device_select @site,
2
+ url: interfaces_device_interface_connections_path,
3
+ target: '#interfaces-container' %>
4
+
5
+
@@ -1,4 +1,5 @@
1
1
  <% javascript 'foreman_datacenter/devices' %>
2
+ <% javascript 'foreman_datacenter/pagination' %>
2
3
  <% stylesheet 'foreman_datacenter/comments' %>
3
4
 
4
5
  <% title _('Devices') %>
@@ -336,7 +336,7 @@
336
336
  </table>
337
337
  <% end %>
338
338
  <div class="panel-footer text-right">
339
- <%= link_to 'Sync', sync_interfaces_with_host_device_path(@device),
339
+ <%= link_to 'Sync', sync_interfaces_with_host_device_path(@device),
340
340
  class: 'btn btn-primary btn-xs' if @device.host %>
341
341
  <%= link_to 'Add an interface', new_device_device_interface_path(@device),
342
342
  class: 'btn btn-primary btn-xs' %>
@@ -14,6 +14,9 @@
14
14
  <% if d.side.nil? %>
15
15
  *
16
16
  <% end %>
17
+ <% if d.size.nil? %>
18
+ **
19
+ <% end %>
17
20
  </div>
18
21
  <% end %>
19
22
  <% end %>
@@ -78,6 +78,7 @@
78
78
  <!-- Unpositioned Devices -->
79
79
  <%= render "unpositioned_devices", rack: @rack if @rack.unpositioned_devices.count != 0 %>
80
80
  <div><h6 class="text-right">* side is not defined</h6></div>
81
+ <div><h6 class="text-right">** size is not defined</h6></div>
81
82
  </div>
82
83
 
83
84
  </div>
@@ -1,10 +1,12 @@
1
- <div class="clearfix">
2
- <div class="form-group">
3
- <label class="col-md-2 control-label required">Rack</label>
4
- <div class="col-md-4">
5
- <%= racks_list_for_site site %>
1
+ <div id="racks-container">
2
+ <div class="clearfix">
3
+ <div class="form-group">
4
+ <label class="col-md-2 control-label required">Rack</label>
5
+ <div class="col-md-4">
6
+ <%= racks_list_for_site site %>
7
+ </div>
8
+ <span class="help-block help-inline">First, you need to select a rack</span>
6
9
  </div>
7
- <span class="help-block help-inline">First, you need to select a rack</span>
8
10
  </div>
9
11
  </div>
10
12
 
@@ -1,3 +1,3 @@
1
1
  module ForemanDatacenter
2
- VERSION = '0.1.49'.freeze
2
+ VERSION = '0.1.50'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_datacenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.49
4
+ version: 0.1.50
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Ivanov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-13 00:00:00.000000000 Z
12
+ date: 2018-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: deface
@@ -232,6 +232,7 @@ files:
232
232
  - app/views/foreman_datacenter/device_types/new.html.erb
233
233
  - app/views/foreman_datacenter/device_types/show.html.erb
234
234
  - app/views/foreman_datacenter/device_types/welcome.html.erb
235
+ - app/views/foreman_datacenter/devices/_aracks.html.erb
235
236
  - app/views/foreman_datacenter/devices/_console_port.html.erb
236
237
  - app/views/foreman_datacenter/devices/_console_server_port.html.erb
237
238
  - app/views/foreman_datacenter/devices/_device_bay.html.erb