Widget Decorators

The widget decorators can be applied to widgets to configure them in some fashion:

from dashboard.widget import *
import time

@refresh_every(5)
async def my_widget(wc):
    return { "time": time.time() }
dashboard.widget.methods(methods)[source]

Widget wrapper that sets the widget to refresh every frequency seconds.

The frequency is available as frequency in the widget options in the index template.

A widget with a frequency of None should be refreshed at the default interval. A widget with a frequency of 0 should never be refreshed. A widget with a frequency of n should be refreshed every n seconds.

dashboard.widget.refresh_every(frequency)[source]

Widget wrapper that sets the widget to refresh every frequency seconds.

The frequency is available as frequency in the widget options in the index template.

A widget with a frequency of None should be refreshed at the default interval. A widget with a frequency of 0 should never be refreshed. A widget with a frequency of n should be refreshed every n seconds.