Wiki

Clone wiki

atlasboard / Dashboards

Dashboards

Dashboards should be written as a JSON object with the following elements:

  • enabled enables/displays the dashboard. A quick way to hide your dashboard without having to delete it (default to true).

  • layout contains the actual dashboard layout, with the following elements:

    • title the title, if any, that you'd like at the top of your page (warning: this could be moved out of the layout key in future releases).

    • gridSize grid size is customizable ( "gridSize" : { "columns" : 8, "rows" : 6 })

    • customJs the names of any extra JavaScript libraries, located in assets/javascripts, that you'd like included. (warning: this could be moved out of the layout key in future releases).

    • widgets an array of objects detailing each widget to be displayed on the dashboard. Each widgets object has the following markup:

      • enabled if false, disables this widget.

      • row value from 1 to 4.

      • col value from 1 to 6.

      • width value from 1 to 6.

      • height value from 1 to 4.

      • widget The name of the folder in widgets/ that contains your widget's HTML, JS and CSS files. If you want to refer to the widget on an specific package, use the namespace <package>#<widgetname> (i.ex: atlasboard#quotes).

      • job The name of the folder in jobs/ that contains the job. Refers to the name of the job to be executed. The same namespace rule applies to jobs.

      • config The config key that will be use for this dashboard item.

  • config a config object for this dashboard, containing a key value container for job configuration.

Example dashboard config file

#!javascript
{
  "enabled": true,

  "layout": {           
    "title": false,
    "gridSize" : { "columns" : 6, "rows" : 4 },
    "customJS" : [],
    "widgets" : [
      {"row" : 1, "col" : 1, "width" : 2, "height" : 3, "widget" : "quotes", "job" : "quotes-famous", "config" : "quotes"}
    ]
   },

  "config" : {
    "quotes" : {
      "numberQuotes" : 10
    }
  }
}

Using the common dashboard config file

If you want to share the same config object for more than one dashboard, you can place it in /config/dashboard_common.json so you donĀ“t have to repeat it.

Example

Dashboard 1

#!javascript
{
  "enabled": true,

  "layout": {           
    "title": 'dashboard 1',
    "customJS" : [],
    "widgets" : [
      {"row" : 1, "col" : 1, "width" : 2, "height" : 3, "widget" : "quotes", "job" : "quotes-famous", "config" : "myquotes"}
    ]
   }
}

Dashboard 2

#!javascript
{
  "enabled": true,

  "layout": {           
    "title": 'dashboard 2',
    "customJS" : [],
    "widgets" : [
      {"row" : 1, "col" : 1, "width" : 2, "height" : 3, "widget" : "quotes", "job" : "quotes-famous", "config" : "myquotes"}
    ]
   }
}

/config/dashboard_common.json

#!javascript

{
  "config" : {
    "myquotes" : {
      "numberQuotes" : 10
    }
  }
}

Note: If the same key is found in both the global dashboard common AND the local dashboard file, configuration defined in the global dashboard will be extended by the local dashboard (if same properties found, they will be overwritten by the version in the local dashboard file)

Namespacing - Refering to jobs and widgets in different packages

Examples: Use atlassian#blockers to refer to a blockers job that is located on the atlassian namespace. Same applies to widgets.

Updated