Skip to content
Snippets Groups Projects
Commit 5452725f authored by Tony Butler's avatar Tony Butler
Browse files

Add Rig ID to connection status web+cli

parent 628ec8c1
No related branches found
No related tags found
No related merge requests found
...@@ -168,6 +168,7 @@ extern const char sHtmlHashrateBodyLow [] = ...@@ -168,6 +168,7 @@ extern const char sHtmlHashrateBodyLow [] =
extern const char sHtmlConnectionBodyHigh [] = extern const char sHtmlConnectionBodyHigh [] =
"<div class='data'>" "<div class='data'>"
"<table>" "<table>"
"<tr><th>Rig ID</th><td>%s</td></tr>"
"<tr><th>Pool address</th><td>%s</td></tr>" "<tr><th>Pool address</th><td>%s</td></tr>"
"<tr><th>Connected since</th><td>%s</td></tr>" "<tr><th>Connected since</th><td>%s</td></tr>"
"<tr><th>Pool ping time</th><td>%u ms</td></tr>" "<tr><th>Pool ping time</th><td>%u ms</td></tr>"
......
...@@ -945,6 +945,7 @@ void executor::connection_report(std::string& out) ...@@ -945,6 +945,7 @@ void executor::connection_report(std::string& out)
pool = pick_pool_by_id(last_usr_pool_id); pool = pick_pool_by_id(last_usr_pool_id);
out.append("CONNECTION REPORT\n"); out.append("CONNECTION REPORT\n");
out.append("Rig ID : ").append(pool != nullptr ? pool->get_rigid() : "").append(1, '\n');
out.append("Pool address : ").append(pool != nullptr ? pool->get_pool_addr() : "<not connected>").append(1, '\n'); out.append("Pool address : ").append(pool != nullptr ? pool->get_pool_addr() : "<not connected>").append(1, '\n');
if(pool != nullptr && pool->is_running() && pool->is_logged_in()) if(pool != nullptr && pool->is_running() && pool->is_logged_in())
out.append("Connected since : ").append(time_format(date, sizeof(date), tPoolConnTime)).append(1, '\n'); out.append("Connected since : ").append(time_format(date, sizeof(date), tPoolConnTime)).append(1, '\n');
...@@ -1145,6 +1146,7 @@ void executor::http_connection_report(std::string& out) ...@@ -1145,6 +1146,7 @@ void executor::http_connection_report(std::string& out)
} }
snprintf(buffer, sizeof(buffer), sHtmlConnectionBodyHigh, snprintf(buffer, sizeof(buffer), sHtmlConnectionBodyHigh,
pool != nullptr ? pool->get_rigid() : "",
pool != nullptr ? pool->get_pool_addr() : "not connected", pool != nullptr ? pool->get_pool_addr() : "not connected",
cdate, ping_time); cdate, ping_time);
out.append(buffer); out.append(buffer);
......
...@@ -58,6 +58,7 @@ public: ...@@ -58,6 +58,7 @@ public:
inline bool get_disconnects(size_t& att, size_t& time) { att = connect_attempts; time = disconnect_time != 0 ? get_timestamp() - disconnect_time + 1 : 0; return pool && usr_login[0]; } inline bool get_disconnects(size_t& att, size_t& time) { att = connect_attempts; time = disconnect_time != 0 ? get_timestamp() - disconnect_time + 1 : 0; return pool && usr_login[0]; }
inline const char* get_pool_addr() { return net_addr.c_str(); } inline const char* get_pool_addr() { return net_addr.c_str(); }
inline const char* get_tls_fp() { return tls_fp.c_str(); } inline const char* get_tls_fp() { return tls_fp.c_str(); }
inline const char* get_rigid() { return usr_rigid.c_str(); }
inline bool is_nicehash() { return nicehash; } inline bool is_nicehash() { return nicehash; }
bool get_pool_motd(std::string& strin); bool get_pool_motd(std::string& strin);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment