{"id":15152706,"url":"https://github.com/theforeman/foreman_column_view","last_synced_at":"2025-09-29T23:32:03.261Z","repository":{"id":7217507,"uuid":"8524362","full_name":"theforeman/foreman_column_view","owner":"theforeman","description":"A simple Foreman plugin showcasing Deface for altering the Hosts view","archived":true,"fork":false,"pushed_at":"2023-05-17T08:22:22.000Z","size":42,"stargazers_count":23,"open_issues_count":6,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-03T04:16:40.754Z","etag":null,"topics":["engine","foreman","hacktoberfest","rails","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theforeman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-03-02T17:44:00.000Z","updated_at":"2024-06-14T11:34:23.000Z","dependencies_parsed_at":"2023-07-14T10:50:28.358Z","dependency_job_id":null,"html_url":"https://github.com/theforeman/foreman_column_view","commit_stats":{"total_commits":30,"total_committers":13,"mean_commits":"2.3076923076923075","dds":0.6666666666666667,"last_synced_commit":"c1f0073007ad0310908bb764d2d59eb1ea3fc455"},"previous_names":["gregsutcliffe/foreman_column_view"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theforeman%2Fforeman_column_view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theforeman%2Fforeman_column_view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theforeman%2Fforeman_column_view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theforeman%2Fforeman_column_view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theforeman","download_url":"https://codeload.github.com/theforeman/foreman_column_view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234673608,"owners_count":18869698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["engine","foreman","hacktoberfest","rails","ruby"],"created_at":"2024-09-26T16:21:27.568Z","updated_at":"2025-09-29T23:31:57.946Z","avatar_url":"https://github.com/theforeman.png","language":"Ruby","readme":"**Note**\nThe plugin's functionality was integrated in Foreman itself with version 3.5, making it obsolete.\n\n# foreman\\_column\\_view\n\nA small plugin to showcase the awesome [Deface](https://github.com/spree/deface)\nlibrary. It simply adds a column to the Hosts list or properties table. It also\nserves as a simple example of including a new Helper in the plugin.\n\n## Compatibility\n\n| Foreman Version | Plugin Version |\n| --------------- | --------------:|\n| \u003c= 1.15         | ~\u003e 0.3         |\n| == 1.16         | untested       |\n| \u003e= 1.17         | ~\u003e 0.4         |\n\n# Installation\n\nRequire the gem in Foreman (you may need extra dependencies such as libxml or libxslt\nto build the nokogiri dependency)\n\n```yaml\ngem 'foreman_column_view'\n```\n\nUpdate Foreman with the new gems:\n\n    bundle update foreman_column_view\n\n# Configuration\n\nBy default the plugin will display the Domain associated by each host. This is not\nmassively useful. To set your own choice of column, add this to Foreman's plugin config file\n`foreman_column_view.yaml`. For package based installs this should be in\n`/etc/foreman/plugins/foreman_column_view.yaml`. For source installs this should be in\n`config/settings.plugins.d` within your install directory.\n\n```yaml\n:column_view:\n  :name1:\n    :title: Shortname1\n    :after: last_report\n    :content: shortname1\n  :name2:\n    :title: Shortname2\n    :after: name1\n    :content: facts_hash['shortname2']\n```\n\n`title` is an arbitrary string which is displayed as the column header. `content` is\na method call to the `Host` object, using `host.send`. In these examples `facts_hash`\nand `params` are method calls to `Host` returning hash values.\n\n```yaml\n:column_view:\n  :architecture:\n    :title: Architecture\n    :after: last_report\n    :content: facts_hash['architecture']\n  :uptime:\n    :title: Uptime\n    :after: architecture\n    :content: facts_hash['uptime']\n  :color:\n    :title: Color\n    :after: last_report\n    :content: params['favorite_color']\n\n```\n\nAdditional rows can also be added to the Properties table on the host page by setting\n`:view: :hosts_properties`.  The position is also controlled by `:after` using either a\nnumeric index to represent the row or the name of the previous row (however this will\nnot work well when the Foreman language is switched).  An example configuration:\n\n```yaml\n:column_view:\n  :uptime:\n    :title: Uptime\n    :after: 6\n    :content: facts_hash['uptime']\n    :view: :hosts_properties\n```\n\nYou can also control the width of the added column by giving a value to the `:width`\nattribute. If the width is not set, the default is set to 10%. Note that the original\nhost list already has 100% width set, so adding more columns will cause other columns\nto resize, which may cause some of the table layout to break a bit. For example:\n\n```yaml\n:column_view:\n  :domain:\n    :title: Domain\n    :after: model\n    :content: domain\n    :width: 7%\n```\n\nIf you need to add information not readily available in a host, you can add information that\nwill be evaluated on runtime by adding `:eval_content: true` to your additional row.\nAlso, some times you do not want to show the additional row if a certain condition is not met,\nin order to show that row conditionally, add `:conditional: :condition_symbol` to your configuration,\nand that conditional will be executed on your host.\n\nAs an example, the following yaml shows a link to a custom URL if the method host.bmc_available? is true.\n\n```yaml\n  :console:\n    :title: Console\n    :after: 0\n    :content: link_to(_(\"Console\"), \"https://#{host.interfaces.first.name}.domainname\", { :class =\u003e \"btn btn-info\" } )\n    :conditional: :bmc_available?\n    :eval_content: true\n    :view: :hosts_properties\n```\n\nIf your conditional method needs arguments to work, the arguments should go after the method name separated by\nspaces, as in `:custom_method arg1 arg2`\n\n\nYou will need to restart Foreman for changes to take effect, as the `settings.yaml` is\nonly read at startup.\n\n# TODO\n\n* Add plugin settings to the Settings UI\n* Make the column sortable\n* Support adding data to other pages\n\n# Copyright\n\nCopyright (c) 2013 Greg Sutcliffe\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheforeman%2Fforeman_column_view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheforeman%2Fforeman_column_view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheforeman%2Fforeman_column_view/lists"}