File tree Expand file tree Collapse file tree 5 files changed +713
-213
lines changed Expand file tree Collapse file tree 5 files changed +713
-213
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ pub enum LogDataSource {
15
15
/// Could be either an `.rrd` recording or a `.rbl` blueprint.
16
16
RrdHttpUrl {
17
17
/// This is a canonicalized URL path without any parameters or fragments.
18
- url : String ,
18
+ url : url :: Url ,
19
19
20
20
/// If `follow` is `true`, the viewer will open the stream in `Following` mode rather than `Playing` mode.
21
21
follow : bool ,
@@ -125,14 +125,12 @@ impl LogDataSource {
125
125
} else if let Ok ( uri) = url. parse :: < re_uri:: ProxyUri > ( ) {
126
126
Some ( Self :: RedapProxy ( uri) )
127
127
} else {
128
- let mut parsed_url = url:: Url :: parse ( url)
128
+ let url = url:: Url :: parse ( url)
129
129
. or_else ( |_| url:: Url :: parse ( & format ! ( "http://{url}" ) ) )
130
130
. ok ( ) ?;
131
+ let path = url. path ( ) ;
131
132
132
- // Ignore any parameters, we don't support them for http urls.
133
- parsed_url. set_query ( None ) ;
134
- let url = parsed_url. to_string ( ) ;
135
- ( url. ends_with ( ".rrd" ) || url. ends_with ( ".rbl" ) )
133
+ ( path. ends_with ( ".rrd" ) || path. ends_with ( ".rbl" ) )
136
134
. then_some ( Self :: RrdHttpUrl { url, follow : false } )
137
135
}
138
136
}
@@ -156,7 +154,9 @@ impl LogDataSource {
156
154
match self {
157
155
Self :: RrdHttpUrl { url, follow } => Ok (
158
156
re_log_encoding:: stream_rrd_from_http:: stream_rrd_from_http_to_channel (
159
- url, follow, on_msg,
157
+ url. to_string ( ) ,
158
+ follow,
159
+ on_msg,
160
160
) ,
161
161
) ,
162
162
Original file line number Diff line number Diff line change @@ -23,7 +23,9 @@ pub struct DataPath {
23
23
impl std:: fmt:: Display for DataPath {
24
24
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
25
25
self . entity_path . fmt ( f) ?;
26
- if let Some ( instance) = & self . instance {
26
+ if let Some ( instance) = & self . instance
27
+ && instance != & Instance :: ALL
28
+ {
27
29
write ! ( f, "[#{instance}]" ) ?;
28
30
}
29
31
if let Some ( component_descriptor) = & self . component_descriptor {
Original file line number Diff line number Diff line change @@ -63,6 +63,34 @@ impl Item {
63
63
}
64
64
}
65
65
}
66
+
67
+ /// Converts this item to a data path if possible.
68
+ pub fn to_data_path ( & self ) -> Option < DataPath > {
69
+ match self {
70
+ Self :: AppId ( _)
71
+ | Self :: TableId ( _)
72
+ | Self :: DataSource ( _)
73
+ | Self :: View ( _)
74
+ | Self :: Container ( _)
75
+ | Self :: StoreId ( _)
76
+ | Self :: RedapServer ( _)
77
+ | Self :: RedapEntry ( _) => None ,
78
+
79
+ Self :: ComponentPath ( component_path) => Some ( DataPath {
80
+ entity_path : component_path. entity_path . clone ( ) ,
81
+ instance : None ,
82
+ component_descriptor : Some ( component_path. component_descriptor . clone ( ) ) ,
83
+ } ) ,
84
+
85
+ Self :: InstancePath ( instance_path) | Self :: DataResult ( _, instance_path) => {
86
+ Some ( DataPath {
87
+ entity_path : instance_path. entity_path . clone ( ) ,
88
+ instance : Some ( instance_path. instance ) ,
89
+ component_descriptor : None ,
90
+ } )
91
+ }
92
+ }
93
+ }
66
94
}
67
95
68
96
impl From < ViewId > for Item {
Original file line number Diff line number Diff line change @@ -648,6 +648,9 @@ impl App {
648
648
}
649
649
650
650
SystemCommand :: AddRedapServer ( origin) => {
651
+ if origin == * re_redap_browser:: EXAMPLES_ORIGIN {
652
+ return ;
653
+ }
651
654
if self . state . redap_servers . has_server ( & origin) {
652
655
return ;
653
656
}
@@ -865,7 +868,7 @@ impl App {
865
868
match data_source {
866
869
LogDataSource :: RrdHttpUrl { url, follow } => {
867
870
let new_source = SmartChannelSource :: RrdHttpStream {
868
- url : url. clone ( ) ,
871
+ url : url. to_string ( ) ,
869
872
follow : * follow,
870
873
} ;
871
874
if all_sources. any ( |source| source. is_same_ignoring_uri_fragments ( & new_source) ) {
@@ -3150,7 +3153,13 @@ fn update_web_address_bar(
3150
3153
if !enable_history {
3151
3154
return None ;
3152
3155
}
3153
- let url = crate :: open_url:: display_mode_to_content_url ( store_hub, display_mode) ?;
3156
+ let Ok ( url) =
3157
+ crate :: open_url:: ViewerImportUrl :: from_display_mode ( store_hub, display_mode. clone ( ) )
3158
+ // History entries expect the url parameter, not the full url, therefore don't pass a base url.
3159
+ . and_then ( |url| url. sharable_url ( None ) )
3160
+ else {
3161
+ return None ;
3162
+ } ;
3154
3163
3155
3164
re_log:: debug!( "Updating navigation bar" ) ;
3156
3165
You can’t perform that action at this time.
0 commit comments