Start to hook this stuff up.

This commit is contained in:
JoelKatz
2012-11-19 15:33:49 -08:00
parent 54fe46feda
commit 08f271443d
5 changed files with 109 additions and 54 deletions

View File

@@ -957,22 +957,7 @@ Json::Value NetworkOPs::getServerInfo()
if (mConsensus)
info["consensus"] = mConsensus->getJson();
typedef std::pair<JobType, int> jt_int_pair;
bool anyJobs = false;
Json::Value jobs = Json::arrayValue;
std::vector< std::pair<JobType, int> > jobCounts = theApp->getJobQueue().getJobCounts();
BOOST_FOREACH(jt_int_pair& it, jobCounts)
{
if (it.second != 0)
{
Json::Value o = Json::objectValue;
o[Job::toString(it.first)] = it.second;
jobs.append(o);
anyJobs = true;
}
}
if (anyJobs)
info["jobs"] = jobs;
info["jobs"] = theApp->getJobQueue().getJson();
return info;
}