Skip to content

Commit 76b1357

Browse files
authored
Merge pull request #28 from MasterEric/develop
Fixed topic list to display all image topics, fixing Issue #18.
2 parents c2c29d2 + bd0ee3b commit 76b1357

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/web_video_server.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,23 @@ bool WebVideoServer::handle_list_streams(const async_web_server_cpp::HttpRequest
234234
}
235235
connection->write("</li>");
236236
}
237+
connection->write("</ul>");
238+
// Add the rest of the image topics that don't have camera_info.
239+
connection->write("<ul>");
240+
std::vector<std::string>::iterator image_topic_itr = image_topics.begin();
241+
for (; image_topic_itr != image_topics.end();) {
242+
connection->write("<li><a href=\"/stream_viewer?topic=");
243+
connection->write(*image_topic_itr);
244+
connection->write("\">");
245+
connection->write(*image_topic_itr);
246+
connection->write("</a> (");
247+
connection->write("<a href=\"/snapshot?topic=");
248+
connection->write(*image_topic_itr);
249+
connection->write("\">Snapshot</a>)");
250+
connection->write("</li>");
251+
252+
image_topic_itr = image_topics.erase(image_topic_itr);
253+
}
237254
connection->write("</ul></body></html>");
238255
return true;
239256
}

0 commit comments

Comments
 (0)