Table Schema Cell Types and Formatters

Table Schema Cell Types and Formatters

Introduction

When you customise a table (see Customising Table Columns), each column object has a cell attribute that controls how the value is rendered, and an optional formatter attribute that controls how the raw value is transformed before display.

The cell and formatter values are names that are resolved to rendering classes at load time. The name is the class name without the trailing Cell or Formatter - for example the cell type LookupUrl maps to the LookupUrlCell renderer, and the formatter UnixTime maps to the UnixTimeFormatter. The tables below list the common, supported values. Names are not case sensitive on the first letter, so string and String are equivalent.

Column Attributes

Attribute

Values

Description

Attribute

Values

Description

name

event property name

The property to display (opEvents Normalised Event Properties). Nested values use dotted path, e.g. notes_context.title.

label

text

The column heading shown in the web page.

cell

a cell type (see below)

How the value is rendered. Defaults to plain text (string).

formatter

a formatter (see below)

Optional. Transforms the raw value before it is rendered.

search

false, true, or "iregex"

false (or omitted) = not searchable; true = searchable; "iregex" = case-insensitive regex search box

editable

true or false

Whether the value can be edited inline. Most columns are false.

direction

"ascending", "descending"

Optional default sort direction for the column.

replace_name

a property name

Used by link cells: the field whose value is substituted into the URL.

base_url_stash_key

a stash key

Used by link cells: the base URL the link is built from.

Cell Types

cell value

Renders as

cell value

Renders as

string

Plain text. The default.

integer

A whole number.

number

A decimal number.

boolean

A checkbox reflecting a true/false value.

uri

A clickable link from a URL value.

LookupUrl

The value rendered as a hyperlink built from base_url_stash_key + replace_name.

DetailsIcon

A clickable icon, shown only when the field contains data.

Edit

An inline-editable field (requires editable: true).

ColouredByLevel

Text coloured by NMIS severity thresholds (supply a levels array).

TrueFalse

A true/false value shown as text.

ArrayToList

An array value rendered as a list.

Epoch

A unix epoch timestamp shown as a date/time.

UriButtonGroup

A row of link buttons (supply a links array).

Formatters

Set with the formatter attribute alongside a cell.

formatter value

Effect

formatter value

Effect

UnixTime

Unix time (seconds) shown as a human date/time.

RelativeTime

A time shown relative to now (e.g. "5 minutes ago").

UpTime

A number of seconds shown as an uptime.

MacAddress

Normalises MAC address formatting.

MegaByte

A byte value shown in megabytes.

MegaBit

A bit value shown in megabits.

IfSpeed

An interface speed value shown in readable units.

ShortenedString

Truncates long strings (supply maxLength).

Example

A searchable plain-text column:

{ "name": "nodeinfo.configuration_location", "label": "Location", "cell": "string", "search": "iregex", "editable": false }

A column whose unix-time value is shown as a readable date:

{ "name": "time", "label": "Time", "cell": "string", "formatter": "UnixTime", "editable": false }

For cell types or formatters not listed here, contact Firstwave Support at support.nmis@firstwave.com.