Changeset - 144ccb07e8e2
[Not reviewed]
0 2 0
Jan Kaluza - 10 years ago 2016-01-28 09:23:41
jkaluza@redhat.com
Web interface: Fix missing ',' in app.js
2 files changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
spectrum_manager/src/APIServer.cpp
Show inline comments
 
@@ -143,24 +143,28 @@ void APIServer::serve_instances_list_rooms(Server *server, Server::session *sess
 
		send_ack(conn, true, "You are not registered to this Spectrum 2 instance.");
 
		return;
 
	}
 

	
 
	std::string response = server->send_command(instance, "list_rooms " + username);
 

	
 
	std::vector<std::string> commands;
 
	boost::split(commands, response, boost::is_any_of("\n"));
 

	
 
	Document json;
 
	json.SetObject();
 
	json.AddMember("error", 0, json.GetAllocator());
 
	json.AddMember("name_label", "Nickname in 3rd-party room", json.GetAllocator());
 
	json.AddMember("legacy_room_label", "3rd-party room name", json.GetAllocator());
 
	json.AddMember("legacy_server_label", "3rd-party server", json.GetAllocator());
 
	json.AddMember("frontend_room_label", "Slack channel", json.GetAllocator());
 

	
 
	std::vector<std::vector<std::string> > tmp;
 
	Value rooms(kArrayType);
 
	BOOST_FOREACH(const std::string &command, commands) {
 
		if (command.size() > 5) {
 
			std::vector<std::string> args2;
 
			boost::split(args2, command, boost::is_any_of(" "));
 
			if (args2.size() == 6) {
 
				tmp.push_back(args2);
 
				Value room;
 
				room.SetObject();
 
				room.AddMember("name", tmp.back()[2].c_str(), json.GetAllocator());
spectrum_manager/src/html/js/app.js
Show inline comments
 
@@ -128,25 +128,25 @@ function show_users() {
 

	
 
function fill_instances_join_room_form() {
 
	var query = getQueryParams(document.location.search);
 
	$("#instance").attr("value", query.id);
 

	
 
	$(".button_command").click(function(e) {
 
		e.preventDefault();
 
		$(this).parent().empty().progressbar( {value: false} ).css('height', '1em');
 

	
 
		var postdata ={
 
			"name": $("#name").val(),
 
			"legacy_room": $("#legacy_room").val(),
 
			"legacy_server": $("#legacy_server").val()
 
			"legacy_server": $("#legacy_server").val(),
 
			"frontend_room": $("#frontend_room").val()
 
		};
 

	
 
		$.post($.cookie("base_location") + "api/v1/instances/join_room/" + $("#instance").val(), postdata, function(data) {
 
			window.location.replace("index.shtml");
 
		});
 
	})
 
	
 
	$.get($.cookie("base_location") + "api/v1/instances/join_room_form/" + query.id, function(data) {
 
		$("#name_desc").html(data.name_label + ":");
 
		$("#legacy_room_desc").html(data.legacy_room_label + ":");
 
		$("#legacy_server_desc").html(data.legacy_server_label + ":");
0 comments (0 inline, 0 general)