dashboard_modules.rst 3.4 KB

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