From d1c036f74c4a6ee5479741133f19faab00447fa5 Mon Sep 17 00:00:00 2001 From: aglkm <39521015+aglkm@users.noreply.github.com> Date: Wed, 21 Jan 2026 02:05:12 +0300 Subject: [PATCH] added coingecko attribute to all pages --- src/main.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main.rs b/src/main.rs index e76cc43..1e806b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,6 +41,7 @@ fn index(dashboard: &State>>) -> Template { fn block_list() -> Template { Template::render("block_list", context! { route: "block_list", + cg_api: CONFIG.coingecko_api.clone(), }) } @@ -62,6 +63,7 @@ async fn block_list_by_height(input_height: &str) -> Template { if index >= height { Template::render("block_list", context! { route: "block_list", + cg_api: CONFIG.coingecko_api.clone(), }) } else { Template::render("block_list", context! { @@ -69,11 +71,13 @@ async fn block_list_by_height(input_height: &str) -> Template { index, blocks, height, + cg_api: CONFIG.coingecko_api.clone(), }) } } else { Template::render("block_list", context! { route: "block_list", + cg_api: CONFIG.coingecko_api.clone(), }) } } @@ -91,12 +95,14 @@ async fn block_details_by_height(height: &str) -> Template { return Template::render("block_details", context! { route: "block_details", block, + cg_api: CONFIG.coingecko_api.clone(), }); } } Template::render("error", context! { route: "error", + cg_api: CONFIG.coingecko_api.clone(), }) } @@ -116,6 +122,7 @@ async fn block_header_by_hash(hash: &str) -> Either { return Either::Left(Template::render("error", context! { route: "error", + cg_api: CONFIG.coingecko_api.clone(), })) } @@ -131,11 +138,13 @@ async fn kernel(excess: &str) -> Template { return Template::render("kernel", context! { route: "kernel", kernel, + cg_api: CONFIG.coingecko_api.clone(), }) } Template::render("error", context! { route: "error", + cg_api: CONFIG.coingecko_api.clone(), }) } @@ -151,11 +160,13 @@ async fn output(commit: &str) -> Template { return Template::render("output", context! { route: "output", output, + cg_api: CONFIG.coingecko_api.clone(), }) } Template::render("error", context! { route: "error", + cg_api: CONFIG.coingecko_api.clone(), }) } @@ -170,6 +181,7 @@ pub async fn search(query: Option<&str>) -> Either { Some(value) => value, None => return Either::Left(Template::render("search", context! { route: "search", + cg_api: CONFIG.coingecko_api.clone(), })), }; @@ -217,6 +229,7 @@ pub async fn search(query: Option<&str>) -> Either { Either::Left(Template::render("error", context! { route: "error", + cg_api: CONFIG.coingecko_api.clone(), })) } @@ -327,6 +340,7 @@ fn stats(statistics: &State>>) -> Template { y_kernels, output_size: OUTPUT_SIZE, kernel_size: KERNEL_SIZE, + cg_api: CONFIG.coingecko_api.clone(), }) } @@ -369,6 +383,7 @@ fn donate() -> Template { Template::render("donate", context! { route: "donate", public_api: CONFIG.public_api.clone(), + cg_api: CONFIG.coingecko_api.clone(), }) } @@ -378,6 +393,7 @@ fn api_overview() -> Template { Template::render("api_overview", context! { route: "api_overview", public_api: CONFIG.public_api.clone(), + cg_api: CONFIG.coingecko_api.clone(), }) }