Skip to content

Display Properties

Example

Here is a subset example of a display.json5 file:

js
{
    version: '1.0.0',
    name: 'Kickstart',
    description: 'Display for Kickstart',
    theme: {
        title: 'Device Manager',
        logo: '/images/ioto-logo.png',
        themes: {
            dark: { ... },
            light: { ... },
        }
    },
    views: [
        { path: '/', name: 'home' },
        { name: 'Login', path: '/auth', component: 'Login' },
        {
            name: 'devices',
            path: '/devices',
            icon: '$devices',
            menu: 'Device',
            component: 'GenericList',
            table: {
                model: 'Device',
                subtitle: 'Click on a device to explore',
                fields: [
                    {name: 'product'},
                    {name: 'description'},
                    {name: 'model'},
                    {name: 'id', title: 'Device ID'},
                    {name: '*', launch: '/devices/:id/overview'}
                ],
                actions: {
                    add: { count: 0, launch: 'claim' },
                    release: { 
                        count: 2,
                        invoke: 'DeviceRelease', 
                        confirm: true 
                    }
                }
            },
            panels: [
                {
                    name: 'claim',
                    component: 'DeviceClaim',
                    button: 'Claim Device'
                }
            ]
        },
    ]
}

Here is an example view that uses the dashboard component and informational widgets:

js
{
    name: 'fleet',
    title: 'Fleet Overview',
    path: '/fleet',
    icon: '$gauge',
    role: 'user',
    menu: 'Fleet'
    component: 'Dashboard',
    widgets: [
        {
            type: 'graph',
            title: 'CPU Metric over 5 mins',
            data: {
                owner: 'account',
                namespace: 'Embedthis/Device',
                metric: 'cpu',
                span: 'min5',
                dimensions: [{Device: 'deviceId'}],
            },
            axes: {y: 'CPU', x: 'Time'},
            width: '25%',
        },
    ],
}

description

Namedescription
DescriptionTextual description of the device.
Synopsisdescription: "Short, one sentence description"

Example

js
description: 'Display for the Acme Rocket device'

features

Namefeatures
DescriptionEnable features for the display UI
Synopsis`features: { "debug": true

Example

js
features: {
    debug: false
}

features.auth

Namefeatures
DescriptionAuthentication features for the display UI
Synopsis`auth: { "social": true

Example

js
features: {
    auth: {
        forgot: true,
        login: true,
        social: true,
    }
}
PropertyDescription
forgotSupport forgot my password recovery
loginDisplay and require user login
socialSupport login via Google, Facebook or Amazon. (Requires cloud-based managemement).

features.cloud

Namefeatures
DescriptionControl cloud features
Synopsis`cloud: { multiple: true

This is useful to support apps that can connect to multiple device clouds.

The following properties are supported

PropertyTypeDescription
enableBooleanEnable cloud connectivity
multipleBooleanApp supports multiple clouds

Example

js
features: {
    cloud: {
        enable: true,
        multiple: false,
    }
}

features.dash

Namefeatures
DescriptionControl dashboard features
Synopsis`dash: { edit: true

This property collection controls the dashboard.

The following properties are supported

PropertyTypeDescription
actionsBooleanEnable editing widget actions
databaseBooleanEnable widgets to access database fields
editBooleanEnable the widget editing panel
metricsBooleanEnable widgets to access metrics
multipleBooleanEnable support for multiple dashboards per user
nameStringName of the dashboard to load by default. Set to "auto" to load "Mobile" on phones and "Desktop" otherwise.
responsiveBooleanEnable widget maximizing on mobile devices

features.demo

Namefeatures
DescriptionEnable demonstration mode
Synopsis`demo: { enable: true

Example

js
features: {
    demo: {
        enable: true,
    }
}

features.debug

Namefeatures
DescriptionEnable debug mode
Synopsis`debug: true

This is useful to enable or disable debug code while developing new features.

features.nav

Namefeatures
DescriptionControl app navigation features
Synopsisnav: { sidebar: true }

This property collection controls the app's navigation features. The following properties are supported:

PropertyTypeDescription
alertsBooleanDisplay automation alerts icon in the navbar
cookiesStringReserved
docStringURL link to app documentation site
fleetBoolean|StringSupport multiple claimed devices in the one UI. Can be set to 'smart' to dynamically determine based on the number of claimed devices.
helpBooleanReserved
profileBooleanDisplay user profile in top navbar menu
settingsBooleanDisplay account settings in top navbar menu
sidebarBooleanDisplay navigation sidebar
navbarBooleanEnable top of application navbar

redirect

Nameredirect
DescriptionRedirect the browser to a new location
Synopsisredirect: "URL"
NotesIf set to a URL, you can use :token segments that will be expanded at runtime from the application route context.

Example

The :deviceId will be replaced with the selected device ID from the device list.

js
redirect: '/devices/:deviceId/overview'

theme

Nametheme
DescriptionDefine the display theme configuration
Synopsistheme: { properties ... }

Example

js
theme: {
    title: 'Acme Rocket',
    logo: '/images/acme-logo.png',
    themes: { ... }
}
Nametheme.logo
DescriptionThe logo displayed in the navigation bar and login screen.
Synopsislogo: "/images/NAME.png"
NotesThe logo should be small, square and have a transparent background.
js
{
theme: {
    logo: '/images/acme.png'
}

theme.title

Nametheme.title
DescriptionThe device title displayed in the navigation bar.
Synopsistitle: "Few word title"
js
theme: {
    title: 'Acme Rocket'
}

theme.themes

Nametheme.themes
DescriptionSet of colors to use for the dark and light UI themes.
Synopsis`themes: { dark: {...}, light: {...}}
NotesThe themes collection should provide a "dark" and "light" mode set of colors.
js
theme: {
    themes: {
        dark: {
            primary: '#3F51B5',
            secondary: '#707070',
            accent: '#82B1FF',    
            error: '#fb6d6d',
            info: '#2196F3',
            success: '#4CAF50',
            warning: '#FB8C00',
            extra: '#00cdcd',
            anchor: '#1976D2',
            nav: '#3f51b5'
        },
        light: { ...}
    }
}

timeouts

Nametimeouts
DescriptionDefine timeout periods for various manager refresh tasks.
Synopsistimeouts: { dashboard: seconds }
NoteThe dashboard time governs how frequently dashboard widgets are updated. You can provide a numeric value in seconds or a textual value such as "3secs".

Example

js
timeouts: {
    dashboard: '10secs'
}

version

Nameversion
DescriptionThe version number of your display.json5 file (SemVer).
Synopsisversion: "SemVer compatible version"

Example

js
version: '1.2.3'

views

Nameviews
DescriptionArray of UI pages to define
Synopsisviews: [ { view }, ...]
NoteViews may also be nested under a view. Such nested views are presented as tabbed views under a common parent view.

Example

js
{
    name: 'fleet',
    title: 'Fleet Overview',
    path: '/fleet',
    icon: '$gauge',
    component: 'Fleet',
    role: 'user',
    menu: 'Fleet',
    period: 10
    views: [
        { /* Tabbed sub-views */ },
    ]
}

view.component

Nameview.component
DescriptionVueJS component to display for the view
Synopsiscomponent: "ComponentName"
NoteThe component can be an inbuilt Ioto Manager component or it can be a component provided by the extension components defined via the modules property.

The inbuilt components are listed below.

Example

js
{
    component: 'Generic',
},

Inbuilt VueJS Components

These components can be referenced in the display.json5 file.

  • AccountSettings
  • Dashboard
  • GenericList
  • GenericEdit
  • DeviceClaim
  • DeviceClaimModal
  • DeviceRelease
  • Forgot
  • Login
  • UserPassword
  • UserList
  • UserProfile

view.enable

Nameview.enble
DescriptionEnable or disable the view
Synopsis`enable: true

May be set to true or false to statically enable or disable a view.

May be set to an array or map of properties for dynamic control based on the app context.

If set to an array, each array map element must evaluate to true. If set to a map of properties, any one of the properties must be true to enable the view.

Map property values can be literal strings, numbers, booleans or regular expressions. Regular expressions are defined as strings delimited by slash characters. For example: "/Some Regular Expression/". Strings can also be prefixed with an operation: < <= > >= == !=.

Property values are derrived by using the property name as an index into the app context. i.e.:

js
value = state.app.context[PropertyName]

Currently, the app context contains the device ID as the "deviceId property. Additional properties can be added to the context via the API:

state.app.setContext(key, value)

Example

js
{
    enable: false
    // or any one of these expressions must be true
    enable: {
        someProperty: 'Required-Value',
        someNumber: '> 100',
        deviceId: '!= ',                    // Must be not equal to empty
        someString: '/Regular Expression/',
    },
    // or All of these expressions must be true
    enable: [
        { someProperty: 'value' },
        { otherProperty: 'value' },
    ]
},

view.height

Nameview.height
DescriptionDefault view widget height
Synopsisheight: Pixels
NoteThis defines the default height for the view's widgets

Example

js
{
    height: 300
}

view.icon

Nameview.icon
DescriptionIcon to display in menus
Synopsisicon: "mdi-NAME"
NoteThe icon name is the name of an icon alias. You should use the icon alias name with an "$" prefix.

Example

js
{
    icon: '$edit'
},

The Manager class provides a subset of the Material Design Icons. Applications can import and add additional aliases when initializing the Manager class.

The following icon aliases are provided as standard:

Icon AliasIcon Name
accountaccount
alertalert
autobrightnessauto
awsaws
bellbell
bookmarkbookmarkmultiple
bookshelfbookshelf
bridgebridge
calendarcalendar
cancelclose-circle
checkboxindeterminateminus-box
checkboxoffcheckbox-blank-outline
checkboxoncheckbox-marked
clearclose-circle
cartcart
clickcursordefaultclick
clipboardclipboardtext
clockclockoutline
cloudcloud
closeclose
cogcog
cogoutlinecogoutline
collapsechevron-up
completecheck
copycontentcopy
criticalflash
cubecubesend
darkbrightness3
dashboardmonitordashboard
deleteclose-circle
delimitercircle
devicesdevices
downchevrondown
downloaddownload
dropdownmenu-down
editpencil
errorclose-circle
expandchevron-down
emailemail
erroralertcircleoutline
eyeeye
eyedroppereyedropper
eyeoffeyeoff
facebookfacebook
functionfunction
filepaperclip
firstpage-first
gaugegauge
gridviewgridoutline
googlegoogle
infoinformation
lastpage-last
lanlan
launchlaunch
leftarrowarrowleftbold
lightbrightness5
loginlogin
loadingcached
menumenu
minusminus
nextchevron-right
plusplus
magnifymagnify
medicalmedicalbag
monitormonitor
offlineflashoutline
onlinecheckcircleoutline
openlockopen
phonephone
playplay
plusboxoutlineplusboxoutline
prevchevron-left
radiooffradiobox-blank
radioonradiobox-marked
ratingemptystar-outline
ratingfullstar
ratinghalfstar-half-full
rightarrowarrowrightbold
reloadreload
redoredo
resizeresizebottomright
rssrss
runrun
sortascarrow-up
sortdescarrow-down
securitysecurity
sendsend
startraystartarrow
stopstop
supporthospitalbox
swapswapverticalbold
subgroupmenu-down
successcheck-circle
tapgesturetapbutton
upchevronup
unfoldunfold-more-horizontal
warningalert-circlewarn
wizardautofix
wrenchwrench

To add icons when initializing the Manager, import the icons and add to the vuetifyProps when calling createVuetify.

js
import {mdiFormatListBulletedSquare} from '@mdi/js'

const Icons = {
    events: mdiFormatListBulletedSquare,
}

async function main() {
    let vue = createApp(Main)
    let router = createRouter({
        history: createWebHashHistory(),
        routes: [],
    })
    let vuetify = createVuetify(
        vuetifyProps({
            components: components,
            directives: directives,
            icons: Icons,
            themes: Display.theme.themes,
        })
    )
}

And then supply the icons when calling

js

view.menu

Nameview.menu
DescriptionDisplay the view in the sidebar menu with the given text
Synopsismenu: 'MenuTitle

Example

js
{
    menu: 'MyMenuItem'
},

view.name

Nameview.name
DescriptionName of the view
Synopsisname: "One-word-name"
NoteThis name is used in several places including as a page title and VueJS route name.

Example

js
{
    name: 'fleet'
},

view.panels

Nameview.panels
DescriptionArray of slide in panels that overlay the view.
Synopsispanels: [ { panel }, ...]
NotePanels are defined inside a parent view. Panels are invoked via buttons defined in the panel properties that are displayed in the parent view. A typical use case is a parent view list of device components and a panel to edit a selected component. For example: from a parent view of device fans, a fan could be selected and an edit panel could modify the fan's operational properties.

Example

js
panels: [
    {
        name: 'claim',
        component: 'DeviceClaim',
        role: 'admin',
        button: 'Claim Device',
        width: '500px'
    }
]

view.panel.button

Nameview.panel.button
DescriptionButton text to display in the parent view's table.
Synopsisrole: "User-role"
NotesThe button will be automatically displayed by panel view parents that use the GenericList component. If you are using a custom view parent component, you will need to manage the buttons display in that component.

Example

js
{
    button: 'admin',
},

view.panel.component

Nameview.panel.component
DescriptionVueJS component to display for the panel
Synopsiscomponent: "ComponentName"
NoteThe component can be an inbuilt Ioto Manager component or it can be a component provided by the extension components defined via the modules property.

The inbuilt components are listed below.

Example

js
{
    component: 'TempPanel',
},

view.panel.fields

Nameview.panel.fields
DescriptionArray of fields to edit
Synopsisfields: [ {field definition}, ...]
NoteThis defines an array of fields to edit when using the GenericEdit component. Input fields have a defined "type" which determines the HTML component used to edit the field value. Supported field types include: checkbox, combo, date, label, password, radio, select, slider, switch, text and textarea.

Example

js
{
    panels: [
        {
            name: 'edit',
            component: 'GenericEdit',
            role: 'admin',
            fields: [
                {
                    name: 'name',
                    type: 'label',
                    role: 'user',
                    props: {'max': 100},
                    width: 6,
                }
            ]
        }
    ]
},

view.panel.fields.label

Nameview.panel.fields.label
DescriptionField displayed label
Synopsislabel: "fieldLabel"
NoteThe field label is displayed before the input field. If not provided, the field name is converted to PascalCase and used by default.

Example

js
{
    label: 'Speed'
}

view.panel.fields.name

Nameview.panel.fields.name
DescriptionField name
Synopsisname: "oneWordName"
NoteIf a field title is not provided, the field name is converted to PascalCase and is used as the input field title.

Example

js
{
    name: 'speed'
}

view.panel.fields.role

Nameview.panel.fields.role
DescriptionRequired user role to display the field
Synopsisrole: "User-role"
NotesThe user role may be selected from "public", "user", "admin", "support" or "owner". The public role permits unauthenticated access. The other roles require a login with the requisite role.

Example

js
{
    rolew 'admin'
},

view.panel.fields.select

Nameview.panel.fields.select
DescriptionSelectable options for switch fields.
Synopsisselect: {options, ...}

Example

js
{
    select: {online: true, offline: false}
},

view.panel.fields.type

Nameview.panel.fields.type
DescriptionField's input UI display type
Synopsistype: "Type"
NoteIf the type is not provided, the Manager attempts to sleuth the type based on the data value provided to edit.

Example

js
{
    name: 'status',
    type: 'switch',
    select: {online: true, offline: false},
    width: 6
}

**The supported panel field data types are:

** checkbox ** combo ** date ** label ** password ** radio ** select ** slider ** switch ** text ** textarea

view.panel.fields.width

Nameview.panel.fields.width
DescriptionNumber of columns the input field should occupy.
Synopsiswidth: "1-12"
NoteThe width is expressed as a number of columns between 1 and 12. The GenericEdit component uses a layout grid of 12 columns. GenericEdit will pack fields to fill a row, before starting a new display row.

Example

js
{
    name: 'User Password',
    type: 'password',
    select: {online: true, offline: false},
    width: 6
}

view.panel.name

Nameview.panel.name
DescriptionUnique panel name
Synopsisname: "Name"

Example

js
{
    name: 'TempEdit',
},

view.panel.role

Nameview.panel.role
DescriptionRequired user role to allow access
Synopsisrole: "User-role"
NotesThe user role may be selected from "public", "user", "admin", "support" or "owner". The public role permits unauthenticated access. The other roles require a login with the requisite role.

Example

js
{
    role: 'admin',
},

view.panel.title

Nameview.panel.title
DescriptionPanel Title
Synopsistitle: "Title"
NotesIf the panel title is not provided, a title is created using the name of the model defined in the parent view table property. The model name is prefixed with 'Create' or 'Modify' as appropriate. For example, if the model was "Port" and an existing port item was selected in the table, the panel title would be "Modify Port".

Example

js
{
    title: 'Temperature Settings',
},

view.panel.width

Nameview.panel.width
DescriptionDisplay width of the panel
Synopsiswidth: "NNpx"
NotesThe default panel width is 700px.

Example

js
{
    width: '500px',
},

view.path

Nameview.path
DescriptionURL path for the view
Synopsispath: "/URL/PATH"
NoteThe URL path is used by VueJS when constructing the app routes and at runtime for navigating the views.

Example

js
{
    path: '/device/list',
},

view.refresh

Nameview.refresh
DescriptionUpdate period to refresh the view's data
Synopsis`refresh: Number
NotesThis is the period for refreshable components to update their data. The period may be a number of seconds or a string equivalent.

Example

js
{
    refresh: '5secs',
},

view.role

Nameview.role
DescriptionRequired user role to allow access
Synopsisrole: "User-role"
NotesThe user role may be selected from "public", "user", "admin", "support" or "owner". The public role permits unauthenticated access. The other roles require a login with the requisite role.

Example

js
{
    role: 'user',
},

view.table

Nameview.table
DescriptionView data table definition
Synopsistable: {table-properties}
NoteThe GenericList component displays database model items as a table. The table can be extensively customized by table properties.

Background

The table is displayed by retrieving items from the table.model database model type. The columns of the table are defined via the table.fields and are displayed in order. Table action menu options are derived from the table.actions collection with buttons from any relevant view panels.

** Data Table** Data Table

Example

This example formats the image above:

js
{
    table: {
        model: 'Event',
        fields: [
            {name: 'edit', icon: '$edit'},
            {name: 'timestamp', width: '5%'},
            {
                name: 'severity',
                width: '5%',
                icon: {
                    info: {name: '$info', color: 'green'},
                    warn: {name: '$warn', color: 'orange'},
                    error: {name: '$error', color: 'red'},
                    critical: {name: '$critical', color: 'red'}
                }
            },
            {name: 'source'},
            {name: 'subject', align: 'left'},
            {name: 'message'},
            {name: '*', launch: 'edit'}
        ],
        actions: {
            edit: {count: 1, launch: 'edit'},
            delete: {count: 2, confirm: true}
        }
    }
}

view.table.actions

Nameview.table.actions
DescriptionActions that can be performed on selected table items.
Synopsisactions: { action, ...}
NotesThe action collection has one or more action definitions. Each definition is a set of properties that scopes how many items can be manipulated (count), the view panel to display (panel), if user confirmation is required before taking the action (confirm) and whether a launch button should be displayed (launch).

Example

js
{
    table: {
        actions: {
            edit: {count: 1, launch: 'edit'},
            delete: {count: 2, confirm: true}
        }
    }
}

view.table.actions.confirm

Nameview.table.actions.confirm
DescriptionDisplay a dialog requesting user confirmation before invoking the action.
Synopsis`confirm: true

Example

js
{
    table: {
        actions: {
            delete: {count: 2, confirm: true}
        }
    }
}

view.table.actions.count

Nameview.table.actions.count
DescriptionNumber of selected items the action supports.
Synopsiscount: Number
NotesSet count to 0 for "add" actions that require no selected items. Set count to 1 for actions that can operate on only 1 item at a time. Set count to 2 for actions that can operation on multiple selected items.

Example

js
{
    table: {
        actions: {
            delete: {count: 2, confirm: true}
        }
    }
}

view.table.actions.invoke

Nameview.table.actions.invoke
DescriptionPanel name to display or URL to navigate to when the action is invoked
Synopsisinvoke: "ComponentName"
NotesThe invoke property defines a VueJS component that will be invoked when the action is triggered. The component will be passed properties containing the data item (item) and the data model (model).

Example

js
{
    table: {
        actions: {
            restart: {count: 2, launch: 'NetRestart'}
        }
    }
}

view.table.actions.launch

Nameview.table.actions.launch
DescriptionPanel name to display or URL to navigate to when the action is invoked
Synopsis`launch: "PanelName"
NotesIf set to a URL, you can use :token segments that will be expanded at runtime from the application route context.

Example

js
{
    table: {
        actions: {
            add: {count: 0, launch: 'claim'}
        }
    }
}

view.table.actions.panel

Nameview.table.actions.panel
DescriptionPanel to display when the action is invoked
Synopsispanel: "PanelName"
NotesPanels can only be used for actions of count 0 or 1.

Example

js
{
    table: {
        actions: {
            edit: {count: 1, launch: 'edit'}
        }
    }
}

view.table.fields

Nameview.table.fields
DescriptionDefine the table fields (columns) to display.
Synopsisfields: [ {field-definitions}, ...]
NotesThe fields define each column in the displayed table. A field definition includes the data items name, with display formatting options.

A pseudo field with the name "*" may be defined to specify a launch action that will be invoked as a default when a row/column combination is click.

Example

js
{
    table: {
        model: 'Port',
        fields: [
            {name: 'edit', icon: '$edit', width: '5%'},
            {name: 'name', align: 'center'},
            {
                name: 'status',
                align: 'center',
                icon: {
                    online: {name: '$online', color: 'green'},
                    offline: '$offline'
                }
            },
            {name: 'negotiate', align: 'center', icon: '$check'},
            {name: 'duplex', align: 'center', icon: '$check'},
            {name: 'flowControl', align: 'center', icon: '$check'},
            {name: 'jumbo', align: 'center', icon: '$check'},
            {name: 'speed', align: 'center'},
            {name: '*', launch: 'edit'}
        ]
    }
}

view.table.fields.align

Nameview.table.fields.align
DescriptionAlign the table column
Synopsis`align: "center
js
{
    align: 'center'
}

view.table.fields.css

Nameview.table.fields.css
DescriptionCSS style name
Synopsisstyle: "RuleName"
NoteCSS rule to apply to the displayed field cells. The CSS rule must exist in a custom component.
js
{
    css:: 'unit-status'
}

view.table.fields.icon

Nameview.table.fields.icon
DescriptionDisplay an icon representing the field value
Synopsis`icon: "iconAliasName"
NotesWhen set to a map value, the field value is used as an index into the map. If the index is not found, the "default" index is used. The map value may be either an icon name or a map containing a "name" property that specifies the icon name and a color property that specifies the color to use for the icon.
js
{
    icon: 'mdi-pencil'

    // or
    icon: {
        online: {name: '$online', color: 'green'},
        offline: '$offline',
        default: '$offline'
    }
}

view.table.fields.launch

Nameview.table.fields.launch
DescriptionPanel to launch or URL to navigate to
Synopsis`launch: "PanelName"
NotesIf set to a URL, you can use :token segments that will be expanded at runtime from the application route context.
js
{
    launch: 'edit'
}

view.table.fields.name

Nameview.table.fields.name
DescriptionName of the data item field to display
Synopsisname: "fieldName"
NoteIf a field.title property is not specified, the name is converted to PascalCase and used as the title.
js
{
    name: 'id'
}

view.table.fields.style

Nameview.table.fields.style
DescriptionCSS style to apply to column cells
Synopsisstyle: "CSS properties; ..."
js
{
    style: 'max-width: 400px; text-overflow: ellipsis;'
}

view.table.fields.title

Nameview.table.fields.title
DescriptionColumn title to display for the field
Synopsistitle: "Column Title"
js
{
    title: 'Current Temperature'
}

view.table.fields.width

Nameview.table.fields.width
DescriptionSet the preferred width of the column.
Synopsis`width: "NNpx"
NoteThis will set the initial preferred width of the column.
js
{
    width: '5%'
}

view.table.sort

Nameview.table.sort
DescriptionHow to sort the rows of the table
Synopsis`sort: "column:asc

Example

This will sort the table based on an ascending order of the "name" column.

js
{
    table: {
        sort: 'name:asc',
    }
}

view.table.model

Nameview.table.model
DescriptionDatabase model name to retrieve for table data
Synopsismodel: "ModelName"

Example

js
{
    table: {
        model: 'Event',
    }
}

view.widgets

Nameview.widgets
DescriptionSet of widgets to display when using the Dashboard component.
Synopsiswidgets: [ {widget}, ...]
NoteThe widgets property defines an ordered set of widgets to be displayed by the Dashboard component. The enclosing view must set the component property to "Dashboard".

Example

js
{
    views: [ {
        name: 'Overview',
        component: 'Dashboard',
        widgets: [
            {
                type: 'gauge',
                title: 'Network IO',
                min: 0,
                max: 10000,
                data: { model: 'Stats', field: 'io' }
            }
        ]
    } ]
}

Supported Widget Types

  • button
  • event
  • file
  • form
  • gauge
  • graph
  • image
  • input
  • led
  • numeric
  • progress
  • service
  • shape
  • sign
  • text
  • table

view.widget.accept

Nameview.widget.accept
DescriptionDefine file types acceptable for use with a file up load widget
Synopsisaccept: 'image/*'

view.widget.action

Nameview.widget.action
DescriptionAutomation actions to invoke when the widget is clicked
Synopsisaction: { type: 'trigger', target: 'MyAction'}

Widget actions are used to react to user input.

Therre are three action types:

  • trigger - Invoke a device cloud automation trigger
  • link - Navigate to a new URL in the app
  • dashboard - Display the named dashboard

The action target is the name of the automation action, the navigation URL or the dashboard name, depending on the action type.

For trigger types, when the widget is clicked, the set of conditions are evaluated. For the first condition that evaluates to true, the specified automation trigger is invoked in the device cloud with the condition parameters.

Example

js
{
    action: {
        type: 'trigger',
        trigger: 'MyAction',
        conditions: [{
            expression: 'expression-to-eval',
            params: {}
        }]
    }
}

Example

js
{
    action: {
        type: 'link',
        target: '/ports',
    }
}

view.widget.axes

Nameview.widget.axes
DescriptionAxes labels for "graph" and "time" widgets.
Synopsisaxes: {"x" "text", "y": "Text"

Example

js
{
    axes: {
        x: 'Time', 
        y: 'KB'
    },
}

view.widget.data

Nameview.widget.data
DescriptionMap specifying the widget data source
Synopsisdata: {properties...}

Note | The data.model property specifies the database model name. The data.field specifies the data field within that model.

Data can be sourced from the Ioto cloud database or Ioto metrics. To access data from the database, specify a model, field and row selection where expression.

Database Example

js
{
    data: {
        model: 'Test',
        field: 'cpu',
    }
}

This will select the cpu field from the Test table. You can also use a where clause to select a table item (row). For example:

js
{
    data: {
        model: 'Test',
        field: 'value',
        where: '${name} = {cpu}',
    }
}

This will select the value field from the Test table using the item (row) where the name field has the value "cpu".

Metric Example

To select an Ioto Metric, first define the metric to be created using the ...

Specify the metric owner, namespace, metric to select the desired metric. Then specify the metric data span to be one of "5min", "hr", "day", "wk", "mth" or "year". Set the metric statistic to be one of "avg", "min", "max", "count", "current" or "sum".

Metrics can have dimensions that further select the desired metric value.

js
{
    data: {
        owner: 'account',
        namespace: 'Embedthis/Device',
        metric: 'cpu',
        span: 'day',
        statistic: 'p90',
        dimensions: [{Device: 'deviceId'}],
    }
}

view.widget.datetime

Nameview.widget.datetime
DescriptionEnable the input widget calendar selection by date, time or datetime
Synopsis`datetime: 'datetime'"

Example

js
{
    datetime: 'date'
}

view.widget.field

Nameview.widget.field
DescriptionWidget field text
Synopsis`field: "address"

The field property defines the input form field name in which to store the input data.

Example

js
{
    field: 'firstName'
}

view.widget.fields

Nameview.widget.fields
DescriptionTable widget fields to display
Synopsis`fields: [table field names, ...],

The fields property defines the table widget fields and their order of display.

Example

js
{
    fields: ['car', 'battery', 'house']
}
Nameview.widget.footer
DescriptionWidget footer text
Synopsis`footer: "Footer Text"

The widget header and footer are rendered over the widget in a standard position. You can modify the style and position of the header and footer by using Widget CSS properties.

Example

js
{
    footer: 'Active Ports'
}

view.widget.form

Nameview.widget.form
DescriptionForm widget name
Synopsis`form: "FormName"

The form widget displays a "Save" button that when clicked will submit the values of all input widgets that refer to the form.

If the widget.text property is defined, that text will be used instead of "Save".

Input widgets can be used stand-alone without a form in which case, they will submit their value immediately when changed.

If input widgets refer to a form widget, they are only submitted to the cloud when the Save button is clicked.

view.widget.format

Nameview.widget.format
DescriptionNumeric display format
Synopsis`format: "Format String"

The format string is used to format numeric values. The following format specifiers can be used:

CharacterDescription
0digits with leading zero

| digit

, | Thousand separators % | format as percent

  • | Always show sign
  • | Show sign if negative ^ | Round up v | Round down

Example

js
{
    format: '-0#,###.#^'
}

view.widget.framed

Nameview.widget.framed
DescriptionHow to frame the widget
Synopsis`framed: boolean

If set to true, the widget will be rendered in a frame. If set to false, it will not have a frame. If set to null, which is the default, the widget will use the Dashboard frame setting.

Example

js
{
    framed: true
}

view.widget.header

Nameview.widget.header
DescriptionWidget header text
Synopsisheader: 'Widget Header Text'

The widget header and footer are rendered over the widget in a standard position. You can modify the style and position of the header and footer by using Widget CSS properties.

Example

js
{
    header: 'Temperature Today'
}

view.widget.height

Nameview.widget.height
DescriptionWidget height in pixels
Synopsisheight: Pixels

Example

js
{
    height: '300'
}

view.widget.input

Nameview.widget.input
DescriptionType of input widget
Synopsisinput: 'input type'

If the widget type is set to input, the widget.input property defines the type of input.

The supported Input widget types are:

  • Checkbox
  • Combo
  • Date
  • File
  • Password
  • Radio
  • Select
  • Slider
  • Switch
  • Text Field
  • Text Area

Example

js
{
    input: 'text'
}

view.widget.items

Nameview.widget.items
DescriptionSet of items to use with the input widget selections
Synopsisitems: [{Array or Map}]

The input select, radio and combo input types utilize selection items. You can provide either an array of items or a map of items and their corresponding selection values.

Example

js
{
    items: {red: '#FF0000', blue: '#0000FF'}
or
    items: ['red', 'blue', 'yellow'],
}

view.widget.label

Nameview.widget.label
DescriptionLabel to use for input widgets
Synopsislabel: 'text label'

Example

js
{
    label: 'First Name'
}

view.widget.limit

Nameview.widget.limit
DescriptionLimit of items for the table widget to display
Synopsislimit: Number'

The table widget will display items up to the limit and will provide pagination icons to navigate to the next page of results.

Example

js
{
    limit: 20
}

view.widget.left

Nameview.widget.left
DescriptionOffset from the left of the display to position the widget
Synopsisleft: 100

This property can be used to absolutely position a widget. The property can be set to the number of pixels or to a percentage fraction less than one.

If set to 0.25, the widget will be positioned 1/4 across the page.

Example

js
{
    top: 0,
    left: 0.25,
    height: 100,
    width: 100,
}

view.widget.max

Nameview.widget.max
DescriptionMaximum data value
Synopsismax: Value
NoteThis defines the maximum value the data field may take. It is used to scale the widget display. The default is to set the maximum field value observed.

Example

js
{
    max: 100
}

view.widget.min

Nameview.widget.min
DescriptionMinimum data value
Synopsismin: Value
NoteThis defines the minimum value the data field may take. It is used to scale the widget display. The default is set to the minimum field value observed.

Example

js
{
    min: 100
}

view.widget.options

Nameview.widget.options
DescriptionMap of widget specific options
Synopsisoptions: { properties }'

Custom widgets can configure and store private options in the widget.options map.

Example

js
{
    options: {
        span: 10000
    }
}

view.widget.placeholder

Nameview.widget.placeholder
DescriptionPlaceholder text to use for input widgets
Synopsisplaceholder: 'text'

The input widget can display placeholder text before a user has entered text.

js
{
    placeholder: 'Enter a valid phone number'
}

view.widget.prefix

Nameview.widget.prefix
DescriptionText prefix to prepend to the displayed value
Synopsisprefix: 'text'

The prefix is displayed before the value text. If the prefix contains a icon: leading portion, the prefix will be interpreted as an icon.

Example

js
{
    prefix: 'icon:$alarm'
}

view.widget.range

Nameview.widget.range
DescriptionThe time range for data displayed
Synopsisrange: {period: Seconds}

Example

js
{
    range: {
        period: 3600
    }
}

view.widget.statistic

Nameview.widget.statistic
DescriptionMetric statistic to display
Synopsisstatistic: 'avg'
NoteSelect from "avg", "min", "max", "count", "current" or "sum".

Example

js
{
    statistic: 'sum'
}

view.widget.suffix

Nameview.widget.suffix
DescriptionText suffix to append to the displayed value
Synopsissuffix: 'text'

The suffix is displayed after the value text. If the suffix contains a icon: leading portion, the suffix will be interpreted as an icon.

Example

js
{
    suffix: 'icon:$alarm'
}

view.widget.text

Nameview.widget.text
DescriptionText to display.
Synopsistext: 'message'

Some widgets such as the Button widget, can display a fixed messages instead of a data source value.

Example

js
{
    text: 'Click Me'
}

view.widget.ticks

Nameview.widget.ticks
DescriptionThe number of data items on the x axis
Synopsisticks: Number

Example

js
{
    ticks: 12
}

view.widget.timezone

Nameview.widget.timezone
DescriptionThe timezone to use with the input widget when using a date input field
Synopsistimezone: 'timezone'

Example

js
{
    timezone: 'utc'
}

view.widget.title

Nameview.widget.title
DescriptionWidget title to display
Synopsistitle: "Title"
NoteSee also widget.footer

Example

js
{
    title: 'Network IO',
}

view.widget.url

Nameview.widget.url
DescriptionSource URL for image widgets
Synopsisurl: 'URL'

Image widgets can load images by specifying the widget.url property.

Example

js
{
    url: 'https://example.com/sunset.jpg',
}

view.widget.top

Nameview.widget.top
DescriptionOffset from the top of the display to position the widget
Synopsistop: 10

This property can be used to absolutely position a widget.

Example

js
{
    top: 0,
    left: 100,
    height: 100,
    width: 100,
}

view.widget.type

Nameview.widget.type
DescriptionType of widget
Synopsiswidgets: [ {widget}, ...]
NoteThe widget type must be set to one of: event, gauge, graph, led, numeric, progress, text, time.

Example

js
{
    type: 'gauge',
    title: 'Network IO',
}

view.widget.validate

Nameview.widget.validate
DescriptionValidation regular expression for input widgets
Synopsisvalidate: 'Regular Expression'

The input widget can use the validate property to test user entered data conforms to the required data format.

The regular expression is NOT enclosed in slash delimiters.

Example

js
{
    validate: '^[0-9]+$'

}

view.widget.width

Nameview.widget.width
DescriptionWidget width in pixels or percentage
Synopsis`width: Pixels

Example

js
{
    width: '25%'
}

view.widget.z

Nameview.widget.z
DescriptionSet the z-order of a widget when using the Exact dashboard layout
Synopsisz: Number

The Exact dashboard layout engine positions widgets exactly and permits widgets to overlap. By setting the Z ordering, you can overlay widgets to create a desired effect.

The default z value is 0.

Example

js
{
    z: 2
}