File tree Expand file tree Collapse file tree 5 files changed +19
-10
lines changed
Expand file tree Collapse file tree 5 files changed +19
-10
lines changed Original file line number Diff line number Diff line change 11use leptos:: prelude:: * ;
2- use leptos_dom:: helpers:: window;
32use state:: TestHistory ;
43
5- use crate :: { charts:: linechart:: LineChart , summaryheader:: format_time} ;
4+ use crate :: {
5+ charts:: linechart:: LineChart ,
6+ navigation:: open_in_new_tab,
7+ summaryheader:: format_time,
8+ } ;
69
710pub fn format_unix ( t : f64 ) -> String {
811 let d = std:: time:: Duration :: from_secs_f64 ( t) ;
@@ -17,7 +20,7 @@ pub fn format_unix(t: f64) -> String {
1720pub fn DurationChart ( history : TestHistory ) -> impl IntoView {
1821 let on_point_click = |point : state:: TestHistoryPoint | {
1922 let link = format ! ( "/invocation/{}" , point. invocation_id) ;
20- window ( ) . open_with_url_and_target ( & link, "_blank" ) . unwrap ( ) ;
23+ open_in_new_tab ( & link) ;
2124 } ;
2225
2326 // Sort data so that successful tests are rendered first and failed tests last
Original file line number Diff line number Diff line change 11use leptos:: prelude:: * ;
2- use leptos_dom:: helpers:: window;
32use state:: { Status , TestHistory } ;
43
5- use crate :: { charts:: scatterplot:: ScatterPlot , summaryheader:: format_time} ;
4+ use crate :: {
5+ charts:: scatterplot:: ScatterPlot ,
6+ navigation:: open_in_new_tab,
7+ summaryheader:: format_time,
8+ } ;
69
710#[ allow( non_snake_case) ]
811#[ component]
912pub fn PassFailScatterPlot ( history : TestHistory ) -> impl IntoView {
1013 let on_point_click = |point : state:: TestHistoryPoint | {
1114 let link = format ! ( "/invocation/{}" , point. invocation_id) ;
12- window ( ) . location ( ) . set_href ( & link) . unwrap ( ) ;
15+ open_in_new_tab ( & link) ;
1316 } ;
1417
1518 view ! {
Original file line number Diff line number Diff line change 11use leptos:: prelude:: * ;
2- use leptos_router:: hooks:: use_navigate;
32use state:: { Status , TestHistory } ;
43
5- use crate :: summaryheader:: format_time;
4+ use crate :: { navigation :: open_in_new_tab , summaryheader:: format_time} ;
65
76#[ derive( Debug , Clone ) ]
87struct RuntimeStats {
@@ -140,9 +139,8 @@ pub fn TestHistoryTable(history: TestHistory) -> impl IntoView {
140139 <tr
141140 class="border-b border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-600 cursor-pointer"
142141 on: click=move |_| {
143- let navigate = use_navigate( ) ;
144142 let url = format!( "/invocation/{}" , & point. invocation_id) ;
145- navigate ( & url, Default :: default ( ) ) ;
143+ open_in_new_tab ( & url) ;
146144 }
147145 >
148146 <td class="py-3 px-6 text-left whitespace-nowrap" >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ pub mod dashboard;
66pub mod list;
77pub mod measuretime;
88pub mod nav;
9+ pub mod navigation;
910pub mod searchbar;
1011pub mod shellout;
1112pub mod statusicon;
Original file line number Diff line number Diff line change 1+ use leptos_dom:: helpers:: window;
2+
3+ /// Opens a URL in a new browser tab
4+ pub fn open_in_new_tab ( url : & str ) { let _ = window ( ) . open_with_url_and_target ( url, "_blank" ) ; }
You can’t perform that action at this time.
0 commit comments