From c9204be4debd215a91e6a80632d5c66c563b003c Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Fri, 20 Jan 2017 01:43:09 +0000 Subject: [PATCH] /mempool page added --- main.cpp | 2 +- src/page.h | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index f626e1a..4b7a21f 100644 --- a/main.cpp +++ b/main.cpp @@ -306,7 +306,7 @@ int main(int ac, const char* av[]) { CROW_ROUTE(app, "/mempool") ([&](const crow::request& req) { - return xmrblocks.mempool(); + return xmrblocks.mempool(true); }); CROW_ROUTE(app, "/robots.txt") diff --git a/src/page.h b/src/page.h index 8f1050d..af1caa2 100644 --- a/src/page.h +++ b/src/page.h @@ -651,7 +651,7 @@ public: * Render mempool data */ string - mempool() + mempool(bool add_header_and_footer = false) { std::vector mempool_txs; @@ -774,9 +774,22 @@ public: return t1 > t2; }); - // read index.html + + // read mempool.html string mempool_html = xmreg::read(TMPL_MEMPOOL); + if (add_header_and_footer) + { + add_css_style(context); + + // add header and footer + string full_page = get_full_page(mempool_html); + + // render the page + return mstch::render(full_page, context); + } + + // render the page return mstch::render(mempool_html, context); }