From 782cca41a0b44ea8ac68c696f73d5491197a933b Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Tue, 27 Feb 2024 17:15:33 -0500 Subject: [PATCH] ui: Add a link to the embed url for a graph --- src/routes.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes.rs b/src/routes.rs index 196ce9a..3b36328 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -77,9 +77,10 @@ pub fn mk_api_routes(config: Arc>) -> Router { pub fn graph_component(dash_idx: usize, graph_idx: usize, graph: &Graph) -> Markup { let graph_id = format!("graph-{}-{}", dash_idx, graph_idx); let graph_data_uri = format!("/api/dash/{}/graph/{}", dash_idx, graph_idx); + let graph_embed_uri = format!("/embed/dash/{}/graph/{}", dash_idx, graph_idx); html!( div { - h2 { (graph.title) } + h2 { (graph.title) " - " a href=(graph_embed_uri) { "embed url" } } @if graph.d3_tick_format.is_some() { timeseries-graph uri=(graph_data_uri) id=(graph_id) d3-tick-format=(graph.d3_tick_format.as_ref().unwrap()) { } } @else {