6. Web UI

A user script can provide some gui configuration items. These are specified via the gui attribute:

local script = {
  ...

  gui = {
    i18n_title = "config_title",
    i18n_description = "config_description",
  }

  ...
}

The mandatory gui attributes are:

  • i18n_title: a localization string for the title of the element
  • i18n_description: a localization string for the description of the element
  • input_builder: a function which is responsible for building the HTML code for the element

Additional parameters can be specified based on the input_builder function. Here is a list of built-in input_builder functions:

  • threshold_cross: contains an input field with an operator and a unit. Suitable to speficy thresholds like “bytes > 512”.

Here is a list of additional supported parameters:

  • field_max: max value for the input field
  • field_min: min value for the input field
  • field_step: step value for the input field
  • i18n_field_unit: localization string for the unit of the field. Should be one of user_scripts.field_units.