An example on how to add a widget to dashboard plugin

In this example I’ve modified the ‘morpheus-dashboard’ plugin, that can be found on GitHub, to include a widget that lists first 10 catalogs in the Morpheus app.

Please check the files in the following location to see what was added/modified in the plugin to create this widget:

#Added ‘CatalogsController.groovy’
CatalogsController.groovy - morpheus-dashboards-catalogs/morpheus-home-dashboard-plugin/src/main/groovy/com/morpheusdata/api/CatalogsController.groovy

#Added ‘CatalogItemProvider.groovy’
CatalogItemProvider.groovy - morpheus-dashboards-catalogs/morpheus-home-dashboard-plugin/src/main/groovy/com/morpheusdata/dashboard/CatalogItemProvider.groovy

#Modified ‘HomeDashboardProvider’ to include the catalog widget in the dashboardItemsGroups
HomeDashboardProvider.groovy - morpheus-dashboards-catalogs/morpheus-home-dashboard-plugin/src/main/groovy/com/morpheusdata/dashboard/HomeDashboardProvider.groovy

#Modified ‘MorpheusHomeDashboardPlugin.groovy’ to add the ‘catalogItemProvider’ and add the ‘CatalogsController’
MorpheusHomeDashboardPlugin.groovy - morpheus-dashboards-catalogs/morpheus-home-dashboard-plugin/src/main/groovy/com/morpheusdata/dashboard/MorpheusHomeDashboardPlugin.groovy

#Added ‘catalogs-widget.hbs’
catalogs-widget.hbs - morpheus-dashboards-catalogs/morpheus-home-dashboard-plugin/src/main/resources/renderer/hbs/catalogs/catalogs-widget.hbs

#Added ‘catalogs-widget.jsx’
catalogs-widget.jsx - morpheus-dashboards-catalogs/morpheus-home-dashboard-plugin/src/assets/js/catalogs/catalogs-widget.jsx

Widget

Very cool @wabbas :+1: