Fit metrics screen into an 80-column terminal without wrapping
This commit is contained in:
parent
4ace963c80
commit
d934e68967
|
@ -107,8 +107,8 @@ void ThreadShowMetricsScreen()
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
// Thank you text
|
// Thank you text
|
||||||
std::cout << OFFSET << "Thank you for running a Zcash node!" << std::endl;
|
std::cout << "Thank you for running a Zcash node!" << std::endl;
|
||||||
std::cout << OFFSET << "By running this node, you're contributing to the social good :)" << std::endl;
|
std::cout << "By running this node, you're contributing to the social good :)" << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
// Miner status
|
// Miner status
|
||||||
|
@ -122,10 +122,10 @@ void ThreadShowMetricsScreen()
|
||||||
else
|
else
|
||||||
nThreads = boost::thread::hardware_concurrency();
|
nThreads = boost::thread::hardware_concurrency();
|
||||||
}
|
}
|
||||||
std::cout << OFFSET << "You are running " << nThreads << " mining threads." << std::endl;
|
std::cout << "You are running " << nThreads << " mining threads." << std::endl;
|
||||||
} else {
|
} else {
|
||||||
std::cout << OFFSET << "You are currently not mining." << std::endl;
|
std::cout << "You are currently not mining." << std::endl;
|
||||||
std::cout << OFFSET << "To enable mining, add 'gen=1' to your zcash.conf and restart." << std::endl;
|
std::cout << "To enable mining, add 'gen=1' to your zcash.conf and restart." << std::endl;
|
||||||
}
|
}
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ void ThreadShowMetricsScreen()
|
||||||
int seconds = uptime - (((((days * 24) + hours) * 60) + minutes) * 60);
|
int seconds = uptime - (((((days * 24) + hours) * 60) + minutes) * 60);
|
||||||
|
|
||||||
// Display uptime
|
// Display uptime
|
||||||
std::cout << OFFSET << "Since starting this node ";
|
std::cout << "Since starting this node ";
|
||||||
if (days > 0) {
|
if (days > 0) {
|
||||||
std::cout << days << " days, ";
|
std::cout << days << " days, ";
|
||||||
}
|
}
|
||||||
|
@ -159,15 +159,15 @@ void ThreadShowMetricsScreen()
|
||||||
}
|
}
|
||||||
std::cout << seconds << " seconds ago:" << std::endl;
|
std::cout << seconds << " seconds ago:" << std::endl;
|
||||||
|
|
||||||
std::cout << OFFSET << "- You have validated " << transactionsValidated.get() << " transactions." << std::endl;
|
std::cout << "- You have validated " << transactionsValidated.get() << " transactions." << std::endl;
|
||||||
|
|
||||||
if (mining) {
|
if (mining) {
|
||||||
std::cout << OFFSET << "- You have completed " << ehSolverRuns.get() << " Equihash solver runs." << std::endl;
|
std::cout << "- You have completed " << ehSolverRuns.get() << " Equihash solver runs." << std::endl;
|
||||||
lines++;
|
lines++;
|
||||||
|
|
||||||
int mined = minedBlocks.get();
|
int mined = minedBlocks.get();
|
||||||
if (mined > 0) {
|
if (mined > 0) {
|
||||||
std::cout << OFFSET << "- You have mined " << mined << " blocks!" << std::endl;
|
std::cout << "- You have mined " << mined << " blocks!" << std::endl;
|
||||||
lines++;
|
lines++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,35 +35,27 @@ void ThreadShowMetricsScreen();
|
||||||
* License: CC BY-SA 3.0
|
* License: CC BY-SA 3.0
|
||||||
*
|
*
|
||||||
* Rendering options:
|
* Rendering options:
|
||||||
* Zcash: img2txt -W 50 -H 26 -f utf8 -d none -g 0.7 Z-yellow.orange-logo.png
|
* Zcash: img2txt -W 40 -H 20 -f utf8 -d none -g 0.7 Z-yellow.orange-logo.png
|
||||||
* Heart: img2txt -W 50 -H 26 -f utf8 -d none 2000px-Heart_corazón.svg.png
|
* Heart: img2txt -W 40 -H 20 -f utf8 -d none 2000px-Heart_corazón.svg.png
|
||||||
*/
|
*/
|
||||||
const std::string METRICS_ART =
|
const std::string METRICS_ART =
|
||||||
" [0;34;40m [0m \n"
|
" [0;34;40m [0m \n"
|
||||||
" [0;34;40m [0m \n"
|
" [0;34;40m [0m \n"
|
||||||
" [0;34;40m [0;31;40m.;tt;. [0;34;40m [0m [0;1;31;91;41m.;t:[0m [0;1;31;91;41m:t;.[0m \n"
|
" [0;34;40m [0;31;40m:8[0;33;5;40;100m8[0;1;30;90;43mSX@888@@X[0;31;5;40;100m8[0;31;40m:[0;34;40m [0m [0;31;5;41;101m8; %[0;1;31;91;41mX[0m [0;1;31;91;41mX[0;31;5;41;101m% ;8[0m \n"
|
||||||
" [0;34;40m [0;31;40m:[0;30;41m8[0;1;30;90;43mSX8[0;1;33;93;43mS[0;33;5;43;103m;;;:::t[0;1;33;93;43m%[0;1;30;90;43m8@[0;31;5;40;100mS[0;31;40m;[0;34;40m [0m [0;1;31;91;41m.[0;31;5;41;101mX ;[0;1;31;91;41mS[0m [0;1;31;91;41mS[0;31;5;41;101m; X[0;1;31;91;41m.[0m \n"
|
" [0;34;40m [0;31;40m%[0;1;30;90;43m%X[0;1;33;93;43mt[0;33;5;43;103m%tt%[0;1;30;90;43mSSSS[0;33;5;43;103mS:[0;37;5;43;103mXXX[0;1;33;93;43mt[0;1;30;90;43m@[0;31;40m@[0;34;40m [0m [0;1;31;91;41mX[0;31;5;41;101m :[0;1;31;91;41m:[0m [0;1;31;91;41m:[0;31;5;41;101m: [0;1;31;91;41mX[0m \n"
|
||||||
" [0;34;40m [0;31;40mt[0;1;30;90;43m%X[0;1;33;93;43mt[0;33;5;43;103m%%ttt[0;1;30;90;43m@XXXX@[0;33;5;43;103m::[0;37;5;43;103mXXXX[0;1;33;93;43m%[0;1;30;90;43mX[0;31;40mS[0;34;40m [0m [0;1;31;91;41mt[0;31;5;41;101m. X[0m [0;31;5;41;101mX .[0;1;31;91;41mt[0m \n"
|
" [0;34;40m [0;31;40m@[0;1;30;90;43mS[0;1;33;93;43m;;tt%%[0;33;5;43;103m%[0;1;33;93;43mt[0;34;40m [0;1;33;93;43m;[0;33;5;43;103m;::[0;37;5;43;103mXXXX[0;37;43mS[0;31;5;40;100mX[0;34;40m [0m [0;31;5;41;101m% SS %[0m \n"
|
||||||
" [0;34;40m [0;31;40m8[0;1;30;90;43mS[0;1;33;93;43m;tttt%[0;33;5;43;103m%tt[0;1;30;90;41m8[0;34;40m [0;31;40m@[0;33;5;43;103m:;::[0;37;5;43;103mXXXXX[0;37;43mS[0;33;5;40;100m8[0;31;40m [0;34;40m [0m [0;31;5;41;101mX [0;1;31;91;41mtt[0;31;5;41;101m X[0m \n"
|
" [0;34;40m [0;31;40m.[0;1;30;90;43mt[0;1;33;93;43m:::;;[0;1;30;90;43m%[0;31;40m8888[0;34;40m [0;31;40m8[0;30;41m8888[0;1;33;93;43mt[0;37;5;43;103mXXXX[0;1;30;90;43m8[0;31;40m;[0;34;40m [0m [0;1;31;91;41mS[0;31;5;41;101m [0;1;31;91;41mS[0m \n"
|
||||||
" [0;34;40m [0;31;40m%[0;1;30;90;43mS[0;1;33;93;43m:;;;;:[0;1;30;90;43mXXX@@[0;31;40m8[0;34;40m [0;31;40mS[0;1;33;93;43m;[0;1;30;90;43m8[0;1;33;93;43m;;tt[0;33;5;43;103m;[0;37;5;43;103mXXXX[0;1;33;93;43m%[0;31;40m8[0;34;40m [0m [0;1;31;91;41m8[0;31;5;41;101m [0;1;31;91;41m8[0m \n"
|
" [0;34;40m [0;31;40m.[0;1;30;90;43m%[0;1;33;93;43m...:::[0;31;40m8[0;34;40m [0;1;30;90;43m8[0;33;5;43;103m::[0;37;5;43;103mXXX[0;1;33;93;43m%[0;31;40m;[0;34;40m [0m [0;31;5;41;101mX X[0m \n"
|
||||||
" [0;34;40m [0;30;41m8[0;1;30;90;43mS[0;1;33;93;43m.:::;;[0;1;30;90;43m%[0;34;40m [0;1;33;93;43mS[0;33;5;43;103m:[0;37;5;43;103mXXXXX[0;1;30;90;43mX[0;32;40m [0;34;40m [0m [0;31;5;41;101m [0m \n"
|
" [0;34;40m [0;31;43m8[0;1;31;91;43m888[0;1;33;93;43m...:[0;1;30;90;43mt[0;1;30;90;41m888888[0;31;40mX[0;34;40m [0;33;5;40;100m8[0;33;5;43;103mt;;::[0;37;5;43;103mXX[0;1;30;90;43m8[0;31;40m [0;34;40m [0m [0;31;5;41;101m8 8[0m \n"
|
||||||
" [0;34;40m [0;1;30;90;41m8[0;1;31;91;43m8[0;1;33;93;43m....:::[0;1;30;90;43m%[0;34;40m [0;1;33;93;43m%[0;33;5;43;103m;::[0;37;5;43;103mXXXX[0;1;30;90;43m@[0;34;40m [0m [0;31;5;41;101m [0m \n"
|
"[0;34;40m [0;31;40m%[0;1;31;91;43m888888[0;1;33;93;43m...:::;:[0;1;30;90;41m8[0;31;40m [0;34;40m [0;31;40m:[0;1;30;90;43mX[0;33;5;43;103mttt;;;::[0;37;5;43;103mX[0;31;5;40;100m@[0;34;40m [0m [0;31;5;41;101m [0m \n"
|
||||||
" [0;34;40m [0;31;40mS[0;1;31;91;43m8888[0;1;33;93;43m....:[0;1;30;90;43m%[0;31;40m;;;;;;;;; [0;34;40m [0;32;40m [0;33;5;40;100m8[0;33;5;43;103mt;;;::[0;37;5;43;103mXXX[0;33;5;40;100m8[0;34;40m [0m [0;31;5;41;101m [0m \n"
|
"[0;34;40m [0;1;30;90;41m8[0;1;31;91;43m88888888[0;1;33;93;43m...:[0;1;30;90;43mS[0;31;40mt[0;34;40m [0;1;30;90;41m8[0;1;33;93;43m:%[0;33;5;43;103m%tttt;;;:[0;1;30;90;43mX[0;34;40m [0m [0;31;5;41;101mX X[0m \n"
|
||||||
" [0;34;40m [0;32;40m [0;31;43mS[0;1;31;91;43m888888[0;1;33;93;43m...:::;;;;t[0;1;30;90;43mX[0;31;40m8 [0;34;40m [0;31;40m;[0;1;30;90;43mX[0;33;5;43;103mtt;;;;;::[0;37;5;43;103mX[0;33;5;43;103mS[0;31;40m.[0;34;40m [0m [0;31;5;41;101m. .[0m \n"
|
"[0;34;40m [0;1;30;90;41m8[0;1;31;91;43m8888888888[0;1;30;90;43mS[0;1;30;90;41m8[0;31;40m [0;34;40m [0;31;40m:[0;1;30;90;43m%[0;1;33;93;43m;ttt%[0;33;5;43;103m%tttt;;[0;1;30;90;43mX[0;34;40m [0m [0;31;5;41;101m8 8[0m \n"
|
||||||
" [0;34;40m [0;31;40mt[0;1;31;91;43m888888888[0;1;33;93;43m....::::[0;33;41m8[0;31;40m [0;34;40m [0;31;40m@[0;1;33;93;43m:[0;33;5;43;103mttttt;;;;:::[0;31;5;40;100mX[0;34;40m [0m [0;1;31;91;41m%[0;31;5;41;101m [0;1;31;91;41m%[0m \n"
|
"[0;34;40m [0;31;40m%[0;1;31;91;43m888888888[0;1;30;90;43m%[0;31;40mt[0;34;40m [0;30;41m8[0;1;30;90;43mS[0;1;33;93;43m:;;;tt%%[0;33;5;43;103m%ttt;[0;1;30;90;41m8[0;34;40m [0m [0;31;5;41;101m: :[0m \n"
|
||||||
" [0;34;40m [0;31;40m8[0;1;31;91;43m88888888888[0;1;33;93;43m...:[0;1;30;90;43mS[0;31;40mS[0;34;40m [0;31;40m [0;1;30;90;43m%[0;1;33;93;43mt%[0;33;5;43;103m%%ttttt;;;;:[0;1;30;90;43mX[0;34;40m [0m [0;31;5;41;101m% %[0m \n"
|
" [0;34;40m [0;31;43m8t[0;1;31;91;43m888888[0;33;41m8[0;31;40m [0;34;40m [0;31;40mS[0;33;41m888[0;31;43m8888[0;1;30;90;43mS[0;1;33;93;43mtt%%[0;33;5;43;103m%t[0;1;30;90;43m@[0;31;40m [0;34;40m [0m [0;1;31;91;41m:[0;31;5;41;101m: :[0;1;31;91;41m:[0m \n"
|
||||||
" [0;34;40m [0;31;40m8[0;1;31;91;43m8888888888888[0;1;33;93;43m.[0;1;30;90;43mt[0;31;40m.[0;34;40m [0;31;40m;[0;1;30;90;43mS[0;1;33;93;43mtttt%[0;33;5;43;103m%%ttttt;;;[0;1;30;90;43mS[0;34;40m [0m [0;31;5;41;101m% %[0m \n"
|
" [0;34;40m [0;31;40m.[0;31;43m@tt[0;1;31;91;43m888[0;31;43m@[0;34;40m [0;1;30;90;41m8[0;1;33;93;43m;;ttt[0;1;30;90;43m@[0;31;40m;[0;34;40m [0m [0;31;5;41;101mt t[0m \n"
|
||||||
" [0;34;40m [0;31;40mt[0;1;31;91;43m888888888888[0;1;30;90;43mS[0;1;30;90;41m8[0;34;40m [0;31;40m8[0;1;30;90;43mX[0;1;33;93;43m;;;tttt%[0;33;5;43;103m%%tttt;;[0;31;5;40;100m@[0;34;40m [0m [0;1;31;91;41m@[0;31;5;41;101m [0;1;31;91;41m@[0m \n"
|
" [0;34;40m [0;31;40m.[0;31;43m8ttt[0;1;31;91;43m8[0;31;43m@[0;31;40mSSSSS[0;34;40m [0;31;40mSXXXX[0;1;30;90;43m%[0;1;33;93;43m:;;;[0;1;30;90;43mX[0;31;40m;[0;34;40m [0m [0;31;5;41;101m8 8[0m \n"
|
||||||
" [0;34;40m [0;31;40m [0;31;43m@[0;1;31;91;43m8888888888[0;1;30;90;43m%[0;31;40m%[0;34;40m [0;31;40m%[0;1;30;90;43m%[0;1;33;93;43m::::;;;tttt%[0;33;5;43;103m%%ttt[0;1;33;93;43mt[0;31;40m.[0;34;40m [0m [0;31;5;41;101mS S[0m \n"
|
" [0;34;40m [0;31;40mX[0;31;43m8ttt[0;1;31;91;43m8888[0;1;30;90;43m%[0;34;40m [0;1;30;90;43m%[0;1;31;91;43m88[0;1;33;93;43m...::[0;1;30;90;43mX[0;30;41m8[0;31;40m [0;34;40m [0m [0;1;31;91;41mX[0;31;5;41;101m. .[0;1;31;91;41mX[0m \n"
|
||||||
" [0;34;40m [0;31;40mS[0;31;43mtt[0;1;31;91;43m8888888[0;31;43m8[0;31;40m.[0;34;40m [0;31;40m%SSSSSSSSS[0;1;30;90;43mS[0;1;33;93;43mtttt%[0;33;5;43;103m%%t[0;31;5;40;100mX[0;34;40m [0m [0;31;5;41;101mS S[0m \n"
|
" [0;34;40m [0;31;40m%[0;1;30;90;41m8[0;31;43m@tt[0;1;31;91;43m88[0;31;43m;[0;33;41m8888[0;1;30;90;43m%[0;1;31;91;43m8888[0;1;30;90;43m%[0;31;43m8[0;31;40mX[0;32;40m [0;34;40m [0m [0;1;31;91;41m:[0;31;5;41;101m; ;[0;1;31;91;41m:[0m \n"
|
||||||
" [0;34;40m [0;30;41m8[0;31;43mttt[0;1;31;91;43m8888[0;31;43mS[0;34;40m [0;1;30;90;43m%[0;1;33;93;43m;;tttt[0;33;5;43;103m%[0;1;30;90;43mS[0;31;40m [0;34;40m [0m [0;31;5;41;101m@ @[0m \n"
|
" [0;34;40m [0;31;40m:@[0;1;30;90;41m8[0;33;41m8[0;31;43m8@XXX@8[0;1;30;90;41m8[0;31;40m8:[0;34;40m [0m [0;31;5;41;101mtt[0m \n"
|
||||||
" [0;34;40m [0;31;40m8[0;31;43m%ttt[0;1;31;91;43m88[0;31;43mS[0;34;40m [0;1;30;90;43m%[0;1;33;93;43m;;;;tt[0;1;30;90;43m%[0;31;40m [0;34;40m [0m [0;1;31;91;41m8[0;31;5;41;101m [0;1;31;91;41m8[0m \n"
|
" [0;34;40m [0m \n"
|
||||||
" [0;34;40m [0;31;40m%[0;31;43m8ttttt@@@XXX[0;31;40m@[0;34;40m [0;31;40m%[0;1;30;90;43m%%%%%%S[0;1;33;93;43m::;;[0;1;30;90;43mX[0;31;40m8[0;34;40m [0m [0;1;31;91;41m%[0;31;5;41;101m. .[0;1;31;91;41m%[0m \n"
|
" [0;34;40m [0m ";
|
||||||
" [0;34;40m [0;31;40m8[0;31;43m8tttt[0;1;31;91;43m88888[0;31;40m8[0;34;40m [0;31;40mX[0;1;31;91;43m8888[0;1;33;93;43m....:[0;1;30;90;43mS[0;1;30;90;41m8[0;31;40m [0;34;40m [0m [0;1;31;91;41m.[0;31;5;41;101m; ;[0;1;31;91;41m.[0m \n"
|
|
||||||
" [0;34;40m [0;31;40mt[0;1;30;90;41m8[0;31;43m@ttt[0;1;31;91;43m888[0;31;43m@[0;33;41m88[0;31;43m88@[0;1;31;91;43m888888[0;1;30;90;43mS[0;31;43m8[0;31;40mS[0;34;40m [0m [0;31;5;41;101mt t[0m \n"
|
|
||||||
" [0;34;40m [0;31;40m:8[0;33;41m8[0;31;43m8St[0;1;31;91;43m8888888[0;1;30;90;43m%[0;31;43mS8[0;30;41m8[0;31;40m;[0;34;40m [0m [0;31;5;41;101mS S[0m \n"
|
|
||||||
" [0;34;40m [0;31;40m .;tt;: [0;34;40m [0m \n"
|
|
||||||
" [0;34;40m [0m \n"
|
|
||||||
" [0;34;40m [0m ";
|
|
||||||
|
|
||||||
const std::string OFFSET = " ";
|
|
||||||
|
|
Loading…
Reference in New Issue