dashboard_modules.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. =================
  2. Dashboard Modules
  3. =================
  4. Build-In Dashboard Modules
  5. ==========================
  6. LinkList
  7. --------
  8. .. image:: _static/dashboard_module_link_list.png
  9. :width: 100%
  10. .. autoclass:: jet.dashboard.modules.LinkList
  11. :members:
  12. AppList
  13. -------
  14. .. image:: _static/dashboard_module_app_list.png
  15. :width: 100%
  16. .. autoclass:: jet.dashboard.modules.AppList
  17. :members:
  18. ModelList
  19. ---------
  20. .. image:: _static/dashboard_module_model_list.png
  21. :width: 100%
  22. .. autoclass:: jet.dashboard.modules.ModelList
  23. :members:
  24. RecentActions
  25. -------------
  26. .. image:: _static/dashboard_module_recent_actions.png
  27. :width: 100%
  28. .. autoclass:: jet.dashboard.modules.RecentActions
  29. :members:
  30. Feed
  31. ----
  32. .. image:: _static/dashboard_module_feed.png
  33. :width: 100%
  34. .. autoclass:: jet.dashboard.modules.Feed
  35. :members:
  36. Google Analytics Widgets
  37. ========================
  38. .. attention::
  39. Google Analytics widgets required extra setup
  40. .. image:: _static/dashboard_module_google_analytics.png
  41. :width: 100%
  42. Extra Installation
  43. ------------------
  44. * Install python package:
  45. .. code::
  46. pip install google-api-python-client==1.4.1
  47. * Specify path to your Google Analytics ``client_secrets.json`` (obtained at Google website):
  48. .. code::
  49. JET_MODULE_GOOGLE_ANALYTICS_CLIENT_SECRETS_FILE = os.path.join(PROJECT_DIR, 'client_secrets.json')
  50. * Add import to the top of your urls.py:
  51. .. code::
  52. from jet.dashboard.dashboard_modules import google_analytics_views
  53. Usage Example
  54. -------------
  55. .. code-block:: python
  56. from django.utils.translation import ugettext_lazy as _
  57. from jet.dashboard.dashboard import Dashboard, AppIndexDashboard
  58. from jet.dashboard.dashboard_modules import google_analytics
  59. class CustomIndexDashboard(Dashboard):
  60. columns = 3
  61. def init_with_context(self, context):
  62. self.available_children.append(google_analytics.GoogleAnalyticsVisitorsTotals)
  63. self.available_children.append(google_analytics.GoogleAnalyticsVisitorsChart)
  64. self.available_children.append(google_analytics.GoogleAnalyticsPeriodVisitors)
  65. .. autoclass:: jet.dashboard.dashboard_modules.google_analytics.GoogleAnalyticsVisitorsTotals
  66. :members:
  67. .. autoclass:: jet.dashboard.dashboard_modules.google_analytics.GoogleAnalyticsVisitorsChart
  68. :members:
  69. .. autoclass:: jet.dashboard.dashboard_modules.google_analytics.GoogleAnalyticsPeriodVisitors
  70. :members:
  71. Yandex Metrika Widgets
  72. ======================
  73. .. attention::
  74. Yandex Metrika widgets required extra setup
  75. .. image:: _static/dashboard_module_yandex_metrika.png
  76. :width: 100%
  77. Extra Installation
  78. ------------------
  79. * Set your Yandex Metrika CLIENT_ID and CLIENT_SECRET (obtained at Yandex Metrika API website):
  80. .. code::
  81. JET_MODULE_YANDEX_METRIKA_CLIENT_ID = 'YANDEX_METRIKA_CLIENT_ID'
  82. JET_MODULE_YANDEX_METRIKA_CLIENT_SECRET = 'YANDEX_METRIKA_CLIENT_SECRET'
  83. * Add import to the top of your urls.py:
  84. .. code::
  85. from jet.dashboard.dashboard_modules import yandex_metrika_views
  86. Usage Example
  87. -------------
  88. .. code-block:: python
  89. from django.utils.translation import ugettext_lazy as _
  90. from jet.dashboard.dashboard import Dashboard, AppIndexDashboard
  91. from jet.dashboard.dashboard_modules import yandex_metrika
  92. class CustomIndexDashboard(Dashboard):
  93. columns = 3
  94. def init_with_context(self, context):
  95. self.available_children.append(yandex_metrika.YandexMetrikaVisitorsTotals)
  96. self.available_children.append(yandex_metrika.YandexMetrikaVisitorsChart)
  97. self.available_children.append(yandex_metrika.YandexMetrikaPeriodVisitors)
  98. .. autoclass:: jet.dashboard.dashboard_modules.yandex_metrika.YandexMetrikaVisitorsTotals
  99. :members:
  100. .. autoclass:: jet.dashboard.dashboard_modules.yandex_metrika.YandexMetrikaVisitorsChart
  101. :members:
  102. .. autoclass:: jet.dashboard.dashboard_modules.yandex_metrika.YandexMetrikaPeriodVisitors
  103. :members: