From 222f77d5fff1787dad09896b4038445723ece19a Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 22 Jan 2015 22:10:07 +0100 Subject: [PATCH] Some fundamental fixes for the admin interface Now rooms get listed and displayed on the page, but a lot is still missing - Pagination - Filter as you type - Action on utton press (only join which is a simple a href works) - Bypass password when joining a room through the admin page (push in the room_partitipant table) - Probably more --- lib/Vroom/Constants.pm | 2 +- public/js/vroom.js | 20 +++++++++++++++----- vroom.pl | 41 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/lib/Vroom/Constants.pm b/lib/Vroom/Constants.pm index 2301ee6..e4c2eda 100644 --- a/lib/Vroom/Constants.pm +++ b/lib/Vroom/Constants.pm @@ -149,7 +149,7 @@ use constant JS_STRINGS => qw( # API actions use constant API_ACTIONS => { admin => { - list_rooms => 1, + get_room_list => 1, set_persistent => 1 }, owner => { diff --git a/public/js/vroom.js b/public/js/vroom.js index 2b2692c..85b2d59 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -257,7 +257,7 @@ function initAdmin(){ var matches = 0; // Update display of room list - function updateDeviceList(filter, min, max){ + function updateRoomList(filter, min, max){ $('#deviceList').html(''); var filterRe = new RegExp(filter, "gi"); var i = 0; @@ -266,14 +266,24 @@ function initAdmin(){ if (filter === '' || obj.name.match(filterRe)){ matches++; if (i >= min && i < max){ - $('#deviceList').append($('') + $('#roomList').append($('') .append($('').html(stringEscape(obj.name))) .append($('') .append($('
').addClass('btn-group') .append($('').addClass('btn btn-default').attr('href',rootUrl + obj.name) .html( $('').addClass('glyphicon glyphicon-log-in') - ) + ) + ) + .append($('