Module

Monitoring

This is a custom widget that is used to monitor the single result value, coloring the background depending on its value and settings.

Tutorials:
See:

View Source widgets/monitoring.js, line 5

Methods

# setColors(colors)

Set custom colors for the background. The order of colors are important to determinate the status. First color represents the OK status. The second color represents a regular status. And the third color represents an fail status.

Parameters:
Name Type Description
colors Array.<string>

Custom colors.

View Source widgets/monitoring.js, line 34

# setHeight(height)

Set a custom height of each element status to show.

Parameters:
Name Type Description
height number

Height value.

View Source widgets/monitoring.js, line 66

# setIcons(icons)

Set custom icons. The order of icons are important to determinate the status. First icon represents the OK status. The second icon represents a regular status. And the third icon represents an fail status.

Parameters:
Name Type Description
icons Array.<string>

Custom icons.

View Source widgets/monitoring.js, line 57

# setIsPercent(bool)

Indicate if the comparation of rules must be with percent.

Parameters:
Name Type Description
bool boolean

Comparation of values as a percentage.

Default Value:
  • true

View Source widgets/monitoring.js, line 101

# setItemsByRow(val)

Indicate the number of elements to show by row.

Parameters:
Name Type Description
val number

Number of elements.

Default Value:
  • 4

View Source widgets/monitoring.js, line 44

# setKey(key)

Set the key to be displayed.

Parameters:
Name Type Description
key string

Key to show.

View Source widgets/monitoring.js, line 119

# setRules(success, fail)

Set the rules to define the status.

Operators availables are:

  • '>'
  • '<'
  • '=='
  • '<='
  • '=>'
  • '!='

By default, values are in percentage, so its value should be between 0 and 100. To change this behavior use setIsPercent with false value.

Parameters:
Name Type Description
success Object
operator string

Comparator operator.

value number

Limit value.

fail Object
operator string

Comparator operator.

value number

Limit value.

View Source widgets/monitoring.js, line 91

# setValue(value)

Set the column value to show.

Parameters:
Name Type Description
value value

Column name.

View Source widgets/monitoring.js, line 110