added coingecko attribute to all pages
This commit is contained in:
+16
@@ -41,6 +41,7 @@ fn index(dashboard: &State<Arc<Mutex<Dashboard>>>) -> Template {
|
|||||||
fn block_list() -> Template {
|
fn block_list() -> Template {
|
||||||
Template::render("block_list", context! {
|
Template::render("block_list", context! {
|
||||||
route: "block_list",
|
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 {
|
if index >= height {
|
||||||
Template::render("block_list", context! {
|
Template::render("block_list", context! {
|
||||||
route: "block_list",
|
route: "block_list",
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Template::render("block_list", context! {
|
Template::render("block_list", context! {
|
||||||
@@ -69,11 +71,13 @@ async fn block_list_by_height(input_height: &str) -> Template {
|
|||||||
index,
|
index,
|
||||||
blocks,
|
blocks,
|
||||||
height,
|
height,
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Template::render("block_list", context! {
|
Template::render("block_list", context! {
|
||||||
route: "block_list",
|
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! {
|
return Template::render("block_details", context! {
|
||||||
route: "block_details",
|
route: "block_details",
|
||||||
block,
|
block,
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Template::render("error", context! {
|
Template::render("error", context! {
|
||||||
route: "error",
|
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! {
|
return Either::Left(Template::render("error", context! {
|
||||||
route: "error",
|
route: "error",
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,11 +138,13 @@ async fn kernel(excess: &str) -> Template {
|
|||||||
return Template::render("kernel", context! {
|
return Template::render("kernel", context! {
|
||||||
route: "kernel",
|
route: "kernel",
|
||||||
kernel,
|
kernel,
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
Template::render("error", context! {
|
Template::render("error", context! {
|
||||||
route: "error",
|
route: "error",
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,11 +160,13 @@ async fn output(commit: &str) -> Template {
|
|||||||
return Template::render("output", context! {
|
return Template::render("output", context! {
|
||||||
route: "output",
|
route: "output",
|
||||||
output,
|
output,
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
Template::render("error", context! {
|
Template::render("error", context! {
|
||||||
route: "error",
|
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,
|
Some(value) => value,
|
||||||
None => return Either::Left(Template::render("search", context! {
|
None => return Either::Left(Template::render("search", context! {
|
||||||
route: "search",
|
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! {
|
Either::Left(Template::render("error", context! {
|
||||||
route: "error",
|
route: "error",
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,6 +340,7 @@ fn stats(statistics: &State<Arc<Mutex<Statistics>>>) -> Template {
|
|||||||
y_kernels,
|
y_kernels,
|
||||||
output_size: OUTPUT_SIZE,
|
output_size: OUTPUT_SIZE,
|
||||||
kernel_size: KERNEL_SIZE,
|
kernel_size: KERNEL_SIZE,
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,6 +383,7 @@ fn donate() -> Template {
|
|||||||
Template::render("donate", context! {
|
Template::render("donate", context! {
|
||||||
route: "donate",
|
route: "donate",
|
||||||
public_api: CONFIG.public_api.clone(),
|
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! {
|
Template::render("api_overview", context! {
|
||||||
route: "api_overview",
|
route: "api_overview",
|
||||||
public_api: CONFIG.public_api.clone(),
|
public_api: CONFIG.public_api.clone(),
|
||||||
|
cg_api: CONFIG.coingecko_api.clone(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user