django-cfg 1.4.87__py3-none-any.whl → 1.4.89__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of django-cfg might be problematic. Click here for more details.

Files changed (177) hide show
  1. django_cfg/__init__.py +1 -1
  2. django_cfg/apps/centrifugo/views/__init__.py +0 -2
  3. django_cfg/apps/dashboard/permissions.py +48 -0
  4. django_cfg/apps/dashboard/serializers/__init__.py +8 -1
  5. django_cfg/apps/dashboard/serializers/commands.py +29 -0
  6. django_cfg/apps/dashboard/services/__init__.py +2 -0
  7. django_cfg/{modules/django_unfold/callbacks/base.py → apps/dashboard/services/commands_security.py} +28 -90
  8. django_cfg/apps/dashboard/services/commands_service.py +208 -9
  9. django_cfg/apps/dashboard/services/overview_service.py +205 -0
  10. django_cfg/apps/dashboard/views/commands_views.py +92 -4
  11. django_cfg/apps/frontend/test_routing.py +134 -0
  12. django_cfg/apps/frontend/views.py +73 -28
  13. django_cfg/apps/urls.py +0 -1
  14. django_cfg/core/builders/apps_builder.py +0 -58
  15. django_cfg/modules/django_unfold/__init__.py +5 -24
  16. django_cfg/modules/django_unfold/models/__init__.py +0 -23
  17. django_cfg/modules/django_unfold/models/config.py +11 -65
  18. django_cfg/modules/django_unfold/{dashboard.py → navigation.py} +21 -152
  19. django_cfg/modules/django_unfold/tailwind.py +2 -4
  20. django_cfg/pyproject.toml +1 -1
  21. django_cfg/registry/third_party.py +0 -9
  22. django_cfg/routing/callbacks.py +1 -43
  23. django_cfg/static/frontend/admin/404/index.html +1 -1
  24. django_cfg/static/frontend/admin/404.html +1 -1
  25. django_cfg/static/frontend/admin/500/index.html +1 -1
  26. django_cfg/static/frontend/admin/_next/static/{ZJZBgOL9mO1koHrgaaLEV → 0sN9ktsgXH48ygtGSrhfu}/_buildManifest.js +1 -1
  27. django_cfg/static/frontend/admin/_next/static/chunks/{19430.fe7bff7372f8a256.js → 19430.c4c95603c23c17fe.js} +1 -1
  28. django_cfg/static/frontend/admin/_next/static/chunks/50314-9443faa6df24aebf.js +1 -0
  29. django_cfg/static/frontend/admin/_next/static/chunks/94141-bc6d47f419b26b21.js +1 -0
  30. django_cfg/static/frontend/admin/_next/static/chunks/pages/{_app-c336f254967dd101.js → _app-c7dcd3aa616fab68.js} +6 -6
  31. django_cfg/static/frontend/admin/_next/static/chunks/pages/legal/{cookies-b39c7f22c066e2c6.js → cookies-97d279800f12aab4.js} +1 -1
  32. django_cfg/static/frontend/admin/_next/static/chunks/pages/legal/{privacy-5aedad0cf3a4f80f.js → privacy-1d5e6cd94689247e.js} +1 -1
  33. django_cfg/static/frontend/admin/_next/static/chunks/pages/legal/{security-dbd854d0d5d483e2.js → security-55e49700e7a01f5a.js} +1 -1
  34. django_cfg/static/frontend/admin/_next/static/chunks/pages/legal/{terms-f3e1d2b9e5edf12f.js → terms-14c02bb2d3198352.js} +1 -1
  35. django_cfg/static/frontend/admin/_next/static/chunks/pages/private/{centrifugo-22532c65971225eb.js → centrifugo-f9ecbc3ae0052a03.js} +1 -1
  36. django_cfg/static/frontend/admin/_next/static/chunks/pages/private-d4ccbe1265cbd853.js +1 -0
  37. django_cfg/static/frontend/admin/_next/static/chunks/{webpack-da114020a6b940f5.js → webpack-5a92f81363b62aa7.js} +1 -1
  38. django_cfg/static/frontend/admin/_next/static/css/3063068f0d5a8a00.css +3 -0
  39. django_cfg/static/frontend/admin/_next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
  40. django_cfg/static/frontend/admin/_next/static/media/21350d82a1f187e9-s.p.woff2 +0 -0
  41. django_cfg/static/frontend/admin/_next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
  42. django_cfg/static/frontend/admin/_next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
  43. django_cfg/static/frontend/admin/_next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
  44. django_cfg/static/frontend/admin/_next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
  45. django_cfg/static/frontend/admin/_next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
  46. django_cfg/static/frontend/admin/auth/index.html +1 -1
  47. django_cfg/static/frontend/admin/index.html +1 -1
  48. django_cfg/static/frontend/admin/legal/cookies/index.html +1 -1
  49. django_cfg/static/frontend/admin/legal/privacy/index.html +1 -1
  50. django_cfg/static/frontend/admin/legal/security/index.html +1 -1
  51. django_cfg/static/frontend/admin/legal/terms/index.html +1 -1
  52. django_cfg/static/frontend/admin/private/centrifugo/index.html +1 -1
  53. django_cfg/static/frontend/admin/private/index.html +1 -1
  54. django_cfg/static/frontend/admin/private/profile/index.html +1 -1
  55. django_cfg/static/frontend/admin/private/ui/index.html +2 -2
  56. django_cfg/templates/admin/index.html +1 -1
  57. {django_cfg-1.4.87.dist-info → django_cfg-1.4.89.dist-info}/METADATA +1 -1
  58. {django_cfg-1.4.87.dist-info → django_cfg-1.4.89.dist-info}/RECORD +62 -163
  59. django_cfg/apps/centrifugo/static/django_cfg_centrifugo/css/dashboard.css +0 -260
  60. django_cfg/apps/centrifugo/static/django_cfg_centrifugo/js/dashboard/live_channels.mjs +0 -313
  61. django_cfg/apps/centrifugo/static/django_cfg_centrifugo/js/dashboard/live_testing.mjs +0 -803
  62. django_cfg/apps/centrifugo/static/django_cfg_centrifugo/js/dashboard/main.mjs +0 -341
  63. django_cfg/apps/centrifugo/static/django_cfg_centrifugo/js/dashboard/overview.mjs +0 -432
  64. django_cfg/apps/centrifugo/static/django_cfg_centrifugo/js/dashboard/testing.mjs +0 -33
  65. django_cfg/apps/centrifugo/static/django_cfg_centrifugo/js/dashboard/websocket.mjs +0 -210
  66. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/components/channels_content.html +0 -46
  67. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/components/live_channels_content.html +0 -123
  68. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/components/overview_content.html +0 -45
  69. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/components/publishes_content.html +0 -84
  70. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/components/stat_cards.html +0 -53
  71. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/components/system_status.html +0 -91
  72. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/components/tab_navigation.html +0 -29
  73. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/components/testing_tools.html +0 -415
  74. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/layout/base.html +0 -61
  75. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/pages/dashboard.html +0 -58
  76. django_cfg/apps/centrifugo/templates/django_cfg_centrifugo/tags/connection_script.html +0 -48
  77. django_cfg/apps/centrifugo/templatetags/__init__.py +0 -1
  78. django_cfg/apps/centrifugo/templatetags/centrifugo_tags.py +0 -81
  79. django_cfg/apps/centrifugo/urls_admin.py +0 -20
  80. django_cfg/apps/centrifugo/views/dashboard.py +0 -28
  81. django_cfg/modules/django_dashboard/__init__.py +0 -23
  82. django_cfg/modules/django_dashboard/components.py +0 -312
  83. django_cfg/modules/django_dashboard/debug.py +0 -174
  84. django_cfg/modules/django_dashboard/management/__init__.py +0 -0
  85. django_cfg/modules/django_dashboard/management/commands/__init__.py +0 -0
  86. django_cfg/modules/django_dashboard/management/commands/debug_dashboard.py +0 -109
  87. django_cfg/modules/django_dashboard/sections/__init__.py +0 -1
  88. django_cfg/modules/django_dashboard/sections/base.py +0 -129
  89. django_cfg/modules/django_dashboard/sections/commands.py +0 -33
  90. django_cfg/modules/django_dashboard/sections/documentation.py +0 -393
  91. django_cfg/modules/django_dashboard/sections/overview.py +0 -398
  92. django_cfg/modules/django_dashboard/sections/stats.py +0 -48
  93. django_cfg/modules/django_dashboard/sections/system.py +0 -74
  94. django_cfg/modules/django_dashboard/sections/widgets.py +0 -222
  95. django_cfg/modules/django_unfold/callbacks/__init__.py +0 -9
  96. django_cfg/modules/django_unfold/callbacks/actions.py +0 -51
  97. django_cfg/modules/django_unfold/callbacks/apizones.py +0 -122
  98. django_cfg/modules/django_unfold/callbacks/charts.py +0 -223
  99. django_cfg/modules/django_unfold/callbacks/commands.py +0 -40
  100. django_cfg/modules/django_unfold/callbacks/main.py +0 -322
  101. django_cfg/modules/django_unfold/callbacks/statistics.py +0 -240
  102. django_cfg/modules/django_unfold/callbacks/system.py +0 -180
  103. django_cfg/modules/django_unfold/callbacks/users.py +0 -65
  104. django_cfg/modules/django_unfold/models/dashboard.py +0 -207
  105. django_cfg/modules/django_unfold/models/tabs.py +0 -26
  106. django_cfg/modules/django_unfold/models.py +0 -98
  107. django_cfg/modules/django_unfold/templates/unfold/helpers/app_list.html +0 -102
  108. django_cfg/static/frontend/admin/_next/static/chunks/23004-faae121bbfecc163.js +0 -1
  109. django_cfg/static/frontend/admin/_next/static/chunks/50314-48bd5701f62faf27.js +0 -1
  110. django_cfg/static/frontend/admin/_next/static/chunks/pages/private-fe9faa86ecdb0ce6.js +0 -1
  111. django_cfg/static/frontend/admin/_next/static/css/5f9a37b6e6a72303.css +0 -3
  112. django_cfg/static/frontend/admin/_next/static/media/438aa629764e75f3-s.woff2 +0 -0
  113. django_cfg/static/frontend/admin/_next/static/media/4c9affa5bc8f420e-s.p.woff2 +0 -0
  114. django_cfg/static/frontend/admin/_next/static/media/51251f8b9793cdb3-s.woff2 +0 -0
  115. django_cfg/static/frontend/admin/_next/static/media/875ae681bfde4580-s.p.woff2 +0 -0
  116. django_cfg/static/frontend/admin/_next/static/media/cc978ac5ee68c2b6-s.woff2 +0 -0
  117. django_cfg/static/frontend/admin/_next/static/media/e857b654a2caa584-s.woff2 +0 -0
  118. django_cfg/templates/admin/sections/commands_section.html +0 -5
  119. django_cfg/templates/admin/sections/documentation_section.html +0 -5
  120. django_cfg/templates/admin/sections/overview_section.html +0 -5
  121. django_cfg/templates/admin/sections/stats_section.html +0 -5
  122. django_cfg/templates/admin/sections/system_section.html +0 -5
  123. django_cfg/templates/admin/sections/widgets_section.html +0 -11
  124. django_cfg/templates/admin_old/components/action_grid.html +0 -49
  125. django_cfg/templates/admin_old/components/card.html +0 -50
  126. django_cfg/templates/admin_old/components/data_table.html +0 -67
  127. django_cfg/templates/admin_old/components/metric_card.html +0 -39
  128. django_cfg/templates/admin_old/components/modal.html +0 -58
  129. django_cfg/templates/admin_old/components/progress_bar.html +0 -20
  130. django_cfg/templates/admin_old/components/section_header.html +0 -26
  131. django_cfg/templates/admin_old/components/stat_item.html +0 -32
  132. django_cfg/templates/admin_old/components/stats_grid.html +0 -72
  133. django_cfg/templates/admin_old/components/status_badge.html +0 -28
  134. django_cfg/templates/admin_old/components/user_avatar.html +0 -27
  135. django_cfg/templates/admin_old/constance/change_list.html +0 -74
  136. django_cfg/templates/admin_old/constance/includes/default_value.html +0 -24
  137. django_cfg/templates/admin_old/constance/includes/fieldset_header.html +0 -15
  138. django_cfg/templates/admin_old/constance/includes/results_list.html +0 -16
  139. django_cfg/templates/admin_old/constance/includes/setting_row.html +0 -50
  140. django_cfg/templates/admin_old/constance/includes/table_headers.html +0 -10
  141. django_cfg/templates/admin_old/examples/component_class_example.html +0 -156
  142. django_cfg/templates/admin_old/import_export/change_list_export.html +0 -24
  143. django_cfg/templates/admin_old/import_export/change_list_import.html +0 -24
  144. django_cfg/templates/admin_old/import_export/change_list_import_export.html +0 -34
  145. django_cfg/templates/admin_old/index.html +0 -80
  146. django_cfg/templates/admin_old/index_new.html +0 -119
  147. django_cfg/templates/admin_old/layouts/base_dashboard.html +0 -62
  148. django_cfg/templates/admin_old/layouts/dashboard_with_tabs.html +0 -176
  149. django_cfg/templates/admin_old/sections/commands_section.html +0 -549
  150. django_cfg/templates/admin_old/sections/documentation_section.html +0 -152
  151. django_cfg/templates/admin_old/sections/overview_section.html +0 -112
  152. django_cfg/templates/admin_old/sections/stats_section.html +0 -35
  153. django_cfg/templates/admin_old/sections/system_section.html +0 -99
  154. django_cfg/templates/admin_old/sections/widgets_section.html +0 -129
  155. django_cfg/templates/admin_old/snippets/components/activity_tracker.html +0 -70
  156. django_cfg/templates/admin_old/snippets/components/charts_section.html +0 -113
  157. django_cfg/templates/admin_old/snippets/components/django_commands.html +0 -270
  158. django_cfg/templates/admin_old/snippets/components/quick_actions.html +0 -66
  159. django_cfg/templates/admin_old/snippets/components/recent_activity_improved.html +0 -25
  160. django_cfg/templates/admin_old/snippets/components/recent_users_table.html +0 -102
  161. django_cfg/templates/admin_old/snippets/components/stats_cards.html +0 -4
  162. django_cfg/templates/admin_old/snippets/components/stats_tiles.html +0 -92
  163. django_cfg/templates/admin_old/snippets/components/system_health.html +0 -22
  164. django_cfg/templates/admin_old/snippets/components/system_metrics.html +0 -199
  165. django_cfg/templates/admin_old/snippets/components/user_permissions.html +0 -57
  166. django_cfg/templates/admin_old/snippets/tabs/app_stats_tab.html +0 -201
  167. django_cfg/templates/admin_old/snippets/tabs/commands_tab.html +0 -114
  168. django_cfg/templates/admin_old/snippets/tabs/documentation_tab.html +0 -42
  169. django_cfg/templates/admin_old/snippets/tabs/overview_tab.html +0 -116
  170. django_cfg/templates/admin_old/snippets/tabs/stats_tab.html +0 -89
  171. django_cfg/templates/admin_old/snippets/tabs/users_tab.html +0 -51
  172. django_cfg/templates/admin_old/snippets/tabs/widgets_tab.html +0 -38
  173. django_cfg/templates/admin_old/snippets/zones/zones_table.html +0 -176
  174. /django_cfg/static/frontend/admin/_next/static/{ZJZBgOL9mO1koHrgaaLEV → 0sN9ktsgXH48ygtGSrhfu}/_ssgManifest.js +0 -0
  175. {django_cfg-1.4.87.dist-info → django_cfg-1.4.89.dist-info}/WHEEL +0 -0
  176. {django_cfg-1.4.87.dist-info → django_cfg-1.4.89.dist-info}/entry_points.txt +0 -0
  177. {django_cfg-1.4.87.dist-info → django_cfg-1.4.89.dist-info}/licenses/LICENSE +0 -0
@@ -1,415 +0,0 @@
1
- <!-- Live Testing Tab -->
2
- <div id="usage-guide-tab" class="tab-panel hidden">
3
- <!-- Include Centrifuge.js Library -->
4
- <script src="https://unpkg.com/centrifuge@^5/dist/centrifuge.js"></script>
5
-
6
- <!-- Introduction Card -->
7
- <div class="bg-gradient-to-r from-purple-500 to-purple-700 rounded-lg p-6 mb-6 text-white">
8
- <h3 class="text-2xl font-bold mb-2 flex items-center">
9
- <span class="material-icons mr-2">science</span>
10
- Live Testing Client
11
- </h3>
12
- <p class="text-purple-100">
13
- Interactive WebSocket client for testing Centrifugo integration. Connect, subscribe to channels, publish messages, and monitor real-time events.
14
- </p>
15
- </div>
16
-
17
- <!-- Quick Test Scenarios Section -->
18
- <div class="bg-white dark:bg-gray-800 rounded-lg p-6 border border-gray-200 dark:border-gray-700 mb-6">
19
- <h3 class="text-lg font-bold text-gray-900 dark:text-white mb-4 flex items-center">
20
- <span class="material-icons mr-2 text-yellow-500">bolt</span>
21
- Quick Test Scenarios
22
- </h3>
23
- <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
24
- One-click test scenarios that automatically connect, subscribe, and publish test messages.
25
- </p>
26
-
27
- <!-- Scenarios Grid -->
28
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
29
- <!-- Scenario 1: Simple Notification -->
30
- <div class="bg-gradient-to-br from-blue-50 to-blue-100 dark:from-blue-900/20 dark:to-blue-800/20 rounded-lg p-4 border border-blue-200 dark:border-blue-800">
31
- <div class="flex items-start justify-between mb-3">
32
- <div>
33
- <h4 class="font-semibold text-gray-900 dark:text-white mb-1 flex items-center gap-2">
34
- <span class="material-icons text-blue-500 text-sm">notifications</span>
35
- Simple Notification
36
- </h4>
37
- <p class="text-xs text-gray-600 dark:text-gray-400">Fire-and-forget notification to user#test-123</p>
38
- </div>
39
- </div>
40
- <div class="bg-white dark:bg-gray-700 rounded p-2 mb-3">
41
- <code class="text-xs text-gray-700 dark:text-gray-300">
42
- → Connect<br>
43
- → Subscribe to user#test-123<br>
44
- → Publish simple message<br>
45
- → Receive immediately
46
- </code>
47
- </div>
48
- <button onclick="window.centrifugoDashboard.liveTestingModule.runQuickScenario('simple-notification')"
49
- class="w-full px-3 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded font-medium text-sm flex items-center justify-center gap-2">
50
- <span class="material-icons text-base">play_arrow</span>
51
- Run Scenario
52
- </button>
53
- </div>
54
-
55
- <!-- Scenario 2: ACK Notification -->
56
- <div class="bg-gradient-to-br from-green-50 to-green-100 dark:from-green-900/20 dark:to-green-800/20 rounded-lg p-4 border border-green-200 dark:border-green-800">
57
- <div class="flex items-start justify-between mb-3">
58
- <div>
59
- <h4 class="font-semibold text-gray-900 dark:text-white mb-1 flex items-center gap-2">
60
- <span class="material-icons text-green-500 text-sm">check_circle</span>
61
- ACK Required Notification
62
- </h4>
63
- <p class="text-xs text-gray-600 dark:text-gray-400">Message with acknowledgment tracking</p>
64
- </div>
65
- </div>
66
- <div class="bg-white dark:bg-gray-700 rounded p-2 mb-3">
67
- <code class="text-xs text-gray-700 dark:text-gray-300">
68
- → Connect<br>
69
- → Subscribe to user#test-123<br>
70
- → Publish with wait_for_ack=true<br>
71
- → Auto-send ACK (10s timeout)
72
- </code>
73
- </div>
74
- <button onclick="window.centrifugoDashboard.liveTestingModule.runQuickScenario('ack-notification')"
75
- class="w-full px-3 py-2 bg-green-600 hover:bg-green-700 text-white rounded font-medium text-sm flex items-center justify-center gap-2">
76
- <span class="material-icons text-base">play_arrow</span>
77
- Run Scenario
78
- </button>
79
- </div>
80
-
81
- <!-- Scenario 3: Broadcast -->
82
- <div class="bg-gradient-to-br from-orange-50 to-orange-100 dark:from-orange-900/20 dark:to-orange-800/20 rounded-lg p-4 border border-orange-200 dark:border-orange-800">
83
- <div class="flex items-start justify-between mb-3">
84
- <div>
85
- <h4 class="font-semibold text-gray-900 dark:text-white mb-1 flex items-center gap-2">
86
- <span class="material-icons text-orange-500 text-sm">campaign</span>
87
- Team Broadcast
88
- </h4>
89
- <p class="text-xs text-gray-600 dark:text-gray-400">Broadcast to team#developers channel</p>
90
- </div>
91
- </div>
92
- <div class="bg-white dark:bg-gray-700 rounded p-2 mb-3">
93
- <code class="text-xs text-gray-700 dark:text-gray-300">
94
- → Connect<br>
95
- → Subscribe to team#developers<br>
96
- → Broadcast announcement<br>
97
- → No ACK tracking
98
- </code>
99
- </div>
100
- <button onclick="window.centrifugoDashboard.liveTestingModule.runQuickScenario('broadcast')"
101
- class="w-full px-3 py-2 bg-orange-600 hover:bg-orange-700 text-white rounded font-medium text-sm flex items-center justify-center gap-2">
102
- <span class="material-icons text-base">play_arrow</span>
103
- Run Scenario
104
- </button>
105
- </div>
106
-
107
- <!-- Scenario 4: Complete ACK Flow -->
108
- <div class="bg-gradient-to-br from-purple-50 to-purple-100 dark:from-purple-900/20 dark:to-purple-800/20 rounded-lg p-4 border border-purple-200 dark:border-purple-800">
109
- <div class="flex items-start justify-between mb-3">
110
- <div>
111
- <h4 class="font-semibold text-gray-900 dark:text-white mb-1 flex items-center gap-2">
112
- <span class="material-icons text-purple-500 text-sm">sync_alt</span>
113
- Complete ACK Flow
114
- </h4>
115
- <p class="text-xs text-gray-600 dark:text-gray-400">Full publish → receive → ACK cycle test</p>
116
- </div>
117
- </div>
118
- <div class="bg-white dark:bg-gray-700 rounded p-2 mb-3">
119
- <code class="text-xs text-gray-700 dark:text-gray-300">
120
- → Connect<br>
121
- → Subscribe to test#ack-flow<br>
122
- → Publish with ACK tracking<br>
123
- → Verify full flow (15s timeout)
124
- </code>
125
- </div>
126
- <button onclick="window.centrifugoDashboard.liveTestingModule.runQuickScenario('ack-flow')"
127
- class="w-full px-3 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded font-medium text-sm flex items-center justify-center gap-2">
128
- <span class="material-icons text-base">play_arrow</span>
129
- Run Scenario
130
- </button>
131
- </div>
132
- </div>
133
- </div>
134
-
135
- <!-- WebSocket Connection Section -->
136
- <div class="bg-white dark:bg-gray-800 rounded-lg p-6 border border-gray-200 dark:border-gray-700 mb-6">
137
- <h3 class="text-lg font-bold text-gray-900 dark:text-white mb-4 flex items-center">
138
- <span class="material-icons mr-2 text-green-500">link</span>
139
- WebSocket Connection
140
- </h3>
141
-
142
- <!-- Connection Status Bar -->
143
- <div class="flex items-center justify-between bg-gray-50 dark:bg-gray-700 rounded-lg p-4 mb-4">
144
- <div class="flex items-center gap-3">
145
- <span class="text-sm font-medium text-gray-700 dark:text-gray-300">Status:</span>
146
- <span id="ws-connection-status" class="px-3 py-1 bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200 rounded-full text-sm font-medium">
147
- Disconnected
148
- </span>
149
- </div>
150
- <div class="flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400">
151
- <span>Client ID:</span>
152
- <code id="ws-client-id" class="bg-gray-200 dark:bg-gray-600 px-2 py-1 rounded">-</code>
153
- </div>
154
- </div>
155
-
156
- <!-- Connection Form -->
157
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
158
- <div>
159
- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
160
- User ID
161
- </label>
162
- <input type="text"
163
- id="ws-user-id"
164
- value="test-user-123"
165
- placeholder="Enter user ID"
166
- class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-purple-500 focus:border-purple-500">
167
- </div>
168
- </div>
169
-
170
- <!-- Connection Buttons -->
171
- <div class="flex gap-3">
172
- <button id="ws-connect-btn"
173
- onclick="window.centrifugoDashboard.liveTestingModule.connectToCentrifugo(document.getElementById('ws-user-id').value)"
174
- class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-md font-medium flex items-center gap-2 transition-colors">
175
- <span class="material-icons text-sm">power</span>
176
- Connect
177
- </button>
178
- <button id="ws-disconnect-btn"
179
- onclick="window.centrifugoDashboard.liveTestingModule.disconnect()"
180
- class="px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-md font-medium flex items-center gap-2 transition-colors"
181
- disabled>
182
- <span class="material-icons text-sm">power_off</span>
183
- Disconnect
184
- </button>
185
- </div>
186
- </div>
187
-
188
- <!-- Channel Subscription Section -->
189
- <div class="bg-white dark:bg-gray-800 rounded-lg p-6 border border-gray-200 dark:border-gray-700 mb-6">
190
- <h3 class="text-lg font-bold text-gray-900 dark:text-white mb-4 flex items-center">
191
- <span class="material-icons mr-2 text-blue-500">subscriptions</span>
192
- Channel Subscriptions
193
- <span id="ws-subscriptions-count" class="ml-auto px-2 py-1 bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full text-xs font-medium">0</span>
194
- </h3>
195
-
196
- <!-- Subscribe Form -->
197
- <div class="mb-4">
198
- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
199
- Channel Name
200
- </label>
201
- <div class="flex gap-2">
202
- <input type="text"
203
- id="ws-channel-name"
204
- value="user#test-123"
205
- placeholder="e.g., user#123, team#developers"
206
- class="flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-purple-500 focus:border-purple-500">
207
- <button id="ws-subscribe-btn"
208
- onclick="window.centrifugoDashboard.liveTestingModule.subscribeToChannel(document.getElementById('ws-channel-name').value)"
209
- class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md font-medium flex items-center gap-2"
210
- disabled>
211
- <span class="material-icons text-sm">add</span>
212
- Subscribe
213
- </button>
214
- </div>
215
- </div>
216
-
217
- <!-- Active Subscriptions List -->
218
- <div id="ws-subscriptions-list" class="border border-gray-200 dark:border-gray-600 rounded-lg p-4">
219
- <div class="text-center py-4 text-gray-500 dark:text-gray-400 text-sm">
220
- No active subscriptions
221
- </div>
222
- </div>
223
- </div>
224
-
225
- <!-- Message Publisher Section -->
226
- <div class="bg-white dark:bg-gray-800 rounded-lg p-6 border border-gray-200 dark:border-gray-700 mb-6">
227
- <h3 class="text-lg font-bold text-gray-900 dark:text-white mb-4 flex items-center">
228
- <span class="material-icons mr-2 text-orange-500">send</span>
229
- Publish Test Message
230
- </h3>
231
-
232
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
233
- <!-- Target Channel -->
234
- <div>
235
- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
236
- Target Channel
237
- </label>
238
- <input type="text"
239
- id="pub-channel"
240
- value="user#test-123"
241
- placeholder="Channel to publish to"
242
- class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-purple-500 focus:border-purple-500">
243
- </div>
244
-
245
- <!-- ACK Settings -->
246
- <div>
247
- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
248
- ACK Mode
249
- </label>
250
- <div class="flex gap-2">
251
- <select id="pub-ack-mode"
252
- class="flex-1 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-purple-500 focus:border-purple-500">
253
- <option value="false">Simple (No ACK)</option>
254
- <option value="true">With ACK Tracking</option>
255
- </select>
256
- <input type="number"
257
- id="pub-ack-timeout"
258
- value="10"
259
- min="1"
260
- max="60"
261
- placeholder="Timeout (s)"
262
- class="w-20 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-purple-500 focus:border-purple-500">
263
- </div>
264
- </div>
265
- </div>
266
-
267
- <!-- Message Data -->
268
- <div class="mb-4">
269
- <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
270
- Message Data (JSON)
271
- </label>
272
- <textarea id="pub-message-data"
273
- rows="6"
274
- class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 text-gray-900 dark:text-white font-mono text-sm focus:ring-purple-500 focus:border-purple-500">{
275
- "type": "notification",
276
- "title": "Test Message",
277
- "message": "This is a test message from the dashboard",
278
- "timestamp": "{% now 'c' %}"
279
- }</textarea>
280
- </div>
281
-
282
- <!-- Publish Button -->
283
- <div class="flex gap-3">
284
- <button id="pub-send-btn"
285
- onclick="window.centrifugoDashboard.liveTestingModule.publishTestMessage(
286
- document.getElementById('pub-channel').value,
287
- JSON.parse(document.getElementById('pub-message-data').value),
288
- document.getElementById('pub-ack-mode').value === 'true',
289
- parseInt(document.getElementById('pub-ack-timeout').value)
290
- ).then(result => {
291
- if (result.success) {
292
- alert('Message published successfully!\nMessage ID: ' + result.message_id + '\nDelivered: ' + result.delivered + '\nACKs: ' + result.acks_received);
293
- } else {
294
- alert('Failed to publish message: ' + result.error);
295
- }
296
- })"
297
- class="px-4 py-2 bg-orange-600 hover:bg-orange-700 text-white rounded-md font-medium flex items-center gap-2 transition-colors">
298
- <span class="material-icons text-sm">send</span>
299
- Publish Message
300
- </button>
301
- </div>
302
- </div>
303
-
304
- <!-- Received Messages Section -->
305
- <div class="bg-white dark:bg-gray-800 rounded-lg p-6 border border-gray-200 dark:border-gray-700 mb-6">
306
- <div class="flex items-center justify-between mb-4">
307
- <h3 class="text-lg font-bold text-gray-900 dark:text-white flex items-center">
308
- <span class="material-icons mr-2 text-purple-500">inbox</span>
309
- Received Messages
310
- <span id="ws-messages-count" class="ml-2 px-2 py-1 bg-purple-100 dark:bg-purple-900 text-purple-800 dark:text-purple-200 rounded-full text-xs font-medium">0</span>
311
- </h3>
312
- <div class="flex items-center gap-2">
313
- <!-- Auto ACK Toggle -->
314
- <label class="flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300">
315
- <input type="checkbox"
316
- id="auto-ack-toggle"
317
- checked
318
- onchange="window.centrifugoDashboard.liveTestingModule.toggleAutoAck(this.checked)"
319
- class="rounded border-gray-300 text-purple-600 focus:ring-purple-500">
320
- Auto ACK
321
- </label>
322
- <button onclick="window.centrifugoDashboard.liveTestingModule.clearReceivedMessages()"
323
- class="px-3 py-1 bg-gray-500 hover:bg-gray-600 text-white rounded text-sm font-medium">
324
- Clear
325
- </button>
326
- </div>
327
- </div>
328
-
329
- <!-- Messages Container -->
330
- <div id="ws-received-messages" class="max-h-96 overflow-y-auto space-y-3">
331
- <div class="text-center py-8 text-gray-500 dark:text-gray-400">
332
- No messages received yet...
333
- </div>
334
- </div>
335
- </div>
336
-
337
- <!-- ACK History Section -->
338
- <div class="bg-white dark:bg-gray-800 rounded-lg p-6 border border-gray-200 dark:border-gray-700 mb-6">
339
- <div class="flex items-center justify-between mb-4">
340
- <h3 class="text-lg font-bold text-gray-900 dark:text-white flex items-center">
341
- <span class="material-icons mr-2 text-green-500">check_circle</span>
342
- ACK History
343
- </h3>
344
- <button onclick="window.centrifugoDashboard.liveTestingModule.clearAckHistory()"
345
- class="px-3 py-1 bg-gray-500 hover:bg-gray-600 text-white rounded text-sm font-medium">
346
- Clear
347
- </button>
348
- </div>
349
-
350
- <!-- ACK History Container -->
351
- <div id="ws-ack-history">
352
- <div class="text-center py-4 text-gray-500 dark:text-gray-400 text-sm">
353
- No ACKs sent yet
354
- </div>
355
- </div>
356
- </div>
357
-
358
- <!-- WebSocket Events Log Section -->
359
- <div class="bg-white dark:bg-gray-800 rounded-lg p-6 border border-gray-200 dark:border-gray-700">
360
- <div class="flex items-center justify-between mb-4">
361
- <h3 class="text-lg font-bold text-gray-900 dark:text-white flex items-center">
362
- <span class="material-icons mr-2 text-blue-500">event_note</span>
363
- WebSocket Events Log
364
- <span id="ws-events-count" class="ml-2 px-2 py-1 bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full text-xs font-medium">0</span>
365
- </h3>
366
- <div class="flex items-center gap-2">
367
- <button onclick="window.centrifugoDashboard.liveTestingModule.exportEventsLog()"
368
- class="px-3 py-1 bg-indigo-500 hover:bg-indigo-600 text-white rounded text-sm font-medium flex items-center gap-1">
369
- <span class="material-icons text-sm">download</span>
370
- Export JSON
371
- </button>
372
- <button onclick="window.centrifugoDashboard.liveTestingModule.clearEventsLog()"
373
- class="px-3 py-1 bg-gray-500 hover:bg-gray-600 text-white rounded text-sm font-medium">
374
- Clear
375
- </button>
376
- </div>
377
- </div>
378
-
379
- <!-- Events Description -->
380
- <div class="bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3 mb-4 border border-blue-200 dark:border-blue-800">
381
- <p class="text-sm text-gray-700 dark:text-gray-300">
382
- Real-time log of all WebSocket events including connections, subscriptions, publications, ACKs, and errors. Events are color-coded by type.
383
- </p>
384
- <div class="flex flex-wrap gap-3 mt-2 text-xs">
385
- <div class="flex items-center gap-1">
386
- <span class="w-3 h-3 rounded bg-green-500"></span>
387
- <span class="text-gray-600 dark:text-gray-400">Connection</span>
388
- </div>
389
- <div class="flex items-center gap-1">
390
- <span class="w-3 h-3 rounded bg-blue-500"></span>
391
- <span class="text-gray-600 dark:text-gray-400">Subscription</span>
392
- </div>
393
- <div class="flex items-center gap-1">
394
- <span class="w-3 h-3 rounded bg-purple-500"></span>
395
- <span class="text-gray-600 dark:text-gray-400">Publication</span>
396
- </div>
397
- <div class="flex items-center gap-1">
398
- <span class="w-3 h-3 rounded bg-indigo-500"></span>
399
- <span class="text-gray-600 dark:text-gray-400">ACK</span>
400
- </div>
401
- <div class="flex items-center gap-1">
402
- <span class="w-3 h-3 rounded bg-red-500"></span>
403
- <span class="text-gray-600 dark:text-gray-400">Error</span>
404
- </div>
405
- </div>
406
- </div>
407
-
408
- <!-- Events Log Container -->
409
- <div id="ws-events-log">
410
- <div class="text-center py-4 text-gray-500 dark:text-gray-400 text-sm">
411
- No events logged yet
412
- </div>
413
- </div>
414
- </div>
415
- </div>
@@ -1,61 +0,0 @@
1
- {% extends 'django_tailwind/app.html' %}
2
- {% load static %}
3
- {% load centrifugo_tags %}
4
-
5
- {% block title %}{% block page_title_text %}Centrifugo Monitor{% endblock %} - Django-CFG{% endblock %}
6
-
7
- {% block header %}
8
- {% with navbar_items=centrifugo_nav_items %}
9
- {% include 'django_tailwind/components/navbar.html' with title="Centrifugo Monitor" icon='<span class="material-icons text-3xl text-purple-400">notifications_active</span>' nav_items=navbar_items full_width=True %}
10
- {% endwith %}
11
-
12
- <div class="bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800">
13
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3">
14
- <div class="flex items-center gap-3">
15
- <!-- Health Status -->
16
- <div id="health-indicator" class="flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700">
17
- <span class="pulse-dot w-2 h-2 bg-green-500 rounded-full"></span>
18
- <span class="text-xs font-medium text-gray-600 dark:text-gray-400">Configured</span>
19
- </div>
20
-
21
- <!-- WebSocket Status -->
22
- <div id="header-ws-status" class="flex items-center gap-1.5 px-3 py-1.5 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700">
23
- <span class="w-2 h-2 bg-gray-400 rounded-full"></span>
24
- <span class="text-xs font-medium text-gray-600 dark:text-gray-400">Connecting...</span>
25
- </div>
26
-
27
- <!-- Auto-refresh Toggle -->
28
- <label class="flex items-center gap-2 px-3 py-1.5 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 cursor-pointer hover:border-purple-300 dark:hover:border-purple-700 transition-colors">
29
- <span class="text-xs font-medium text-gray-600 dark:text-gray-400">Auto-refresh</span>
30
- <input type="checkbox" id="auto-refresh-toggle" checked
31
- class="w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-purple-600 dark:text-purple-500 focus:ring-2 focus:ring-purple-500 dark:focus:ring-purple-400 focus:ring-offset-0">
32
- </label>
33
-
34
- <!-- Centrifugo UI Button -->
35
- {% centrifugo_admin_url as admin_url %}
36
- {% if admin_url %}
37
- <a href="{{ admin_url }}" target="_blank" rel="noopener noreferrer"
38
- class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-purple-600 dark:text-purple-400 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg hover:border-purple-300 dark:hover:border-purple-700 hover:bg-purple-50 dark:hover:bg-purple-900/20 transition-colors"
39
- title="Open Centrifugo Admin UI">
40
- <span class="material-icons text-sm">open_in_new</span>
41
- <span>Centrifugo UI</span>
42
- </a>
43
- {% endif %}
44
- </div>
45
- </div>
46
- </div>
47
- {% endblock %}
48
-
49
- {% block extra_head %}
50
- {{ block.super }}
51
- <!-- Chart.js -->
52
- <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.js"></script>
53
-
54
- <!-- Dashboard Styles -->
55
- <link rel="stylesheet" href="{% static 'django_cfg_centrifugo/css/dashboard.css' %}">
56
- {% block extra_css %}{% endblock %}
57
- {% endblock %}
58
-
59
- {% block body %}
60
- {{ block.super }}
61
- {% endblock %}
@@ -1,58 +0,0 @@
1
- {% extends 'django_cfg_centrifugo/layout/base.html' %}
2
- {% load static %}
3
-
4
- {% block title %}Centrifugo Monitor Dashboard{% endblock %}
5
-
6
- {% block content %}
7
- <!-- System Status -->
8
- {% include 'django_cfg_centrifugo/components/system_status.html' %}
9
-
10
- <!-- Statistics Cards -->
11
- {% include 'django_cfg_centrifugo/components/stat_cards.html' %}
12
-
13
- <!-- Tab Navigation -->
14
- {% include 'django_cfg_centrifugo/components/tab_navigation.html' %}
15
-
16
- <!-- Tab Content -->
17
- <div class="tab-content">
18
- {% include 'django_cfg_centrifugo/components/overview_content.html' %}
19
- {% include 'django_cfg_centrifugo/components/publishes_content.html' %}
20
- {% include 'django_cfg_centrifugo/components/channels_content.html' %}
21
- {% include 'django_cfg_centrifugo/components/live_channels_content.html' %}
22
- {% include 'django_cfg_centrifugo/components/testing_tools.html' %}
23
- </div>
24
- {% endblock %}
25
-
26
- {% block extra_js %}
27
- {% load i18n %}
28
- {% now "U" as current_timestamp %}
29
-
30
- <!-- Load and initialize Centrifugo API -->
31
- <script type="module">
32
- try {
33
- console.log('🔄 Starting CentrifugoAPI module import...');
34
- const { loadAPI, showNotification } = await import('/static/js/api-loader.mjs');
35
-
36
- // Load centrifugo API
37
- const centrifugoAPI = await loadAPI('centrifugo');
38
- console.log('✅ CentrifugoAPI module imported successfully:', centrifugoAPI);
39
-
40
- // Make it available globally as centrifugoAPI
41
- window.centrifugoAPI = centrifugoAPI;
42
- window.showNotification = showNotification;
43
-
44
- console.log('✅ CentrifugoAPI loaded from generated MJS client');
45
- } catch (error) {
46
- console.error('❌ Failed to load CentrifugoAPI module:', error);
47
- console.error('Error stack:', error.stack);
48
- window.centrifugoAPI = null;
49
- }
50
- </script>
51
-
52
- <!-- Dashboard Modules -->
53
- <script type="module" src="{% static 'django_cfg_centrifugo/js/dashboard/overview.mjs' %}?v={{ current_timestamp }}"></script>
54
- <script type="module" src="{% static 'django_cfg_centrifugo/js/dashboard/testing.mjs' %}?v={{ current_timestamp }}"></script>
55
- <script type="module" src="{% static 'django_cfg_centrifugo/js/dashboard/live_channels.mjs' %}?v={{ current_timestamp }}"></script>
56
- <script type="module" src="{% static 'django_cfg_centrifugo/js/dashboard/live_testing.mjs' %}?v={{ current_timestamp }}"></script>
57
- <script type="module" src="{% static 'django_cfg_centrifugo/js/dashboard/main.mjs' %}?v={{ current_timestamp }}"></script>
58
- {% endblock %}
@@ -1,48 +0,0 @@
1
- {% load static %}
2
- {% if config and user.is_authenticated %}
3
- <!-- Centrifugo WebSocket Connection -->
4
- <script src="https://unpkg.com/centrifuge@^5/dist/centrifuge.js"></script>
5
- <script>
6
- (function() {
7
- // Centrifugo connection configuration
8
- window.centrifugoConfig = {
9
- url: '{{ config.centrifugo_url }}',
10
- token: '{{ token }}',
11
- debug: {{ config.log_level|lower == 'debug'|yesno:"true,false" }}
12
- };
13
-
14
- // Initialize Centrifuge client
15
- window.centrifuge = new Centrifuge(window.centrifugoConfig.url, {
16
- token: window.centrifugoConfig.token,
17
- debug: window.centrifugoConfig.debug
18
- });
19
-
20
- // Connection event handlers
21
- window.centrifuge.on('connected', function(ctx) {
22
- console.log('[Centrifugo] Connected:', ctx);
23
- document.dispatchEvent(new CustomEvent('centrifugo:connected', { detail: ctx }));
24
- });
25
-
26
- window.centrifuge.on('disconnected', function(ctx) {
27
- console.log('[Centrifugo] Disconnected:', ctx);
28
- document.dispatchEvent(new CustomEvent('centrifugo:disconnected', { detail: ctx }));
29
- });
30
-
31
- window.centrifuge.on('error', function(ctx) {
32
- console.error('[Centrifugo] Error:', ctx);
33
- document.dispatchEvent(new CustomEvent('centrifugo:error', { detail: ctx }));
34
- });
35
-
36
- // Auto-connect on page load
37
- if (document.readyState === 'loading') {
38
- document.addEventListener('DOMContentLoaded', function() {
39
- window.centrifuge.connect();
40
- });
41
- } else {
42
- window.centrifuge.connect();
43
- }
44
-
45
- console.log('[Centrifugo] Client initialized');
46
- })();
47
- </script>
48
- {% endif %}
@@ -1 +0,0 @@
1
- """Centrifugo template tags."""