mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-25 13:17:38 +01:00
show family name in webiface
This commit is contained in:
parent
85840872ab
commit
26de037e94
3 changed files with 14 additions and 0 deletions
|
@ -405,6 +405,7 @@ namespace util
|
|||
|
||||
void HTTPConnection::FillContent (std::stringstream& s)
|
||||
{
|
||||
s << "<b>Family:</b> " << i2p::context.GetFamilyString() << "<br>\r\n";
|
||||
s << "<b>Uptime:</b> " << boost::posix_time::to_simple_string (
|
||||
boost::posix_time::time_duration (boost::posix_time::seconds (
|
||||
i2p::context.GetUptime ()))) << "<br>\r\n";
|
||||
|
|
|
@ -149,18 +149,29 @@ namespace i2p
|
|||
UpdateRouterInfo ();
|
||||
}
|
||||
|
||||
std::string RouterContext::GetFamilyString () const
|
||||
{
|
||||
return m_FamilyString;
|
||||
}
|
||||
|
||||
void RouterContext::SetFamily (const std::string& family)
|
||||
{
|
||||
|
||||
std::string signature;
|
||||
if (family.length () > 0)
|
||||
{
|
||||
m_FamilyString = family;
|
||||
signature = i2p::data::CreateFamilySignature (family, GetIdentHash ());
|
||||
}
|
||||
if (signature.length () > 0)
|
||||
{
|
||||
m_FamilyString = "<none>";
|
||||
m_RouterInfo.SetProperty (i2p::data::ROUTER_INFO_PROPERTY_FAMILY, family);
|
||||
m_RouterInfo.SetProperty (i2p::data::ROUTER_INFO_PROPERTY_FAMILY_SIG, signature);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_FamilyString = "<???>";
|
||||
m_RouterInfo.DeleteProperty (i2p::data::ROUTER_INFO_PROPERTY_FAMILY);
|
||||
m_RouterInfo.DeleteProperty (i2p::data::ROUTER_INFO_PROPERTY_FAMILY_SIG);
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace i2p
|
|||
bool IsFloodfill () const { return m_IsFloodfill; };
|
||||
void SetFloodfill (bool floodfill);
|
||||
void SetFamily (const std::string& family);
|
||||
std::string GetFamilyString () const { return m_FamilyString; };
|
||||
void SetBandwidth (int limit); /* in kilobytes */
|
||||
void SetBandwidth (char L); /* by letter */
|
||||
bool AcceptsTunnels () const { return m_AcceptsTunnels; };
|
||||
|
@ -100,6 +101,7 @@ namespace i2p
|
|||
i2p::data::PrivateKeys m_Keys;
|
||||
uint64_t m_LastUpdateTime;
|
||||
bool m_AcceptsTunnels, m_IsFloodfill;
|
||||
std::string m_FamilyString;
|
||||
uint64_t m_StartupTime; // in seconds since epoch
|
||||
uint32_t m_BandwidthLimit; // allowed bandwidth
|
||||
RouterStatus m_Status;
|
||||
|
|
Loading…
Add table
Reference in a new issue