@@ -297,7 +297,7 @@ async fn start_tokio(context: ContextArc, receiver: ReceiverArc) {
297297 log:: info!( "Event worker finished" ) ;
298298}
299299
300- async fn render_flamegraph (
300+ async fn render_or_share_flamegraph (
301301 tui : bool ,
302302 cb_sink : cursive:: CbSink ,
303303 block : Columns ,
@@ -316,7 +316,22 @@ async fn render_flamegraph(
316316 } ) )
317317 . map_err ( |_| anyhow ! ( "Cannot send message to UI" ) ) ?;
318318 } else {
319- flamegraph:: share ( block, & pastila_clickhouse_host, & pastila_url) . await ?;
319+ let url = flamegraph:: share ( block, & pastila_clickhouse_host, & pastila_url) . await ?;
320+
321+ let url_clone = url. clone ( ) ;
322+ cb_sink
323+ . send ( Box :: new ( move |siv : & mut cursive:: Cursive | {
324+ siv. add_layer (
325+ views:: Dialog :: text ( format ! ( "Flamegraph shared (encrypted):\n \n {}" , url) )
326+ . title ( "Share Complete" )
327+ . button ( "Close" , |siv| {
328+ siv. pop_layer ( ) ;
329+ } ) ,
330+ ) ;
331+ } ) )
332+ . map_err ( |_| anyhow ! ( "Cannot send message to UI" ) ) ?;
333+
334+ crate :: utils:: open_url_command ( & url_clone) . status ( ) ?;
320335 }
321336 return Ok ( ( ) ) ;
322337}
@@ -403,7 +418,7 @@ async fn process_event(context: ContextArc, event: Event, need_clear: &mut bool)
403418 selected_host. as_ref ( ) ,
404419 )
405420 . await ?;
406- render_flamegraph (
421+ render_or_share_flamegraph (
407422 tui,
408423 cb_sink,
409424 flamegraph_block,
@@ -423,7 +438,7 @@ async fn process_event(context: ContextArc, event: Event, need_clear: &mut bool)
423438 selected_host. as_ref ( ) ,
424439 )
425440 . await ?;
426- render_flamegraph (
441+ render_or_share_flamegraph (
427442 tui,
428443 cb_sink,
429444 flamegraph_block,
@@ -437,7 +452,7 @@ async fn process_event(context: ContextArc, event: Event, need_clear: &mut bool)
437452 let flamegraph_block = clickhouse
438453 . get_live_query_flamegraph ( & query_ids, selected_host. as_ref ( ) )
439454 . await ?;
440- render_flamegraph (
455+ render_or_share_flamegraph (
441456 tui,
442457 cb_sink,
443458 flamegraph_block,
0 commit comments