-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display main table after change to one map
- Loading branch information
Showing
2 changed files
with
134 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#[derive(serde::Deserialize, serde::Serialize, Debug, PartialEq, Eq)] | ||
pub struct DataDisplayOptions { | ||
main_list_fields: Vec<String>, | ||
/// The field to use to highlight other related log entries | ||
/// | ||
/// WARNING: This must be a valid index into the list as this is assumed in method implementations | ||
emphasize_if_matching_field_idx: Option<usize>, | ||
} | ||
|
||
impl DataDisplayOptions { | ||
pub fn main_list_fields(&self) -> &[String] { | ||
&self.main_list_fields | ||
} | ||
pub fn emphasize_if_matching_field_idx(&self) -> &Option<usize> { | ||
&self.emphasize_if_matching_field_idx | ||
} | ||
} | ||
|
||
impl Default for DataDisplayOptions { | ||
fn default() -> Self { | ||
Self { | ||
// TODO 3: Add ability to show, select and reorder selected fields | ||
main_list_fields: vec![ | ||
"time".into(), | ||
"request_id".into(), | ||
"otel.name".into(), | ||
"msg".into(), | ||
], | ||
emphasize_if_matching_field_idx: Some(1), | ||
} | ||
} | ||
} |