Skip to content
Arjen van Bochoven edited this page May 19, 2020 · 5 revisions

Since MunkiReport 5.3.1 it is possible and advised to configure widgets using the built-in widget templates. You can use the widgets by adding your widgets as YAML files with an extension of .yml

At the moment there are three types of widgets available:

Scrollbox widget

Use this widget to show a list of entries with counts. The scrollbox widget takes in the following properties:

property required description
type yes to determine the widget type
widget_id. yes unique id, prefix with module name
api_url yes url to get the data from
i18n_title no i18n string that points to the localised title
icon. no icon for the widget
listing_link no link to the relevant listing
search_key no key to search for in the data
badge no if not set, no badge is shown, possible values: name of field, reg_timestamp, percent

Example

type: scrollbox
widget_id: hardware-model-widget
api_url: /module/machine/get_model_stats
i18n_title: machine.hardware_widget_title
icon: fa-laptop
listing_link: /show/listing/machine/hardware
search_key: label

Bargraph Widget

type: bargraph
widget_id: memory-widget
api_url: /module/machine/get_memory_stats
i18n_title: machine.memory.title
icon: fa-lightbulb-o
listing_link: /show/listing/machine/hardware
label_modifier: label + ' GB'
search_component: encodeURIComponent('memory = ') + parseInt(label) + 'GB'
margin: {left: 70}

Button widget

type: button
widget_id: installed-memory-widget
api_url: /module/machine/get_memory_stats/button
i18n_title: warranty.installed_memory_title
listing_link: /show/listing/machine/hardware
icon: fa-tasks
buttons:
  - label: < 4GB
    search_component: memory < 4GB 
    class: btn-danger  
  - label: 4GB + 
    search_component: 4GB memory 7GB 
    class: btn-warning
  - label: 8GB + 
    search_component: memory > 7GB 
    class: btn-success
Clone this wiki locally