All Projects → theforeman → foreman_column_view

theforeman / foreman_column_view

Licence: GPL-3.0 license
A simple Foreman plugin showcasing Deface for altering the Hosts view

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to foreman column view

robottelo
Robottelo is a test suite that exercises The Foreman.
Stars: ✭ 54 (+134.78%)
Mutual labels:  foreman
abi-code-gen
Generic code generator from abi
Stars: ✭ 21 (-8.7%)
Mutual labels:  engine
continuum-engine
A Javascript engine to power incremental and idle games
Stars: ✭ 45 (+95.65%)
Mutual labels:  engine
php-chess
A chess library for PHP.
Stars: ✭ 42 (+82.61%)
Mutual labels:  engine
HelenaFramework
Modern framework on C++20 for backend/frontend development.
Stars: ✭ 53 (+130.43%)
Mutual labels:  engine
binocle-c
A simple game engine in C
Stars: ✭ 113 (+391.3%)
Mutual labels:  engine
Dome
A lightweight game development environment where games can be written in Wren
Stars: ✭ 251 (+991.3%)
Mutual labels:  engine
Nero-Game-Engine
Advanced SFML Game Engine, Designed to be Simple and Intuitive
Stars: ✭ 50 (+117.39%)
Mutual labels:  engine
diaspora federation
A library that provides functionalities needed for the diaspora* federation protocol.
Stars: ✭ 97 (+321.74%)
Mutual labels:  engine
Explosion
💥 A modern cross-platform game engine (WIP)
Stars: ✭ 102 (+343.48%)
Mutual labels:  engine
Landing-CMS
A simple CMS for landing pages
Stars: ✭ 78 (+239.13%)
Mutual labels:  engine
unified-args
Create CLIs for unified processors
Stars: ✭ 30 (+30.43%)
Mutual labels:  engine
LivePP
A UE4 plugin wrapper for Molecular Matter's Live++ Hot-Reloading Library
Stars: ✭ 105 (+356.52%)
Mutual labels:  engine
unity-button-sounds-editor
Editor extension for Unity game engine. It helps to assign AudioClip to buttons and to play sounds by button clicks.
Stars: ✭ 65 (+182.61%)
Mutual labels:  engine
fgmkJsEngine
Js JRPG Engine for FGMK
Stars: ✭ 20 (-13.04%)
Mutual labels:  engine
codacy-scalameta
Codacy tool for Scalameta
Stars: ✭ 35 (+52.17%)
Mutual labels:  engine
rpgwizard
2D RPG Game creator
Stars: ✭ 37 (+60.87%)
Mutual labels:  engine
WurfelEngineSDK
Isometric game engine. Open world, block/voxel based and sprite rendering.
Stars: ✭ 96 (+317.39%)
Mutual labels:  engine
OldBang
Bang OLD REPO. Please go to the current repo ============>
Stars: ✭ 18 (-21.74%)
Mutual labels:  engine
foreman hyperv
Microsoft Hyper-V compute resource for Foreman
Stars: ✭ 14 (-39.13%)
Mutual labels:  foreman

foreman_column_view

A small plugin to showcase the awesome Deface library. It simply adds a column to the Hosts list or properties table. It also serves as a simple example of including a new Helper in the plugin.

Compatibility

Foreman Version Plugin Version
<= 1.15 ~> 0.3
== 1.16 untested
>= 1.17 ~> 0.4

Installation

Require the gem in Foreman (you may need extra dependencies such as libxml or libxslt to build the nokogiri dependency)

gem 'foreman_column_view'

Update Foreman with the new gems:

bundle update foreman_column_view

Configuration

By default the plugin will display the Domain associated by each host. This is not massively useful. To set your own choice of column, add this to Foreman's plugin config file foreman_column_view.yaml. For package based installs this should be in /etc/foreman/plugins/foreman_column_view.yaml. For source installs this should be in config/settings.plugins.d within your install directory.

:column_view:
  :name1:
    :title: Shortname1
    :after: last_report
    :content: shortname1
  :name2:
    :title: Shortname2
    :after: name1
    :content: facts_hash['shortname2']

title is an arbitrary string which is displayed as the column header. content is a method call to the Host object, using host.send. In these examples facts_hash and params are method calls to Host returning hash values.

:column_view:
  :architecture:
    :title: Architecture
    :after: last_report
    :content: facts_hash['architecture']
  :uptime:
    :title: Uptime
    :after: architecture
    :content: facts_hash['uptime']
  :color:
    :title: Color
    :after: last_report
    :content: params['favorite_color']

Additional rows can also be added to the Properties table on the host page by setting :view: :hosts_properties. The position is also controlled by :after using either a numeric index to represent the row or the name of the previous row (however this will not work well when the Foreman language is switched). An example configuration:

:column_view:
  :uptime:
    :title: Uptime
    :after: 6
    :content: facts_hash['uptime']
    :view: :hosts_properties

You can also control the width of the added column by giving a value to the :width attribute. If the width is not set, the default is set to 10%. Note that the original host list already has 100% width set, so adding more columns will cause other columns to resize, which may cause some of the table layout to break a bit. For example:

:column_view:
  :domain:
    :title: Domain
    :after: model
    :content: domain
    :width: 7%

If you need to add information not readily available in a host, you can add information that will be evaluated on runtime by adding :eval_content: true to your additional row. Also, some times you do not want to show the additional row if a certain condition is not met, in order to show that row conditionally, add :conditional: :condition_symbol to your configuration, and that conditional will be executed on your host.

As an example, the following yaml shows a link to a custom URL if the method host.bmc_available? is true.

  :console:
    :title: Console
    :after: 0
    :content: link_to(_("Console"), "https://#{host.interfaces.first.name}.domainname", { :class => "btn btn-info" } )
    :conditional: :bmc_available?
    :eval_content: true
    :view: :hosts_properties

If your conditional method needs arguments to work, the arguments should go after the method name separated by spaces, as in :custom_method arg1 arg2

You will need to restart Foreman for changes to take effect, as the settings.yaml is only read at startup.

TODO

  • Add plugin settings to the Settings UI
  • Make the column sortable
  • Support adding data to other pages

Copyright

Copyright (c) 2013 Greg Sutcliffe

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.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].