Console: place sensitive router info in collapsible section

This commit is contained in:
dr|z3d 2021-08-16 03:40:28 +00:00
parent 1022a43407
commit 1449e3a186
2 changed files with 15 additions and 6 deletions

View file

@ -1099,7 +1099,13 @@ namespace http {
static void ShowCommands (std::stringstream& s, uint32_t token) static void ShowCommands (std::stringstream& s, uint32_t token)
{ {
s << "<tr><th class=\"sectiontitle configuration\" colspan=\"2\"><span>" << tr("Router Configuration") << "</span></th></tr>"; s << "<tr><th class=\"sectiontitle configuration\" colspan=\"2\"><span>" << tr("Router Configuration") << "</span></th></tr>";
s << "<tr id=\"version\"><td>" << tr("Version") << "</td><td>" VERSION "</td></tr>\r\n";
s << "<tr><td class=\"center nopadding\" colspan=\"2\">\r\n";
s << "<div class=\"slide\">\r\n<input hidden type=\"checkbox\" class=\"toggle\" id=\"slide_routerinfo\" />\r\n"
<< "<label for=\"slide_routerinfo\">i2pd " VERSION "</label>\r\n";
s << "<div class=\"slidecontent\">\r\n<table id=\"routerinfos\">\r\n";
s << "<tr><td>" << tr("Router Identity") << "</td><td class=\"nopadding\"><span id=\"rid\" class=\"sensitive\" hidden>" s << "<tr><td>" << tr("Router Identity") << "</td><td class=\"nopadding\"><span id=\"rid\" class=\"sensitive\" hidden>"
<< i2p::context.GetRouterInfo().GetIdentHashBase64() << "</span></td></tr>\r\n"; << i2p::context.GetRouterInfo().GetIdentHashBase64() << "</span></td></tr>\r\n";
s << "<tr><td>" << tr("Router Caps") << "</td><td>" << i2p::context.GetRouterInfo().GetProperty("caps") << "</td></tr>\r\n"; s << "<tr><td>" << tr("Router Caps") << "</td><td>" << i2p::context.GetRouterInfo().GetProperty("caps") << "</td></tr>\r\n";
@ -1143,6 +1149,7 @@ namespace http {
s << "<td><span class=\"sensitive\" hidden>" << address->host.to_string() << ":" << address->port << "</span></td>\r\n</tr>\r\n"; s << "<td><span class=\"sensitive\" hidden>" << address->host.to_string() << ":" << address->port << "</span></td>\r\n</tr>\r\n";
} }
s << "<tr><td>" << tr("Data path") << "</td><td><span class=\"sensitive\">" << i2p::fs::GetUTF8DataDir() << "</span></td></tr>\r\n"; s << "<tr><td>" << tr("Data path") << "</td><td><span class=\"sensitive\">" << i2p::fs::GetUTF8DataDir() << "</span></td></tr>\r\n";
s << "</table>\r\n</div>\r\n</div>\r\n</td></tr>\r\n";
std::string webroot; i2p::config::GetOption("http.webroot", webroot); std::string webroot; i2p::config::GetOption("http.webroot", webroot);

View file

@ -420,24 +420,26 @@ tr {
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
} }
tr#version, tr#version ~ tr:nth-child(odd), tr.chrome, .listitem:nth-child(odd), tr:not(.chrome):nth-child(odd) { tr#version, tr#version ~ tr:nth-child(odd), tr.chrome, .listitem:nth-child(odd),
tr:not(.chrome):nth-child(odd), #routerinfos tr:nth-child(odd) {
background: linear-gradient(to bottom, rgba(16,0,16,.5), rgba(8,0,8,.5)); background: linear-gradient(to bottom, rgba(16,0,16,.5), rgba(8,0,8,.5));
} }
tr#version ~ tr:nth-child(even), .listitem:nth-child(even), tr:not(.chrome):nth-child(even) { tr#version ~ tr:nth-child(even), .listitem:nth-child(even),
tr:not(.chrome):nth-child(even), #routerinfos tr:nth-child(even) {
background: linear-gradient(to bottom, rgba(32,0,32,.5), rgba(24,0,24,.5)); background: linear-gradient(to bottom, rgba(32,0,32,.5), rgba(24,0,24,.5));
} }
tr tr, /*tr#version, tr#version ~ tr:nth-child(odd),*/ .tableitem tr:nth-child(odd) { tr tr, /*tr#version, tr#version ~ tr:nth-child(odd),*/ .tableitem tr:nth-child(odd) {
background: var(--tr-inner) !important; background: var(--tr-inner);
} }
tr.chrome { tr.chrome {
background: linear-gradient(to bottom, rgba(16,0,16,.5), rgba(8,0,8,.5)) !important; background: linear-gradient(to bottom, rgba(16,0,16,.5), rgba(8,0,8,.5));
} }
.tableitem tr:nth-child(even) { .tableitem tr:nth-child(even) {
background: var(--tr) !important; background: var(--tr);
} }
th, td, .listitem { th, td, .listitem {