Pages
Pages are the main part of the configuration. They define the pages that can be accessed in the project. Pages can be used to embed dashboards and adapted to suit the usecase.
Besides the list of the actual dashboards the page configuration also contains some meta data about the page. This includes the name, the path, the access permissions and optionally variables to be used inside the page.
Path
A page can be accessed by it's path. The path is made up of two parts. The base path and the query parameters.
Base
The base path of the page. This is the path that will be used to access the page.
To make the page accessible under the url /project/example.
{
"path": {
"base": "/example"
}
}This will error if the path is already taken by another page. Currently it is
not possible to have sub pages like /example/subpage.
Query Parameter
This is not implemented yet. But will hopefully make it into the first release.
Query parameters can be used to pass data to the page. This can be used to create dynamic pages. The value of the query parameters can be then accessed like other variables.
To make a page accept the query parameter id for example to filter data.
{
"path": {
"base": "/example",
"query": ["id"]
}
}This will error if one query parameter is defined multible times.
Name
The name of the page. This will show as the pages title. The page name also accepts variables. This can be usefull to create dynamic page titles.
To name a page Example:
{
"name": "Example"
}Access
Public
If the page is public or not. If the page is public it can be accessed by anyone. If the page is not public it can only be accessed by users that have the canView permission.
To make a page public:
{
"access": {
"public": true
}
}Can View
The roles that can view the page. This is a list of acceptable roles. If the page is public this will be ignored.
To make a page viewable for the existing role vip:
{
"access": {
"canView": ["vip"]
}
}By default all pages can be viewed by the admin role. The admin role is
also the only role who can edit pages configuration.
Variables
User defined
Variables can help to keep your page configuration clean and avoid repetition. Internally any useage of a variable in the configuration will be replaced with it's value. So you can use variables in any part of the configuration like the page name or the dashboard configurations.
To define the magic number 42 as a variable:
{
"variables": {
"magicNumber": 42
}
}To use a variable precede it with a $ symbol. To access an object use dot notation.
$magicNumber will be replaced with 42.
{
"variables": {
"magicNumber": 42
},
"dashboards": [
{
"type": "infoAndLinks",
"parameters": {
"text": "The magic number is $magicNumber"
}
}
]
}Built in
To help make pages more dynamic there are some built in variables. These variables can be used in any part of the configuration like user defined ones. They also can be overwritten by user defined variables.
| Name | Description | Example |
|---|---|---|
user | The user that is currently viewing the page. | $user.name |
query | The query parameters of the page. | $query.id |
project | The project the page is in. | $project.name |
page | The page itself. Without it's dashboards | $page.name |
time | The time the page was accessed. | $time |
Derived Values
Some variables can be derived from other variables. These variables can be used to make the configuration more dynamic.
To read more about variables see the variables page.