Added current algo to clientStatus
Added client config editor to dashboard Little beautifying of dashboard
This commit is contained in:
parent
437b81f098
commit
7cc38f768f
5 changed files with 107 additions and 24 deletions
|
@ -62,6 +62,11 @@ CCClient::CCClient(const Options *options)
|
|||
}
|
||||
|
||||
m_clientStatus.setClientId(clientId);
|
||||
|
||||
if (m_options->algoName() != nullptr) {
|
||||
m_clientStatus.setCurrentAlgoName(m_options->algoName());
|
||||
}
|
||||
|
||||
m_serverURL = std::string("http://") + options->ccUrl();
|
||||
|
||||
if (m_options->ccToken() != nullptr) {
|
||||
|
|
|
@ -43,7 +43,7 @@ ClientStatus::ClientStatus()
|
|||
|
||||
}
|
||||
|
||||
const std::string ClientStatus::getClientId() const
|
||||
std::string ClientStatus::getClientId() const
|
||||
{
|
||||
return m_clientId;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ void ClientStatus::setClientId(const std::string& clientId)
|
|||
m_clientId = clientId;
|
||||
}
|
||||
|
||||
const std::string ClientStatus::getCurrentPool() const
|
||||
std::string ClientStatus::getCurrentPool() const
|
||||
{
|
||||
return m_currentPool;
|
||||
}
|
||||
|
@ -63,6 +63,16 @@ void ClientStatus::setCurrentPool(const std::string& currentPool)
|
|||
m_currentPool = currentPool;
|
||||
}
|
||||
|
||||
void ClientStatus::setCurrentAlgoName(const std::string& algoName)
|
||||
{
|
||||
m_currentAlgoName = algoName;
|
||||
}
|
||||
|
||||
std::string ClientStatus::getCurrentAlgoName() const
|
||||
{
|
||||
return m_currentAlgoName;
|
||||
}
|
||||
|
||||
ClientStatus::Status ClientStatus::getCurrentStatus() const
|
||||
{
|
||||
return m_currentStatus;
|
||||
|
@ -178,6 +188,10 @@ bool ClientStatus::parseFromJson(const rapidjson::Document& document)
|
|||
m_currentStatus = toStatus(clientStatus["current_status"].GetString());
|
||||
}
|
||||
|
||||
if (clientStatus.HasMember("current_algo_name")) {
|
||||
m_currentAlgoName = clientStatus["current_algo_name"].GetString();
|
||||
}
|
||||
|
||||
if (clientStatus.HasMember("hashrate_short")) {
|
||||
m_hashrateShort = clientStatus["hashrate_short"].GetDouble();
|
||||
}
|
||||
|
@ -228,6 +242,7 @@ rapidjson::Value ClientStatus::toJson(rapidjson::MemoryPoolAllocator<rapidjson::
|
|||
clientStatus.AddMember("client_id", rapidjson::StringRef(m_clientId.c_str()), allocator);
|
||||
clientStatus.AddMember("current_pool", rapidjson::StringRef(m_currentPool.c_str()), allocator);
|
||||
clientStatus.AddMember("current_status", rapidjson::StringRef(toString(m_currentStatus)), allocator);
|
||||
clientStatus.AddMember("current_algo_name", rapidjson::StringRef(m_currentAlgoName.c_str()), allocator);
|
||||
|
||||
clientStatus.AddMember("hashrate_short", m_hashrateShort, allocator);
|
||||
clientStatus.AddMember("hashrate_medium", m_hashrateMedium, allocator);
|
||||
|
@ -262,4 +277,3 @@ std::string ClientStatus::toJsonString()
|
|||
return strdup(buffer.GetString());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -58,12 +58,15 @@ public:
|
|||
return Status::RUNNING;
|
||||
}
|
||||
|
||||
const std::string getClientId() const;
|
||||
std::string getClientId() const;
|
||||
void setClientId(const std::string& clientId);
|
||||
|
||||
const std::string getCurrentPool() const;
|
||||
std::string getCurrentPool() const;
|
||||
void setCurrentPool(const std::string& currentPool);
|
||||
|
||||
std::string getCurrentAlgoName() const;
|
||||
void setCurrentAlgoName(const std::string &algoName);
|
||||
|
||||
Status getCurrentStatus() const;
|
||||
void setCurrentStatus(Status currentStatus);
|
||||
|
||||
|
@ -109,6 +112,7 @@ private:
|
|||
|
||||
std::string m_clientId;
|
||||
std::string m_currentPool;
|
||||
std::string m_currentAlgoName;
|
||||
|
||||
double m_hashrateShort;
|
||||
double m_hashrateMedium;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue