foreman_column_view 0.2.1 → 0.3.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 95da9455cf65da4a8e2944bb57f9bd77521e1ca5
4
+ data.tar.gz: 3c892aaceb8c2a1a69daaf84559160d77730a2c6
5
+ SHA512:
6
+ metadata.gz: 81478c69c4a0dbd9b69f07874b94bf2578716cb99a0ffe73a7f80f092fd6a3a167744008f88029b937e3fc581cc6328c364269a037ab329f67efd957b8475eaf
7
+ data.tar.gz: 273371f2927e7ff22541cf9f8bdbbe6acb8abd780ff2a18d768e82a4c50437cf878b0f58c2b745b9baf371c5d0cc77f6116f76b55eb3e4be83df9fe6306f4f2e
data/README.md CHANGED
@@ -20,7 +20,10 @@ Update Foreman with the new gems:
20
20
  # Configuration
21
21
 
22
22
  By default the plugin will display the Domain associated by each host. This is not
23
- massively useful. To set your own choice of column, add this to Foreman's config file
23
+ massively useful. To set your own choice of column, add this to Foreman's plugin config file
24
+ `foreman_column_view.yaml`. For package based installs this should be in
25
+ `/etc/foreman/plugins/foreman_column_view.yaml`. For source installs this should be in
26
+ `config/settings.plugins.d` within your install directory.
24
27
 
25
28
  ```yaml
26
29
  :column_view:
@@ -35,8 +38,8 @@ massively useful. To set your own choice of column, add this to Foreman's config
35
38
  ```
36
39
 
37
40
  `title` is an arbitrary string which is displayed as the column header. `content` is
38
- a method call to the `Host` object, using `host.send`. You can also access `Hash` objects
39
- as well:
41
+ a method call to the `Host` object, using `host.send`. In these examples `facts_hash`
42
+ and `params` are method calls to `Host` returning hash values.
40
43
 
41
44
  ```yaml
42
45
  :column_view:
@@ -48,6 +51,11 @@ as well:
48
51
  :title: Uptime
49
52
  :after: architecture
50
53
  :content: facts_hash['uptime']
54
+ :color:
55
+ :title: Color
56
+ :after: last_report
57
+ :content: params['favorite_color']
58
+
51
59
  ```
52
60
 
53
61
  Additional rows can also be added to the Properties table on the host page by setting
@@ -56,6 +64,7 @@ numeric index to represent the row or the name of the previous row (however this
56
64
  not work well when the Foreman language is switched). An example configuration:
57
65
 
58
66
  ```yaml
67
+ :column_view:
59
68
  :uptime:
60
69
  :title: Uptime
61
70
  :after: 6
@@ -63,6 +72,20 @@ not work well when the Foreman language is switched). An example configuration:
63
72
  :view: :hosts_properties
64
73
  ```
65
74
 
75
+ You can also control the width of the added column by giving a value to the `:width`
76
+ attribute. If the width is not set, the default is set to 10%. Note that the original
77
+ host list already has 100% width set, so adding more columns will cause other columns
78
+ to resize, which may cause some of the table layout to break a bit. For example:
79
+
80
+ ```yaml
81
+ :column_view:
82
+ :domain:
83
+ :title: Domain
84
+ :after: model
85
+ :content: domain
86
+ :width: 7%
87
+ ```
88
+
66
89
  If you need to add information not readily available in a host, you can add information that
67
90
  will be evaluated on runtime by adding `:eval_content: true` to your additional row.
68
91
  Also, some times you do not want to show the additional row if a certain condition is not met,
@@ -5,7 +5,7 @@ if SETTINGS[:column_view]
5
5
  :virtual_path => "hosts/_list",
6
6
  :name => "content_#{k}",
7
7
  :insert_after => "td:contains('#{after}')",
8
- :text => "\n <td class=\"hidden-tablet hidden-phone\"><%= fcv_content host, '#{k}' %></td>"
8
+ :text => "\n <td class=\"hidden-tablet hidden-phone ellipsis\"><%= fcv_content host, '#{k}' %></td>"
9
9
  )
10
10
  end
11
11
  end
@@ -1,11 +1,12 @@
1
1
  if SETTINGS[:column_view]
2
2
  SETTINGS[:column_view].reject { |k,v| v[:view] && v[:view] != :hosts_list }.keys.sort.map do |k|
3
3
  after = SETTINGS[:column_view][k.to_sym][:after]
4
+ width = SETTINGS[:column_view][k.to_sym][:width] || "10%"
4
5
  Deface::Override.new(
5
6
  :virtual_path => "hosts/_list",
6
7
  :name => "title_#{k}",
7
8
  :insert_after => "th:contains('#{after}')",
8
- :text => "\n <th class=\"hidden-tablet hidden-phone\"><%= fcv_title '#{k}' %></th>"
9
+ :text => "\n <th class=\"hidden-tablet hidden-phone\" width=\"#{width}%\"><%= fcv_title '#{k}' %></th>"
9
10
  )
10
11
  end
11
12
  end
@@ -7,7 +7,7 @@ module ForemanColumnView
7
7
  #Thus, inhereits from ::Rails::Engine and not from Rails::Engine
8
8
  class Engine < ::Rails::Engine
9
9
 
10
- initializer 'foreman_column_view.register_plugin', :after=> :finisher_hook do |app|
10
+ initializer 'foreman_column_view.register_plugin', :before => :finisher_hook do |app|
11
11
  Foreman::Plugin.register :foreman_column_view do
12
12
  end if (Rails.env == "development" or defined? Foreman::Plugin)
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanColumnView
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,34 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_column_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Greg Sutcliffe
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-08-03 00:00:00.000000000 Z
11
+ date: 2016-10-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: deface
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - <
17
+ - - "<"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '2.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - <
24
+ - - "<"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '2.0'
30
- description: ! "Displays an additional column in the Foreman Hosts view\n and/or
31
- additional entries in the Host show page"
27
+ description: |-
28
+ Displays an additional column in the Foreman Hosts view
29
+ and/or additional entries in the Host show page
32
30
  email: greg.sutcliffe@gmail.com
33
31
  executables: []
34
32
  extensions: []
@@ -36,39 +34,38 @@ extra_rdoc_files:
36
34
  - LICENSE
37
35
  - README.md
38
36
  files:
37
+ - LICENSE
38
+ - README.md
39
+ - Rakefile
39
40
  - app/helpers/foreman_column_view/hosts_helper.rb
40
41
  - app/helpers/foreman_column_view/hosts_helper_extension.rb
41
- - app/overrides/add_column_title.rb
42
42
  - app/overrides/add_column_content.rb
43
+ - app/overrides/add_column_title.rb
43
44
  - lib/foreman_column_view.rb
44
- - lib/foreman_column_view/version.rb
45
45
  - lib/foreman_column_view/engine.rb
46
- - LICENSE
47
- - Rakefile
48
- - README.md
46
+ - lib/foreman_column_view/version.rb
49
47
  homepage: http://github.com/GregSutcliffe/foreman_column_view
50
48
  licenses:
51
49
  - GPL-3
50
+ metadata: {}
52
51
  post_install_message:
53
52
  rdoc_options: []
54
53
  require_paths:
55
54
  - lib
56
55
  required_ruby_version: !ruby/object:Gem::Requirement
57
- none: false
58
56
  requirements:
59
- - - ! '>='
57
+ - - ">="
60
58
  - !ruby/object:Gem::Version
61
59
  version: '0'
62
60
  required_rubygems_version: !ruby/object:Gem::Requirement
63
- none: false
64
61
  requirements:
65
- - - ! '>='
62
+ - - ">="
66
63
  - !ruby/object:Gem::Version
67
64
  version: '0'
68
65
  requirements: []
69
66
  rubyforge_project:
70
- rubygems_version: 1.8.23
67
+ rubygems_version: 2.5.1
71
68
  signing_key:
72
- specification_version: 3
69
+ specification_version: 4
73
70
  summary: Column View Plugin for Foreman
74
71
  test_files: []