From 1449e3a1869a7bfc3be7135a13751771bc7cdf1d Mon Sep 17 00:00:00 2001 From: dr|z3d Date: Mon, 16 Aug 2021 03:40:28 +0000 Subject: [PATCH] Console: place sensitive router info in collapsible section --- daemon/HTTPServer.cpp | 9 ++++++++- webconsole/style.css | 12 +++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp index 419140dc..6bc1bf1e 100644 --- a/daemon/HTTPServer.cpp +++ b/daemon/HTTPServer.cpp @@ -1099,7 +1099,13 @@ namespace http { static void ShowCommands (std::stringstream& s, uint32_t token) { s << "" << tr("Router Configuration") << ""; - s << "" << tr("Version") << "" VERSION "\r\n"; + + s << "\r\n"; + s << "
\r\n\r\n" + << "\r\n"; + s << "
\r\n\r\n"; + + s << "\r\n"; s << "\r\n"; @@ -1143,6 +1149,7 @@ namespace http { s << "\r\n\r\n"; } s << "\r\n"; + s << "
" << tr("Router Identity") << "
" << tr("Router Caps") << "" << i2p::context.GetRouterInfo().GetProperty("caps") << "
" << tr("Data path") << "" << i2p::fs::GetUTF8DataDir() << "
\r\n
\r\n
\r\n\r\n"; std::string webroot; i2p::config::GetOption("http.webroot", webroot); diff --git a/webconsole/style.css b/webconsole/style.css index 5247f132..74de8297 100644 --- a/webconsole/style.css +++ b/webconsole/style.css @@ -420,24 +420,26 @@ tr { 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)); } -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)); } 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 { - 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) { - background: var(--tr) !important; + background: var(--tr); } th, td, .listitem {