Changeset - b11cb99ccd57
[Not reviewed]
0 1 0
Jan Kaluza - 10 years ago 2016-02-20 15:37:39
jkaluza@redhat.com
Web interface: Fix leaving the room with hash in the name
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
spectrum_manager/src/html/js/app.js
Show inline comments
 
@@ -60,49 +60,49 @@ function show_instances() {
 
					e.preventDefault();
 
					$(this).parent().empty().progressbar( {value: false} ).css('height', '1em');
 

	
 
					var url = $(this).attr('href');
 
					$.get(url, function(data) {
 
						show_instances();
 
					});
 
				})
 
			}
 
		});
 
	});
 
}
 

	
 
function show_list_rooms() {
 
	var query = getQueryParams(document.location.search);
 
	$.get($.cookie("base_location") + "api/v1/instances/list_rooms/" + query.id, function(data) {
 
		$("#main_content").html("<h2>Joined rooms</h2><table id='main_result'><tr><th>" + data.frontend_room_label + "</th><th>" + data.legacy_room_label + "</th><th>" + data.legacy_server_label + "</th><th>" + data.name_label + "</th><th>Actions</th></tr>");
 

	
 
		$.each(data.rooms, function(i, room) {
 
			var row = '<tr>';
 
			row += '<td>' + room.frontend_room + '</td>';
 
			row += '<td>' + room.legacy_room + '</td>';
 
			row += '<td>' + room.legacy_server + '</td>';
 
			row += '<td>' + room.name + '</td>';
 
			row += '<td><a class="button_command" href="' + $.cookie("base_location") +  'api/v1/instances/leave_room/' + query.id + '?frontend_room=' + room.frontend_room + '">Leave</a></td>';
 
			row += '<td><a class="button_command" href="' + $.cookie("base_location") +  'api/v1/instances/leave_room/' + query.id + '?frontend_room=' + encodeURIComponent(room.frontend_room) + '">Leave</a></td>';
 
			row += '</tr>';
 

	
 
			$("#main_result  > tbody:last-child").append(row);
 
			$(".button_command").click(function(e) {
 
				e.preventDefault();
 
				$(this).parent().empty().progressbar( {value: false} ).css('height', '1em');
 

	
 
				var url = $(this).attr('href');
 
				$.get(url, function(data) {
 
					show_list_rooms();
 
				});
 
			})
 
		});
 
	});
 
}
 

	
 
function show_users() {
 
	var admin = $.cookie("admin") == "1";
 
	if (!admin) {
 
		$("#main_content").html("<h2>List of Spectrum 2 users</h2><p>Only administrator can list the users.</p>");
 
		return;
 
	}
 

	
 
	$.get($.cookie("base_location") + "api/v1/users", function(data) {
0 comments (0 inline, 0 general)