Browse Source

qt: i2cp server page is now shown, work towards #914

pull/1606/head
user 4 years ago
parent
commit
a0d90717c3
  1. 2
      daemon/HTTPServer.cpp
  2. 1
      daemon/HTTPServer.h
  3. 9
      qt/i2pd_qt/mainwindow.cpp

2
daemon/HTTPServer.cpp

@ -532,7 +532,7 @@ namespace http { @@ -532,7 +532,7 @@ namespace http {
}
}
static void ShowI2CPLocalDestination (std::stringstream& s, const std::string& id)
void ShowI2CPLocalDestination (std::stringstream& s, const std::string& id)
{
auto i2cpServer = i2p::client::context.GetI2CPServer ();
if (i2cpServer)

1
daemon/HTTPServer.h

@ -99,6 +99,7 @@ namespace http @@ -99,6 +99,7 @@ namespace http
void ShowI2PTunnels (std::stringstream& s);
void ShowLocalDestination (std::stringstream& s, const std::string& b32, uint32_t token);
void ShowSAMSession (std::stringstream& s, const std::string& id);
void ShowI2CPLocalDestination (std::stringstream& s, const std::string& id);
} // http
} // i2p

9
qt/i2pd_qt/mainwindow.cpp

@ -1002,11 +1002,10 @@ void MainWindow::anchorClickedHandler(const QUrl & link) { @@ -1002,11 +1002,10 @@ void MainWindow::anchorClickedHandler(const QUrl & link) {
const std::string page = params["page"];
const std::string cmd = params["cmd"];
if (page == "sam_session") {
const std::string samID = params["sam_id"];
pageWithBackButton->show();
textBrowser->hide();
std::stringstream s;
i2p::http::ShowSAMSession (s, samID);
i2p::http::ShowSAMSession (s, params["sam_id"]);
childTextBrowser->setHtml(QString::fromStdString(s.str()));
} else if (page == "local_destination") {
std::string b32 = params["b32"];
@ -1017,6 +1016,12 @@ void MainWindow::anchorClickedHandler(const QUrl & link) { @@ -1017,6 +1016,12 @@ void MainWindow::anchorClickedHandler(const QUrl & link) {
std::string strstd = currentLocalDestinationB32;
i2p::http::ShowLocalDestination(s,strstd,0);
childTextBrowser->setHtml(QString::fromStdString(s.str()));
} else if (page == "i2cp_local_destination") {
pageWithBackButton->show();
textBrowser->hide();
std::stringstream s;
i2p::http::ShowI2CPLocalDestination (s, params["i2cp_id"]);
childTextBrowser->setHtml(QString::fromStdString(s.str()));
} else if(cmd == "closestream") {
std::string b32 = params["b32"];
uint32_t streamID = std::stoul(params["streamID"], nullptr);

Loading…
Cancel
Save