diff options
Diffstat (limited to 'src/meetingtools')
-rw-r--r-- | src/meetingtools/apps/room/views.py | 10 | ||||
-rw-r--r-- | src/meetingtools/urls.py | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/meetingtools/apps/room/views.py b/src/meetingtools/apps/room/views.py index ba949fe..e612141 100644 --- a/src/meetingtools/apps/room/views.py +++ b/src/meetingtools/apps/room/views.py @@ -358,6 +358,16 @@ def _clean(request,room): room.sco_id = None return _update_room(request, room) +def occupation(request,rid): + room = get_object_or_404(Room,pk=rid) + with ac_api_client(room.acc) as api: + api.poll_user_counts(room) + d = {'nusers': room.user_count, 'nhosts': room.host_count} + return respond_to(request, + {'text/html': 'apps/room/fragments/occupation.txt', + 'application/json': json_response(d, request)}, + d) + def go_by_id(request,id): room = get_object_or_404(Room,pk=id) return goto(request,room) diff --git a/src/meetingtools/urls.py b/src/meetingtools/urls.py index ed541b9..c5401b3 100644 --- a/src/meetingtools/urls.py +++ b/src/meetingtools/urls.py @@ -45,6 +45,7 @@ urlpatterns = patterns('', (r'^api/stats/user/(.*)$','meetingtools.apps.stats.views.user_minutes_api'), (r'^api/stats/domain/(.+)$','meetingtools.apps.stats.views.domain_minutes_api'), (r'^api/stats/room/(\d+)$','meetingtools.apps.stats.views.room_minutes_api'), + (r'^api/room/(\d+)/occupation$','meetingtools.apps.room.views.occupation'), (r'^stats$','meetingtools.apps.stats.views.user'), (r'^stats/user/(.+)$','meetingtools.apps.stats.views.user'), (r'^stats/domain/(.+)$','meetingtools.apps.stats.views.domain'), |