system.kanoa.dashboard.addDashboard
Description
Adds a new dashboard.Syntax
addDashboard(dashboardInfo, userId)- dashboardInfo (dict)
- - dashboardName (string): The name of the dashboard. This must be unique within the folder.
- - dashboardDescription (string): Some information about the dashboard.
- - folderId (int): The id of the folder this dashboard is going into. Use None if the dashboard is going onto the root.
- - private (boolean): Indicates if the dashboard is private or public. True for private, False for public
- - iconPath (string): The path to the icon for this dashboard.
- - iconColor (string): The color of the icon for this dashboard.
- - roles ([string]): An array of roles that are able to view this dashboard.
- - showOnMobile (boolean): Indicates if the dashboard should be shown on mobile devices.
- - enabled (boolean)
- - sortOrder (int): Determines where within the folder the dashboard is placed relative to other dashboards. If the same as another dashboard, then sorted by name.
- int userId - User ID
- dashboardId (int)
- msg (string): error message, None if successful
Code Examples
# Example usage
dashboardInfo = {
"dashboardDescription": "Downtime By Asset",
"dashboardName": "Asset Downtime",
"enabled": True,
"folderId": 1,
"iconColor": "#AC5F00",
"iconPath": "kanoa/maintenance",
"private": False,
"roles": None,
"showOnMobile": false,
"sortOrder": None
}
userId = 123
dashboardId, msg = system.kanoa.dashboard.addDashboard(dashboardInfo, userId)
if msg: system.perspective.sendMessage('showFailerToast', msg)
else: system.perspective.sendMessage('showSuccessfulToast', 'Dashboard has been saved')