added coingecko attribute to all pages

This commit is contained in:
aglkm
2026-01-21 02:05:12 +03:00
parent fb97449c2a
commit d1c036f74c
+16
View File
@@ -41,6 +41,7 @@ fn index(dashboard: &State<Arc<Mutex<Dashboard>>>) -> 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<Template, Redirect> {
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<Template, Redirect> {
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<Template, Redirect> {
Either::Left(Template::render("error", context! {
route: "error",
cg_api: CONFIG.coingecko_api.clone(),
}))
}
@@ -327,6 +340,7 @@ fn stats(statistics: &State<Arc<Mutex<Statistics>>>) -> 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(),
})
}