Dashboard Widgets ***************** Example ======= Basic example of a dynamic and configurable widget can be browsed and downloaded at https://github.com/ajenti/demo-plugins/tree/master/demo_5_widget Plugins can provide dashboard widgets by extending the :class:`aj.plugins.dashboard.api.Widget` abstract class:: @component(Widget) class RandomWidget(Widget): id = 'random' # display name name = 'Random' # template of the widget template = '/demo_5_widget:resources/partial/widget.html' # template of the configuration dialog config_template = '/demo_5_widget:resources/partial/widget.config.html' def __init__(self, context): Widget.__init__(self, context) def get_value(self, config): # generate value based on widget's config if 'bytes' not in config: return 'Not configured' return os.urandom(int(config['bytes'])).encode('hex') There are some CSS classes available for the standard widget looks::